[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] admin/inc class.bocategories.inc.php class.uica...
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] admin/inc class.bocategories.inc.php class.uica... |
Date: |
Tue, 18 Apr 2006 11:35:11 +0000 |
CVSROOT: /cvsroot/phpgroupware
Module name: admin
Branch:
Changes by: Dave Hall <address@hidden> 06/04/18 11:35:11
Modified files:
inc : class.bocategories.inc.php
class.uicategories.inc.php
Log message:
fix delete properly
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/admin/inc/class.bocategories.inc.php.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/admin/inc/class.uicategories.inc.php.diff?tr1=1.43&tr2=1.44&r1=text&r2=text
Patches:
Index: admin/inc/class.bocategories.inc.php
diff -u admin/inc/class.bocategories.inc.php:1.21
admin/inc/class.bocategories.inc.php:1.22
--- admin/inc/class.bocategories.inc.php:1.21 Tue Apr 18 10:59:01 2006
+++ admin/inc/class.bocategories.inc.php Tue Apr 18 11:35:11 2006
@@ -9,7 +9,7 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\**************************************************************************/
- /* $Id: class.bocategories.inc.php,v 1.21 2006/04/18 10:59:01 skwashd
Exp $ */
+ /* $Id: class.bocategories.inc.php,v 1.22 2006/04/18 11:35:11 skwashd
Exp $ */
/* $Source:
/cvsroot/phpgroupware/admin/inc/class.bocategories.inc.php,v $ */
class bocategories
@@ -143,10 +143,7 @@
function delete($data)
{
- if (is_array($data))
- {
- $this->cats->delete($data);
- }
+ $this->cats->delete($data);
}
function check_values($values)
Index: admin/inc/class.uicategories.inc.php
diff -u admin/inc/class.uicategories.inc.php:1.43
admin/inc/class.uicategories.inc.php:1.44
--- admin/inc/class.uicategories.inc.php:1.43 Tue Apr 18 10:59:01 2006
+++ admin/inc/class.uicategories.inc.php Tue Apr 18 11:35:11 2006
@@ -9,7 +9,7 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\**************************************************************************/
- /* $Id: class.uicategories.inc.php,v 1.43 2006/04/18 10:59:01 skwashd
Exp $ */
+ /* $Id: class.uicategories.inc.php,v 1.44 2006/04/18 11:35:11 skwashd
Exp $ */
/* $Source:
/cvsroot/phpgroupware/admin/inc/class.uicategories.inc.php,v $ */
class uicategories
@@ -358,7 +358,7 @@
function delete()
{
- $global_cats =
get_var('global_cats',array('POST','GET'));
+ $global_cats = $_REQUEST['global_cats'];
$link_data = array
(
@@ -367,34 +367,34 @@
'global_cats' => $global_cats
);
- if ($_POST['done'] || $_POST['cancel'] ||
!$this->cat_id)
+ if ( (isset($_POST['cancel']) && $_POST['cancel']) ||
!$this->cat_id)
{
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
- if ($_POST['delete'])
+ if ( isset($_POST['confirm']) && $_POST['confirm'] )
{
- if ($_POST['subs'])
+ if ( isset($_POST['subs']) && $_POST['susbs'] )
{
switch ($_POST['subs'])
{
case 'move':
-
$this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True));
+
$this->bo->delete($this->cat_id, false, true);
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
break;
case 'drop':
-
$this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True));
+
$this->bo->delete($this->cat_id, true);
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
break;
default:
- $error
= array('Please choose one of the methods to handle the subcategories');
+ $error =
array('Please choose one of the methods to handle the subcategories');
$msgbox_error =
$GLOBALS['phpgw']->common->error_list($error);
break;
}
}
else
{
- $this->bo->delete(array('cat_id' =>
$this->cat_id));
+ $this->bo->delete($this->cat_id);
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
}
@@ -405,9 +405,13 @@
$type = ($_REQUEST['appname']?'noglobalapp':'noglobal');
- $apps_cats = $this->bo->exists(array('type'
=> $type,
-
'cat_name' => '',
-
'cat_id' => $this->cat_id));
+ $apps_cats = $this->bo->exists(array
+ (
+ 'type' => $type,
+ 'cat_name' => '',
+ 'cat_id' => $this->cat_id
+ ));
+
if ($apps_cats)
{
$error = array('This category is currently
being used by applications as a parent category',
@@ -435,26 +439,27 @@
}
}
+ $link_data['menuaction'] =
'admin.uicategories.delete';
+ $link_data['cat_id'] = $this->cat_id;
+
$data = array
(
- 'show_done'
=> $show_done,
- 'msgbox_data' =>
$msgbox_error,
- 'lang_delete' =>
lang('delete'),
- 'subs'
=> $subs,
- 'lang_sub_select_move' =>
$lang_sub_select_move,
- 'lang_sub_select_drop' =>
$lang_sub_select_drop,
- 'lang_delete_statustext' => lang('delete
the category'),
- 'lang_cancel_statustext' => lang('do NOT
delete the category and return back to the list'),
- 'lang_done_statustext' => lang('back
to the list'),
- 'lang_cancel' =>
lang('cancel'),
- 'lang_done'
=> lang('done'),
- 'lang_confirm_msg' =>
$confirm_msg
+ 'delete_action' =>
$GLOBALS['phpgw']->link('/index.php', $link_data),
+ 'done_action' =>
$GLOBALS['phpgw']->link('/index.php', $link_data),
+ 'show_done' => $show_done,
+ 'msgbox_data' => $msgbox_error,
+ 'lang_delete' => lang('delete'),
+ 'subs' => $subs,
+ 'lang_confirm_msg' => $confirm_msg,
+ 'lang_sub_select_move' =>
$lang_sub_select_move,
+ 'lang_sub_select_drop' =>
$lang_sub_select_drop,
+ 'lang_done_statustext' => lang('back to the
list'),
+ 'lang_no' => lang('no'),
+ 'lang_no_statustext' => lang('do NOT delete
the category and return back to the list'),
+ 'lang_yes' => lang('yes'),
+ 'lang_yes_statustext' => lang('delete the
category')
);
- $link_data['menuaction'] =
'admin.uicategories.delete';
- $link_data['cat_id'] = $this->cat_id;
- $data['delete_url'] =
$GLOBALS['phpgw']->link('/index.php',$link_data);
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
}
}