phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] syncml/docs/patches notes-ipc-getidlist-time-pa...


From: Johan Gunnarsson
Subject: [Phpgroupware-cvs] syncml/docs/patches notes-ipc-getidlist-time-pa...
Date: Sun, 19 Aug 2007 18:38:27 +0000

CVSROOT:        /sources/phpgroupware
Module name:    syncml
Changes by:     Johan Gunnarsson <johang>       07/08/19 18:38:27

Added files:
        docs/patches   : notes-ipc-getidlist-time-parameter.patch 
Removed files:
        docs/patches   : getipc-ipc_manager-notice.patch 
                         notes_fixes-johang.patch 

Log message:
        Delete outdated/commited patches. Add current and uncommited patch.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/syncml/docs/patches/notes-ipc-getidlist-time-parameter.patch?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/syncml/docs/patches/getipc-ipc_manager-notice.patch?cvsroot=phpgroupware&r1=1.1.1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/syncml/docs/patches/notes_fixes-johang.patch?cvsroot=phpgroupware&r1=1.1.1.1&r2=0

Patches:
Index: notes-ipc-getidlist-time-parameter.patch
===================================================================
RCS file: notes-ipc-getidlist-time-parameter.patch
diff -N notes-ipc-getidlist-time-parameter.patch
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ notes-ipc-getidlist-time-parameter.patch    19 Aug 2007 18:38:26 -0000      
1.1
@@ -0,0 +1,53 @@
+Index: inc/class.bonotes.inc.php
+===================================================================
+RCS file: /sources/phpgroupware/notes/inc/class.bonotes.inc.php,v
+retrieving revision 1.28
+diff -u -r1.28 class.bonotes.inc.php
+--- inc/class.bonotes.inc.php  18 Jul 2007 14:54:35 -0000      1.28
++++ inc/class.bonotes.inc.php  19 Aug 2007 16:07:43 -0000
+@@ -213,8 +213,17 @@
+ 
+               function read()
+               {
+-                      $notes = $this->sonotes->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+-                                                                              
        'filter' => $this->filter,'cat_id' => $this->cat_id,'limit' => 
$this->limit));
++                      $notes = $this->sonotes->read(array
++                      (
++                              'start' => $this->start,
++                              'query' => $this->query,
++                              'sort' => $this->sort,
++                              'order' => $this->order,
++                              'filter' => $this->filter,
++                              'cat_id' => $this->cat_id,
++                              'limit' => $this->limit
++                      ));
++                      
+                       $this->total_records = $this->sonotes->total_records;
+ 
+                       for ($i=0; $i<count($notes); $i++)
+Index: inc/class.ipc_notes.inc.php
+===================================================================
+RCS file: /sources/phpgroupware/notes/inc/class.ipc_notes.inc.php,v
+retrieving revision 1.3
+diff -u -r1.3 class.ipc_notes.inc.php
+--- inc/class.ipc_notes.inc.php        18 Jul 2007 14:54:35 -0000      1.3
++++ inc/class.ipc_notes.inc.php        19 Aug 2007 16:07:43 -0000
+@@ -107,13 +107,16 @@
+       */
+       function getIdList($time=-1)
+       {
+-              $all_notes = $this->bonotes->read();
++              $all_notes = $this->bonotes->sonotes->read(array());
+               $note_count = count($all_notes);
+               $all_note_ids = array();
+               
+               for($i = 0; $i < $note_count; $i++)
+               {
+-                      $all_note_ids[] = intval($all_notes[$i]['note_id']);
++                      if($all_notes[$i]['date'] > $time)
++                      {
++                              $all_note_ids[] = 
intval($all_notes[$i]['note_id']);
++                      }
+               }
+               
+               return $all_note_ids;

Index: getipc-ipc_manager-notice.patch
===================================================================
RCS file: getipc-ipc_manager-notice.patch
diff -N getipc-ipc_manager-notice.patch
--- getipc-ipc_manager-notice.patch     30 Jul 2007 13:04:38 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-Index: inc/class.ipc_manager.inc.php
-===================================================================
-RCS file: /sources/phpgwapi/phpgwapi/inc/class.ipc_manager.inc.php,v
-retrieving revision 1.7
-diff -u -8 -p -r1.7 class.ipc_manager.inc.php
---- inc/class.ipc_manager.inc.php      3 Sep 2006 06:15:27 -0000       1.7
-+++ inc/class.ipc_manager.inc.php      8 Jul 2007 23:41:21 -0000
-@@ -48,19 +48,21 @@ class ipc_manager
-        * Get the ipc application object
-        *
-        * @access  public
-        * @param   string  $appName  name of the application
-        * @return  object            ipc object of application 
-        */
-       function &getIPC($appName)
-       {
-+              $error = false;
-+              
-               // check if app is available amd the acl run app right
--      if ($this->_checkIPCApp($appName) == false)
--        return false;
-+              if ($this->_checkIPCApp($appName) == false)
-+                      return $error;
- 
-               // create ipc class name
-               $className = $this->_createIPCAppClassName($appName);
-               
-               // check if ipc app object exists
-               if (isset($this->_ipcObjectList[$className]) && 
is_object($this->_ipcObjectList[$className]))
-               { // return the existing ipc app object
-                       return $this->_ipcObjectList[$className];
-@@ -70,17 +72,17 @@ class ipc_manager
-                       $obj =& CreateObject($className);
-                       if (is_object($obj) == true)
-                       { // save and return the created ipc app object
-                               $this->_ipcObjectList[$className] =& $obj;
-                               return $this->_ipcObjectList[$className];
-                       }
-                       else
-                       {
--                        return false;
-+                        return $error;
-                       }
-               }
-       }
- 
- 
-   /**
-    * Destroy the ipc application object.
-    *
-@@ -188,9 +190,9 @@ class ipc_manager
-        * @return  string             name of tne ipc application class
-        */
-       function _createIPCAppClassName($appName)
-       {
-               return $appName.'.ipc_'.$appName;
-       }
- 
- }
--?>
-\ No newline at end of file
-+?>

