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.10,


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: preferences/inc class.bocategories.inc.php,1.10,1.11 class.uicategories.inc.php,1.16,1.17
Date: Sat, 12 Oct 2002 14:27:24 -0400

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

Modified Files:
        class.bocategories.inc.php class.uicategories.inc.php 
Log Message:
update edit_cats to move the subtree with the cat if the parent changes

Index: class.bocategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/class.bocategories.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.bocategories.inc.php  25 Sep 2002 03:56:06 -0000      1.10
--- class.bocategories.inc.php  12 Oct 2002 18:27:22 -0000      1.11
***************
*** 32,35 ****
--- 32,36 ----
                        $sort   = get_var('sort',Array('GET','POST'));
                        $order  = get_var('order',Array('GET','POST'));
+                       $cat_id = intval(get_var('cat_id', 
array('POST','GET')));
  
                        if(!empty($start) || $start == '0' || $start == 0)
***************
*** 37,40 ****
--- 38,46 ----
                                $this->start = $start;
                        }
+                       else
+                       {
+                               $this->start = 0;
+                       }
+ 
                        if((empty($query) && !empty($this->query)) || 
!empty($query))
                        {
***************
*** 50,53 ****
--- 56,68 ----
                                $this->order = $order;
                        }
+                       if(isset($cat_id))
+                       {
+                               $this->cat_id = $cat_id;
+                       }
+ 
+                       if($cat_id == 0)
+                       {
+                               unset($this->cat_id);
+                       }
                }
  
***************
*** 63,70 ****
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data',$column);
  
!                       $this->start  = $data['start'];
!                       $this->query  = $data['query'];
!                       $this->sort   = $data['sort'];
!                       $this->order  = $data['order'];
                }
  
--- 78,86 ----
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data',$column);
  
!                       $this->start    = $data['start'];
!                       $this->query    = $data['query'];
!                       $this->sort             = $data['sort'];
!                       $this->order    = $data['order'];
!                       $this->cat_id   = $data['cat_id'];
                }
  
***************
*** 85,89 ****
                        }
  
!                       if ($values['id'] && $values['id'] != 0)
                        {
                                return $this->cats->edit($values);
--- 101,105 ----
                        }
  
!                       if ($values['cat_id'] && $values['cat_id'] != 0)
                        {
                                return $this->cats->edit($values);
***************
*** 132,136 ****
                                                'type'     => 'appandmains',
                                                'cat_name' => $values['name'],
!                                               'cat_id'   => $values['id']
                                        ));
                                }
--- 148,152 ----
                                                'type'     => 'appandmains',
                                                'cat_name' => $values['name'],
!                                               'cat_id'   => $values['cat_id']
                                        ));
                                }
***************
*** 141,145 ****
                                                'type'     => 'appandsubs',
                                                'cat_name' => $values['name'],
!                                               'cat_id'   => $values['id']
                                        ));
                                }
--- 157,161 ----
                                                'type'     => 'appandsubs',
                                                'cat_name' => $values['name'],
!                                               'cat_id'   => $values['cat_id']
                                        ));
                                }

Index: class.uicategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/class.uicategories.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** class.uicategories.inc.php  12 Oct 2002 00:48:36 -0000      1.16
--- class.uicategories.inc.php  12 Oct 2002 18:27:22 -0000      1.17
***************
*** 43,46 ****
--- 43,47 ----
                        $this->sort                     = $this->bo->sort;
                        $this->order            = $this->bo->order;
+                       $this->cat_id           = $this->bo->cat_id;
                }
  
***************
*** 49,56 ****
                        $data = array
                        (
!                               'start' => $this->start,
!                               'query' => $this->query,
!                               'sort'  => $this->sort,
!                               'order' => $this->order
                        );
                        $this->bo->save_sessiondata($data,$cats_app);
--- 50,58 ----
                        $data = array
                        (
!                               'start'         => $this->start,
!                               'query'         => $this->query,
!                               'sort'          => $this->sort,
!                               'order'         => $this->order,
!                               'cat_id'        => $this->cat_id
                        );
                        $this->bo->save_sessiondata($data,$cats_app);
***************
*** 91,95 ****
                        $global_cats    = 
get_var('global_cats',array('POST','GET'));
                        $cats_level             = 
get_var('cats_level',array('POST','GET'));
-                       $cat_id                 = 
get_var('cat_id',array('POST','GET'));
  
                        $link_data = array
--- 93,96 ----
***************
*** 120,128 ****
                        
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/preferences/index.php'));
  
-                       if(!$this->start)
-                       {
-                               $this->start = 0;
-                       }
- 
                        if (!$global_cats)
                        {
--- 121,124 ----
***************
*** 187,191 ****
                                }
  
!                               $descr = 
$GLOBALS['phpgw']->strip_html($cats[$i]['description']);
                                if (!$descr) { $descr = '&nbsp;'; }
  
--- 183,187 ----
                                }
  
!                               $descr = 
$GLOBALS['phpgw']->strip_html($cats[$i]['descr']);
                                if (!$descr) { $descr = '&nbsp;'; }
  
