phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: notes/inc class.bo.inc.php,1.4,1.5 class.so.inc.


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: notes/inc class.bo.inc.php,1.4,1.5 class.so.inc.php,1.5,1.6 class.ui.inc.php,1.14,1.15
Date: Tue, 17 Sep 2002 18:09:43 -0400

Update of /cvsroot/phpgroupware/notes/inc
In directory subversions:/tmp/cvs-serv22202

Modified Files:
        class.bo.inc.php class.so.inc.php class.ui.inc.php 
Log Message:
added index

Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.bo.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.bo.inc.php    17 Sep 2002 21:25:30 -0000      1.4
--- class.bo.inc.php    17 Sep 2002 22:09:41 -0000      1.5
***************
*** 30,34 ****
                        'set_font_size'         => True,
                        'read_preferences'      => True,
!                       'save_preferences'      => True
                );
  
--- 30,35 ----
                        'set_font_size'         => True,
                        'read_preferences'      => True,
!                       'save_preferences'      => True,
!                       'get_rows'                              => True
                );
  
***************
*** 263,266 ****
--- 264,285 ----
                        }
                }
+ 
+               function get_rows($query)
+               {
+                       //echo 
"<p>notes.ui.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id]):
 notes_list =";
+ 
+                       $notes_list = 
$this->read($query['start'],$query['search'],$query['filter'],$query['cat_id']);
+                       if (!is_array($notes_list))
+                       {
+                               $notes_list = array( 0 => 0 );
+                       }
+                       else
+                       {
+                               array_unshift($notes_list,$this->total_records);
+                               //_debug_array($notes_list);
+                       }
+                       return $notes_list;
+               }
+ 
        }
  ?>

Index: class.so.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.so.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.so.inc.php    17 Sep 2002 21:25:30 -0000      1.5
--- class.so.inc.php    17 Sep 2002 22:09:41 -0000      1.6
***************
*** 88,92 ****
                                        'date'          => 
$this->db->f('note_date'),
                                        'cat'           => 
(int)$this->db->f('note_category'),
!                                       'content'       => 
$this->db->f('note_content')
                                        'grants'        => $ngrants
                                );
--- 88,92 ----
                                        'date'          => 
$this->db->f('note_date'),
                                        'cat'           => 
(int)$this->db->f('note_category'),
!                                       'content'       => 
$this->db->f('note_content'),
                                        'grants'        => $ngrants
                                );

Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.ui.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.ui.inc.php    17 Sep 2002 21:25:30 -0000      1.14
--- class.ui.inc.php    17 Sep 2002 22:09:41 -0000      1.15
***************
*** 103,107 ****
                }
  
!               function index()
                {
                        $this->display_app_header();
--- 103,144 ----
                }
  
!               function index($content = '')
!               {
!                       //echo "<p>notes.ui.list_notes: content[nm][rows] = "; 
//_debug_array($content);
! 
!                       if ($content == '')
!                       {
!                               $content = array();
!                       }
!                       elseif (isset($content['nm']['rows']['edit']))
!                       {
!                               list($id) = 
each($content['nm']['rows']['edit']);
!                               return $this->edit($id);
!                       }
!                       elseif (isset($content['nm']['rows']['delete']))
!                       {
!                               list($id) = 
each($content['nm']['rows']['delete']);
!                               return $this->delete($id);
!                       }
!                       $this->tpl->read('notes.index');
! 
!                       $filter_list = array(
!                               'all' => 'Show all',
!                               'public' => 'Only yours',
!                               'private' => 'Private'
!                       );
!                       $content['nm'] = array(
!                               'start'   => $this->start,
!                               'search'  => $this->search,
!                               'filter'  => $this->filter,
!                               'cat_id'  => $this->cat_id,
!                               'get_rows' => 'notes.bo.get_rows',
!                               'no_filter2' => True,
!                               'options-filter' => $filter_list
!                       );
!                       $this->tpl->exec('notes.ui.index',$content);
!               }
! 
!               function index_old()
                {
                        $this->display_app_header();
***************
*** 287,297 ****
                function edit($values=0)
                {
-                       $id = get_var('id',array('POST','GET'));
- 
                        if (!is_array($values))
                        {
!                               if ($id > 0)
                                {
!                                       $values = $this->bo->read_single($id);
                                }
                                else
--- 324,336 ----
                function edit($values=0)
                {
                        if (!is_array($values))
                        {
!                               if (!$values)
!                               {
!                                       $values = 
get_var('id',array('POST','GET'));
!                               }
!                               if ($values > 0)
                                {
!                                       $values = 
$this->bo->read_single($values);
                                }
                                else
***************
*** 318,326 ****
                                elseif($values['delete'])
                                {
!                                       $this->delete();
                                }
                        }
  
!                       if ($id <= 0)
                        {
                                $no_button = array
--- 357,366 ----
                                elseif($values['delete'])
                                {
!                                       $this->delete($values['id']);
                                }
+                               return;
                        }
  
!                       if ($values['id'] <= 0)
                        {
                                $no_button = array
***************
*** 340,344 ****
  
                        $data = $values + array('header' => $header);
!                       
$this->tpl->exec('notes.ui.edit',$data,'',$no_button,array('id' => $id));
                }
  
--- 380,384 ----
  
                        $data = $values + array('header' => $header);
!                       
$this->tpl->exec('notes.ui.edit',$data,'',$no_button,array('id' => 
$values['id']));
                }
  
***************
*** 399,428 ****
                function delete($values=0)
                {
!                       $id = get_var('id',array('POST','GET'));
! 
!                       if (!$id)
!                       {
!                               $this->index();
!                       }
!                       else
                        {
!                               if (is_array($values))
                                {
!                                       if ($values['confirm'])
!                                       {
!                                               $this->bo->delete($id);
!                                               $this->index();
!                                       }
!                                       elseif($values['done'])
!                                       {
!                                               $this->index();
!                                       }
                                }
!                               else
                                {
                                        $this->tpl->read('notes.delete');
!                                       
$this->tpl->exec('notes.ui.delete','','','',array('id' => $id));
                                }
                        }
                }
  
--- 439,460 ----
                function delete($values=0)
                {
!                       if (!is_array($values))
                        {
!                               if (!$values)
                                {
!                                       $values = 
get_var('id',array('POST','GET'));
                                }
!                               if ($values > 0)
                                {
                                        $this->tpl->read('notes.delete');
!                                       
$this->tpl->exec('notes.ui.delete','','','',array('id' => $values));
!                                       return;
                                }
                        }
+                       elseif ($values['confirm'])
+                       {
+                               $this->bo->delete($values['id']);
+                       }
+                       $this->index();
                }
  





reply via email to

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