phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: preferences/inc class.bocategories.inc.php,1.2,1


From: Bettina gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: preferences/inc class.bocategories.inc.php,1.2,1.3 class.uicategories.inc.php,1.2,1.3
Date: Sun, 13 Jan 2002 17:35:56 -0500

Update of /cvsroot/phpgroupware/preferences/inc
In directory subversions:/tmp/cvs-serv16224/inc

Modified Files:
        class.bocategories.inc.php class.uicategories.inc.php 
Log Message:
added data fields to cats setup

Index: class.bocategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/class.bocategories.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.bocategories.inc.php  12 Jan 2002 18:28:42 -0000      1.2
--- class.bocategories.inc.php  13 Jan 2002 22:35:54 -0000      1.3
***************
*** 69,75 ****
                }
  
!               function get_list()
                {
!                       return 
$this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True);
                }
  
--- 69,75 ----
                }
  
!               function get_list($global_cats)
                {
!                       return 
$this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,$global_cats);
                }
  

Index: class.uicategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/class.uicategories.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uicategories.inc.php  12 Jan 2002 18:28:42 -0000      1.2
--- class.uicategories.inc.php  13 Jan 2002 22:35:54 -0000      1.3
***************
*** 60,63 ****
--- 60,64 ----
                function set_langs()
                {
+                       
$this->t->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
                        $this->t->set_var('lang_access',lang('Private'));
                        $this->t->set_var('lang_save',lang('Save'));
***************
*** 89,96 ****
                        );
  
                        $GLOBALS['phpgw']->common->phpgw_header();
                        echo parse_navbar();
  
!                       $this->t->set_file(array('cat_list_t' => 
'listcats.tpl'));
                        $this->t->set_block('cat_list_t','cat_list','list');
  
--- 90,104 ----
                        );
  
+                       if ($extra)
+                       {
+                               $edata = explode(',',$extra);
+                       }
+ 
                        $GLOBALS['phpgw']->common->phpgw_header();
                        echo parse_navbar();
  
!                       $this->t->set_file(array('cat_list_t'   => 
'listcats.tpl',
!                                                                       
'data_column'   => 'listcats.tpl'));
!                       
$this->t->set_block('cat_list_t','data_column','column');
                        $this->t->set_block('cat_list_t','cat_list','list');
  
***************
*** 107,112 ****
                        }
  
                        $this->bo->cats->app_name = $cats_app;
!                       $cats = $this->bo->get_list();
  
  //--------------------------------- nextmatch 
--------------------------------------------
--- 115,125 ----
                        }
  
+                       if (!$global_cats)
+                       {
+                               $global_cats = False;
+                       }
+ 
                        $this->bo->cats->app_name = $cats_app;
!                       $cats = $this->bo->get_list($global_cats);
  
  //--------------------------------- nextmatch 
--------------------------------------------
***************
*** 123,139 ****
  //------------------- list header variable template-declarations 
------------------------- 
  
-                       
$this->t->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
                        
$this->t->set_var('sort_name',$this->nextmatchs->show_sort_order($this->sort,'cat_name',$this->order,'/index.php',lang('Name'),$link_data));
                        
$this->t->set_var('sort_description',$this->nextmatchs->show_sort_order($this->sort,'cat_description',$this->order,'/index.php',lang('Description'),$link_data));
  
!                       if ($extra)
                        {
!                               $this->t->set_var('sort_data','<td bgcolor="' . 
$GLOBALS['phpgw_info']['theme']['th_bg'] . '">'
!                                                                               
        . $this->nextmatchs->show_sort_order($this->sort,'cat_data',
!                                                                               
                $this->order,'/index.php',lang($extra),$link_data) . '</td>');
                        }
                        else
                        {
!                               $this->t->set_var('sort_data','');
                        }
  
--- 136,153 ----
  //------------------- list header variable template-declarations 
------------------------- 
  
                        
$this->t->set_var('sort_name',$this->nextmatchs->show_sort_order($this->sort,'cat_name',$this->order,'/index.php',lang('Name'),$link_data));
                        
