phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: todo/inc class.ui.inc.php,1.2.2.8,1.2.2.9 hook_a


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: todo/inc class.ui.inc.php,1.2.2.8,1.2.2.9 hook_admin.inc.php,1.1.2.1,1.1.2.2
Date: Wed, 13 Mar 2002 16:32:39 -0500

Update of /cvsroot/phpgroupware/todo/inc
In directory subversions:/tmp/cvs-serv28283/inc

Modified Files:
      Tag: Version-0_9_14-branch
        class.ui.inc.php hook_admin.inc.php 
Log Message:
fixed cats to work in global cats apps part

Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/todo/inc/class.ui.inc.php,v
retrieving revision 1.2.2.8
retrieving revision 1.2.2.9
diff -C2 -r1.2.2.8 -r1.2.2.9
*** class.ui.inc.php    9 Mar 2002 22:10:42 -0000       1.2.2.8
--- class.ui.inc.php    13 Mar 2002 21:32:37 -0000      1.2.2.9
***************
*** 3,7 ****
        * phpGroupWare - Todo list                                              
   *
        * http://www.phpgroupware.org                                           
   *
!       * Written by Joseph Engo <address@hidden>                          *
        *            Bettina Gille address@hidden                          *
        * -----------------------------------------------                       
   *
--- 3,7 ----
        * phpGroupWare - Todo list                                              
   *
        * http://www.phpgroupware.org                                           
   *
!     * Written by Joseph Engo <address@hidden>                          *
        *            Bettina Gille address@hidden                          *
        * -----------------------------------------------                       
   *
***************
*** 19,30 ****
                var $public_functions = array
                (
!                       'show_list' => True,
                        'view'      => True,
                        'add'       => True,
                        'edit'      => True,
!                       'delete'    => True,
!                       'matrix'    => True
                );
-               var $debug = False;
  
                function ui()
--- 19,29 ----
                var $public_functions = array
                (
!                       'show_list'     => True,
                        'view'      => True,
                        'add'       => True,
                        'edit'      => True,
!                       'delete'        => True,
!                       'matrix'        => True
                );
  
                function ui()
***************
*** 59,63 ****
                        $this->t          = $GLOBALS['phpgw']->template;
                        $this->grants     = 
$GLOBALS['phpgw']->acl->get_grants('todo');
!                       $this->grants[$this->account] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
  
                        $this->start      = $this->bo->start;
--- 58,62 ----
                        $this->t          = $GLOBALS['phpgw']->template;
                        $this->grants     = 
$GLOBALS['phpgw']->acl->get_grants('todo');
! //                    $this->grants[$this->account]   = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
  
                        $this->start      = $this->bo->start;
***************
*** 86,89 ****
--- 85,91 ----
                {
                        
$this->t->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
+                       
$this->t->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
+                       
$this->t->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
+ 
                        $this->t->set_var('lang_category',lang('Category'));
                        $this->t->set_var('lang_select',lang('Select'));
***************
*** 91,96 ****
                        $this->t->set_var('lang_title',lang('Title'));
                        $this->t->set_var('lang_none',lang('None'));
                        $this->t->set_var('lang_urgency',lang('Urgency'));
!                       $this->t->set_var('lang_completed',lang('completed'));
                        $this->t->set_var('lang_start_date',lang('Start Date'));
                        $this->t->set_var('lang_end_date',lang('End Date'));
--- 93,99 ----
                        $this->t->set_var('lang_title',lang('Title'));
                        $this->t->set_var('lang_none',lang('None'));
+                       $this->t->set_var('lang_nobody',lang('Nobody'));
                        $this->t->set_var('lang_urgency',lang('Urgency'));
!                       $this->t->set_var('lang_completed',lang('Completed'));
                        $this->t->set_var('lang_start_date',lang('Start Date'));
                        $this->t->set_var('lang_end_date',lang('End Date'));
***************
*** 98,101 ****
--- 101,109 ----
                        $this->t->set_var('lang_access',lang('Private'));
                        $this->t->set_var('lang_parent',lang('Parent project'));
+                       $this->t->set_var('lang_submit',lang('Submit'));
+                       $this->t->set_var('lang_save',lang('Save'));
+                       $this->t->set_var('lang_done',lang('Done'));
+                       $this->t->set_var('lang_assigned',lang('Assigned to'));
+                       $this->t->set_var('lang_owner',lang('Created by'));
                }
  
