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.8,1


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: preferences/inc class.bocategories.inc.php,1.8,1.9 class.uicategories.inc.php,1.12,1.13
Date: Sun, 08 Sep 2002 16:40:14 -0400

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

Modified Files:
        class.bocategories.inc.php class.uicategories.inc.php 
Log Message:
update cats

Index: class.bocategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/class.bocategories.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.bocategories.inc.php  18 Jun 2002 01:09:20 -0000      1.8
--- class.bocategories.inc.php  8 Sep 2002 20:40:12 -0000       1.9
***************
*** 97,103 ****
                function exists($data)
                {
!                       $data['type']   = $data['type'] ? $data['type'] : '';
!                       $data['cat_id'] = $data['cat_id'] ? $data['cat_id'] : 
'';
!                       return 
$this->cats->exists($data['type'],$data['cat_name'],$data['cat_id']);
                }
  
--- 97,101 ----
                function exists($data)
                {
!                       return $this->cats->exists($data);
                }
  
***************
*** 107,113 ****
                }
  
!               function delete($cat_id,$subs)
                {
!                       return $this->cats->delete($cat_id,$subs);
                }
  
--- 105,111 ----
                }
  
!               function delete($cat_id,$drop_subs,$modify_subs)
                {
!                       $this->cats->delete($cat_id,$drop_subs,$modify_subs);
                }
  