$this->t->set_var('sort_description',$this->nextmatchs->show_sort_order($this->sort,'cat_description',$this->order,'/index.php',lang('Description'),$link_data));
  
!                       if (is_array($edata))
                        {
!                               for($i=0;$i<count($edata);$i++)
!                               {
!                                       $this->t->set_var('th_data','<td 
bgcolor="' . $GLOBALS['phpgw_info']['theme']['th_bg'] . '">' . lang($edata[$i]) 
. '</td>');
!                                       
$this->t->fp('column','data_column',True);
!                               }
                        }
                        else
                        {
!                               $this->t->set_var('th_data','');
                        }
  
***************
*** 165,180 ****
                                if (!$descr) { $descr = '&nbsp;'; }
  
!                               if ($extra)
                                {
!                                       $data = $cats[$i]['data'];
!                                       if (! $data)
                                        {
!                                               $data  = '&nbsp;';
                                        }
-                                       $this->t->set_var('td_data','<td>' . 
$data . '</td>');
-                               }
-                               else
-                               {
-                                       $this->t->set_var('td_data','');
                                }
  
--- 179,199 ----
                                if (!$descr) { $descr = '&nbsp;'; }
  
!                               if (is_array($edata))
                                {
!                                       $data = unserialize($cats[$i]['data']);
!                                       if (! is_array($data))
                                        {
!                                               $holder = '<td>&nbsp;</td>' . 
"\n";
!                                               $placeholder = 
str_repeat($holder,count($edata));
!                                               
$this->t->set_var('td_data',$placeholder);
!                                       }
!                                       else
!                                       {
!                                               for ($j=0;$j<count($edata);$j++)
!                                               {
!                                                       $td_data .= '<td>' . 
$data[$edata[$j]] . '</td>' . "\n";
!                                               }
!                                               
$this->t->set_var('td_data',$td_data);
                                        }
                                }
  
***************
*** 237,241 ****
                function add()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level;
  
                        $link_data = array
--- 256,260 ----
                function add()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level, 
$cat_data;
  
                        $link_data = array
***************
*** 256,263 ****
                        $cat_name                       = 
$GLOBALS['HTTP_POST_VARS']['cat_name'];
                        $cat_description        = 
$GLOBALS['HTTP_POST_VARS']['cat_description'];
!                       $cat_data                       = 
$GLOBALS['HTTP_POST_VARS']['cat_data'];
                        $cat_access                     = 
$GLOBALS['HTTP_POST_VARS']['cat_access'];
  
                        $this->t->set_file(array('form' => 
'category_form.tpl'));
                        $this->t->set_block('form','add','addhandle');
                        $this->t->set_block('form','edit','edithandle');
--- 275,283 ----
                        $cat_name                       = 
$GLOBALS['HTTP_POST_VARS']['cat_name'];
                        $cat_description        = 
$GLOBALS['HTTP_POST_VARS']['cat_description'];
! //                    $cat_data                       = 
$GLOBALS['HTTP_POST_VARS']['cat_data'];
                        $cat_access                     = 
$GLOBALS['HTTP_POST_VARS']['cat_access'];
  
                        $this->t->set_file(array('form' => 
'category_form.tpl'));
+                       $this->t->set_block('form','data_row','row');
                        $this->t->set_block('form','add','addhandle');
                        $this->t->set_block('form','edit','edithandle');
***************
*** 274,277 ****
--- 294,299 ----
                        if ($submit)
                        {
+                               $data = serialize($cat_data);
+ 
                                $values = array
                                (
***************
*** 281,285 ****
                                        'name'          => $cat_name,
                                        'access'        => $cat_access,
!                                       'data'          => $cat_data
                                );
  
--- 303,307 ----
                                        'name'          => $cat_name,
                                        'access'        => $cat_access,
!                                       'data'          => $data
                                );
  
