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.6,1.6.2.1 class.ui.


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: notes/inc class.bo.inc.php,1.6,1.6.2.1 class.ui.inc.php,1.16,1.16.2.1
Date: Tue, 24 Sep 2002 13:29:58 -0400

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

Modified Files:
      Tag: eTemplate
        class.bo.inc.php class.ui.inc.php 
Log Message:
add view and ACL, changed some layouts

Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.bo.inc.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** class.bo.inc.php    18 Sep 2002 00:40:36 -0000      1.6
--- class.bo.inc.php    24 Sep 2002 17:29:56 -0000      1.6.2.1
***************
*** 56,59 ****
--- 56,62 ----
                {
                        $this->so = CreateObject('notes.so');
+                       $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->grants           = 
$GLOBALS['phpgw']->acl->get_grants('notes');
+                       $this->grants[$this->account] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
  
                        if ($session)
***************
*** 265,283 ****
                }
  
!               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;
                }
        }
--- 268,301 ----
                }
  
!               function get_rows($query,&$rows,&$readonlys)
                {
                        //echo 
"<p>notes.ui.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id]):
 notes_list =";
  
!                       $rows = 
$this->read($query['start'],$query['search'],$query['filter'],$query['cat_id']);
!                       if (!is_array($rows))
                        {
!                               $rows = array( );
                        }
                        else
                        {
!                               array_unshift($rows,0); each($rows); // first 
entry is not used
                                //_debug_array($notes_list);
                        }
!                       $readonlys = array( );
!                       while (list($n,$note) = each($rows))
!                       {
!                               if 
(!$this->check_perms($this->grants[$note['owner_id']],PHPGW_ACL_EDIT))
!                               {
!                                       $readonlys["edit[$note[id]]"] = True;
!                               }
!                               if 
(!$this->check_perms($this->grants[$note['owner_id']],PHPGW_ACL_DELETE))
!                               {
!                                       $readonlys["delete[$note[id]]"] = True;
!                               }
!                               $rows[$n]['access'] = $note['access'] == 
'private' ? 'private' : 'public';
!                       }
!                       reset($rows);
! 
!                       return $this->total_records;
                }
        }

Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.ui.inc.php,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -C2 -r1.16 -r1.16.2.1
*** class.ui.inc.php    17 Sep 2002 23:10:18 -0000      1.16
--- class.ui.inc.php    24 Sep 2002 17:29:56 -0000      1.16.2.1
***************
*** 16,24 ****
        {
                var $grants;
!               var $cat_id;
!               var $start;
!               var $search;
!               var $filter;
! 
                var $message;
  
--- 16,20 ----
        {
                var $grants;
!               var $session_data;
                var $message;
  
***************
*** 36,52 ****
                {
                        $this->cats                     = 
CreateObject('phpgwapi.categories');
-                       $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       //$this->t                      = 
$GLOBALS['phpgw']->template;
                        $this->tpl                      = 
CreateObject('etemplate.etemplate','notes.edit');
-                       $this->grants           = 
$GLOBALS['phpgw']->acl->get_grants('notes');
-                       $this->grants[$this->account] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
                        $this->bo                       = 
CreateObject('notes.bo',True);
  
!                       $this->start            = $this->bo->start;
!                       $this->search           = $this->bo->search;
!                       $this->filter           = $this->bo->filter;
!                       $this->cat_id           = $this->bo->cat_id;
! 
                        $this->data                     = $this->bo->data;
                }
--- 32,45 ----
                {
                        $this->cats                     = 
CreateObject('phpgwapi.categories');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->tpl                      = 
CreateObject('etemplate.etemplate','notes.edit');
                        $this->bo                       = 
CreateObject('notes.bo',True);
  
!                       $this->session_data = array(
!                               'start' => $this->bo->start,
!                               'search'        => $this->bo->search,
!                               'filter'        => $this->bo->filter,
!                               'cat_id'        => $this->bo->cat_id
!                       );
                        $this->data                     = $this->bo->data;
                }
***************
*** 54,447 ****
                function save_sessiondata()
                {
!                       $data = array
!                       (
!                               'start'  => $this->start,
!                               'search' => $this->search,
!                               'filter' => $this->filter,
!                               'cat_id' => $this->cat_id
!                       );
!                       $this->bo->save_sessiondata($data);
!               }
! 
!               function set_app_langs()
!               {
!                       global $tr_color;
! 
!                       
$this->t->set_var('bg_color',$GLOBALS['phpgw_info']['theme']['th_bg']);
!                       $tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
!                       $this->t->set_var('tr_color',$tr_color);
!                       $this->t->set_var('font',$this->bo->set_font());
!                       
$this->t->set_var('font_size',$this->bo->set_font_size());
!                       
$this->t->set_var('name',$GLOBALS['phpgw_info']['user']['fullname']);
! 
!                       $this->t->set_var('lang_categories',lang('Categories'));
!                       $this->t->set_var('lang_category',lang('Category'));
!                       $this->t->set_var('lang_notes',lang('Notes'));
!                       $this->t->set_var('lang_search',lang('Search'));
!                       $this->t->set_var('lang_submit',lang('Submit'));
!                       $this->t->set_var('lang_all',lang('All'));
!                       $this->t->set_var('lang_view',lang('View'));
!                       $this->t->set_var('lang_choose',lang('Choose the 
category'));
!                       $this->t->set_var('lang_access',lang('Private'));
!                       $this->t->set_var('lang_done',lang('Done'));
!                       $this->t->set_var('lang_save',lang('Save'));
!                       
$this->t->set_var('done_action',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui._list'));
!               }
! 
!               function display_app_header()
!               {
!                       $this->t->set_file(array('header' => 'header.tpl'));
!             $this->t->set_block('header','notes_header');
! 
!                       $this->set_app_langs();
! 
!                       
$this->t->set_var('link_categories',$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=notes&cats_level=True&global_cats=True'));
!                       
$this->t->set_var('link_notes',$GLOBALS['phpgw']->link('/notes/index.php','menuaction=notes.ui._list'));
!                       $this->t->fp('app_header','notes_header');
! 
!                       $GLOBALS['phpgw']->common->phpgw_header();
                }
  
                function index($values = 0)
                {
!                       //echo "<p>notes.ui.list_notes: content[nm][rows] = "; 
//_debug_array($content);
  
                        if (!is_array($values))
                        {
!                               $values = array();
!                       }
! 
!                       if ($values['add'])
!                       {
!                               return $this->edit();
                        }
!                       elseif (isset($values['nm']['rows']['edit']))
                        {
!                               list($id) = each($values['nm']['rows']['edit']);
!                               return $this->edit($id);
!                       }
!                       elseif (isset($values['nm']['rows']['delete']))
!                       {
!                               list($id) = 
each($values['nm']['rows']['delete']);
!                               return $this->delete($id);
                        }
                        $this->tpl->read('notes.index');
  
!                       $filter_list = array
                        (
!                               'all'           => 'Show all',
!                               'public'        => 'Only yours',
                                'private'       => 'Private'
                        );
  
-                       $values['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',$values);
                }
  
!               function index_old()
                {
!                       $this->display_app_header();
  
!                       $this->t->set_file(array('notes_list_t' => 'list.tpl'));
!                       $this->t->set_block('notes_list_t','notes_list','list');
! 
!                       if (!$this->start)
                        {
!                               $this->start = 0;
                        }
! 
!                       $notes_list = 
$this->bo->read($this->start,$this->search,$this->filter,$this->cat_id);
! 
! // --------------------------------- nextmatch ---------------------------
! 
!                       $link_data = array
!                       (
!                               'menuaction' => 'notes.ui._list'
!                       );
! 
!                       $left = 
$this->nextmatchs->left('/index.php',$this->start,$this->bo->total_records,$link_data);
!                       $right = 
$this->nextmatchs->right('/index.php',$this->start,$this->bo->total_records,$link_data);
!                       $this->t->set_var('left',$left);
!                       $this->t->set_var('right',$right);
! 
!                       
$this->t->set_var('search_message',$this->nextmatchs->show_hits($this->bo->total_records,$this->start));
! 
! // -------------------------- end nextmatch 
------------------------------------
! 
!                       
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                       $this->t->set_var('title_notes',lang('Personalized 
notes for'));
!                       
$this->t->set_var('cat_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                       
$this->t->set_var('filter_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                       
$this->t->set_var('category_list',$this->cats->formated_list('select','all',$this->cat_id,True));
! 
!                       switch($this->filter)
                        {
!                               case 'all': $filter_sel[0]=' selected';break;
!                               case 'public': $filter_sel[1]=' selected';break;
!                               case 'private': $filter_sel[2]=' 
selected';break;
                        }
! 
!                       $filter_list = '<option value="all"' . $filter_sel[0] . 
'>' . lang('Show all') . '</option>' . "\n"
!                               . '<option value="public"' . $filter_sel[1] . 
'>' . lang('Only yours') . '</option>' . "\n"
!                               . '<option value="private"' . $filter_sel[2] . 
'>' . lang('Private') . '</option>' . "\n";
! 
!                       $this->t->set_var('filter_list',$filter_list);
! 
!                       for ($i=0;$i<count($notes_list);$i++)
                        {
!                               $note_owner = 
intval($notes_list[$i]['owner_id']);
!                               $new_dateout = $notes_list[$i]['date'];
! 
!                               $words = split(' 
',$GLOBALS['phpgw']->strip_html($notes_list[$i]['content']));
!                               $first = "$words[0] $words[1] $words[2] 
$words[3] .....";
!                               
$this->nextmatchs->template_alternate_row_color(&$this->t);
! 
!                               $this->t->set_var(array
!                               (
!                                       'new_date' => $new_dateout,
!                                       'first' => $first
!                               ));
! 
!                               $link_data['note_id']           = 
$notes_list[$i]['id'];
!                               $link_data['menuaction']        = 
'notes.ui.view';
! 
!                               
$this->t->set_var('view',$GLOBALS['phpgw']->link('/index.php',$link_data));
! 
!                               if 
($this->bo->check_perms($this->grants[$note_owner],PHPGW_ACL_EDIT) || 
$note_owner == $this->account)
!                               {
!                                       $link_data['menuaction'] = 
'notes.ui.edit';
!                                       
$this->t->set_var('edit',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                                       
$this->t->set_var('lang_edit',lang('Edit'));
!                               }
!                               else
!                               {
!                                       $this->t->set_var('edit','');
!                                       $this->t->set_var('lang_edit','');
!                               }
! 
!                               if 
($this->bo->check_perms($this->grants[$note_owner],PHPGW_ACL_DELETE) || 
$note_owner == $this->account)
!                               {
!                                       $link_data['menuaction'] = 
'notes.ui.delete';
!                                       
$this->t->set_var('delete',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                                       
$this->t->set_var('lang_delete',lang('Delete'));
!                               }
!                               else
!                               {
!                                       $this->t->set_var('delete','');
!                                       $this->t->set_var('lang_delete','');
!                               }
! 
!                               $this->t->fp('list','notes_list',True);
                        }
! 
!                       if ($this->cat_id && $this->cat_id != 0)
                        {
!                               $cat = 
$this->cats->return_single($this->cat_id);
                        }
! 
!                       $link_data['menuaction']        = 'notes.ui.add';
!                       $link_data['cat_id']            = $this->cat_id;
! 
!                       if ($cat[0]['app_name'] == 'phpgw' || $cat[0]['owner'] 
== '-1' || !$this->cat_id)
                        {
!                               $this->t->set_var('add','<form method="POST" 
action="' . $GLOBALS['phpgw']->link('/index.php',$link_data)
!                                       . '"><input type="submit" name="Add" 
value="' . lang('Add note') .'"></font></form>');
                        }
!                       else
                        {
!                               if 
($this->bo->check_perms($this->grants[$cat[0]['owner']],PHPGW_ACL_ADD) || 
$cat[0]['owner'] == $this->account)
!                               {
!                                       $this->t->set_var('add','<form 
method="POST" action="' . $GLOBALS['phpgw']->link('/index.php',$link_data)
!                                               . '"><input type="submit" 
name="Add" value="' . lang('Add note') .'"></font></form>');
!                               }
!                               else
!                               {
!                                       $this->t->set_var('add','');
!                               }
                        }
! 
!                       $this->t->pfp('out','notes_list_t');
!                       $this->save_sessiondata();
!               }
! 
!               function add()
!               {
!                       global $cat_id, $new_cat, $addnote, $note;
! 
!               /*      if ($GLOBALS['spellcheck'])
                        {
!                               $check_fields = array(
!                                       'content' => $GLOBALS['note']['content']
!                               );
! 
!                               $spellcheck = 
createobject('phpgwapi.spellcheck');
!                               
$spellcheck->check('notes.ui.add',$check_fields,array());
! 
!                               return False;
!                       } */
! 
!                       if ($new_cat)
                        {
!                               $cat_id = $new_cat;
                        }
! 
!                       if ($addnote)
                        {
!                               $note['category'] = $cat_id;
! 
!                               $this->bo->save($note);
! //                            $this->t->set_var('message',lang('Note has been 
added for x !',$GLOBALS['phpgw_info']['user']['fullname']));
!                               $this->cat_id = $cat_id;
!                               $this->_list();
!                               return False;
                        }
!                       else
                        {
!                               $this->display_app_header();
! 
!                               $this->t->set_file(array('form' => 'form.tpl'));
!                               $this->t->set_block('form','add','addhandle');
!                               $this->t->set_block('form','edit','edithandle');
! 
!                               $this->t->set_var('message','');
!                               $this->t->set_var('lang_action',lang('Add a 
note for'));
!                               
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.add&cat_id='
 . $cat_id));
!                               $this->t->set_var('content',$note['content']);
!                               
$this->t->set_var('main_cat_list',$this->cats->formated_list('select','all',$cat_id,'True'));
! 
!                               $this->t->set_var('access','<input 
type="checkbox" name="note[access]" value="True" checked>');
! 
!                               $this->t->set_var('lang_reset',lang('Clear 
Form'));
!                               $this->t->set_var('lang_add',lang('Add note'));
!                               $this->t->set_var('edithandle','');
!                               $this->t->set_var('addhandle','');
!                               $this->t->pfp('out','form');
!                               $this->t->pfp('addhandle','add');
                        }
!               }
! 
!               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
!                               {
!                                       $values = array();
!                               }
                        }
                        else
                        {
!                               if ($this->debug)
!                               {
!                                       echo '<p>edit: values = ' .  
_debug_array($values);
!                               }
  
!                               if ($values['save'])
                                {
!                                       $this->bo->save($values);
!                                       $this->index();
                                }
!                               elseif($values['done'])
!                               {
!                                       $this->index();
!                               }
!                               elseif($values['delete'])
                                {
!                                       $this->delete($values['id']);
                                }
-                               return;
-                       }
- 
-                       if ($values['id'] <= 0)
-                       {
-                               $no_button = array
-                               (
-                                       'delete' => True
-                               );
-                               $header = 'Add note for ' . 
$GLOBALS['phpgw_info']['user']['fullname'];
-                       }
-                       else
-                       {
-                               $no_button = array
-                               (
-                                       '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']));
                }
  
!       /*      function edit()
                {
!                       global $cat_id, $new_cat, $editnote, $note, $note_id;
! 
!                       $this->display_app_header();
! 
!                       $this->t->set_file(array('form' => 'form.tpl'));
!                       $this->t->set_block('form','add','addhandle');
!                       $this->t->set_block('form','edit','edithandle');
! 
!                       if ($new_cat)
!                       {
!                               $cat_id = $new_cat;
!                       }
! 
!                       if ($editnote)
!                       {
!                               $note['category'] = $cat_id;
!                               $note['id'] = $note_id;
! 
!                               $this->bo->save($note);
!                               $this->t->set_var('message',lang('Note has been 
updated for x !',$GLOBALS['phpgw_info']['user']['fullname']));
!                       }
!                       else
!                       {
!                               $this->t->set_var('message','');
!                       }
! 
!                       $note = $this->bo->read($note_id);
! 
!                       $this->t->set_var('lang_action',lang('Edit note for'));
!                       
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.edit&cat_id='
 . $cat_id . '&note_id=' . $note_id));
!                       
$this->t->set_var('content',$GLOBALS['phpgw']->strip_html($note['content']));
!                       
$this->t->set_var('main_cat_list',$this->cats->formated_list('select','all',$note['category'],'True'));
!                       $this->t->set_var('lang_edit',lang('Edit'));
! 
!                       $this->t->set_var('access','<input type="checkbox" 
name="note[access]" value="True"' . ($note['access'] == 'private'?' 
checked':'') . '>');
! 
!                       if 
($this->bo->check_perms($this->grants[$note['owner']],PHPGW_ACL_DELETE) || 
$note['owner'] == $this->account)
!                       {
!                               $this->t->set_var('delete','<form method="POST" 
action="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.delete&note_id=' . 
$note_id)
!                                       . '"><input type="submit" value="' . 
lang('Delete') .'"></form>');
!                       }
!                       else
!                       {
!                               $this->t->set_var('delete','&nbsp;');
!                       }
! 
!                       $this->t->set_var('edithandle','');
!                       $this->t->set_var('addhandle','');
!                       $this->t->pfp('out','form');
!                       $this->t->pfp('edithandle','edit');
!               } */
  
                function delete($values=0)
--- 47,189 ----
                function save_sessiondata()
                {
!                       $this->bo->save_sessiondata($this->session_data);
                }
  
                function index($values = 0)
                {
!                       //echo "<p>notes.ui.index: values = "; 
_debug_array($values);
  
                        if (!is_array($values))
                        {
!                               $values = array('nm' => $this->session_data);
                        }
!                       if ($values['add'] || $values['cats'] || 
isset($values['nm']['rows']))
                        {
!                               $this->session_data = $values['nm'];
!                               unset($this->session_data['rows']);
!                               $this->save_sessiondata();
! 
!                               if ($values['add'])
!                               {
!                                       return $this->edit();
!                               }
!                               elseif ($values['cats'])
!                               {
!                                       Header('Location: ' 
.$GLOBALS['phpgw']->link('/index.php?menuaction=preferences.uicategories.index&cats_app=notes&cats_level=True&global_cats=True'));
!                                       $GLOBALS['phpgw']->common->phpgw_exit();
!                               }
!                               elseif (isset($values['nm']['rows']['view']))
!                               {
!                                       list($id) = 
each($values['nm']['rows']['view']);
!                                       return $this->view($id);
!                               }
!                               elseif (isset($values['nm']['rows']['edit']))
!                               {
!                                       list($id) = 
each($values['nm']['rows']['edit']);
!                                       return $this->edit($id);
!                               }
!                               elseif (isset($values['nm']['rows']['delete']))
!                               {
!                                       list($id) = 
each($values['nm']['rows']['delete']);
!                                       return $this->delete($id);
!                               }
                        }
                        $this->tpl->read('notes.index');
  
!                       $values['nm']['options-filter'] = array
                        (
!                               'all'                   => 'Show all',
!                               'public'                => 'Only yours',
                                'private'       => 'Private'
                        );
+                       $values['nm']['get_rows'] = 'notes.bo.get_rows';
+                       $values['nm']['no_filter2'] = True;
+                       $values['user'] = 
$GLOBALS['phpgw_info']['user']['fullname'];
  
                        $this->tpl->exec('notes.ui.index',$values);
                }
  
!               function edit($values=0,$view=False)
                {
!                       //echo "<p>notes.ui.edit():"; _debug_array($values);
  
!                       if (!is_array($values))
                        {
!                               $id = $values > 0 ? $values : 
get_var('id',array('POST','GET'));
!                               $values = array( );
                        }
!                       else
                        {
!                               $id = $values['id'];
                        }
!                       if ($id > 0)
                        {
!                               $content = $this->bo->read_single($id);
                        }
!                       else
                        {
!                               $content = array();
                        }
!                       if ($this->debug)
                        {
!                               echo '<p>edit: id=$id, values = ' .  
_debug_array($values);
                        }
!                       if ($values['save'])
                        {
!                               $this->bo->save($values);
!                               return $this->index();
                        }
!                       elseif($values['done'])
                        {
!                               return $this->index();
!                       }
!                       elseif($values['delete'])
                        {
!                               return $this->delete($values['id']);
                        }
!                       elseif($values['reset'])
                        {
!                               $content = array();
                        }
!                       elseif($values['cats'])
                        {
!                               Header('Location: ' 
.$GLOBALS['phpgw']->link('/index.php?menuaction=preferences.uicategories.index&cats_app=notes&cats_level=True&global_cats=True'));
!                               $GLOBALS['phpgw']->common->phpgw_exit();
                        }
!                       if ($view)
                        {
!                               $content['header'] = 'Notes - View note for';
!                               $this->tpl->read('notes.view');
!                               $content['cat']    = 
$this->cats->id2name($content['cat']);
!                               $no_button['delete'] = 
!$this->bo->check_perms($this->bo->grants[$content['owner']],PHPGW_ACL_DELETE);
!                               $no_button['edit'] = 
!$this->bo->check_perms($this->bo->grants[$content['owner']],PHPGW_ACL_EDIT);
                        }
                        else
                        {
!                               $content['access'] = $content['access'] == 
'private';
  
!                               if ($content['id'] <= 0)
                                {
!                                       $no_button['delete'] = True;
!                                       $content['header'] = 'Notes - Add note 
for';
!                                       $content['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
                                }
!                               else
                                {
!                                       $no_button['reset']  = True;
!                                       $no_button['delete'] = 
!$this->bo->check_perms($this->bo->grants[$content['owner']],PHPGW_ACL_DELETE);
!                                       $content['header'] = 'Notes - Edit note 
for';
                                }
                        }
+                       $content['user'] = 
$GLOBALS['phpgw_info']['user']['fullname'];
+                       $content['owner'] = 
$GLOBALS['phpgw']->accounts->id2name($content['owner_id'] = $content['owner']);
  
!                       
$this->tpl->exec('notes.ui.edit',$content,'',$no_button,array('id' => $id));
                }
  
!               function view($id)
                {
!                       $this->edit($id,True);
!               }
  
                function delete($values=0)
***************
*** 467,496 ****
                }
  
!               function view()
!               {
!                       global $note_id, $note;
! 
!                       $this->display_app_header();
! 
!                       $this->t->set_file('view','view.tpl');
! 
!                       $this->t->set_var('lang_time',lang('Time created'));
!                       $this->t->set_var('lang_action',lang('Display note 
for'));
!                       $this->t->set_var('lang_access',lang('Access'));
! 
!                       $note = $this->bo->read($note_id);
! 
!                       
$this->t->set_var('category',$this->cats->id2name($note['category']));
!                       
$this->t->set_var('new_date',$GLOBALS['phpgw']->common->show_date($note['date']));
!                       
$this->t->set_var('fnote',nl2br($GLOBALS['phpgw']->strip_html($note['content'])));
!                       $this->t->set_var('access',ucfirst($note['access']));
! 
!                       $this->t->pfp('out','view');
!               }
! 
!               function preferences()
                {
                        global $submit, $prefs;
  
                        if ($submit)
                        {
--- 209,218 ----
                }
  
!               function preferences()  // not yet ported to eTemplates
                {
                        global $submit, $prefs;
  
+                       $this->t = $GLOBALS['phpgw']->template;
+ 
                        if ($submit)
                        {
***************
*** 505,509 ****
                        
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.preferences'));
  
!                       $this->set_app_langs();
  
                        $this->t->set_var('lang_action',lang('Notes 
preferences'));
--- 227,231 ----
                        
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.preferences'));
  
!                       //$this->set_app_langs();
  
                        $this->t->set_var('lang_action',lang('Notes 
preferences'));
***************
*** 517,524 ****
                                case'Arial,Helvetica,sans-serif': 
$font_sel[0]=' selected'; break;
                                case'Times New Roman,Times,serif': 
$font_sel[1]=' selected'; break;
!                               case'Verdana,Arial,Helvetica,sans-serif': 
$font_sel[2]=' selected'; break; 
                                case'Georgia,Times New Roman,Times,serif': 
$font_sel[3]=' selected'; break;
                                case'Courier New,Courier,mono': $font_sel[4]=' 
selected'; break;
!                               case'Helvetica,Arial,sans-serif': 
$font_sel[5]=' selected'; break; 
                                
case'Tahoma,Verdana,Arial,Helvetica,sans-serif': $font_sel[6]=' selected'; 
break;
                        }
--- 239,246 ----
                                case'Arial,Helvetica,sans-serif': 
$font_sel[0]=' selected'; break;
                                case'Times New Roman,Times,serif': 
$font_sel[1]=' selected'; break;
!                               case'Verdana,Arial,Helvetica,sans-serif': 
$font_sel[2]=' selected'; break;
                                case'Georgia,Times New Roman,Times,serif': 
$font_sel[3]=' selected'; break;
                                case'Courier New,Courier,mono': $font_sel[4]=' 
selected'; break;
!                               case'Helvetica,Arial,sans-serif': 
$font_sel[5]=' selected'; break;
                                
case'Tahoma,Verdana,Arial,Helvetica,sans-serif': $font_sel[6]=' selected'; 
break;
                        }





reply via email to

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