Index: class.uicategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/class.uicategories.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.uicategories.inc.php  18 Jun 2002 01:09:20 -0000      1.12
--- class.uicategories.inc.php  8 Sep 2002 20:40:12 -0000       1.13
***************
*** 33,36 ****
--- 33,37 ----
                function uicategories()
                {
+                       
                        $this->bo         = 
CreateObject('preferences.bocategories',$cats_app);
                        $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
***************
*** 86,90 ****
                function index()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level;
  
                        $link_data = array
--- 87,95 ----
                function index()
                {
!                       $cats_app               = 
get_var('cats_app',array('POST','GET'));
!                       $extra                  = 
get_var('extra',array('POST','GET'));
!                       $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
***************
*** 259,263 ****
                function add()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level;
  
                        $link_data = array
--- 264,272 ----
                function add()
                {
!                       $cats_app               = 
get_var('cats_app',array('POST','GET'));
!                       $extra                  = 
get_var('extra',array('POST','GET'));
!                       $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
***************
*** 270,277 ****
                        );
  
-                       $GLOBALS['phpgw']->common->phpgw_header();
- 
                        $new_parent      = get_var('new_parent',Array('POST'));
-                       $submit          = get_var('submit',Array('POST'));
                        $cat_parent      = 
get_var('cat_parent',Array('GET','POST'));
                        $cat_name        = get_var('cat_name',Array('POST'));
--- 279,283 ----
***************
*** 280,293 ****
                        $cat_access      = get_var('cat_access',Array('POST'));
  
-                       $GLOBALS['phpgw']->template->set_file(array('cat_form' 
=> 'category_form.tpl'));
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','data_row');
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','add');
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','edit');
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','form');
- 
-                       $this->set_langs();
- 
-                       $this->bo->cats->app_name = $cats_app;
- 
                        if ($new_parent)
                        {
--- 286,289 ----
***************
*** 295,304 ****
                        }
  
!                       if (!$global_cats)
!                       {
!                               $global_cats = False;
!                       }
! 
!                       if ($submit)
                        {
                                $data = serialize($cat_data);
--- 291,295 ----
                        }
  
!                       if (get_var('submit',Array('POST')))
                        {
                                $data = serialize($cat_data);
***************
*** 316,332 ****
                                if (is_array($error))
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                                }
                                else
                                {
                                        $this->bo->save_cat($values);
!                                       
$GLOBALS['phpgw']->template->set_var('message',lang('Category x has been added 
!', $cat_name));
                                }
                        }
  
                        
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Add x category 
for',lang($cats_app)));
                        
$GLOBALS['phpgw']->template->set_var('lang_app',lang($cats_app));
                        
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
                        if ($cats_level)
                        {
--- 307,339 ----
                                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);
                                }
                        }
  
+                       $GLOBALS['phpgw']->common->phpgw_header();
+ 
+                       $GLOBALS['phpgw']->template->set_file(array('cat_form' 
=> 'category_form.tpl'));
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','data_row');
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','add');
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','edit');
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','form');
+ 
+                       $this->set_langs();
+ 
                        
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Add x category 
for',lang($cats_app)));
+                       
$GLOBALS['phpgw']->template->set_var('message',$message);
                        
$GLOBALS['phpgw']->template->set_var('lang_app',lang($cats_app));
                        
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
+                       if (!$global_cats)
+                       {
+                               $global_cats = False;
+                       }
+ 
                        if ($cats_level)
                        {
***************
*** 343,347 ****
  
                        $GLOBALS['phpgw']->template->set_var('access','<input 
type="checkbox" name="cat_access" value="True"'
!                               . ($cat_access == True ?' checked':'') . '>');
  
                        if ($extra)
--- 350,354 ----
  
                        $GLOBALS['phpgw']->template->set_var('access','<input 
type="checkbox" name="cat_access" value="True"'
!                                                                               
                                . ($cat_access == True ?' checked':'') . '>');
  
                        if ($extra)
***************
*** 365,369 ****
                function edit()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level, 
$cat_id;
  
                        $link_data = array
--- 372,380 ----
                function edit()
                {
!                       $cats_app               = 
get_var('cats_app',array('POST','GET'));
!                       $extra                  = 
get_var('extra',array('POST','GET'));
!                       $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
***************
*** 382,389 ****
                        }
  
-                       $GLOBALS['phpgw']->common->phpgw_header();
- 
                        $new_parent      = get_var('new_parent',Array('POST'));
-                       $submit          = get_var('submit',Array('POST'));
                        $cat_parent      = get_var('cat_parent',Array('POST'));
                        $cat_name        = get_var('cat_name',Array('POST'));
--- 393,397 ----
***************
*** 392,405 ****
                        $cat_access      = get_var('cat_access',Array('POST'));
  
-                       $GLOBALS['phpgw']->template->set_file(array('cat_form' 
=> 'category_form.tpl'));
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','data_row');
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','add');
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','edit');
-                       
$GLOBALS['phpgw']->template->set_block('cat_form','form');
- 
-                       $this->set_langs();
-                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       $this->bo->cats->app_name = $cats_app;
- 
                        if ($new_parent)
                        {
--- 400,403 ----
***************
*** 407,416 ****
                        }
  
!                       if (!$global_cats)
!                       {
!                               $global_cats = False;
!                       }
! 
!                       if ($submit)
                        {
                                $data = serialize($cat_data);
--- 405,409 ----
                        }
  
!                       if (get_var('submit',Array('POST')))
                        {
                                $data = serialize($cat_data);
***************
*** 429,445 ****
                                if (is_array($error))
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                                }
                                else
                                {
                                        $this->bo->save_cat($values);
!                                       
$GLOBALS['phpgw']->template->set_var('message',lang('Category x has been 
updated !',$cat_name));
                                }
                        }
  
                        $cats = $this->bo->cats->return_single($cat_id);
  
                        
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit x category 
for',lang($cats_app)));
                        
$GLOBALS['phpgw']->template->set_var('lang_app',lang($cats_app));
                        $link_data['menuaction'] = 
'preferences.uicategories.edit';
                        
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
--- 422,451 ----
                                if (is_array($error))
                                {
!                                       $message = 
$GLOBALS['phpgw']->common->error_list($error);
                                }
                                else
                                {
                                        $this->bo->save_cat($values);
!                                       $message = lang('Category x has been 
updated !',$cat_name);
                                }
                        }
  
+                       $GLOBALS['phpgw']->common->phpgw_header();
+ 
+                       $GLOBALS['phpgw']->template->set_file(array('cat_form' 
=> 'category_form.tpl'));
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','data_row');
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','add');
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','edit');
+                       
$GLOBALS['phpgw']->template->set_block('cat_form','form');
+ 
+                       $this->set_langs();
+ 
                        $cats = $this->bo->cats->return_single($cat_id);
  
                        
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit x category 
for',lang($cats_app)));
+                       
$GLOBALS['phpgw']->template->set_var('message',$message);
                        
$GLOBALS['phpgw']->template->set_var('lang_app',lang($cats_app));
+                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
+ 
                        $link_data['menuaction'] = 
'preferences.uicategories.edit';
                        
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
***************
*** 448,451 ****
--- 454,462 ----
                        
$GLOBALS['phpgw']->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats[0]['description']));
  
+                       if (!$global_cats)
+                       {
+                               $global_cats = False;
+                       }
+ 
                        if ($cats_level)
                        {
***************
*** 460,464 ****
  
                        $GLOBALS['phpgw']->template->set_var('access','<input 
type="checkbox" name="cat_access" value="True"'
!                               . ($cats[0]['access'] == private ?' 
checked':'') . '>');
  
                        if ($extra)
--- 471,475 ----
  
                        $GLOBALS['phpgw']->template->set_var('access','<input 
type="checkbox" name="cat_access" value="True"'
!                                                                               
                                . ($cats[0]['access'] == private ?' 
checked':'') . '>');
  
                        if ($extra)
***************
*** 479,483 ****
                                $link_data['menuaction'] = 
'preferences.uicategories.delete';
                                
$GLOBALS['phpgw']->template->set_var('delete','<form method="POST" action="' . 
$GLOBALS['phpgw']->link('/index.php',$link_data)
!                                       . '"><input type="submit" value="' . 
lang('Delete') .'"></form>');
                        }
                        else
--- 490,494 ----
                                $link_data['menuaction'] = 
'preferences.uicategories.delete';
                                
$GLOBALS['phpgw']->template->set_var('delete','<form method="POST" action="' . 
$GLOBALS['phpgw']->link('/index.php',$link_data)
!                                                                               
                                        . '"><input type="submit" value="' . 
lang('Delete') .'"></form>');
                        }
                        else
***************
*** 492,496 ****
                function delete()
                {
!                       global $cats_app, $extra, $global_cats, $cats_level, 
$cat_id;
  
                        $link_data = array
--- 503,511 ----
                function delete()
                {
!                       $cats_app               = 
get_var('cats_app',array('POST','GET'));
!                       $extra                  = 
get_var('extra',array('POST','GET'));
!                       $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
***************
*** 511,561 ****
                        $this->bo->cats->app_name = $cats_app;
  
!                       if(get_var('confirm',Array('POST')))
                        {
!                               if(get_var('subs',Array('POST')))
!                               {
!                                       $this->bo->delete($cat_id,True);
!                               }
!                               else
                                {
!                                       $this->bo->delete($cat_id,False);
                                }
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
-                       else
-                       {
-                               
$GLOBALS['phpgw']->template->set_file(array('category_delete' => 'delete.tpl'));
  
!                               $nolink = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
  
!                               $GLOBALS['phpgw']->common->phpgw_header();
  
!                               
$GLOBALS['phpgw']->template->set_var('deleteheader',lang('Are you sure you want 
to delete this category ?'));
  
!                               $exists = $this->bo->exists(array
!                               (
!                                       'type'     => 'subs',
!                                       'cat_name' => '',
!                                       'cat_id'   => $cat_id
!                               ));
  
!                               if ($exists)
!                               {
!                                       
$GLOBALS['phpgw']->template->set_var('lang_subs',lang('Do you also want to 
delete all subcategories ?'));
!                                       
$GLOBALS['phpgw']->template->set_var('subs','<input type="checkbox" name="subs" 
value="True">');
!                               }
!                               else
!                               {
!                                       
$GLOBALS['phpgw']->template->set_var('lang_subs','');
!                                       
$GLOBALS['phpgw']->template->set_var('subs', '');
!                               }
  
!                               
$GLOBALS['phpgw']->template->set_var('nolink',$nolink);
!                               
$GLOBALS['phpgw']->template->set_var('lang_no',lang('No'));
!                               $link_data['menuaction'] = 
'preferences.uicategories.delete';
!                               
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                               
$GLOBALS['phpgw']->template->set_var('lang_yes',lang('Yes'));
!                               
$GLOBALS['phpgw']->template->fp('phpgw_body','category_delete');
!                       }
                }
        }
--- 526,574 ----
                        $this->bo->cats->app_name = $cats_app;
  
!                       if (get_var('confirm',array('POST')))
                        {
!                               switch (get_var('subs',array('POST')))
                                {
!                                       case 'move':
!                                               
$this->bo->delete($this->cat_id,False,True);
!                                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
!                                               break;
!                                       case 'drop':
!                                               
$this->bo->delete($this->cat_id,True);
!                                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
!                                               break;
!                                       default:
!                                               $error_msg = lang('Please 
choose one of the methods to handle the subcategories');
!                                               break;
                                }
                        }
  
!                       $GLOBALS['phpgw']->common->phpgw_header();
!                       
$GLOBALS['phpgw']->template->set_file(array('category_delete' => 'delete.tpl'));
  
!                       
$GLOBALS['phpgw']->template->set_var('error_msg',$error_msg);
!                       
$GLOBALS['phpgw']->template->set_var('deleteheader',lang('Are you sure you want 
to delete this category ?'));
  
!                       $exists = $this->bo->exists(array
!                       (
!                               'type'     => 'subs',
!                               'cat_name' => '',
!                               'cat_id'   => $cat_id
!                       ));
  
!                       if ($exists)
!                       {
!                                       $sub_select = '<input type="radio" 
name="subs" value="move">' . lang('Do you want to move all subcategories one 
level down ?') . '<br>';
!                                       $sub_select .= '<input type="radio" 
name="subs" value="drop">' . lang('Do you want to delete all subcategories ?');
!                                       
$GLOBALS['phpgw']->template->set_var('sub_select',$sub_select);
!                       }
  
!                       
$GLOBALS['phpgw']->template->set_var('nolink',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('lang_no',lang('No'));
  
!                       $link_data['menuaction'] = 
'preferences.uicategories.delete';
!                       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('lang_yes',lang('Yes'));
!                       
$GLOBALS['phpgw']->template->fp('phpgw_body','category_delete');
                }
        }





reply via email to

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