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.18


From: nomail
Subject: [Phpgroupware-cvs] notes/class.base.php, 1.1.2.18
Date: Sun, 11 Jul 2004 06:50:21 +0200

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

date: 2004/07/11 04:50:21;  author: jengo;  state: Exp;  lines: +48 -24

Log Message:
- Nextmatchs is working
- Fixed note_content not being displayed in list view
=====================================================================
Index: notes/class.base.php
diff -u notes/class.base.php:1.1.2.17 notes/class.base.php:1.1.2.18
--- notes/class.base.php:1.1.2.17       Fri Jul  9 14:11:25 2004
+++ notes/class.base.php        Sun Jul 11 04:50:21 2004
@@ -117,12 +117,11 @@
                        $args = new safe_args();
                        $args->set('note_id'            ,REQUIRED       
,'number');
                        $args->set('note_owner'         ,REQUIRED       
,'number');
-                       $args->set('note_access'        ,REQUIRED       ,'any');
                        $args->set('note_dm_type'       ,REQUIRED       ,'any');
                        $args->set('note_category'      ,REQUIRED       
,'number');
-                       $args->set('note_content'       ,''                     
,'any');
-                       $args->set('note_modified'      ,REQUIRED       
,'number');
-                       $args->set('note_created'       ,REQUIRED       
,'number');
+                       $args->set('note_content'       ,''             ,'any');
+                       $args->set('note_modified'      ,REQUIRED       ,'any');
+                       $args->set('note_created'       ,REQUIRED       ,'any');
                        $args = $args->get(func_get_args());
                        
                        // Believe it or not, some browsers don't have strlen 
or substr support in XSLT,
@@ -137,17 +136,18 @@
                                $content_title = $args['note_content'];
                        }
 
-                       return array(
+                       return array
+                       (
 
-                               'id'                    => $args['note_id'],
+                               'id'            => $args['note_id'],
                                // FIXME: Need to create a function to handle 
displaying loginids in the proper format.
                                // Based on preference and the system settings
-                               'owner'                 => 
$GLOBALS['phpgw']->accounts->cross_reference((int)$args['note_owner']),
-                               'owner_id'              => $args['note_owner'],
-                               'access'                => $args['note_access'],
-                               'category'              => 
$this->_temp_cat($args['note_category']),
-                               'category_id'   => $args['note_category'],
-                               'content'               => 
$args['note_content'],
+                               'owner'         => 
$GLOBALS['phpgw']->accounts->cross_reference((int)$args['note_owner']),
+                               'owner_id'      => $args['note_owner'],
+                               'access'        => $args['note_access'],
+                               'category'      => 
$this->_temp_cat($args['note_category']),
+                               'category_id'   => $args['note_category'],
+                               'content'       => $args['note_content'],
                                'content_title' => $content_title,
                                'created'       => 
execMethod('api.history._record_creation_date','notes.base.' . 
$args['note_id']),
                                'modified'      => 
execMethod('api.history._record_modified_date','notes.base.' . $args['note_id'])
@@ -163,19 +163,43 @@
                        $args->set('order'      ,'note_created' ,'string');
                        $args = $args->get(func_get_args());
 
-                       $result = array(
-                               'action_type'           => 'note_start',
-                               'notes'                         => array(),
-                               'edit_allowed'          => 
$GLOBALS['phpgw']->acl->check('notes.base.edit',1,1),
-                               'delete_allowed'        => 
$GLOBALS['phpgw']->acl->check('notes.base.delete',1,1)
+                       $result = array
+                       (
+                               'action_type'    => 'note_start',
+                               'notes'          => array(),
+                               'edit_allowed'   => 
$GLOBALS['phpgw']->acl->check('notes.base.edit',1,1),
+                               'delete_allowed' => 
$GLOBALS['phpgw']->acl->check('notes.base.delete',1,1)
                        );
 
-                       $sql = 'SELECT * '
-                                . ' FROM phpgw_notes'
-                                . ' WHERE note_owner=' . 
$GLOBALS['phpgw']->db->qstr($GLOBALS['phpgw_data']['user']['id'])
-                                . ' AND note_dm_type=' . 
$GLOBALS['phpgw']->db->qstr('N')
-                                . ' ORDER BY ' . $args['order'] . ' ' . 
$args['sort'];
-                       if (!is_object($rs = 
$GLOBALS['phpgw']->db->execute($sql)))
+                       $dbresult = $GLOBALS['phpgw']->db->execute('
+                               SELECT
+                                       count(*)
+                                FROM
+                                       phpgw_notes
+                                WHERE
+                                       note_owner=' . 
$GLOBALS['phpgw']->db->qstr($GLOBALS['phpgw_data']['user']['id']) . '
+                                AND
+                                       note_dm_type in (\'N\',\'S\')
+                       ');
+
+                       if (is_object($dbresult))
+                       {
+                               $total = $dbresult->fields[0];
+                               
$GLOBALS['phpgw']->interface->handle_nextmatchs($args['start'],$total);
+                       }
+
+                       $sql = 'SELECT
+                                       *
+                                FROM
+                                       phpgw_notes
+                                WHERE
+                                       note_owner=' . 
$GLOBALS['phpgw']->db->qstr($GLOBALS['phpgw_data']['user']['id']) . '
+                                AND
+                                       note_dm_type=' . 
$GLOBALS['phpgw']->db->qstr('N') . '
+                                ORDER BY
+                                       ' . $args['order'] . ' ' . 
$args['sort'];
+
+                       if (! is_object($rs = 
$GLOBALS['phpgw']->db->execute($sql)))
                        {
                                return $result;
                        }




reply via email to

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