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.3,1.4 class.so.inc.


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: notes/inc class.bo.inc.php,1.3,1.4 class.so.inc.php,1.4,1.5 class.ui.inc.php,1.13,1.14
Date: Tue, 17 Sep 2002 17:25:32 -0400

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

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

Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.bo.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bo.inc.php    17 Sep 2002 15:43:02 -0000      1.3
--- class.bo.inc.php    17 Sep 2002 21:25:30 -0000      1.4
***************
*** 185,189 ****
                        }
  
!                       $notes = 
$this->so->read_notes($params['start'],$params['search'],$params['filter'],$params['cat_id']);
                        $this->total_records = $this->so->total_records;
  
--- 185,189 ----
                        }
  
!                       $notes = 
$this->so->read($params['start'],$params['search'],$params['filter'],$params['cat_id']);
                        $this->total_records = $this->so->total_records;
  
***************
*** 217,229 ****
                                if ($note['id'] != 0)
                                {
!                                       $note_id = $note['id'];
!                                       $this->so->edit_note($note);
                                }
                        }
                        else
                        {
!                               $note_id = $this->so->add_note($note);
                        }
-                       return $note_id;
                }
  
--- 217,227 ----
                                if ($note['id'] != 0)
                                {
!                                       $this->so->edit($note);
                                }
                        }
                        else
                        {
!                               $this->so->add($note);
                        }
                }
  
***************
*** 232,242 ****
                        if (is_array($params))
                        {
!                               $this->so->delete_note($params[0]);
                        }
                        else
                        {
!                               $this->so->delete_note($params);
                        }
-                       return True;
                }
  
--- 230,239 ----
                        if (is_array($params))
                        {
!                               $this->so->delete($params[0]);
                        }
                        else
                        {
!                               $this->so->delete($params);
                        }
                }
  

Index: class.so.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.so.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.so.inc.php    17 Sep 2002 15:43:02 -0000      1.4
--- class.so.inc.php    17 Sep 2002 21:25:30 -0000      1.5
***************
*** 24,28 ****
                }
  
!               function read_notes($start, $search = '', $filter = '',$cat_id 
= '')
                {
                        if (! $filter)
--- 24,28 ----
                }
  
!               function read($start, $search = '', $filter = '',$cat_id = '')
                {
                        if (! $filter)
***************
*** 77,92 ****
                        $this->db->limit_query($sql,$start,__LINE__,__FILE__);
  
-                       $i = 0;
                        while ($this->db->next_record())
                        {
!                               $notes[$i]['id']        = 
(int)$this->db->f('note_id');
!                               $notes[$i]['owner']     = 
$this->db->f('note_owner');
!                               $notes[$i]['owner_id']  = 
(int)$this->db->f('note_owner');
!                               $notes[$i]['access']    = 
$this->db->f('note_access');
!                               $notes[$i]['date']      = 
$this->db->f('note_date');
!                               $notes[$i]['category']  = 
(int)$this->db->f('note_category');
!                               $notes[$i]['content']   = 
$this->db->f('note_content');
!                               $notes[$i]['grants']    = 
(int)$this->grants[$this->db->f('note_owner')];
!                               $i++;
                        }
                        return $notes;
--- 77,94 ----
                        $this->db->limit_query($sql,$start,__LINE__,__FILE__);
  
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('note_owner')];
!                               $notes[] = array
!                               (
!                                       'id'            => 
(int)$this->db->f('note_id'),
!                                       'owner'         => 
$this->db->f('note_owner'),
!                                       'owner_id'      => 
(int)$this->db->f('note_owner'),
!                                       'access'        => 
$this->db->f('note_access'),
!                                       'date'          => 
$this->db->f('note_date'),
!                                       'cat'           => 
(int)$this->db->f('note_category'),
!                                       'content'       => 
$this->db->f('note_content')
!                                       'grants'        => $ngrants
!                               );
                        }
                        return $notes;
***************
*** 110,134 ****
                }
  
!               function add_note($note)
                {
!                       $note['content'] = addslashes($note['content']);
  
                        $this->db->query("INSERT INTO phpgw_notes 
(note_owner,note_access,note_date,note_content,note_category) "
                                . "VALUES ('" . $this->owner . "','" . 
$note['access'] . "','" . time() . "','" . $note['content']
!                               . "','" . $note['category'] . 
"')",__LINE__,__FILE__);
!                       return 
$this->db->get_last_insert_id('phpgw_notes','note_id');
                }
  
!               function edit_note($note)
                {
!                       $note['content'] = addslashes($note['content']);
  
!                       $this->db->query("UPDATE phpgw_notes set 
note_content='" . $note['content'] . "', note_date='" . time() . "', 
note_category='" . $note[category] . "', "
!                               . "note_access='" . $note['access'] . "' WHERE 
note_id='" . $note['id'] . "'",__LINE__,__FILE__);
                }
  
!               function delete_note($note_id)
                {
!                       $this->db->query("DELETE FROM phpgw_notes WHERE 
note_id='$note_id'",__LINE__,__FILE__);
                }
        }
--- 112,136 ----
                }
  