***************
*** 332,342 ****
                        if ($extra)
                        {
!                               $this->t->set_var('td_data','<input 
name="cat_data" size="50" value="' . $GLOBALS['phpgw']->strip_html($cat_data) . 
'">');
!                               $this->t->set_var('lang_data',lang($extra));
!                       }
!                       else
!                       {
!                               $this->t->set_var('td_data','');
!                               $this->t->set_var('lang_data','');
                        }
  
--- 354,365 ----
                        if ($extra)
                        {
!                               $edata = explode(',',$extra);
!                               $cat_data = array();
!                               for($i=0;$i<count($edata);$i++)
!                               {
!                                       $this->t->set_var('td_data','<input 
name="cat_data[' . $edata[$i] . ']" size="50" value="' . $cat_data[$edata[$i]] 
. '">');
!                                       
$this->t->set_var('lang_data',lang($edata[$i]));
!                                       $this->t->fp('row','data_row',True);
!                               }
                        }
  
***************
*** 351,355 ****
                function edit()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level, 
$cat_id;
  
                        $link_data = array
--- 374,378 ----
                function edit()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level, 
$cat_id, $cat_data;
  
                        $link_data = array
***************
*** 376,383 ****
                        $cat_name                       = 
$GLOBALS['HTTP_POST_VARS']['cat_name'];
                        $cat_description        = 
$GLOBALS['HTTP_POST_VARS']['cat_description'];
!                       $cat_data                       = 
$GLOBALS['HTTP_POST_VARS']['cat_data'];
                        $cat_access                     = 
$GLOBALS['HTTP_POST_VARS']['cat_access'];
  
                        $this->t->set_file(array('form' => 
'category_form.tpl'));
                        $this->t->set_block('form','add','addhandle');
                        $this->t->set_block('form','edit','edithandle');
--- 399,407 ----
                        $cat_name                       = 
$GLOBALS['HTTP_POST_VARS']['cat_name'];
                        $cat_description        = 
$GLOBALS['HTTP_POST_VARS']['cat_description'];
!       //              $cat_data                       = 
$GLOBALS['HTTP_POST_VARS']['cat_data'];
                        $cat_access                     = 
$GLOBALS['HTTP_POST_VARS']['cat_access'];
  
                        $this->t->set_file(array('form' => 
'category_form.tpl'));
+                       $this->t->set_block('form','data_row','row');
                        $this->t->set_block('form','add','addhandle');
                        $this->t->set_block('form','edit','edithandle');
***************
*** 394,397 ****
--- 418,423 ----
                        if ($submit)
                        {
+                               $data = serialize($cat_data);
+ 
                                $values = array
                                (
***************
*** 401,405 ****
                                        'name'          => $cat_name,
                                        'access'        => $cat_access,
!                                       'data'          => $cat_data
                                );
  
--- 427,431 ----
                                        'name'          => $cat_name,
                                        'access'        => $cat_access,
!                                       'data'          => $data
                                );
  
***************
*** 452,456 ****
  
                        $this->t->set_var('access','<input type="checkbox" 
name="cat_access" value="True"'
!                                                                               
. ($cat_access == True ?' checked':'') . '>');
  
                        if ($cats[0]['owner'] == $this->account)
--- 478,496 ----
  
                        $this->t->set_var('access','<input type="checkbox" 
name="cat_access" value="True"'
!                                                                               
. ($cats[0]['access'] == private ?' checked':'') . '>');
! 
!                       if ($extra)
!                       {
!                               $edata = explode(',',$extra);
! 
!                               $data = unserialize($cats[0]['data']);
!                               $cat_data = array();
!                               for($i=0;$i<count($edata);$i++)
!                               {
!                                       $this->t->set_var('td_data','<input 
name="cat_data[' . $edata[$i] . ']" size="50" value="' . $data[$edata[$i]] . 
'">');
!                                       
$this->t->set_var('lang_data',lang($edata[$i]));
!                                       $this->t->fp('row','data_row',True);
!                               }
!                       }
  
                        if ($cats[0]['owner'] == $this->account)




reply via email to

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