phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] api/class.datamine.php, 1.1.2.4


From: nomail
Subject: [Phpgroupware-cvs] api/class.datamine.php, 1.1.2.4
Date: Sun, 23 May 2004 04:08:55 -0000

Update of /api
Modified Files:
        Branch: proposal-branch
          class.datamine.php

date: 2004/05/07 07:12:18;  author: jengo;  state: Exp;  lines: +30 -7

Log Message:
Added support for symbolic datamine links
=====================================================================
Index: api/class.datamine.php
diff -u api/class.datamine.php:1.1.2.3 api/class.datamine.php:1.1.2.4
--- api/class.datamine.php:1.1.2.3      Sat Apr 24 20:53:31 2004
+++ api/class.datamine.php      Fri May  7 07:12:18 2004
@@ -52,7 +52,7 @@
                        }
                        while ($row = $rs->FetchRow())
                        {
-                               $GLOBALS['phpgw']->add_appmenu('Datamine 
menu',$row['dml_title'],$row['dml_op'] . '&dm_type=D&datamine_location=' . 
$args['location'] . '&dm_redirect=' . 
$_SESSION['phpgw_session']['phpgw_data']['current_history_position']);
+                               $GLOBALS['phpgw']->add_appmenu('Datamine 
menu',$row['dml_title'],$row['dml_op'] . '&dm_type=H&datamine_location=' . 
$args['location'] . '&dm_redirect=' . 
$_SESSION['phpgw_session']['phpgw_data']['current_history_position']);
                        }
                        $GLOBALS['datamine_menus_loaded'] = true;
                        $GLOBALS['phpgw']->add_appmenu('Datamine menu','Show 
map','api.base.datamine_map');
@@ -65,10 +65,24 @@
                        $args = $args->get(func_get_args());
 
                        $this->__create_menu($args);
-                       $sql = 'SELECT dm_location_to'
-                                . ' FROM phpgw_datamine'
-                                . ' WHERE dm_location_from=' . 
$GLOBALS['phpgw']->db->qstr($args['location'])
-                                . ' AND dm_owner=' . 
$GLOBALS['phpgw_data']['user']['id'];
+                       $sql = 'SELECT
+                                       dm_location_to,
+                                       dm_location_from
+                               FROM
+                                       phpgw_datamine
+                               WHERE
+                               (
+                                               dm_location_from=' . 
$GLOBALS['phpgw']->db->qstr($args['location']) . '
+                                       AND
+                                               dm_owner=' . 
$GLOBALS['phpgw_data']['user']['id'] . '
+                               )
+                               OR
+                               (
+                                               dm_location_to=' . 
$GLOBALS['phpgw']->db->qstr($args['location']) . '
+                                       AND
+                                               dm_owner=' . 
$GLOBALS['phpgw_data']['user']['id'] . '                           
+                               )';
+
                        if (!is_object($rs = 
$GLOBALS['phpgw']->db->execute($sql)))
                        {
                                return false;
@@ -79,7 +93,16 @@
                                // The no_app_menu is *ONLY* a temp workaround 
for not showing the app menu
                                // during _datamine_get(), I am currently 
working on another solution to it
                                $GLOBALS['no_app_menu'] = true;
-                               list($app,$class,$id) = 
explode('.',$row['dm_location_to']);
+
+                               if ($row['dm_location_to'] != $args['location'])
+                               {
+                                       list($app,$class,$id) = 
explode('.',$row['dm_location_to']);
+                               }
+                               else
+                               {
+                                       list($app,$class,$id) = 
explode('.',$row['dm_location_from']);
+                               }
+
                                $result[] = array(
                                        'type' => $app . '_' . $class,
                                        'data' => execMethod($app . '.' . 
$class . '._datamine_get',$id)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]