***************
*** 122,129 ****
  // --------------------- nextmatch variable template-declarations 
------------------------
  
-                       $GLOBALS['query']  = $this->query;
-                       $GLOBALS['filter'] = $this->filter;
- //                    $GLOBALS['cat_id'] = $this->cat_id;
- 
                        $left = 
$this->nextmatchs->left('/index.php',$this->start,$this->bo->total_records,'&menuaction=todo.ui.show_list');
                        $right = 
$this->nextmatchs->right('/index.php',$this->start,$this->bo->total_records,'&menuaction=todo.ui.show_list');
--- 130,133 ----
***************
*** 138,144 ****
                        
$this->t->set_var('categories',$this->cats->formated_list('select','all',$this->cat_id,'True'));
                        
$this->t->set_var('filter_action',$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list'));
!                       
$this->t->set_var('filter_list',$this->nextmatchs->filter(1,1));
                        
$this->t->set_var('search_action',$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list'));
!                       
$this->t->set_var('search_list',$this->nextmatchs->search(1));
  
  // ---------------- list header variable template-declarations 
--------------------------
--- 142,148 ----
                        
$this->t->set_var('categories',$this->cats->formated_list('select','all',$this->cat_id,'True'));
                        
$this->t->set_var('filter_action',$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list'));
!                       
$this->t->set_var('filter_list',$this->nextmatchs->filter(1,array('yours' => 
1,'filter' => $this->filter)));
                        
$this->t->set_var('search_action',$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list'));
!                       
$this->t->set_var('search_list',$this->nextmatchs->search(array('search_obj' => 
1,'query' => $this->query)));
  
  // ---------------- list header variable template-declarations 
--------------------------
***************
*** 147,159 ****
                        
$this->t->set_var('sort_urgency',$this->nextmatchs->show_sort_order($this->sort,'todo_pri',$this->order,'/todo/index.php',lang('Urgency')));
                        
$this->t->set_var('sort_title',$this->nextmatchs->show_sort_order($this->sort,'todo_title',$this->order,'/todo/index.php',lang('title')));
!                       
$this->t->set_var('sort_lastupdated',$this->nextmatchs->show_sort_order($this->sort,'todo_startdate',$this->order,'/todo/index.php',lang('start
 date')));
!                       
$this->t->set_var('sort_datedue',$this->nextmatchs->show_sort_order($this->sort,'todo_enddate',$this->order,'/todo/index.php',lang('end
 date')));
                        
$this->t->set_var('sort_owner',$this->nextmatchs->show_sort_order($this->sort,'todo_owner',$this->order,'/todo/index.php',lang('created
 by')));
                        $this->t->set_var('h_lang_sub',lang('Add Sub'));
                        $this->t->set_var('h_lang_view',lang('View'));
                        $this->t->set_var('h_lang_edit',lang('Edit'));
-                       $this->t->set_var('h_lang_delete',lang('Delete'));
- 
-                       $query = $filter = '';
  
  // -------------- end header declaration 
--------------------------------------- 
--- 151,161 ----
                        
$this->t->set_var('sort_urgency',$this->nextmatchs->show_sort_order($this->sort,'todo_pri',$this->order,'/todo/index.php',lang('Urgency')));
                        
$this->t->set_var('sort_title',$this->nextmatchs->show_sort_order($this->sort,'todo_title',$this->order,'/todo/index.php',lang('title')));
!                       
$this->t->set_var('sort_sdate',$this->nextmatchs->show_sort_order($this->sort,'todo_startdate',$this->order,'/todo/index.php',lang('start
 date')));
!                       
$this->t->set_var('sort_edate',$this->nextmatchs->show_sort_order($this->sort,'todo_enddate',$this->order,'/todo/index.php',lang('end
 date')));
                        
$this->t->set_var('sort_owner',$this->nextmatchs->show_sort_order($this->sort,'todo_owner',$this->order,'/todo/index.php',lang('created
 by')));
+                       
$this->t->set_var('sort_assigned',$this->nextmatchs->show_sort_order($this->sort,'todo_assigned',$this->order,'/todo/index.php',lang('assigned
 to')));
                        $this->t->set_var('h_lang_sub',lang('Add Sub'));
                        $this->t->set_var('h_lang_view',lang('View'));
                        $this->t->set_var('h_lang_edit',lang('Edit'));
  
  // -------------- end header declaration 
--------------------------------------- 
***************
*** 164,168 ****
                                $level = $todo_list[$i]['level'];
  
!                               $title = 
$GLOBALS['phpgw']->strip_html($todo_list[$i]['title']);
  
                                if (!$title)
--- 166,170 ----
                                $level = $todo_list[$i]['level'];
  
!                               $title = 
$GLOBALS['phpgw']->strip_html($todo_list[$i]['title']); 
  
                                if (!$title)
***************
*** 196,200 ****
                                else
                                {
- 
                                        $datedue = 
$todo_list[$i]['edate_epoch'];
                                        $month  = 
$GLOBALS['phpgw']->common->show_date(time(),'n');
--- 198,201 ----
***************
*** 220,223 ****
--- 221,227 ----
                                }
  
+                               $assigned = 
$this->bo->list_assigned($todo_list[$i]['assigned']);
+                               $assigned .= 
$this->bo->list_assigned($todo_list[$i]['assigned_group']);
+ 
  // --------------- template declaration for list records 
-------------------------------------
  
***************
*** 229,233 ****
                                        'datecreated'   => 
$todo_list[$i]['sdate'],
                                        'datedue'               => $datedueout,
!                                       'owner'                 => $ownerout
                                ));
  
--- 233,238 ----
                                        'datecreated'   => 
$todo_list[$i]['sdate'],
                                        'datedue'               => $datedueout,
!                                       'owner'                 => 
$todo_list[$i]['owner'],
!                                       'assigned'              => $assigned
                                ));
  
***************
*** 238,242 ****
                                {
                                        $this->t->set_var('edit','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.edit&todo_id=' . 
$todo_list[$i]['id'])
!                                               . '">' . lang('Edit') . '</a>');
                                }
                                else
--- 243,247 ----
                                {
                                        $this->t->set_var('edit','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.edit&todo_id=' . 
$todo_list[$i]['id'])
!                                                                               
        . '">' . lang('Edit') . '</a>');
                                }
                                else
***************
*** 248,252 ****
                                {
                                        $this->t->set_var('delete','<a href="' 
. $GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.delete&todo_id=' . 
$todo_list[$i]['id'])
!                                               . '">' . lang('Delete') . 
'</a>');
                                }
                                else
--- 253,257 ----
                                {
                                        $this->t->set_var('delete','<a href="' 
. $GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.delete&todo_id=' . 
$todo_list[$i]['id'])
!                                                                               
                . '">' . lang('Delete') . '</a>');
                                }
                                else
***************
*** 258,262 ****
                                {
                                        $this->t->set_var('subadd', '<a href="' 
. $GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.add&parent=' . 
$todo_list[$i]['id']
!                                               . '&cat_id=' . $this->cat_id) . 
'">' . lang('Add Sub') . '</a>');
                                }
                                else
--- 263,267 ----
                                {
                                        $this->t->set_var('subadd', '<a href="' 
. $GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.add&parent=' . 
$todo_list[$i]['id']
!                                                                               
                                                . '&cat_id=' . $this->cat_id) . 
'">' . lang('Add Sub') . '</a>');
                                }
                                else
***************
*** 277,291 ****
                        }
  
!                       if ($cat[0]['app_name'] == 'phpgw' || !$this->cat_id)
                        {
                                $this->t->set_var('add','<form method="POST" 
action="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.add&cat_id=' . 
$this->cat_id)
!                                       . '"><input type="submit" name="Add" 
value="' . lang('Add') .'"></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','menuaction=todo.ui.add&cat_id=' . 
$this->cat_id)
!                                               . '"><input type="submit" 
name="Add" value="' . lang('Add') .'"></form>');
                                }
                                else
--- 282,296 ----
                        }
  
!                       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','menuaction=todo.ui.add&cat_id=' . 
$this->cat_id)
!                                                                               
. '"><input type="submit" name="Add" value="' . lang('Add') .'"></form>');
                        }
                        else
                        {
!                               if 
($this->bo->check_perms($this->grants[$cat[0]['owner']],PHPGW_ACL_ADD) || 
$cat[0]['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])
                                {
                                        $this->t->set_var('add','<form 
method="POST" action="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.add&cat_id=' . 
$this->cat_id)
!                                                                               
        . '"><input type="submit" name="Add" value="' . lang('Add') 
.'"></form>');
                                }
                                else
***************
*** 302,307 ****
                        $month = date('m');
  
!                       
$this->t->set_var('matrixview',$GLOBALS['phpgw']->common->check_owner($this->account,'/index.php',
!                               lang('View matrix of actual 
month'),'menuaction=todo.ui.matrix&month=' . $month . '&year=' . $year));
  
                        $this->t->pfp('out','todo_list_t',True);
--- 307,312 ----
                        $month = date('m');
  
!                       
$this->t->set_var('matrixview',$GLOBALS['phpgw']->common->check_owner($GLOBALS['phpgw_info']['user']['account_id'],'/index.php',
!                                                               lang('View 
matrix of actual month'),'menuaction=todo.ui.matrix&month=' . $month . '&year=' 
. $year));
  
                        $this->t->pfp('out','todo_list_t',True);
***************
*** 309,315 ****
                }
  
                function add()
                {
!                       global $cat_id, $new_cat, $values, $submit, 
$new_parent, $parent;
  
                        if ($new_parent)
--- 314,381 ----
                }
  
+               function formatted_user($selected = '',$type)
+               {
+                       if (!$selected)
+                       {
+                               $selected = $this->account;
+                       }
+ 
+                       if (! is_array($selected))
+                       {
+                               $selected = explode(',',$selected);
+                       }
+ 
+                       $employees = $this->bo->employee_list($type);
+ 
+                       while (list($null,$account) = each($employees))
+                       {
+                               $user_list .= '<option value="' . 
$account['account_id'] . '"';
+                               if (in_array($account['account_id'],$selected))
+                               {
+                                       $user_list .= ' selected';
+                               }
+                               if ($account['account_type'] == 'u')
+                               {
+                                       $user_list .= '>' . 
$account['account_firstname'] . ' ' . $account['account_lastname']
+                                                                               
. ' [' . $account['account_lid'] . ']'; 
+                               }
+                               else
+                               {
+                                       $user_list .= '>' . 
$account['account_firstname'] . '&nbsp;' . lang('Group');
+                               }
+                               $user_list .= '</option>' . "\n";
+                       }
+                       return $user_list;
+               }
+ 
+               function formatted_todo($selected = '')
+               {
+                       $todos = $this->bo->_list($start, False, $query, 
$filter, $sort, $order, $cat_id, $tree);
+ 
+                       for ($i=0;$i<count($todos);$i++)
+                       {
+                               $todo_select .= '<option value="' . 
$todos[$i]['id'] . '"';
+                               if ($todos[$i]['id'] == $selected)
+                               {
+                                       $todo_select .= ' selected';
+                               }
+                               if (! $todos[$i]['title'])
+                               {
+                                       $words = split(' 
',$GLOBALS['phpgw']->strip_html($todos[$i]['descr']));
+                                       $title = "$words[0] $words[1] $words[2] 
$words[3] ...";
+                                       $todo_select .= '>' . $title;
+                               }
+                               else
+                               {
+                                       $todo_select .= '>' . 
$GLOBALS['phpgw']->strip_html($todos[$i]['title']);
+                               }
+                               $todo_select .= '</option>';
+                       }
+                       return $todo_select;
+               }
+ 
                function add()
                {
!                       global $cat_id, $new_cat, $values, $submit, 
$new_parent, $parent, $assigned, $assigned_group;
  
                        if ($new_parent)
***************
*** 328,331 ****
--- 394,415 ----
                                $values['parent'] = $parent;
  
+                               if (is_array($assigned))
+                               {
+                                       $values['assigned'] = 
implode(',',$assigned);
+                                       if (count($assigned) > 1)
+                                       {
+                                               $values['assigned'] = ',' . 
$values['assigned'] . ',';
+                                       }
+                               }
+ 
+                               if (is_array($assigned_group))
+                               {
+                                       $values['assigned_group'] = 
implode(',',$assigned_group);
+                                       if (count($assigned_group) > 1)
+                                       {
+                                               $values['assigned_group'] = ',' 
. $values['assigned_group'] . ',';
+                                       }
+                               }
+ 
                                $error = $this->bo->check_values($values);
                                if (is_array($error))
***************
*** 337,340 ****
--- 421,425 ----
                                        $this->bo->save($values);
                                        Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list&cat_id=' . 
$cat_id));
+                                       $GLOBALS['phpgw']->common->phpgw_exit();
                                }
                        }
***************
*** 360,364 ****
  
                        
$this->t->set_var('cat_list',$this->cats->formated_list('select','all',$cat_id,'True'));
!                       
$this->t->set_var('todo_list',$this->bo->select_todo_list($parent));
  
                        $this->t->set_var('descr',$values['descr']);
--- 445,449 ----
  
                        
$this->t->set_var('cat_list',$this->cats->formated_list('select','all',$cat_id,'True'));
!                       
$this->t->set_var('todo_list',$this->formatted_todo($parent));
  
                        $this->t->set_var('descr',$values['descr']);
***************
*** 367,370 ****
--- 452,459 ----
                        
$this->t->set_var('stat_list',$this->sbox->getPercentage('values[status]',0));
  
+                       
$this->t->set_var('user_list',$this->formatted_user($assigned,'accounts'));
+ 
+                       
$this->t->set_var('group_list',$this->formatted_user($assigned_group,'groups'));
+ 
                        if (!$values['smonth'])
                        {
***************
*** 383,389 ****
  
                        
$this->t->set_var('start_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[syear]',$values['syear']),
!                               
$this->sbox->getMonthText('values[smonth]',$values['smonth']),$this->sbox->getDays('values[sday]',$values['sday'])));
                        
$this->t->set_var('end_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
!                               
$this->sbox->getMonthText('values[emonth]',$values['emonth']),$this->sbox->getDays('values[eday]',$values['eday'])));
  
                        $this->t->set_var('selfortoday','<input type="checkbox" 
name="values[seltoday]" value="True">');
--- 472,478 ----
  
                        
$this->t->set_var('start_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[syear]',$values['syear']),
!                                                                               
$this->sbox->getMonthText('values[smonth]',$values['smonth']),$this->sbox->getDays('values[sday]',$values['sday'])));
                        
$this->t->set_var('end_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
!                                                                               
$this->sbox->getMonthText('values[emonth]',$values['emonth']),$this->sbox->getDays('values[eday]',$values['eday'])));
  
                        $this->t->set_var('selfortoday','<input type="checkbox" 
name="values[seltoday]" value="True">');
***************
*** 411,435 ****
                        $this->t->set_file('_view','view.tpl');
  
!                       $this->t->set_var('lang_todo_action',lang('View todo 
item'));
! 
!                       $this->t->set_var('lang_title',lang('Title'));
!                       $this->t->set_var('value_title',$values['title']);
  
!                       $this->t->set_var('lang_descr',lang('Description'));
!                       $this->t->set_var('value_descr',$values['descr']);
  
-                       $this->t->set_var('lang_start_date',lang('Start date'));
                        
$this->t->set_var('value_start_date',$GLOBALS['phpgw']->common->show_date($values['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
- 
-                       $this->t->set_var('lang_end_date',lang('End date'));
                        
$this->t->set_var('value_end_date',$GLOBALS['phpgw']->common->show_date($values['edate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
  
                        $parent_values = $this->bo->read($values['parent']);
!                       $this->t->set_var('lang_parent',lang('Parent'));
!                       
$this->t->set_var('value_parent',$parent_values['title']);
  
-                       $this->t->set_var('lang_completed',lang('Completed'));
                        $this->t->set_var('value_completed',$values['status']);
  
                        switch ($values['pri'])
                        {
--- 500,527 ----
                        $this->t->set_file('_view','view.tpl');
  
!                       $this->set_app_langs();
  
!                       $this->t->set_var('lang_todo_action',lang('View todo 
item'));
!                       
$this->t->set_var('value_title',$GLOBALS['phpgw']->strip_html($values['title']));
!                       
$this->t->set_var('value_descr',$GLOBALS['phpgw']->strip_html($values['descr']));
!                       
$this->t->set_var('value_category',$this->cats->id2name($values['cat']));
  
                        
$this->t->set_var('value_start_date',$GLOBALS['phpgw']->common->show_date($values['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
                        
$this->t->set_var('value_end_date',$GLOBALS['phpgw']->common->show_date($values['edate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']));
  
                        $parent_values = $this->bo->read($values['parent']);
!                       
$this->t->set_var('value_parent',$GLOBALS['phpgw']->strip_html($parent_values['title']));
  
                        $this->t->set_var('value_completed',$values['status']);
  
+                       $assigned = 
$this->bo->list_assigned($this->bo->format_assigned($values['assigned']));
+                       $assigned .= 
$this->bo->list_assigned($this->bo->format_assigned($values['assigned_group']));
+ 
+                       $this->t->set_var('assigned',$assigned);
+ 
+                       $cached_data = 
$this->bo->cached_accounts($values['owner']);
+                       
$this->t->set_var('owner',$GLOBALS['phpgw']->common->display_fullname($cached_data[$values['owner']]['lid'],
+                                                                       
$cached_data[$values['owner']]['firstname'],$cached_data[$values['owner']]['lastname']));
+ 
                        switch ($values['pri'])
                        {
***************
*** 439,448 ****
                        }
  
-                       $this->t->set_var('lang_urgency',lang('Urgency'));
                        $this->t->set_var('value_urgency',$pri);
  
                        $this->t->set_var('lang_access',lang('Access'));
  
                        
$this->t->set_var('history',$this->historylog->return_html(array(),'','',$GLOBALS['todo_id']));
                        $this->t->pfp('out','_view');
                }
--- 531,541 ----
                        }
  
                        $this->t->set_var('value_urgency',$pri);
  
                        $this->t->set_var('lang_access',lang('Access'));
+                       $this->t->set_var('access',lang($values['access']));
  
                        
$this->t->set_var('history',$this->historylog->return_html(array(),'','',$GLOBALS['todo_id']));
+                       
$this->t->set_var('done_action',$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list'));
                        $this->t->pfp('out','_view');
                }
***************
*** 450,454 ****
                function edit()
                {
!                       global $cat_id, $new_cat, $values, $submit, 
$new_parent, $parent, $todo_id;
  
                        if ($new_parent)
--- 543,547 ----
                function edit()
                {
!                       global $cat_id, $new_cat, $values, $submit, 
$new_parent, $parent, $todo_id, $assigned, $assigned_group;
  
                        if ($new_parent)
***************
*** 462,470 ****
                        }
  
!                       if ($submit)
!                       {
!                               $values['cat'] = $cat_id;
!                               $values['parent'] = $parent;
!                               $values['id'] = $todo_id;
  
                                $error = $this->bo->check_values($values);
--- 555,581 ----
                        }
  
!             if ($submit)
!             {
!                 $values['cat'] = $cat_id;
!                 $values['parent'] = $parent;
!                 $values['id'] = $todo_id;
! 
!                               if (is_array($assigned))
!                               {
!                                       $values['assigned'] = 
implode(',',$assigned);
!                                       if (count($assigned) > 1)
!                                       {
!                                               $values['assigned'] = ',' . 
$values['assigned'] . ',';
!                                       }
!                               }
! 
!                               if (is_array($assigned_group))
!                               {
!                                       $values['assigned_group'] = 
implode(',',$assigned_group);
!                                       if (count($assigned_group) > 1)
!                                       {
!                                               $values['assigned_group'] = ',' 
. $values['assigned_group'] . ',';
!                                       }
!                               }
  
                                $error = $this->bo->check_values($values);
***************
*** 477,480 ****
--- 588,592 ----
                                        $this->bo->save($values,'edit');
                                        Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list&cat_id=' . 
$cat_id));
+                                       $GLOBALS['phpgw']->common->phpgw_exit();
                                }
                        }
***************
*** 502,506 ****
  
                        
$this->t->set_var('cat_list',$this->cats->formated_list('select','all',$values['cat'],'True'));
!                       
$this->t->set_var('todo_list',$this->bo->select_todo_list($values['parent']));
  
                        
$this->t->set_var('descr',$GLOBALS['phpgw']->strip_html($values['descr']));
--- 614,618 ----
  
                        
$this->t->set_var('cat_list',$this->cats->formated_list('select','all',$values['cat'],'True'));
!                       
$this->t->set_var('todo_list',$this->formatted_todo($values['parent']));
  
                        
$this->t->set_var('descr',$GLOBALS['phpgw']->strip_html($values['descr']));
***************
*** 509,512 ****
--- 621,626 ----
                        
$this->t->set_var('pri_list',$this->sbox->getPriority('values[pri]',$values['pri']));
                        
$this->t->set_var('stat_list',$this->sbox->getPercentage('values[status]',$values['status']));
+                       
$this->t->set_var('user_list',$this->formatted_user($this->bo->format_assigned($values['assigned']),'accounts'));
+                       
$this->t->set_var('group_list',$this->formatted_user($this->bo->format_assigned($values['assigned_group']),'groups'));
  
                        if ($values['sdate'] == 0)
***************
*** 524,528 ****
  
                        
$this->t->set_var('start_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[syear]',$values['syear']),
!                               
$this->sbox->getMonthText('values[smonth]',$values['smonth']),$this->sbox->getDays('values[sday]',$values['sday'])));
  
                        if ($values['edate'] == 0)
--- 638,642 ----
  
                        
$this->t->set_var('start_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[syear]',$values['syear']),
!                                                                               
$this->sbox->getMonthText('values[smonth]',$values['smonth']),$this->sbox->getDays('values[sday]',$values['sday'])));
  
                        if ($values['edate'] == 0)
***************
*** 540,544 ****
  
                        
$this->t->set_var('end_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
!                               
$this->sbox->getMonthText('values[emonth]',$values['emonth']),$this->sbox->getDays('values[eday]',$values['eday'])));
  
                        $this->t->set_var('selfortoday','&nbsp;');
--- 654,658 ----
  
                        
$this->t->set_var('end_select_date',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
!                                                                               
$this->sbox->getMonthText('values[emonth]',$values['emonth']),$this->sbox->getDays('values[eday]',$values['eday'])));
  
                        $this->t->set_var('selfortoday','&nbsp;');
***************
*** 549,553 ****
                        $this->t->set_var('access_list', '<input 
type="checkbox" name="values[access]" value="True"' . ($values['access'] == 
'private'?' checked':'') . '>');
  
!                       if 
($this->bo->check_perms($this->grants[$values['owner']],PHPGW_ACL_DELETE) || 
$values['owner'] == $this->account)
                        {
                                $this->t->set_var('delete','<form method="POST" 
action="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.delete&todo_id=' . 
$values['id'])
--- 663,667 ----
                        $this->t->set_var('access_list', '<input 
type="checkbox" name="values[access]" value="True"' . ($values['access'] == 
'private'?' checked':'') . '>');
  
!                       if 
($this->bo->check_perms($this->grants[$values['owner']],PHPGW_ACL_DELETE) || 
$values['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])
                        {
                                $this->t->set_var('delete','<form method="POST" 
action="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.delete&todo_id=' . 
$values['id'])
***************
*** 641,650 ****
                                        
$this->matrix->setPeriod($GLOBALS['phpgw']->strip_html($entries[$i]['title']),$startd,$endd,$colors[$ind]);
  
!                                       $subentries = 
$this->bo->_list($start,False,$query,$filter,$order,$sort,$cat_id,'subs',$entries[$i]['id']);
                                        for ($j=0;$j<count($subentries);$j++)
                                        {
                                                if 
($subentries[$j]['sdate_epoch'] > 0 && $subentries[$j]['edate_epoch'] > 0)
                                                {
!                                                       $startd = 
date('Y',$subentries[$j]['sdate_epoch']) . 
date('m',$subentries[$j]['sdate_epoch']) . 
date('d',$subentries[$j]['sdate_epoch']);
                                                        $endd = 
date('Y',$subentries[$j]['edate_epoch']) . 
date('m',$subentries[$j]['edate_epoch']) . 
date('d',$subentries[$j]['edate_epoch']);
                                                        
$this->matrix->setPeriod($GLOBALS['phpgw']->strip_html($subentries[$j]['title']),$startd,$endd,$colors[$ind]);
--- 755,764 ----
                                        
$this->matrix->setPeriod($GLOBALS['phpgw']->strip_html($entries[$i]['title']),$startd,$endd,$colors[$ind]);
  
!                                       $subentries = 
$this->bo->list_todos($start,False,$query,$filter,$order,$sort,$cat_id,'subs',$entries[$i]['id']);
                                        for ($j=0;$j<count($subentries);$j++)
                                        {
                                                if 
($subentries[$j]['sdate_epoch'] > 0 && $subentries[$j]['edate_epoch'] > 0)
                                                {
!                                                       $startd = 
date('Y',$subentries[$j]['sdate_epoch']) . 
date('m',$subentries[$j]['sdate_epoch']) . 
date('d',$subentries[$j]['sdate_epoch']);                                       
                 
                                                        $endd = 
date('Y',$subentries[$j]['edate_epoch']) . 
date('m',$subentries[$j]['edate_epoch']) . 
date('d',$subentries[$j]['edate_epoch']);
                                                        
$this->matrix->setPeriod($GLOBALS['phpgw']->strip_html($subentries[$j]['title']),$startd,$endd,$colors[$ind]);
***************
*** 653,657 ****
                                }
                        }
- 
                        
$this->matrix->out($GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.matrix'));
                }
--- 767,770 ----

Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/todo/inc/hook_admin.inc.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** hook_admin.inc.php  23 Jan 2002 20:54:50 -0000      1.1.2.1
--- hook_admin.inc.php  13 Mar 2002 21:32:37 -0000      1.1.2.2
***************
*** 10,22 ****
        *  option) any later version.                                           
   *
        
\**************************************************************************/
- 
        // $Id$
        // $Source$
  
!       $values = array
!       (
!               'Global Categories' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=todo')
!       );
  
!       display_section('todo','Todo list',$values);
! ?>
\ No newline at end of file
--- 10,23 ----
        *  option) any later version.                                           
   *
        
\**************************************************************************/
        // $Id$
        // $Source$
  
!       {
!               $values = array
!               (
!                       'Global Categories' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
 . $appname)
!               );
  
!               display_section($appname,$appname,$values);
!       }
! ?>




reply via email to

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