mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
update delete cats
This commit is contained in:
parent
79561e21f7
commit
8dac4d5616
@ -32,7 +32,7 @@
|
||||
{
|
||||
if ($subs)
|
||||
{
|
||||
$c->delete($cat_id,'True');
|
||||
$c->delete($cat_id,True);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
$apps_cats = $c->exists('subs',$cat_name='',$cat_id);
|
||||
|
||||
if ($apps_cats==True)
|
||||
if ($apps_cats)
|
||||
{
|
||||
$t->set_var('messages',lang('This category is currently being used by applications as a parent category') . '<br>'
|
||||
. lang('You will need to remove the subcategories before you can delete the parent category'));
|
||||
@ -82,7 +82,7 @@
|
||||
|
||||
$exists = $c->exists('subs',$cat_name='',$cat_id);
|
||||
|
||||
if ($exists==True)
|
||||
if ($exists)
|
||||
{
|
||||
$t->set_var('lang_subs',lang('Do you also want to delete all global subcategories ?'));
|
||||
$t->set_var('subs','<input type="checkbox" name="subs" value="True">');
|
||||
|
@ -183,7 +183,6 @@
|
||||
*/
|
||||
function return_single($id = '')
|
||||
{
|
||||
|
||||
$this->db->query("select * from phpgw_categories where cat_id='$id'",__LINE__,__FILE__);
|
||||
|
||||
if ($this->db->next_record())
|
||||
@ -361,11 +360,11 @@
|
||||
@abstract delete category
|
||||
@param $cat_id int - category id
|
||||
*/
|
||||
function delete($cat_id,$subs = 'False')
|
||||
function delete($cat_id,$subs = False)
|
||||
{
|
||||
if ($subs == 'True')
|
||||
if ($subs)
|
||||
{
|
||||
$subdelete = " OR cat_parent='$cat_id'";
|
||||
$subdelete = " OR cat_parent='$cat_id' OR cat_main='$cat_id' ";
|
||||
}
|
||||
|
||||
$this->db->query("delete from phpgw_categories where cat_id='$cat_id' $subdelete and cat_appname='"
|
||||
|
@ -36,12 +36,13 @@
|
||||
{
|
||||
if ($subs)
|
||||
{
|
||||
$c->delete($cat_id,'True');
|
||||
$c->delete($cat_id,True);
|
||||
}
|
||||
else
|
||||
{
|
||||
$c->delete($cat_id);
|
||||
}
|
||||
|
||||
Header('Location: ' . $phpgw->link('/preferences/categories.php','cats_app=' . $cats_app . '&extra=' . $extra . '&cats_level=' . $cats_level
|
||||
. '&global_cats=' . $global_cats));
|
||||
}
|
||||
@ -65,7 +66,8 @@
|
||||
$t->set_var('hidden_vars',$hidden_vars);
|
||||
|
||||
$exists = $c->exists('subs',$cat_name='',$cat_id);
|
||||
if ($exists==True)
|
||||
|
||||
if ($exists)
|
||||
{
|
||||
$t->set_var('lang_subs',lang('Do you also want to delete all subcategories ?'));
|
||||
$t->set_var('subs','<input type="checkbox" name="subs" value="True">');
|
||||
|
Loading…
Reference in New Issue
Block a user