***************
*** 216,220 ****
                                ));
  
!                               
$GLOBALS['phpgw']->template->set_var('app_url',$GLOBALS['phpgw']->link('/' . 
$cats_app . '/index.php','cat_id=' . $cats[$i]['id']));
  
                                if ($cats_level || ($level == 0))
--- 212,216 ----
                                ));
  
!                               
$GLOBALS['phpgw']->template->set_var('app_url',$GLOBALS['phpgw']->link('/' . 
$cats_app . '/index.php','cat_id=' . $cats[$i]['cat_id']));
  
                                if ($cats_level || ($level == 0))
***************
*** 223,227 ****
                                        {
                                                $link_data['menuaction'] = 
'preferences.uicategories.add';
-                                               $link_data['cat_parent'] = 
$cats[$i]['id'];
                                                
$GLOBALS['phpgw']->template->set_var('add_sub',$GLOBALS['phpgw']->link('/index.php',$link_data));
                                                
$GLOBALS['phpgw']->template->set_var('lang_sub_entry',lang('Add sub'));
--- 219,222 ----
***************
*** 234,238 ****
                                }
  
!                               $link_data['cat_id'] = $cats[$i]['id'];
                                if ($cats[$i]['owner'] == $this->account && 
$cats[$i]['app_name'] != 'phpgw')
                                {
--- 229,233 ----
                                }
  
!                               $link_data['cat_id'] = $cats[$i]['cat_id'];
                                if ($cats[$i]['owner'] == $this->account && 
$cats[$i]['app_name'] != 'phpgw')
                                {
***************
*** 268,272 ****
                        $global_cats    = 
get_var('global_cats',array('POST','GET'));
                        $cats_level             = 
get_var('cats_level',array('POST','GET'));
-                       $cat_id                 = 
get_var('cat_id',array('POST','GET'));
  
                        $link_data = array
--- 263,266 ----
***************
*** 279,316 ****
                        );
  
!                       $new_parent      = get_var('new_parent',Array('POST'));
!                       $cat_parent      = 
get_var('cat_parent',Array('GET','POST'));
!                       $cat_name        = get_var('cat_name',Array('POST'));
!                       $cat_description = 
get_var('cat_description',Array('POST'));
!                       $cat_data        = get_var('cat_data',Array('POST'));
!                       $cat_access      = get_var('cat_access',Array('POST'));
! 
!                       if ($new_parent)
!                       {
!                               $cat_parent = $new_parent;
!                       }
  
                        if (get_var('submit',Array('POST')))
                        {
!                               $data = serialize($cat_data);
! 
!                               $values = array
!                               (
!                                       'parent' => $cat_parent,
!                                       'descr'  => $cat_description,
!                                       'name'   => $cat_name,
!                                       'access' => $cat_access,
!                                       'data'   => $data
!                               );
! 
!                               $error = $this->bo->check_values($values);
!                               if (is_array($error))
                                {
!                                        $message = 
$GLOBALS['phpgw']->common->error_list($error);
                                }
!                               else
                                {
!                                       $this->bo->save_cat($values);
!                                       $message = lang('Category x has been 
added !', $cat_name);
                                }
                        }
--- 273,300 ----
                        );
  
!                       $values         = get_var('values',array('POST'));
!                       $cat_data       = get_var('cat_data',array('POST'));
  
                        if (get_var('submit',Array('POST')))
                        {
!                               if (is_array($cat_data))
                                {
!                                       $data = serialize($cat_data);
                                }
! 
!                               if (is_array($values))
                                {
!                                       $values['data'] = $data;
! 
!                                       $error = 
$this->bo->check_values($values);
!                                       if (is_array($error))
!                                       {
!                                                $message = 
$GLOBALS['phpgw']->common->error_list($error);
!                                       }
!                                       else
!                                       {
!                                               $this->cat_id = 
$this->bo->save_cat($values);
!                                               $message = lang('Category x has 
been added !', $values['name']);
!                                       }
                                }
                        }
***************
*** 376,380 ****
                        $global_cats    = 
get_var('global_cats',array('POST','GET'));
                        $cats_level             = 
get_var('cats_level',array('POST','GET'));
-                       $cat_id                 = 
get_var('cat_id',array('POST','GET'));
  
                        $link_data = array
--- 360,363 ----
***************
*** 384,433 ****
                                'extra'       => $extra,
                                'global_cats' => $global_cats,
!                               'cats_level'  => $cats_level,
!                               'cat_id'      => $cat_id
                        );
  
!                       if (!$cat_id)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
  