Index: notes_fixes-johang.patch
===================================================================
RCS file: notes_fixes-johang.patch
diff -N notes_fixes-johang.patch
--- notes_fixes-johang.patch    30 Jul 2007 13:04:38 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,251 +0,0 @@
-? notes_fixes-johang.patch
-Index: inc/class.bonotes.inc.php
-===================================================================
-RCS file: /sources/phpgroupware/notes/inc/class.bonotes.inc.php,v
-retrieving revision 1.27
-diff -u -8 -p -r1.27 class.bonotes.inc.php
---- inc/class.bonotes.inc.php  18 Feb 2007 21:03:14 -0000      1.27
-+++ inc/class.bonotes.inc.php  11 Jul 2007 21:41:06 -0000
-@@ -227,46 +227,46 @@
- 
-               function read_single($note_id)
-               {
-                       return $this->sonotes->read_single($note_id);
-               }
- 
-               function save($note)
-               {
--                      if ($note['access'])
-+                      if (isset($note['access']) && $note['access'])
-                       {
-                               $note['access'] = 'private';
-                       }
-                       else
-                       {
-                               $note['access'] = 'public';
-                       }
- 
--                      if (intval($note['note_id']) > 0)
-+                      if (isset($note['note_id']) && intval($note['note_id']) 
> 0)
-                       {
-                               $note_id = $note['note_id'];
-                               $this->sonotes->edit($note);
-                       }
-                       else
-                       {
-                               $note_id = $this->sonotes->add($note);
-                       }
-                       return $note_id;
-               }
- 
-               function delete($params)
-               {
-                       if (is_array($params))
-                       {
--                              $this->sonotes->delete($params[0]);
-+                              return $this->sonotes->delete($params[0]);
-                       }
-                       else
-                       {
--                              $this->sonotes->delete($params);
-+                              return $this->sonotes->delete($params);
-                       }
-               }
- 
-               /**
-               * Convert data from a certain mime type format to the internal 
application data structure.
-               *
-               * @access  public
-               * @param   mixed    $dataExtern  data to convert, the datatype 
depends on the passed mime type
-Index: inc/class.ipc_notes.inc.php
-===================================================================
-RCS file: /sources/phpgroupware/notes/inc/class.ipc_notes.inc.php,v
-retrieving revision 1.2
-diff -u -8 -p -r1.2 class.ipc_notes.inc.php
---- inc/class.ipc_notes.inc.php        28 Apr 2005 18:33:52 -0000      1.2
-+++ inc/class.ipc_notes.inc.php        11 Jul 2007 21:41:06 -0000
-@@ -1,13 +1,14 @@
- <?php
- /**
-  * Notes IPC Layer
-  *
-  * @author Dirk Schaller <address@hidden>
-+ * @author Johan Gunnarsson <address@hidden>
-  * @copyright Copyright (C) 2003,2005 Free Software Foundation 
http://www.fsf.org/
-  * @license http://www.fsf.org/licenses/gpl.html GNU General Public License
-  * @package notes
-  * @subpackage ipc
-  * @version $Id: notes_fixes-johang.patch,v 1.1.1.1 2007/07/30 13:04:38 
johang Exp $
-  */
- 
- // require_once(PHPGW_API_INC . 'class.ipc_.inc.php');
-@@ -90,35 +91,48 @@ class ipc_notes extends ipc_
-               {
-                       return false;
-               }
- 
-               // 2: mapping internal data to the output mime type
-               return $this->bonotes->exportData($dataIntern, $type);
-       }
- 
-+      /**
-+      * Return a list with the available id's in the application.
-+      * The optional lastmod parameter allows a limitations of the data id 
list.
-+      * The list contains all the id's of the modified data since the passed 
lastmod timestamp.
-+      *
-+      * @abstract
-+      * @param   integer  $lastmod  last modification time, default is -1 and 
means return all data id's
-+      * @return  array              list of data id's
-+      */
-+      function getIdList($time=-1)
-+      {
-+              $all_notes = $this->bonotes->read();
-+              $note_count = count($all_notes);
-+              $all_note_ids = array();
-+              
-+              for($i = 0; $i < $note_count; $i++)
-+              {
-+                      $all_note_ids[] = intval($all_notes[$i]['note_id']);
-+              }
-+              
-+              return $all_note_ids;
-+      }
- 
-       /**
-        * Remove data of the passed id.
-        *
-        * @param integer $id ID of data to remove from the application
-        * @return boolean True if the data is removed, otherwise false
-        */
-       function removeData($id)
-       {
--              $this->bonotes->delete($id);
--              // return status workaround: delete() : void  --> check if sql 
error
--              if ($GLOBALS['phpgw']->db->Error)
--              {
--                      return false;
--              }
--              else
--              {
--                      return true;
--              }
-+              return $this->bonotes->delete($id);
-       }
- 
-       /**
-        * Replace the existing data of the passed id with the passed data in a 
certain mime type format.
-        *
-        * @param integer $id ID of data to replace
-        * @param mixed $data The new data, the datatype depends on the passed 
mime type
-        * @param string $type Specifies the mime type of the passed data
-@@ -127,30 +141,35 @@ class ipc_notes extends ipc_
-       function replaceData($id, $data, $type)
-       {
-               // 1: mapping the passed input data to application internal data
-               $dataIntern = $this->bonotes->importData($data, $type);
-               if ($dataIntern == false)
-               {
-                       return false;
-               }
--                
--              $dataIntern['id'] = (int) $id;
-+              
-+              $dataIntern['note_id'] = (int) $id;
- 
-               // 2: replace data
--              $this->bonotes->save($dataIntern);
-+              $note_id = $this->bonotes->save($dataIntern);
-+              
-+              /*
-               // return status workaround: save() : void  --> check if sql 
error
-               if ($GLOBALS['phpgw']->db->Error)
-               {
-                       return false;
-               }
-               else
-               {
-                       return true;
-               }
-+              */
-+              
-+              return $note_id == $id;
-       }
- 
- 
-       /**
-        * Checks if data for the passed id exists.
-        *
-        * @param integer $id ID to check
-        * @return boolean True if the data with id exist, otherwise false
-Index: inc/class.sonotes.inc.php
-===================================================================
-RCS file: /sources/phpgroupware/notes/inc/class.sonotes.inc.php,v
-retrieving revision 1.16
-diff -u -8 -p -r1.16 class.sonotes.inc.php
---- inc/class.sonotes.inc.php  18 Feb 2007 21:03:14 -0000      1.16
-+++ inc/class.sonotes.inc.php  11 Jul 2007 21:41:06 -0000
-@@ -4,33 +4,30 @@
-       * @author Andy Holman
-       * @author Bettina Gille address@hidden
-       * @copyright Copyright (C) 2000-2003,2005 Free Software Foundation, 
Inc. http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @package notes
-       * @version $Id: notes_fixes-johang.patch,v 1.1.1.1 2007/07/30 13:04:38 
johang Exp $
-       */
- 
--
-       /**
-       * Notes storage object class
-       *
-       * @package notes
-       */
-       class sonotes
-       {
-               var $grants;
-               var $db;
--              var $db2;
-               var $account;
- 
-               function sonotes()
-               {
--                      $this->db               = $GLOBALS['phpgw']->db;
--                      $this->db2              = clone($this->db);
-+                      $this->db               = &$GLOBALS['phpgw']->db;
-                       $this->grants   = 
$GLOBALS['phpgw']->acl->get_grants('notes');
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-               }
- 
-               function read($data)
-               {
-                       if(is_array($data))
-                       {
-@@ -145,26 +142,28 @@
-               }
- 
-               function add($note)
-               {
-                       $note['content'] = 
$this->db->db_addslashes($note['content']);
- 
-                       $this->db->query('INSERT INTO phpgw_notes 
(note_owner,note_access,note_date,note_content,note_category) '
-                               . 'VALUES (' . $this->account . ",'" . 
$note['access'] . "'," . time() . ",'" . $note['content']
--                              . "'," . intval($note['cat_id']) . 
')',__LINE__,__FILE__);
-+                              . "'," . (isset($note['cat_id']) ? 
intval($note['cat_id']) : 0) . ')',__LINE__,__FILE__);
-                       return 
$this->db->get_last_insert_id('phpgw_notes','note_id');
-               }
- 
-               function edit($note)
-               {
-                       $note['content'] = 
$this->db->db_addslashes($note['content']);
- 
-                       $this->db->query("UPDATE phpgw_notes set 
note_content='" . $note['content'] . "', note_date=" . time() . ', 
note_category='
-                                                       . 
intval($note['cat_id']) . ", note_access='" . $note['access'] . "' WHERE 
note_id=" . intval($note['note_id']),__LINE__,__FILE__);
-               }
- 
-               function delete($note_id)
-               {
-                       $this->db->query('DELETE FROM phpgw_notes WHERE 
note_id=' . intval($note_id),__LINE__,__FILE__);
-+                      
-+                      return $this->db->affected_rows() > 0;
-               }
-       }
- ?>




reply via email to

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