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.15,1.16


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: todo/inc class.ui.inc.php,1.15,1.16
Date: Sun, 28 Apr 2002 20:18:17 -0400

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

Modified Files:
        class.ui.inc.php 
Log Message:
Additional code changes for the home hook.

Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/todo/inc/class.ui.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.ui.inc.php    13 Apr 2002 21:20:32 -0000      1.15
--- class.ui.inc.php    29 Apr 2002 00:18:09 -0000      1.16
***************
*** 17,20 ****
--- 17,21 ----
                var $grants;
                var $historylog;
+               var $t;
                var $public_functions = array
                (
***************
*** 58,64 ****
                        $this->matrix     = CreateObject('phpgwapi.matrixview');
                        $this->account    = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       $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;
--- 59,64 ----
                        $this->matrix     = CreateObject('phpgwapi.matrixview');
                        $this->account    = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       $this->t          = 
CreateObject('phpgwapi.Tempalte',$GLOBALS['phpgw']->common->get_tpl_dir('todo'));
                        $this->grants     = 
$GLOBALS['phpgw']->acl->get_grants('todo');
  
                        $this->start      = $this->bo->start;
***************
*** 114,121 ****
                        $GLOBALS['phpgw']->common->phpgw_header();
                        echo parse_navbar();
  
!                       $this->t->set_file(array('todo_list_t' => 'list.tpl'));
!                       $this->t->set_block('todo_list_t','todo_list','list');
  
                        $this->set_app_langs();
  
--- 114,134 ----
                        $GLOBALS['phpgw']->common->phpgw_header();
                        echo parse_navbar();
+                       echo $this->show_list_body(True);
+               }
  
!               function show_list_body($show_page_header=True)
!               {
!                       $this->t->set_file(
!                               Array(
!                                       'todo_list_t' => 'list.tpl'
!                               )
!                       );
!                       
$this->t->set_block('todo_list_t','page_header','page_header');
!                       
$this->t->set_block('todo_list_t','table_header','table_header');
!                       
$this->t->set_block('todo_list_t','todo_list','todo_list');
!                       
$this->t->set_block('todo_list_t','table_footer','table_footer');
!                       
$this->t->set_block('todo_list_t','page_footer','page_footer');
  
+                       $body = '';
                        $this->set_app_langs();
  
***************
*** 132,150 ****
  // --------------------- nextmatch variable template-declarations 
------------------------
  
!                       $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');
!                       $this->t->set_var('left',$left);
!                       $this->t->set_var('right',$right);
  
!                       
$this->t->set_var('total_matchs',$this->nextmatchs->show_hits($this->bo->total_records,$this->start));
  
  // ------------------------- end nextmatch template 
--------------------------------------
  
!                       
$this->t->set_var('cat_action',$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list'));
!                       
$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 
--------------------------
--- 145,168 ----
  // --------------------- nextmatch variable template-declarations 
------------------------
  
!                       if($show_page_header)
!                       {
!                               $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');
!                               $this->t->set_var('left',$left);
!                               $this->t->set_var('right',$right);
  
!                               
$this->t->set_var('total_matchs',$this->nextmatchs->show_hits($this->bo->total_records,$this->start));
  
  // ------------------------- end nextmatch template 
--------------------------------------
  
!                               
$this->t->set_var('cat_action',$GLOBALS['phpgw']->link('/index.php','menuaction=todo.ui.show_list'));
!                               
$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)));
! 
!                               $body .= $this->t->fp('out','page_header');
!                       }
  
  // ---------------- list header variable template-declarations 
--------------------------
***************
*** 161,169 ****
                        $this->t->set_var('h_lang_edit',lang('Edit'));
  
  // -------------- end header declaration 
--------------------------------------- 
  
                        for ($i=0;$i<count($todo_list);$i++)
                        {
!                               
$this->nextmatchs->template_alternate_row_color(&$this->t);
                                $level = $todo_list[$i]['level'];
  
--- 179,189 ----
                        $this->t->set_var('h_lang_edit',lang('Edit'));
  
+                       $body .= $this->t->fp('out','table_header');
+ 
  // -------------- end header declaration 
--------------------------------------- 
  
                        for ($i=0;$i<count($todo_list);$i++)
                        {
!                               
$this->nextmatchs->template_alternate_row_color($this->t);
                                $level = $todo_list[$i]['level'];
  
***************
*** 178,182 ****
                                if ($level == 0)
                                {
!                                       $title = '<font color="0000EE"><b>' . 
$title . '</b></font>';
                                }
                                else
--- 198,202 ----
                                if ($level == 0)
                                {
!                                       $title = '<font color="#0000EE"><b>' . 
$title . '</b></font>';
                                }
                                else
***************
*** 191,195 ****
                                        case 1: $pri = lang('Low'); break;
                                        case 2: $pri = '<b>' . lang('normal') . 
'</b>'; break;
!                                       case 3: $pri = '<font 
color="CC0000"><b>' . lang('high') . '</b></font>'; break;
                                }
  
--- 211,215 ----
                                        case 1: $pri = lang('Low'); break;
                                        case 2: $pri = '<b>' . lang('normal') . 
'</b>'; break;
!                                       case 3: $pri = '<font 
color="#CC0000"><b>' . lang('high') . '</b></font>'; break;
                                }
  
***************
*** 210,214 ****
                                        if (($currentdate >= $datedue) && 
($todo_list[$i]['status'] < 100))
                                        {
!                                               $datedueout =  '<font 
color="CC0000"><b>';
                                        }
                                        else
--- 230,234 ----
                                        if (($currentdate >= $datedue) && 
($todo_list[$i]['status'] < 100))
                                        {
!                                               $datedueout =  '<font 
color="#CC0000"><b>';
                                        }
                                        else
***************
*** 273,305 ****
                                }
  
!                               $this->t->parse('list','todo_list',True);
                        }
  
  // ------------------------- end record declaration ------------------------
  
  // --------------- template declaration for Add Form 
--------------------------
  
!                       if ($this->cat_id && $this->cat_id != 0)
                        {
!                               $cat = 
$this->cats->return_single($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','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
                                {
!                                       $this->t->set_var('add','');
                                }
-                       }
  
  // ----------------------- end Add form declaration 
----------------------------
--- 293,329 ----
                                }
  
!                               $body .= $this->t->fp('out','todo_list');
                        }
  
+                       $body .= $this->t->fp('out','table_footer');
+ 
  // ------------------------- end record declaration ------------------------
  
  // --------------- template declaration for Add Form 
--------------------------
  
!                       if($show_page_header)
                        {
!                               if ($this->cat_id && $this->cat_id != 0)
!                               {
!                                       $cat = 
$this->cats->return_single($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','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
!                                       {
!                                               $this->t->set_var('add','');
!                                       }
                                }
  
  // ----------------------- end Add form declaration 
----------------------------
***************
*** 307,318 ****
  // ------------ get actual date and year for matrixview arguments 
--------------
  
!                       $year = date('Y');
!                       $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);
                        $this->save_sessiondata();
                }
  
--- 331,344 ----
  // ------------ get actual date and year for matrixview arguments 
--------------
  
!                               $year = date('Y');
!                               $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));
  
!                               $body .= $this->t->fp('out','page_footer');
!                       }
                        $this->save_sessiondata();
+                       return $body;
                }
  




reply via email to

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