!               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->owner . "','" . 
$note['access'] . "','" . time() . "','" . $note['content']
!                               . "','" . $note['cat'] . 
"')",__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='"
!                                                       . $note['cat'] . "', 
note_access='" . $note['access'] . "' WHERE note_id=" . 
intval($note['id']),__LINE__,__FILE__);
                }
  
!               function delete($note_id)
                {
!                       $this->db->query('DELETE FROM phpgw_notes WHERE 
note_id=' . intval($note_id),__LINE__,__FILE__);
                }
        }

Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.ui.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.ui.inc.php    17 Sep 2002 19:48:08 -0000      1.13
--- class.ui.inc.php    17 Sep 2002 21:25:30 -0000      1.14
***************
*** 25,29 ****
                var $public_functions = array
                (
!                       '_list'  => True,
                        'view'   => True,
                        'add'    => True,
--- 25,29 ----
                var $public_functions = array
                (
!                       'index'  => True,
                        'view'   => True,
                        'add'    => True,
***************
*** 33,44 ****
                );
  
-               var $messages = array
-               (
-                       'saved'                 => 'Note has been added for %1 
!',
-                       'error_writing' => 'Error: writing !!!',
-                       'add_header'    => 'Add note for:',
-                       'edit_header'   => 'Edit note for:',
-               );
- 
                function ui()
                {
--- 33,36 ----
***************
*** 123,127 ****
                        }
  
!                       $notes_list = 
$this->bo->_list($this->start,$this->search,$this->filter,$this->cat_id);
  
  // --------------------------------- nextmatch ---------------------------
--- 115,119 ----
                        }
  
!                       $notes_list = 
$this->bo->read($this->start,$this->search,$this->filter,$this->cat_id);
  
  // --------------------------------- nextmatch ---------------------------
***************
*** 293,301 ****
                }
  
!               function edit($values=0, $msg = '')
                {
                        if (!is_array($values))
                        {
-                               $id = get_var('id',array('POST','GET'));
                                if ($id > 0)
                                {
--- 285,294 ----
                }
  
!               function edit($values=0)
                {
+                       $id = get_var('id',array('POST','GET'));
+ 
                        if (!is_array($values))
                        {
                                if ($id > 0)
                                {
***************
*** 314,325 ****
                                }
  
-                               //$this->data_merge($values);
-                               //echo "<p>edit: data ="; 
_debug_array($this->data);
- 
                                if ($values['save'])
                                {
!                                       $values['id'] = 
$this->bo->save($values);
! 
!                                       $msg .= $this->messages[$values['id'] > 
0 ? 'saved' : 'error_writing'];
                                }
                                elseif($values['done'])
--- 307,314 ----
                                }
  
                                if ($values['save'])
                                {
!                                       $this->bo->save($values);
!                                       $this->index();
                                }
                                elseif($values['done'])
***************
*** 331,345 ****
                                        $this->delete();
                                }
- 
-                               /*if (isset($values['entry']['edit']))
-                               {
-                                       list($id) = 
each($content['entry']['edit']);
-                                       if ($id > 0)
-                                       {
-                                               $this->read(array('id' => $id));
-                                       }
-                               }*/
                        }
!                       if ($values['id'] <= 0)
                        {
                                $no_button = array
--- 320,326 ----
                                        $this->delete();
                                }
                        }
! 
!                       if ($id <= 0)
                        {
                                $no_button = array
***************
*** 347,351 ****
                                        'delete' => True
                                );
- 
                                $header = 'Add note for ' . 
$GLOBALS['phpgw_info']['user']['fullname'];
                        }
--- 328,331 ----
***************
*** 356,367 ****
                                        'reset' => True
                                );
- 
                                $header = 'Edit note for ' . 
$GLOBALS['phpgw_info']['user']['fullname'];
                        }
  
                        $data = $values + array('header' => $header);
! 
! 
!                       
$this->tpl->exec('notes.ui.edit',$data,'',$no_button,array('id' => 
$values['id']));
                }
  
--- 336,344 ----
                                        'reset' => True
                                );
                                $header = 'Edit note for ' . 
$GLOBALS['phpgw_info']['user']['fullname'];
                        }
  
                        $data = $values + array('header' => $header);
!                       
$this->tpl->exec('notes.ui.edit',$data,'',$no_button,array('id' => $id));
                }
  
***************
*** 420,445 ****
                } */
  
!               function delete()
                {
!                       global $note_id, $confirm;
  
!                       if ($confirm)
                        {
!                               $this->bo->delete($note_id);
!                               $this->_list();
!                               return False;
                        }
                        else
                        {
!                               $this->display_app_header();
! 
!                               $this->t->set_file('delete','delete.tpl');
! 
!                               
$this->t->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.delete&note_id='
 . $note_id));
!                               
$this->t->set_var('done_action',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.list_notes'));
!                               $this->t->set_var('deleteheader',lang('Are you 
sure you want to delete this note ?'));
!                               $this->t->set_var('lang_no',lang('No'));
!                               $this->t->set_var('lang_yes',lang('Yes'));
!                               $this->t->pfp('out','delete');
                        }
                }
--- 397,427 ----
                } */
  
!               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));
!                               }
                        }
                }





reply via email to

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