phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] notes/class.base.php, 1.1.2.9


From: nomail
Subject: [Phpgroupware-cvs] notes/class.base.php, 1.1.2.9
Date: Sun, 23 May 2004 11:21:58 -0000

Update of /notes
Modified Files:
        Branch: proposal-branch
          class.base.php

date: 2004/05/07 07:12:19;  author: jengo;  state: Exp;  lines: +20 -9

Log Message:
Added support for symbolic datamine links
=====================================================================
Index: notes/class.base.php
diff -u notes/class.base.php:1.1.2.8 notes/class.base.php:1.1.2.9
--- notes/class.base.php:1.1.2.8        Fri May  7 00:12:34 2004
+++ notes/class.base.php        Fri May  7 07:12:19 2004
@@ -133,6 +133,7 @@
                                'id'          => $db->fields['note_id'],
                                // FIXME: Need to create a function to handle 
displaying loginids in the proper format.
                                // Based on preference and the system settings
+                               'dm_type'       => $db->fields['note_dm_type'],
                                'owner'         => 
$GLOBALS['phpgw']->accounts->cross_reference((int)$db->fields['note_owner']),
                                'owner_id'      => $db->fields['note_owner'],
                                'access'        => $db->fields['note_access'],
@@ -168,7 +169,7 @@
                        }
 
                        $db = $GLOBALS['phpgw']->db->execute("SELECT * FROM 
phpgw_notes WHERE note_owner="
-                               . $GLOBALS['phpgw_data']['user']['id'] . " AND 
note_dm_type='N' order by "
+                               . $GLOBALS['phpgw_data']['user']['id'] . " AND 
note_dm_type in ('N','S') order by "
                                . $args['order'] . " " . $args['sort']);
 
                        while (! $db->EOF)
@@ -190,7 +191,7 @@
                        $args = $args->get(func_get_args());
 
                        $result['action_type'] = 'note_view';
-                       $note                  = 
$this->_read($args['note_id'],'N');
+                       $note                  = $this->_read($args['note_id']);
 
                        if (! $GLOBALS['phpgw']->acl->check('notes.' . 
$args['note_id'],PHPGW_ACL_READ))
                        {
@@ -229,7 +230,7 @@
                        $args = new safe_args();
                        $args->set('form_submit',array('false','true'),'enum');
                        $args->set('access',array('public','private'),'enum');
-                       $args->set('dm_type',array('N','D'),'enum');
+                       $args->set('dm_type',array('N','H','S'),'enum');
                        $args->set('dm_redirect',NOTSET,'any');
                        $args->set('datamine_location',NOTSET,'any');
                        $args->set('content',NOTSET,'any');
@@ -273,7 +274,7 @@
 
                                                
$GLOBALS['msgbox']->add(lang('Note has been successfully created'),'notice');
 
-                                               if ($args['dm_type'] == 'D')
+                                               if ($args['dm_type'] != 'N')
                                                {
                                                        
execMethod('api.datamine._set',array('location_from' => 
$args['datamine_location'], 'location_to' => 'notes.base.' . $note_id));
                                                        return 
execMethod($_SESSION['phpgw_session']['phpgw_data']['op_history'][$args['dm_redirect']]['op'],$_SESSION['phpgw_session']['phpgw_data']['op_history'][$args['dm_redirect']]['data']);
@@ -466,9 +467,19 @@
                {
                        $args = new safe_args();
                        $args->set('note_id',REQUIRED,'number');
-                       $args->set('note_dm_type','N','string');
+                       $args->set('note_dm_type',array('N','H','S'),'enum');
                        $args = $args->get(func_get_args());
 
+                       // By default, read normal records and symbolic links
+                       if ($args['note_dm_type'] != 'N')
+                       {
+                               $dm_query = "note_dm_type='" . 
$args['note_dm_type'] . "'";
+                       }
+                       else
+                       {
+                               $dm_query = "note_dm_type in('N','S')";
+                       }
+
                        $dbresult = $GLOBALS['phpgw']->db->execute("
                                SELECT
                                        *
@@ -477,7 +488,7 @@
                                WHERE
                                        note_id='" . $args['note_id'] . "'
                                AND
-                                       note_dm_type='" . $args['note_dm_type'] 
. "'
+                                       $dm_query
                                AND
                                        note_owner='" . 
$GLOBALS['phpgw_data']['user']['id'] . "'");
 
@@ -499,7 +510,7 @@
 
                        $GLOBALS['phpgw']->add_xsl('notes.widgets');
 
-                       // FIXME: This needs ACL check and it needs to check 
for note_dm_type of D
+                       // FIXME: This needs ACL check
                        $dbresult = $GLOBALS['phpgw']->db->execute("
                                SELECT
                                        *
@@ -508,7 +519,7 @@
                                WHERE
                                        note_id='" . $args['note_id'] . "'
                                AND
-                                       note_dm_type='D'");
+                                       note_dm_type in ('S','H')");
 
                        //return $this->_read($args['note_id']);
                        return $this->__get_record(&$dbresult);




reply via email to

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