!                       $new_parent                     = 
get_var('new_parent',Array('POST'));
!                       $cat_parent                     = 
get_var('cat_parent',Array('POST'));
!                       $cat_name                       = 
get_var('cat_name',Array('POST'));
!                       $cat_description        = 
get_var('cat_description',Array('POST'));
!                       $cat_data                       = 
get_var('cat_data',Array('POST'));
!                       $cat_access                     = 
get_var('cat_access',Array('POST'));
!                       $old_parent                     = 
get_var('old_parent',array('POST'));
! 
!                       if ($new_parent)
!                       {
!                               $cat_parent = $new_parent;
!                       }
  
                        if (get_var('submit',Array('POST')))
                        {
!                               $data = serialize($cat_data);
! 
!                               $values = array
!                               (
!                                       'id'                    => $cat_id,
!                                       'parent'                => $cat_parent,
!                                       'old_parent'    => $old_parent,
!                                       'descr'                 => 
$cat_description,
!                                       'name'                  => $cat_name,
!                                       'access'                => $cat_access,
!                                       'data'                  => $data
!                               );
! 
!                               $error = $this->bo->check_values($values);
!                               if (is_array($error))
                                {
!                                       $message = 
$GLOBALS['phpgw']->common->error_list($error);
                                }
!                               else
                                {
!                                       $cat_id = $this->bo->save_cat($values);
!                                       $message = lang('Category x has been 
updated !',$cat_name);
                                }
                        }
--- 367,403 ----
                                'extra'       => $extra,
                                'global_cats' => $global_cats,
!                               'cats_level'  => $cats_level
                        );
  
!                       if (!$this->cat_id)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
  
!                       $values         = get_var('values',Array('POST'));
!                       $cat_data       = get_var('cat_data',Array('POST'));
  
                        if (get_var('submit',Array('POST')))
                        {
!                               if (is_array($cat_data))
                                {
!                                       $data = serialize($cat_data);
                                }
! 
!                               if (is_array($values))
                                {
!                                       $values['cat_id']       = $this->cat_id;
!                                       $values['data']         = $data;
! 
!                                       $error = 
$this->bo->check_values($values);
!                                       if (is_array($error))
!                                       {
!                                               $message = 
$GLOBALS['phpgw']->common->error_list($error);
!                                       }
!                                       else
!                                       {
!                                               $this->cat_id = 
$this->bo->save_cat($values);
!                                               $message = lang('Category x has 
been updated !',$values['name']);
!                                       }
                                }
                        }
***************
*** 443,449 ****
                        $this->set_langs();
  
!                       $cats = $this->bo->cats->return_single($cat_id);
! 
!                       
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden" 
name="old_parent" value="' . $cats[0]['parent'] . '">');
  
                        
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit x category 
for',lang($cats_app)));
--- 413,417 ----
                        $this->set_langs();
  
!                       $cats = $this->bo->cats->return_single($this->cat_id);
  
                        
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit x category 
for',lang($cats_app)));
***************
*** 455,460 ****
                        
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
!                       
$GLOBALS['phpgw']->template->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats[0]['name']));
!                       
$GLOBALS['phpgw']->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats[0]['description']));
  
                        if (!$global_cats)
--- 423,429 ----
                        
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
!                       
$GLOBALS['phpgw']->template->set_var('old_parent',$cats['parent']);
!                       
$GLOBALS['phpgw']->template->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats['name']));
!                       
$GLOBALS['phpgw']->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats['descr']));
  
                        if (!$global_cats)
***************
*** 472,479 ****
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cats[0]['parent'],$global_cats));
  
!                       $GLOBALS['phpgw']->template->set_var('access','<input 
type="checkbox" name="cat_access" value="True"'
!                                                                               
                                . ($cats[0]['access'] == private ?' 
checked':'') . '>');
  
                        if ($extra)
--- 441,447 ----
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cats['parent'],$global_cats));
  
!                       
$GLOBALS['phpgw']->template->set_var('access',$cats['access'] == 'private' ?' 
checked':'');
  
                        if ($extra)
***************
*** 481,485 ****
                                $edata = explode(',',$extra);
  
!                               $data = unserialize($cats[0]['data']);
                                for($i=0;$i<count($edata);$i++)
                                {
--- 449,453 ----
                                $edata = explode(',',$extra);
  
!                               $data = unserialize($cats['data']);
                                for($i=0;$i<count($edata);$i++)
                                {
***************
*** 511,515 ****
                        $global_cats    = 
get_var('global_cats',array('POST','GET'));
                        $cats_level             = 
get_var('cats_level',array('POST','GET'));
-                       $cat_id                 = 
get_var('cat_id',array('POST','GET'));
  
                        $link_data = array
--- 479,482 ----
***************
*** 519,527 ****
                                'extra'       => $extra,
                                'global_cats' => $global_cats,
!                               'cats_level'  => $cats_level,
!                               'cat_id'      => $cat_id
                        );
  
!                       if (!$cat_id)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
--- 486,493 ----
                                'extra'       => $extra,
                                'global_cats' => $global_cats,
!                               'cats_level'  => $cats_level
                        );
  
!                       if (!$this->cat_id)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
***************
*** 566,570 ****
                                'type'     => 'subs',
                                'cat_name' => '',
!                               'cat_id'   => $cat_id
                        ));
  
--- 532,536 ----
                                'type'     => 'subs',
                                'cat_name' => '',
!                               'cat_id'   => $this->cat_id
                        ));
  





reply via email to

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