forked from extern/egroupware
update cats
This commit is contained in:
parent
aacd03d33f
commit
e4044935f0
@ -94,7 +94,7 @@
|
||||
|
||||
function index()
|
||||
{
|
||||
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
|
||||
$global_cats = get_var('global_cats',array('POST','GET'));
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
|
||||
@ -236,7 +236,7 @@
|
||||
|
||||
function add()
|
||||
{
|
||||
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
|
||||
$global_cats = get_var('global_cats',array('POST','GET'));
|
||||
|
||||
$link_data = array
|
||||
(
|
||||
@ -317,7 +317,7 @@
|
||||
|
||||
function edit()
|
||||
{
|
||||
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
|
||||
$global_cats = get_var('global_cats',array('POST','GET'));
|
||||
|
||||
$link_data = array
|
||||
(
|
||||
@ -411,7 +411,7 @@
|
||||
|
||||
function delete()
|
||||
{
|
||||
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
|
||||
$global_cats = get_var('global_cats',array('POST','GET'));
|
||||
|
||||
$link_data = array
|
||||
(
|
||||
@ -449,9 +449,18 @@
|
||||
$GLOBALS['phpgw']->template->set_var('error_msg',$error_msg);
|
||||
$nolink = $GLOBALS['phpgw']->link('/index.php',$link_data);
|
||||
|
||||
if ($GLOBALS['appname'])
|
||||
{
|
||||
$type = 'noglobalapp';
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = 'noglobal';
|
||||
}
|
||||
|
||||
$apps_cats = $this->bo->exists(array
|
||||
(
|
||||
'type' => 'noapp',
|
||||
'type' => $type,
|
||||
'cat_name' => '',
|
||||
'cat_id' => $this->cat_id
|
||||
));
|
||||
@ -461,8 +470,8 @@
|
||||
|
||||
if ($apps_cats)
|
||||
{
|
||||
$GLOBALS['phpgw']->template->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 this category'));
|
||||
$GLOBALS['phpgw']->template->set_var('delete_msg',lang('This category is currently being used by applications as a parent category') . '<br>'
|
||||
. lang('You will need to reassign these subcategories before you can delete this category'));
|
||||
|
||||
$GLOBALS['phpgw']->template->set_var('lang_subs','');
|
||||
$GLOBALS['phpgw']->template->set_var('subs','');
|
||||
@ -474,7 +483,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to delete this global category ?'));
|
||||
$GLOBALS['phpgw']->template->set_var('delete_msg',lang('Are you sure you want to delete this global category ?'));
|
||||
|
||||
$exists = $this->bo->exists(array
|
||||
(
|
||||
|
@ -24,8 +24,8 @@ are you sure you want to kill this session ? admin de Sind Sie sicher, da
|
||||
change main screen message admin de Nachricht der Startseite ändern
|
||||
create group admin de Erstelle Gruppe
|
||||
display admin de Bezeichnung
|
||||
do you want to delete all global subcategories ? admin de Wollen Sie alle globalen Unterkategorien löschen ?
|
||||
do you want to move all global subcategories one level down ? admin de Wollen Sie alle globalen Unterkategorien einen Level nach unten verschieben ?
|
||||
do you want to delete all global subcategories ? admin de Möchten Sie alle globalen Unterkategorien löschen ?
|
||||
do you want to move all global subcategories one level down ? admin de Möchten Sie alle globalen Unterkategorien um einen Level nach unten verschieben ?
|
||||
edit application admin de Anwendung bearbeiten
|
||||
edit global category admin de Globale Kategorie bearbeiten
|
||||
edit global category for x admin de Globale Kategorie für %1 bearbeiten
|
||||
@ -78,8 +78,8 @@ that loginid has already been taken admin de Diese LoginID ist bereits vergeben
|
||||
the login and password can not be the same admin de Login und Passwort dürfen nicht identisch sein
|
||||
the two passwords are not the same admin de Die beiden Paßwörter stimmen nicht überein
|
||||
they must be removed before you can continue admin de Sie müssen zuvor aus dieser entfernt werden
|
||||
This category is currently being used by applications as a parent category admin de Diese Kategorie wird gegenwärtig als übergeordnete Kategorie benutzt.
|
||||
You will need to remove the subcategories before you can delete this category admin de Sie müssen erst die Unterkategorien löschen befor Sie diese Kategorie löschen können !
|
||||
This category is currently being used by applications as a parent category admin de Diese Kategorie wird gegenwärtig von Anwendungen als übergeordnete Kategorie benutzt.
|
||||
you will need to reassign these subcategories before you can delete this category admin de Sie müssen die Unterkategorien neu zuordnen, befor Sie diese Kategorie löschen können !
|
||||
total records admin de Anzahl Datensätze insgesamt
|
||||
user data admin de Benutzerdaten
|
||||
user accounts admin de Benutzerkonten
|
||||
@ -91,4 +91,4 @@ view user account admin de Benutzerkonto anzeigen
|
||||
you must add at least 1 permission to this account admin de Sie müssen diesem Konto mindestens eine Berechtigung zuteilen
|
||||
you must enter an application name and title. admin de Sie müssen der Anwendung einen Namen und einen Titel geben.
|
||||
you must select a file type admin de Sie müssen einen Filetyp auswählen
|
||||
userdata admin de Benutzerkonto
|
||||
userdata admin de Benutzerkonten
|
@ -209,4 +209,4 @@ you must enter an application name. admin en You must enter an application name.
|
||||
you must enter an application name and title. admin en You must enter an application name and title.
|
||||
you must enter an application title. admin en You must enter an application title.
|
||||
you must select a file type admin en You must select a file type
|
||||
you will need to remove the subcategories before you can delete this category admin en You will need to remove the subcategories before you can delete this category !
|
||||
you will need to reassign these subcategories before you can delete this category admin en You will need to reassign these subcategories before you can delete this category !
|
||||
|
@ -7,19 +7,19 @@
|
||||
<table border="0" width="65%" cellpadding="2" cellspacing="2">
|
||||
<form method="POST" action="{action_url}">
|
||||
<tr>
|
||||
<td align="center" colspan=2>{messages}</td>
|
||||
<td align="center" colspan="2">{delete_msg}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">{sub_select}</td>
|
||||
<td align="center" colspan="2">{sub_select}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="submit" name="confirm" value="{lang_yes}"></td>
|
||||
<td>
|
||||
<input type="submit" name="confirm" value="{lang_yes}">
|
||||
</form>
|
||||
</td>
|
||||
<td align="center">
|
||||
<td align="right">
|
||||
<form method="POST" action="{nolink}">
|
||||
<input type="submit" name="cancel" value="{lang_no}"></td>
|
||||
<input type="submit" name="cancel" value="{lang_no}">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -57,7 +57,7 @@
|
||||
$this->app_name = $app_name;
|
||||
$this->db = $GLOBALS['phpgw']->db;
|
||||
$this->grants = $GLOBALS['phpgw']->acl->get_grants($app_name);
|
||||
$this->cats = $this->return_array($type,$start,$limit,$query,$sort,$order,$public);
|
||||
$this->cats = $this->return_array($type,$start,$limit,$query,$sort,$order,$globals,$parent_id);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -74,7 +74,8 @@
|
||||
case 'mains': $s = " AND cat_parent = '0'"; break;
|
||||
case 'appandmains': $s = " AND cat_appname='" . $this->app_name . "' AND cat_parent ='0'"; break;
|
||||
case 'appandsubs': $s = " AND cat_appname='" . $this->app_name . "' AND cat_parent !='0'"; break;
|
||||
case 'noapp': $s = " AND cat_appname != '" . $this->app_name . "'"; break;
|
||||
case 'noglobal': $s = " AND cat_appname != '" . $this->app_name . "'"; break;
|
||||
case 'noglobalapp': $s = " AND cat_appname = '" . $this->app_name . "' AND cat_owner != '" . $this->account_id . "'"; break;
|
||||
default: return False;
|
||||
}
|
||||
return $s;
|
||||
|
@ -96,7 +96,8 @@ default category common de Standard-Kategorie
|
||||
delete common de Löschen
|
||||
description common de Beschreibung
|
||||
disabled common de Deaktiviert
|
||||
do you also want to delete all subcategories ? common de Wollen Sie auch alle Unterkategorien löschen ?
|
||||
do you want to delete all subcategories ? common de Möchten Sie alle Unterkategorien löschen ?
|
||||
do you want to move all subcategories one level down ? common de Möchten Sie alle Unterkategorien um einen Level nach unten verschieben ?
|
||||
done common de Fertig
|
||||
e-mail common de E-Mail
|
||||
edit common de Editieren
|
||||
|
@ -103,7 +103,8 @@ detail common en Detail
|
||||
details common en Details
|
||||
disabled common en Disabled
|
||||
djibouti common en DJIBOUTI
|
||||
do you also want to delete all subcategories ? common en Do you also want to delete all subcategories ?
|
||||
do you want to delete all subcategories ? common en Do you want to delete all subcategories ?
|
||||
do you want to move all subcategories one level down ? common en Do you want to move all subcategories one level down ?
|
||||
dominica common en DOMINICA
|
||||
dominican republic common en DOMINICAN REPUBLIC
|
||||
done common en Done
|
||||
|
@ -96,9 +96,7 @@
|
||||
|
||||
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']);
|
||||
return $this->cats->exists($data);
|
||||
}
|
||||
|
||||
function formatted_list($format,$type,$cat_parent,$global_cats)
|
||||
@ -106,9 +104,9 @@
|
||||
return $this->cats->formated_list($format,$type,$cat_parent,$global_cats);
|
||||
}
|
||||
|
||||
function delete($cat_id,$subs)
|
||||
function delete($cat_id,$drop_subs,$modify_subs)
|
||||
{
|
||||
return $this->cats->delete($cat_id,$subs);
|
||||
$this->cats->delete($cat_id,$drop_subs,$modify_subs);
|
||||
}
|
||||
|
||||
function check_values($values)
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
function uicategories()
|
||||
{
|
||||
|
||||
$this->bo = CreateObject('preferences.bocategories',$cats_app);
|
||||
$this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
|
||||
$this->account = $GLOBALS['phpgw_info']['user']['account_id'];
|
||||
@ -85,7 +86,11 @@
|
||||
|
||||
function index()
|
||||
{
|
||||
global $cats_app, $extra, $global_cats, $cats_level;
|
||||
$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
|
||||
(
|
||||
@ -258,7 +263,11 @@
|
||||
|
||||
function add()
|
||||
{
|
||||
global $cats_app, $extra, $global_cats, $cats_level;
|
||||
$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
|
||||
(
|
||||
@ -269,37 +278,19 @@
|
||||
'cats_level' => $cats_level
|
||||
);
|
||||
|
||||
$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'));
|
||||
$cat_description = get_var('cat_description',Array('POST'));
|
||||
$cat_data = get_var('cat_data',Array('POST'));
|
||||
$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)
|
||||
{
|
||||
$cat_parent = $new_parent;
|
||||
}
|
||||
|
||||
if (!$global_cats)
|
||||
{
|
||||
$global_cats = False;
|
||||
}
|
||||
|
||||
if ($submit)
|
||||
if (get_var('submit',Array('POST')))
|
||||
{
|
||||
$data = serialize($cat_data);
|
||||
|
||||
@ -315,19 +306,35 @@
|
||||
$error = $this->bo->check_values($values);
|
||||
if (is_array($error))
|
||||
{
|
||||
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
|
||||
$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));
|
||||
$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)
|
||||
{
|
||||
$type = 'all';
|
||||
@ -342,7 +349,7 @@
|
||||
$GLOBALS['phpgw']->template->set_var('cat_description',$cat_description);
|
||||
|
||||
$GLOBALS['phpgw']->template->set_var('access','<input type="checkbox" name="cat_access" value="True"'
|
||||
. ($cat_access == True ?' checked':'') . '>');
|
||||
. ($cat_access == True ?' checked':'') . '>');
|
||||
|
||||
if ($extra)
|
||||
{
|
||||
@ -364,7 +371,11 @@
|
||||
|
||||
function edit()
|
||||
{
|
||||
global $cats_app, $extra, $global_cats, $cats_level, $cat_id;
|
||||
$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
|
||||
(
|
||||
@ -381,37 +392,19 @@
|
||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data));
|
||||
}
|
||||
|
||||
$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'));
|
||||
$cat_description = get_var('cat_description',Array('POST'));
|
||||
$cat_data = get_var('cat_data',Array('POST'));
|
||||
$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)
|
||||
{
|
||||
$cat_parent = $new_parent;
|
||||
}
|
||||
|
||||
if (!$global_cats)
|
||||
{
|
||||
$global_cats = False;
|
||||
}
|
||||
|
||||
if ($submit)
|
||||
if (get_var('submit',Array('POST')))
|
||||
{
|
||||
$data = serialize($cat_data);
|
||||
|
||||
@ -428,25 +421,43 @@
|
||||
$error = $this->bo->check_values($values);
|
||||
if (is_array($error))
|
||||
{
|
||||
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
|
||||
$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));
|
||||
$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));
|
||||
|
||||
$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)
|
||||
{
|
||||
$global_cats = False;
|
||||
}
|
||||
|
||||
if ($cats_level)
|
||||
{
|
||||
$type = 'all';
|
||||
@ -459,7 +470,7 @@
|
||||
$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':'') . '>');
|
||||
. ($cats[0]['access'] == private ?' checked':'') . '>');
|
||||
|
||||
if ($extra)
|
||||
{
|
||||
@ -478,7 +489,7 @@
|
||||
{
|
||||
$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>');
|
||||
. '"><input type="submit" value="' . lang('Delete') .'"></form>');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -491,7 +502,11 @@
|
||||
|
||||
function delete()
|
||||
{
|
||||
global $cats_app, $extra, $global_cats, $cats_level, $cat_id;
|
||||
$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
|
||||
(
|
||||
@ -510,53 +525,51 @@
|
||||
|
||||
$this->bo->cats->app_name = $cats_app;
|
||||
|
||||
if(get_var('confirm',Array('POST')))
|
||||
if (get_var('confirm',array('POST')))
|
||||
{
|
||||
if(get_var('subs',Array('POST')))
|
||||
switch (get_var('subs',array('POST')))
|
||||
{
|
||||
$this->bo->delete($cat_id,True);
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->bo->delete($cat_id,False);
|
||||
}
|
||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data));
|
||||
}
|
||||
else
|
||||
|
||||
$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)
|
||||
{
|
||||
$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');
|
||||
$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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<center>
|
||||
<table border="0" width="80%" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<td colspan="1" align="center" bgcolor="#c9c9c9"><b>{title_categories}: {user_name}<b/></td>
|
||||
<td align="center" bgcolor="#c9c9c9"><b>{title_categories}: {user_name}<b/></td>
|
||||
</tr>
|
||||
</table>
|
||||
{message}
|
||||
@ -16,19 +16,19 @@
|
||||
<td><select name="new_parent"><option value="">{lang_none}</option>{category_list}</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{lang_name}</font></td>
|
||||
<td>{lang_name}</td>
|
||||
<td><input name="cat_name" size="50" value="{cat_name}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{lang_descr}</td>
|
||||
<td colspan="2"><textarea name="cat_description" rows="4" cols="50" wrap="virtual">{cat_description}</textarea></td>
|
||||
<td><textarea name="cat_description" rows="4" cols="50" wrap="virtual">{cat_description}</textarea></td>
|
||||
</tr>
|
||||
|
||||
{rows}
|
||||
|
||||
<tr>
|
||||
<td>{lang_access}</td>
|
||||
<td colspan="2">{access}</td>
|
||||
<td>{access}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -40,13 +40,13 @@
|
||||
|
||||
<!-- BEGIN add -->
|
||||
|
||||
<table width="50%" border="0" cellspacing="2" cellpadding="2">
|
||||
<table width="80%" border="0" cellspacing="2" cellpadding="2">
|
||||
<tr valign="bottom">
|
||||
<td height="50" align="right">
|
||||
<td height="50">
|
||||
<input type="submit" name="submit" value="{lang_save}"></td>
|
||||
<td height="50" align="center">
|
||||
<input type="reset" name="reset" value="{lang_reset}"></form></td>
|
||||
<td height="50">
|
||||
<td height="50" align="right">
|
||||
<form method="POST" action="{doneurl}">
|
||||
<input type="submit" name="done" value="{lang_done}"></form></td>
|
||||
</tr>
|
||||
@ -56,13 +56,13 @@
|
||||
|
||||
<!-- BEGIN edit -->
|
||||
|
||||
<table width="50%" border="0" cellspacing="2" cellpadding="2">
|
||||
<table width="80%" border="0" cellspacing="2" cellpadding="2">
|
||||
<tr valign="bottom">
|
||||
<td height="50" align="right">
|
||||
<td height="50">
|
||||
<input type="submit" name="submit" value="{lang_save}"></form></td>
|
||||
<td height="50" align="center">
|
||||
{delete}</td>
|
||||
<td height="50">
|
||||
<td height="50" align="right">
|
||||
<form method="POST" action="{doneurl}">
|
||||
<input type="submit" name="done" value="{lang_done}"></form></td>
|
||||
</tr>
|
||||
|
@ -3,23 +3,23 @@
|
||||
<!-- BEGIN form -->
|
||||
|
||||
<center>
|
||||
{error_msg}
|
||||
<table border="0" width="65%" cellpadding="2" cellspacing="2">
|
||||
<form method="POST" action="{action_url}">
|
||||
<tr>
|
||||
<td align="center" colspan=2>{deleteheader}</td>
|
||||
<td align="center" colspan="2">{deleteheader}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">{lang_subs}</td>
|
||||
<td align="center">{subs}</td>
|
||||
<td align="center" colspan="2">{sub_select}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<form method="POST" action="{action_url}">
|
||||
<input type="submit" name="confirm" value="{lang_yes}"></td>
|
||||
<td>
|
||||
<input type="submit" name="confirm" value="{lang_yes}">
|
||||
</form>
|
||||
</td>
|
||||
<td align="center">
|
||||
<td align="right">
|
||||
<form method="POST" action="{nolink}">
|
||||
<input type="submit" name="cancel" value="{lang_no}"></td>
|
||||
<input type="submit" name="cancel" value="{lang_no}">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user