Use the same code for categories for preferences & admin, add context menu

This commit is contained in:
Nathan Gray 2011-06-21 20:14:56 +00:00
parent f413b9dc4b
commit a555588dbe
6 changed files with 304 additions and 119 deletions

View File

@ -30,10 +30,11 @@ class admin_categories
*/
const ICON_PATH = '/phpgwapi/images';
/**
* Flag used in the nextmatch filter to indicate filtering by user
*/
const FILTER_USER = '-user-';
protected $appname = 'admin';
protected $get_rows = 'admin.admin_categories.get_rows';
protected $list_link = 'admin.admin_categories.index';
protected $add_link = 'admin.admin_categories.edit';
protected $edit_link = 'admin.admin_categories.edit';
/**
* Stupid old admin ACL - dont think anybody uses or understands it ;-)
@ -90,6 +91,7 @@ class admin_categories
// read the session, as the global_cats param is stored with it.
$session = egw_cache::getSession(__CLASS__,'nm');
$global_cats = $session['global_cats'];
$appname = $content['appname'] ? $content['appname'] : ($_GET['appname']?$_GET['appname']:categories::GLOBAL_APPNAME);
unset($session);
if (!isset($content))
{
@ -103,21 +105,20 @@ class admin_categories
}
if (isset($_GET['appname']) && isset($GLOBALS['egw_info']['apps'][$_GET['appname']]))
{
$content['appname'] = $_GET['appname'];
$appname = $_GET['appname'];
}
else
{
$content['appname'] = categories::GLOBAL_APPNAME;
$appname = categories::GLOBAL_APPNAME;
}
}
elseif (!self::$acl_edit)
elseif (!self::$acl_edit || (!$GLOBALS['egw_info']['user']['apps']['admin'] && $content['owner'] != $GLOBALS['egw_info']['user']['account_id']))
{
// only allow to view category
$readonlys['__ALL__'] = true;
$readonlys['button[cancel]'] = false;
}
$content['base_url'] = self::icon_url();
$content['icon_url'] = $content['base_url'] . $content['data']['icon'];
}
elseif ($content['button'] || $content['delete'])
{
@ -179,7 +180,8 @@ class admin_categories
break;
}
$link = egw::link('/index.php',array(
'menuaction' => 'admin.admin_categories.index',
'menuaction' => $this->list_link,
'appname' => $appname,
'msg' => $msg,
'global_cats' => (empty($global_cats)? false : true),
));
@ -192,15 +194,22 @@ class admin_categories
if (!empty($js)) $GLOBALS['egw']->js->set_onload($js);
}
$content['msg'] = $msg;
$sel_options['icon'] = self::get_icons();
$content['appname'] = $appname;
$content['icon_url'] = $content['base_url'] . $content['data']['icon'];
$sel_options['icon'] = self::get_icons();
$sel_options['owner'] = array();
$sel_options['owner'] = array(0 => lang('All users'));
// User's category - add current value to be able to preserve owner
if(!$GLOBALS['egw_info']['user']['apps']['admin']) {
if($content['owner'] > 0) $sel_options['owner'][$content['owner']] = common::grab_owner_name($content['owner']);
}
else
if(!$content['id'] && $this->appname != 'admin') $content['owner'] = $GLOBALS['egw_info']['user']['account_id'];
if($content['owner'] > 0 )
{
$sel_options['owner'][$content['owner']] = common::grab_owner_name($content['owner']);
}
if($this->appname == 'admin')
{
$sel_options['owner'][0] = lang('All users');
$accs = $GLOBALS['egw']->accounts->get_list('groups');
foreach($accs as $acc)
{
@ -209,7 +218,9 @@ class admin_categories
$sel_options['owner'][$acc['account_id']] = ExecMethod2('etemplate.select_widget.accountInfo',$acc['account_id'],$acc,$type2,$type=='both');
}
}
$content['no_private'] = true;
}
$readonlys['owner'] = $this->appname != 'admin' && !$GLOBALS['egw_info']['user']['apps']['admin'];
egw_framework::validate_file('.','global_categories','admin');
egw_framework::set_onload('$(document).ready(function() {
@ -217,11 +228,12 @@ class admin_categories
permission_prompt = \'' . lang('cat_permission_confirm').'\';
});');
$readonlys['button[delete]'] = !$content['id'] || !self::$acl_delete; // cant delete not yet saved category
$readonlys['button[delete]'] = !$content['id'] || !self::$acl_delete || // cant delete not yet saved category
(!$GLOBALS['egw_info']['user']['apps']['admin'] && $content['owner'] != $GLOBALS['egw_info']['user']['account_id']);
$tmpl = new etemplate('admin.categories.edit');
$tmpl->exec('admin.admin_categories.edit',$content,$sel_options,$readonlys,$content+array(
'old_parent' => $content['old_parent'] ? $content['old_parent'] : $content['parent'],
$tmpl->exec($this->edit_link,$content,$sel_options,$readonlys,$content+array(
'old_parent' => $content['old_parent'] ? $content['old_parent'] : $content['parent'], 'appname' => $appname
),2);
}
@ -274,25 +286,30 @@ class admin_categories
{
throw new egw_exception_assertion_failed(__METHOD__.'($query,...) $query[appname] NOT set!');
}
$globalcat = ($query['filter'] == categories::GLOBAL_ACCOUNT);
$filter = array();
$globalcat = ($query['filter'] === categories::GLOBAL_ACCOUNT || !$query['filter']);
if (isset($query['global_cats']) && $query['global_cats']===false)
{
$globalcat = false;
}
if($globalcat) $filter['access'] = 'public';
egw_cache::setSession(__CLASS__,'nm',$query);
if($query['filter'])
if($query['filter'] > 0 || $query['col_filter']['owner']) {
$filter['owner'] = $query['col_filter']['owner'] ? $query['col_filter']['owner'] : $query['filter'];
}
elseif ((string)$query['filter'] === (string)categories::GLOBAL_ACCOUNT)
{
$filter['owner'] = $query['filter'] == self::FILTER_USER ? $query['col_filter']['owner'] : $query['filter'];
$filter['owner'] = 0;
}
$cats = new categories($query['filter'] == self::FILTER_USER ? $query['col_filter']['owner'] : $query['filter'],$query['appname']);
//$cats = new categories($query['col_filter']['owner'] ? $query['col_filter']['owner'] : $query['filter'],$query['appname']);
$cats = new categories($filter['owner'],$query['appname']);
// Use all parents, in case user has their cat as a child of a global or something
$parent =array(0);
if($query['filter']) $parent += $cats->return_array('all',0,false,'','ASC','',true,$parent,-1, 'id');
if($filter['owner']) $parent += $cats->return_array('all',0,false,'','ASC','',true,null,-1, 'id');
$rows = $cats->return_sorted_array($query['start'],$query['num_rows'],$query['search'],$query['sort'],$query['order'],$globalcat,$parent,true, $filter);
foreach($rows as &$row)
{
$row['level_spacer'] = str_repeat('    ',$row['level']);
@ -302,7 +319,10 @@ class admin_categories
$row['subs'] = count($row['children']);
$row['class'] = 'level'.$row['level'];
if($row['owner'] > 0 && !$GLOBALS['egw_info']['user']['apps']['admin'] && $row['owner'] != $GLOBALS['egw_info']['user']['account_id'])
{
$row['class'] . ' rowNoEdit rowNoDelete ';
}
$readonlys["edit[$row[id]]"] = !self::$acl_edit;
$readonlys["add[$row[id]]"] = !self::$acl_add_sub;
$readonlys["delete[$row[id]]"] = !self::$acl_delete;
@ -329,17 +349,14 @@ class admin_categories
if(!isset($content))
{
if (isset($_GET['msg'])) $msg = $_GET['msg'];
$appname = $content['nm']['appname'] ? $content['nm']['appname'] : categories::GLOBAL_APPNAME;
$appname = $content['nm']['appname'] ? $content['nm']['appname'] : $_GET['cats_app']?$_GET['cats_app']:categories::GLOBAL_APPNAME;
$content['nm'] = egw_cache::getSession(__CLASS__,'nm');
if (!is_array($content['nm']))
{
$content['nm'] = array(
'get_rows' => 'admin_categories::get_rows', // I method/callback to request the data for the rows eg. 'notes.bo.get_rows'
'get_rows' => $this->get_rows, // I method/callback to request the data for the rows eg. 'notes.bo.get_rows'
'no_filter' => false,
'filter' => categories::GLOBAL_ACCOUNT,
'options-filter' => array(
'' => lang('All categories'),
categories::GLOBAL_ACCOUNT => lang('Global categories'),
$GLOBALS['egw_info']['user']['account_id'] => lang('Own categories'),
),
@ -352,52 +369,165 @@ class admin_categories
'start' => 0, // IO position in list
'order' => 'name', // IO name of the column to sort after (optional for the sortheaders)
'sort' => 'ASC', // IO direction of the sort: 'ASC' or 'DESC'
'default_cols' => '!color,last_mod,subs', // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns
'default_cols' => '!color,last_mod,subs,legacy_actions', // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns
'csv_fields' => false, // I false=disable csv export, true or unset=enable it with auto-detected fieldnames,
//or array with name=>label or name=>array('label'=>label,'type'=>type) pairs (type is a eT widget-type)
'appname' => $appname,
'no_search' => !self::$acl_search,
'row_id' => 'id',
);
}
else
{
$content['nm']['start']=0;
$content['nm']['filter'] = $GLOBALS['egw_info']['flags']['currentapp'] == 'admin'?categories::GLOBAL_ACCOUNT:$GLOBALS['egw_info']['user']['account_id'];
}
if (isset($_GET['appname']) && ($_GET['appname'] == categories::GLOBAL_APPNAME ||
isset($GLOBALS['egw_info']['apps'][$_GET['appname']])))
{
$content['nm']['appname'] = $_GET['appname'];
}
$content['nm']['appname'] = $appname = $_GET['appname'] ? $_GET['appname'] : $appname;
$content['nm']['actions'] = $this->get_actions($appname);
$content['nm']['global_cats'] = true;
if (isset($_GET['global_cats']) && empty($_GET['global_cats'] ))
{
$content['nm']['global_cats'] = false;
}
}
elseif($content['nm']['action'])
{
// Old buttons
foreach(array('delete') as $button)
{
if(isset($content['nm']['rows'][$button]))
{
list($id) = @each($content['nm']['rows'][$button]);
$content['nm']['action'] = $button;
$content['nm']['selected'] = array($id);
break; // Only one can come per submit
}
}
if (!count($content['nm']['selected']) && !$content['nm']['select_all'])
{
$msg = lang('You need to select some entries first!');
}
else
{
if($content['delete']['delete'] && ($cat = categories::read($content['delete']['cat_id'])))
// Action has an additional action - add / delete, etc. Buttons named <multi-action>_action[action_name]
if ($this->action($content['nm']['action'],$content['nm']['selected'],$content['nm']['select_all'],
$success,$failed,$action_msg,$content['nm'],$msg))
{
$cats = new categories(categories::GLOBAL_ACCOUNT,$cat['appname']);
$cats->delete($content['delete']['cat_id'],$content['delete']['subs'],!$content['delete']['subs']);
$msg = lang('Category deleted.');
$msg .= lang('%1 category(s) %2',$success,$action_msg);
}
elseif(empty($msg))
{
$msg .= lang('%1 category(s) %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
}
}
unset($content['delete']);
}
$content['msg'] = $msg;
$content['add_link']= $this->add_link.'&appname='.$appname;
$content['edit_link']= $this->edit_link.'&appname='.$appname;
$readonlys['add'] = !self::$acl_add;
if($GLOBALS['egw_info']['user']['apps']['admin'])
{
$content['nm']['options-filter'][self::FILTER_USER] = lang('Limit to user');
$content['nm']['options-filter'][''] = lang('All categories');
} else {
$readonlys['nm']['rows']['owner'] = true;
$readonlys['nm']['col_filter']['owner'] = true;
}
$tmpl = new etemplate('admin.categories.index');
$tmpl->exec('admin.admin_categories.index',$content,$sel_options,$readonlys,array(
$tmpl->exec($this->list_link,$content,$sel_options,$readonlys,array(
'nm' => $content['nm'],
));
}
protected function get_actions($appname=categories::GLOBAL_APPNAME) {
$actions = array(
'open' => array( // does edit if allowed, otherwise view
'caption' => 'Open',
'default' => true,
'allowOnMultiple' => false,
'url' => 'menuaction='.$this->edit_link.'&cat_id=$id&appname='.$appname,
'popup' => '600x380',
'group' => $group=1,
),
'add' => array( // does edit if allowed, otherwise view
'caption' => 'Add',
'allowOnMultiple' => false,
'icon' => 'new',
'url' => 'menuaction='.$this->add_link.'&appane='.$appname,
'popup' => '600x380',
'group' => $group,
),
'sub' => array( // does edit if allowed, otherwise view
'caption' => 'Add sub',
'allowOnMultiple' => false,
'icon' => 'new',
'url' => 'menuaction='.$this->add_link.'&parent=$id&appname='.$appname,
'popup' => '600x380',
'group' => $group,
'disableClass' => 'rowNoSub',
),
'delete' => array( // does edit if allowed, otherwise view
'caption' => 'Delete',
'allowOnMultiple' => true,
'nm_action' => 'open_popup',
'group' => $group,
'disableClass' => 'rowNoDelete',
),
);
return $actions;
}
/**
* Handles actions on multiple entries
*
* @param action
* @param array $checked contact id's to use if !$use_all
* @param boolean $use_all if true use all entries of the current selection (in the session)
* @param int &$success number of succeded actions
* @param int &$failed number of failed actions (not enought permissions)
* @param string &$action_msg translated verb for the actions, to be used in a message like '%1 entries deleted'
* @param array $query get_rows parameter
* @param string &$msg on return user feedback
* @param boolean $skip_notifications=false true to NOT notify users about changes
* @return boolean true if all actions succeded, false otherwise
*/
function action($action, $checked, $use_all, &$success, &$failed, &$action_msg,
array $query, &$msg, $skip_notifications = false)
{
//echo '<p>'.__METHOD__."('$action',".array2string($checked).','.(int)$use_all.",...)</p>\n";
$success = $failed = 0;
if ($use_all)
{
@set_time_limit(0); // switch off the execution time limit, as it's for big selections to small
$query['num_rows'] = -1; // all
$this->get_rows($query,$result,$readonlys);
$checked = array();
foreach($result as $key => $info)
{
if(is_numeric($key))
{
$checked[] = $info['id'];
}
}
}
$owner = $query['col_filter']['owner'] ? $query['col_filter']['owner'] : $query['filter'];
$cats = new categories($owner,$query['appname']);
foreach($checked as $id) {
switch($action) {
case 'delete':
case 'delete_sub':
$cats->delete($id,$action == 'delete_sub',$action != 'delete_sub');
$action_msg = lang('deleted');
$success++;
break;
}
}
return $failed == 0;
}
}
admin_categories::init_static();

View File

@ -14,7 +14,7 @@ function check_owner(element_id) {
var all_users = $(document.getElementById(element_id + '[0]'));
// If they checked all users, uncheck the others
if(all_users.attr("checked")) {
if(all_users.length > 0 && all_users.attr("checked")) {
checkboxes.attr("checked",false);
all_users.attr("checked", true);
checkboxes = $(':checkbox', document.getElementById(element_id)).filter(':checked');
@ -25,7 +25,7 @@ function check_owner(element_id) {
var seen = [], diff = [], labels = [];
for ( var i = 0; i < cat_original_owner.length; i++) {
var checkbox = checkboxes.filter('[value="'+cat_original_owner[i]+'"]');
if(checkbox.filter(':checked').length == 0) {
if(checkbox.filter(':checked').length == 0 && checkbox.get(0) != undefined) {
diff.push(cat_original_owner[i]);
labels.push($(checkbox.get(0).nextSibling).text());
}

View File

@ -2,7 +2,7 @@
/**
* EGroupware - eTemplates for Application admin
* http://www.egroupware.org
* generated by soetemplate::dump4setup() 2011-06-16 09:53
* generated by soetemplate::dump4setup() 2011-06-21 13:52
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package admin
@ -37,11 +37,39 @@ $templ_data[] = array('name' => 'admin.categories.delete','template' => '','lang
{
}','modified' => '1308076484',);
$templ_data[] = array('name' => 'admin.categories.edit','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:2:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:11:{i:0;a:12:{s:2:"c2";s:2:"th";s:2:"c3";s:3:"row";s:2:"c4";s:7:"row,top";s:2:"c5";s:3:"row";s:2:"c7";s:3:"row";s:2:"c6";s:3:"row";s:2:"h7";s:15:",@appname=phpgw";s:2:"h2";s:2:"25";s:2:"h1";s:6:",!@msg";s:2:"c9";s:3:"row";s:2:"c8";s:3:"row";s:2:"h9";s:11:",!@last_mod";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:5:"align";s:6:"center";s:4:"name";s:3:"msg";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:9:",,,parent";s:5:"label";s:15:"Parent category";}s:1:"B";a:3:{s:4:"type";s:10:"select-cat";s:4:"size";s:25:"None,,,$cont[appname],,-1";s:4:"name";s:6:"parent";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:7:",,,name";s:5:"label";s:4:"Name";}s:1:"B";a:3:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,150";s:4:"name";s:4:"name";}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:14:",,,description";s:5:"label";s:11:"Description";}s:1:"B";a:3:{s:4:"type";s:8:"textarea";s:4:"size";s:4:"5,50";s:4:"name";s:11:"description";}}i:5;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:18:",,,cat_data[color]";s:5:"label";s:5:"Color";}s:1:"B";a:2:{s:4:"type";s:11:"colorpicker";s:4:"name";s:11:"data[color]";}}i:6;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:13:",,,data[icon]";s:5:"label";s:4:"Icon";}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:4:{s:4:"type";s:6:"select";s:4:"name";s:10:"data[icon]";s:4:"size";s:4:"None";s:8:"onchange";s:73:"document.getElementById(\'icon_url\').src = \'$cont[base_url]\' + this.value;";}i:2;a:3:{s:4:"type";s:5:"image";s:4:"name";s:8:"icon_url";s:4:"span";s:9:",leftPad5";}}}i:7;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"B";a:4:{s:4:"type";s:10:"select-app";s:4:"name";s:7:"appname";s:8:"readonly";s:1:"1";s:4:"size";s:16:"All applications";}}i:8;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:8:",,,owner";s:5:"label";s:19:"Limit to members of";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"size";s:1:"3";s:4:"name";s:5:"owner";s:4:"help";s:51:"Limit global category to members of a certain group";s:6:"needed";s:1:"1";}}i:9;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Modified";}s:1:"B";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:8:"last_mod";s:8:"readonly";s:1:"1";}}i:10;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:7:"onclick";s:40:"return check_owner(form::name(\'owner\'));";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:7:"onclick";s:40:"return check_owner(form::name(\'owner\'));";}}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:10:"buttononly";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"Cancel";s:7:"onclick";s:15:"window.close();";}i:2;a:6:{s:4:"type";s:10:"buttononly";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:14:"button[delete]";s:4:"help";s:20:"Delete this category";s:7:"onclick";s:157:"set_style_by_class(\'tr\',\'confirmSubs\',\'visibility\',\'$cont[children]\'?\'visible\':\'collapse\'); set_style_by_class(\'fieldset\',\'confirmDelete\',\'display\',\'block\');";}}}}s:4:"rows";i:10;s:4:"cols";i:2;}i:1;a:2:{s:4:"type";s:8:"template";s:4:"name";s:23:"admin.categories.delete";}}','size' => '','style' => '','modified' => '1308076611',);
$templ_data[] = array('name' => 'admin.categories.edit','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:2:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:12:{i:0;a:14:{s:2:"c2";s:2:"th";s:2:"c3";s:3:"row";s:2:"c4";s:7:"row,top";s:2:"c7";s:3:"row";s:2:"c6";s:3:"row";s:2:"h2";s:2:"25";s:2:"h1";s:6:",!@msg";s:2:"c9";s:3:"row";s:2:"c8";s:3:"row";s:3:"c10";s:3:"row";s:3:"h10";s:11:",!@last_mod";s:2:"h8";s:15:",@appname=phpgw";s:2:"h5";s:12:",@no_private";s:2:"c5";s:3:"nmr";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:5:"align";s:6:"center";s:4:"name";s:3:"msg";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:9:",,,parent";s:5:"label";s:15:"Parent category";}s:1:"B";a:3:{s:4:"type";s:10:"select-cat";s:4:"size";s:25:"None,,,$cont[appname],,-1";s:4:"name";s:6:"parent";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:7:",,,name";s:5:"label";s:4:"Name";}s:1:"B";a:3:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,150";s:4:"name";s:4:"name";}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:14:",,,description";s:5:"label";s:11:"Description";}s:1:"B";a:3:{s:4:"type";s:8:"textarea";s:4:"size";s:4:"5,50";s:4:"name";s:11:"description";}}i:5;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Private";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:6:"access";s:4:"size";s:14:"private,public";}}i:6;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:18:",,,cat_data[color]";s:5:"label";s:5:"Color";}s:1:"B";a:2:{s:4:"type";s:11:"colorpicker";s:4:"name";s:11:"data[color]";}}i:7;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:13:",,,data[icon]";s:5:"label";s:4:"Icon";}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:4:{s:4:"type";s:6:"select";s:4:"name";s:10:"data[icon]";s:4:"size";s:4:"None";s:8:"onchange";s:73:"document.getElementById(\'icon_url\').src = \'$cont[base_url]\' + this.value;";}i:2;a:3:{s:4:"type";s:5:"image";s:4:"name";s:8:"icon_url";s:4:"span";s:9:",leftPad5";}}}i:8;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"B";a:4:{s:4:"type";s:10:"select-app";s:4:"name";s:7:"appname";s:8:"readonly";s:1:"1";s:4:"size";s:16:"All applications";}}i:9;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:8:",,,owner";s:5:"label";s:19:"Limit to members of";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"size";s:1:"3";s:4:"name";s:5:"owner";s:4:"help";s:51:"Limit global category to members of a certain group";s:6:"needed";s:1:"1";}}i:10;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Modified";}s:1:"B";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:8:"last_mod";s:8:"readonly";s:1:"1";}}i:11;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:7:"onclick";s:40:"return check_owner(form::name(\'owner\'));";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:7:"onclick";s:40:"return check_owner(form::name(\'owner\'));";}}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:10:"buttononly";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"Cancel";s:7:"onclick";s:15:"window.close();";}i:2;a:6:{s:4:"type";s:10:"buttononly";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:14:"button[delete]";s:4:"help";s:20:"Delete this category";s:7:"onclick";s:157:"set_style_by_class(\'tr\',\'confirmSubs\',\'visibility\',\'$cont[children]\'?\'visible\':\'collapse\'); set_style_by_class(\'fieldset\',\'confirmDelete\',\'display\',\'block\');";}}}}s:4:"rows";i:11;s:4:"cols";i:2;}i:1;a:2:{s:4:"type";s:8:"template";s:4:"name";s:23:"admin.categories.delete";}}','size' => '','style' => '','modified' => '1308076611',);
$templ_data[] = array('name' => 'admin.categories.index','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:2:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"name";s:3:"msg";s:5:"align";s:6:"center";s:4:"span";s:13:"all,redItalic";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:4:"rows";s:4:"name";s:2:"nm";}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:10:"buttononly";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";s:7:"onclick";s:193:"window.open(egw::link(\'/index.php\',\'menuaction=admin.admin_categories.edit&appname={$cont[nm][appname]}\'),\'_blank\',\'dependent=yes,width=600,height=300,scrollbars=yes,status=yes\'); return false;";}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}i:1;a:2:{s:4:"type";s:8:"template";s:4:"name";s:23:"admin.categories.delete";}}','size' => '100%','style' => '.level0 { font-weight: bold; }','modified' => '1264657515',);
$templ_data[] = array('name' => 'admin.categories.index','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:2:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"name";s:3:"msg";s:5:"align";s:6:"center";s:4:"span";s:13:"all,redItalic";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:4:"rows";s:4:"name";s:2:"nm";}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:10:"buttononly";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";s:7:"onclick";s:187:"window.open(egw::link(\'/index.php\',\'menuaction=$cont[add_link]&cat_id=&appname=$cont[nm][appname]\'),\'_blank\',\'dependent=yes,width=600,height=380,scrollbars=yes,status=yes\'); return false;";}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}i:1;a:6:{s:5:"class";s:19:"action_popup prompt";s:4:"name";s:12:"delete_popup";s:4:"type";s:3:"box";s:4:"size";s:1:"1";i:1;a:6:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"3";i:1;a:3:{s:4:"type";s:5:"label";s:5:"label";s:6:"Delete";s:4:"span";s:13:",promptheader";}i:2;a:3:{s:4:"name";s:13:"delete_prompt";s:4:"type";s:5:"label";s:5:"label";s:24:"Delete selected entries?";}i:3;a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:4:{s:5:"label";s:12:"Yes - Delete";s:7:"onclick";s:36:"nm_submit_popup(this); return false;";s:4:"name";s:6:"delete";s:4:"type";s:6:"button";}i:2;a:4:{s:5:"label";s:34:"Yes - Delete including sub-entries";s:7:"onclick";s:71:"nm_popup_action.id = \'delete_sub\'; nm_submit_popup(this); return false;";s:4:"name";s:10:"delete_sub";s:4:"type";s:6:"button";}i:3;a:3:{s:5:"label";s:11:"No - Cancel";s:7:"onclick";s:35:"nm_hide_popup(this,\'delete_popup\');";s:4:"type";s:10:"buttononly";}}s:4:"span";s:7:",prompt";}s:4:"span";s:13:",action_popup";}}','size' => '100%','style' => '.level0 { font-weight: bold; }
$templ_data[] = array('name' => 'admin.categories.index.rows','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:6:{s:2:"c1";s:2:"th";s:2:"c2";s:13:"$row_cont[id]";s:1:"I";s:2:"1%";s:1:"F";s:2:"80";s:1:"E";s:2:"40";s:1:"H";s:2:"30";}i:1;a:9:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:11:"Description";s:4:"name";s:11:"description";}s:1:"C";a:3:{s:4:"type";s:16:"nextmatch-header";s:4:"name";s:3:"app";s:5:"label";s:11:"Application";}s:1:"D";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:19:"Limit to members of";s:4:"name";s:5:"owner";}s:1:"E";a:4:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:4:"Icon";s:4:"name";s:4:"icon";s:5:"align";s:6:"center";}s:1:"F";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Color";s:4:"name";s:5:"color";}s:1:"G";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Modified";s:4:"name";s:8:"last_mod";}s:1:"H";a:4:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:8:"Children";s:4:"name";s:4:"subs";s:5:"align";s:6:"center";}s:1:"I";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";}}i:2;a:9:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:2:{s:4:"type";s:4:"html";s:4:"name";s:20:"${row}[level_spacer]";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[name]";s:4:"span";s:17:",$row_cont[class]";}}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[description]";}s:1:"C";a:3:{s:4:"type";s:10:"select-app";s:4:"name";s:15:"${row}[appname]";s:8:"readonly";s:1:"1";}s:1:"D";a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";s:4:"size";s:16:"All users,groups";}s:1:"E";a:4:{s:4:"type";s:5:"image";s:4:"name";s:16:"${row}[icon_url]";s:5:"label";s:23:"{$row_cont[data][icon]}";s:5:"align";s:6:"center";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[data][color]";}s:1:"G";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:16:"${row}[last_mod]";s:8:"readonly";s:1:"1";}s:1:"H";a:3:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[subs]";s:5:"align";s:6:"center";}s:1:"I";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"3,,0,0";i:1;a:5:{s:4:"type";s:10:"buttononly";s:4:"size";s:4:"edit";s:5:"label";s:4:"Edit";s:4:"name";s:19:"edit[$row_cont[id]]";s:7:"onclick";s:185:"window.open(egw::link(\'/index.php\',\'menuaction=admin.admin_categories.edit&cat_id=$row_cont[id]\'),\'_blank\',\'dependent=yes,width=600,height=380,scrollbars=yes,status=yes\'); return false;";}i:2;a:5:{s:4:"type";s:10:"buttononly";s:4:"size";s:3:"new";s:5:"label";s:7:"Add sub";s:4:"name";s:18:"add[$row_cont[id]]";s:7:"onclick";s:208:"window.open(egw::link(\'/index.php\',\'menuaction=admin.admin_categories.edit&parent=$row_cont[id]&appname=$cont[appname]\'),\'_blank\',\'dependent=yes,width=600,height=380,scrollbars=yes,status=yes\'); return false;";}i:3;a:7:{s:4:"type";s:10:"buttononly";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"name";s:21:"delete[$row_cont[id]]";s:4:"help";s:20:"Delete this category";s:7:"onclick";s:246:"document.getElementById(\'exec[delete][cat_id]\').value=\'$row_cont[id]\'; set_style_by_class(\'tr\',\'confirmSubs\',\'visibility\',\'$row_cont[children]\'?\'visible\':\'collapse\'); set_style_by_class(\'fieldset\',\'confirmDelete\',\'display\',\'block\'); return false;";s:4:"span";s:9:",leftPad5";}}}}s:4:"rows";i:2;s:4:"cols";i:9;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1264657599',);
.action_popup {
position: fixed;
top: 200px;
left: 450px;
width: 76ex;
z-index: 20000;
display: none;
border-collapse:collapse;
border-spacing:0px
}
.action_popup-content {
display:block;
padding:2ex;
color:#666666;
margin: -2px -1px 0px -2px;
}
.action_popup > table {
width: 100%
}
.action_popup .promptheader {
padding: 1ex;
width: 100%
}
.action_select {
width: 100%
}','modified' => '1308602792',);
$templ_data[] = array('name' => 'admin.categories.index.rows','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:6:{s:2:"c1";s:2:"th";s:2:"c2";s:13:"$row_cont[id]";s:1:"I";s:2:"1%";s:1:"F";s:2:"80";s:1:"E";s:2:"40";s:1:"H";s:2:"30";}i:1;a:9:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:11:"Description";s:4:"name";s:11:"description";}s:1:"C";a:3:{s:4:"type";s:16:"nextmatch-header";s:4:"name";s:3:"app";s:5:"label";s:11:"Application";}s:1:"D";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:19:"Limit to members of";s:4:"name";s:5:"owner";}s:1:"E";a:4:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:4:"Icon";s:4:"name";s:4:"icon";s:5:"align";s:6:"center";}s:1:"F";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Color";s:4:"name";s:5:"color";}s:1:"G";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Modified";s:4:"name";s:8:"last_mod";}s:1:"H";a:4:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:8:"Children";s:4:"name";s:4:"subs";s:5:"align";s:6:"center";}s:1:"I";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:7:"Actions";s:4:"name";s:14:"legacy_actions";}}i:2;a:9:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:2:{s:4:"type";s:4:"html";s:4:"name";s:20:"${row}[level_spacer]";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[name]";s:4:"span";s:17:",$row_cont[class]";}}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[description]";}s:1:"C";a:3:{s:4:"type";s:10:"select-app";s:4:"name";s:15:"${row}[appname]";s:8:"readonly";s:1:"1";}s:1:"D";a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";s:4:"size";s:16:"All users,groups";}s:1:"E";a:4:{s:4:"type";s:5:"image";s:4:"name";s:16:"${row}[icon_url]";s:5:"label";s:23:"{$row_cont[data][icon]}";s:5:"align";s:6:"center";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[data][color]";}s:1:"G";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:16:"${row}[last_mod]";s:8:"readonly";s:1:"1";}s:1:"H";a:3:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[subs]";s:5:"align";s:6:"center";}s:1:"I";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"3,,0,0";i:1;a:5:{s:4:"type";s:10:"buttononly";s:4:"size";s:4:"edit";s:5:"label";s:4:"Edit";s:4:"name";s:19:"edit[$row_cont[id]]";s:7:"onclick";s:174:"window.open(egw::link(\'/index.php\',\'menuaction=$cont[edit_link]&cat_id=$row_cont[id]\'),\'_blank\',\'dependent=yes,width=600,height=380,scrollbars=yes,status=yes\'); return false;";}i:2;a:5:{s:4:"type";s:10:"buttononly";s:4:"size";s:3:"new";s:5:"label";s:7:"Add sub";s:4:"name";s:18:"add[$row_cont[id]]";s:7:"onclick";s:197:"window.open(egw::link(\'/index.php\',\'menuaction=$cont[edit_link]&parent=$row_cont[id]&appname=$cont[appname]\'),\'_blank\',\'dependent=yes,width=600,height=380,scrollbars=yes,status=yes\'); return false;";}i:3;a:7:{s:4:"type";s:10:"buttononly";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"name";s:21:"delete[$row_cont[id]]";s:4:"help";s:20:"Delete this category";s:7:"onclick";s:246:"document.getElementById(\'exec[delete][cat_id]\').value=\'$row_cont[id]\'; set_style_by_class(\'tr\',\'confirmSubs\',\'visibility\',\'$row_cont[children]\'?\'visible\':\'collapse\'); set_style_by_class(\'fieldset\',\'confirmDelete\',\'display\',\'block\'); return false;";s:4:"span";s:9:",leftPad5";}}}}s:4:"rows";i:2;s:4:"cols";i:9;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1264657599',);
$templ_data[] = array('name' => 'admin.cmds','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:15:"admin.cmds.rows";s:4:"name";s:2:"nm";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1195518120',);

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="admin.categories.index.rows" template="" lang="" group="0" version="1.7.001">
<template id="admin.categories.index.rows" template="" lang="" group="0" version="1.9.001">
<grid width="100%">
<columns>
<column/>
@ -18,13 +18,13 @@
<row class="th">
<nextmatch-sortheader label="Name" id="name"/>
<nextmatch-sortheader label="Description" id="description"/>
<nextmatch-header id="app" label="Application"/>
<nextmatch-header label="Limit to members of" id="owner"/>
<nextmatch-header label="Icon" id="icon" align="center"/>
<nextmatch-header label="Application" id="app"/>
<nextmatch-accountfilter label="Limit to members of" id="owner"/>
<nextmatch-header align="center" label="Icon" id="icon"/>
<nextmatch-header label="Color" id="color"/>
<nextmatch-sortheader label="Modified" id="last_mod"/>
<nextmatch-header label="Children" id="subs" align="center"/>
<description value="Actions"/>
<nextmatch-header align="center" label="Children" id="subs"/>
<nextmatch-header label="Actions" id="legacy_actions"/>
</row>
<row class="$row_cont[id]">
<hbox options="0,0">
@ -38,86 +38,77 @@
<menulist>
<menupopup type="select-account" id="${row}[owner]" readonly="true" options="All users,groups"/>
</menulist>
<image src="${row}[icon_url]" label="{$row_cont[data][icon]}" align="center"/>
<image align="center" label="{$row_cont[data][icon]}" src="${row}[icon_url]"/>
<description id="${row}[data][color]"/>
<date-time id="${row}[last_mod]" readonly="true"/>
<description id="${row}[subs]" align="center"/>
<description align="center" id="${row}[subs]"/>
<hbox options="0,0">
<buttononly options="edit" label="Edit" id="edit[$row_cont[id]]" onclick="window.open(egw::link('/index.php','menuaction=admin.admin_categories.edit&amp;cat_id=$row_cont[id]'),'_blank','dependent=yes,width=600,height=380,scrollbars=yes,status=yes'); return false;"/>
<buttononly options="new" label="Add sub" id="add[$row_cont[id]]" onclick="window.open(egw::link('/index.php','menuaction=admin.admin_categories.edit&amp;parent=$row_cont[id]&amp;appname=$cont[appname]'),'_blank','dependent=yes,width=600,height=380,scrollbars=yes,status=yes'); return false;"/>
<buttononly options="delete" label="Delete" id="delete[$row_cont[id]]" statustext="Delete this category" onclick="document.getElementById('exec[delete][cat_id]').value='$row_cont[id]'; set_style_by_class('tr','confirmSubs','visibility','$row_cont[children]'?'visible':'collapse'); set_style_by_class('fieldset','confirmDelete','display','block'); return false;" class="leftPad5"/>
<buttononly label="Edit" id="edit[$row_cont[id]]" onclick="window.open(egw::link('/index.php','menuaction=$cont[edit_link]&amp;cat_id=$row_cont[id]'),'_blank','dependent=yes,width=600,height=380,scrollbars=yes,status=yes'); return false;" options="edit"/>
<buttononly label="Add sub" id="add[$row_cont[id]]" onclick="window.open(egw::link('/index.php','menuaction=$cont[edit_link]&amp;parent=$row_cont[id]&amp;appname=$cont[appname]'),'_blank','dependent=yes,width=600,height=380,scrollbars=yes,status=yes'); return false;" options="new"/>
<buttononly statustext="Delete this category" label="Delete" id="delete[$row_cont[id]]" onclick="document.getElementById('exec[delete][cat_id]').value='$row_cont[id]'; set_style_by_class('tr','confirmSubs','visibility','$row_cont[children]'?'visible':'collapse'); set_style_by_class('fieldset','confirmDelete','display','block'); return false;" options="delete" class="leftPad5"/>
</hbox>
</row>
</rows>
</grid>
</template>
<template id="admin.categories.delete" template="" lang="" group="0" version="1.7.001">
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox class="confirmDelete">
<caption label="Delete this category"/>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row height="30">
<description span="all" value="Are you sure you want to delete this category ?" align="center"/>
</row>
<row class="confirmSubs">
<checkbox label="Do you also want to delete all global subcategories ?" id="delete[subs]" span="all" align="center"/>
</row>
<row height="40">
<button label="Delete" id="delete[delete]" align="center"/>
<buttononly label="Cancel" id="delete[cancel]" align="center" onclick="set_style_by_class('fieldset','confirmDelete','display','none');"/>
</row>
</rows>
</grid>
</groupbox>
</row>
</rows>
</grid>
<textbox id="delete[cat_id]" class="hiddenCatid"/>
<styles>
.confirmDelete {
position: absolute;
left: 120px;
top: 80px;
background-color: white;
display: none;
border: 2px solid black;
}
.hiddenCatid {
display: none;
}
.confirmSubs
{
}
</styles>
</template>
<template id="admin.categories.index" template="" lang="" group="0" version="1.7.001">
<template id="admin.categories.index" template="" lang="" group="0" version="1.9.001">
<grid width="100%">
<columns>
<column/>
</columns>
<rows>
<row disabled="!@msg">
<description id="msg" align="center" span="all" class="redItalic"/>
<description align="center" id="msg" span="all" class="redItalic"/>
</row>
<row>
<nextmatch options="admin.categories.index.rows" id="nm"/>
<nextmatch id="nm" options="admin.categories.index.rows"/>
</row>
<row>
<buttononly label="Add" id="add" onclick="window.open(egw::link('/index.php','menuaction=admin.admin_categories.edit&amp;appname={$cont[nm][appname]}'),'_blank','dependent=yes,width=600,height=300,scrollbars=yes,status=yes'); return false;"/>
<buttononly label="Add" id="add" onclick="window.open(egw::link('/index.php','menuaction=$cont[add_link]&amp;cat_id=&amp;appname=$cont[nm][appname]'),'_blank','dependent=yes,width=600,height=380,scrollbars=yes,status=yes'); return false;"/>
</row>
</rows>
</grid>
<template id="admin.categories.delete"/>
<styles>.level0 { font-weight: bold; }</styles>
<box class="action_popup" id="delete_popup">
<vbox class="prompt">
<description value="Delete" class="promptheader"/>
<description value="Delete selected entries?" id="delete_prompt"/>
<hbox>
<button label="Yes - Delete" id="delete" onclick="nm_submit_popup(this); return false;"/>
<button label="Yes - Delete including sub-entries" id="delete_sub" onclick="nm_popup_action.id = 'delete_sub'; nm_submit_popup(this); return false;"/>
<buttononly label="No - Cancel" onclick="nm_hide_popup(this,'delete_popup');"/>
</hbox>
</vbox>
</box>
<styles>
.level0 { font-weight: bold; }
.action_popup {
position: fixed;
top: 200px;
left: 450px;
width: 76ex;
z-index: 20000;
display: none;
border-collapse:collapse;
border-spacing:0px
}
.action_popup-content {
display:block;
padding:2ex;
color:#666666;
margin: -2px -1px 0px -2px;
}
.action_popup &gt; table {
width: 100%
}
.action_popup .promptheader {
padding: 1ex;
width: 100%
}
.action_select {
width: 100%
}
</styles>
</template>
</overlay>

View File

@ -0,0 +1,34 @@
<?php
/**
* Preferences UI for regular users
*
* @link http://www.egroupware.org
* @author Nathan Gray
* @package preferences
* @copyright (c) 2011 Nathan Gray
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/**
* Preference UI extends Admin class to give regular users restricted
* access to modify categories
*/
class preferences_categories_ui extends admin_categories {
protected $appname = 'preferences';
protected $get_rows = 'preferences_categories_ui::get_rows';
protected $list_link = 'preferences.preferences_categories_ui.index';
protected $edit_link = 'preferences.preferences_categories_ui.edit';
protected $add_link = 'preferences.preferences_categories_ui.edit';
function __construct() {
}
public static function get_rows(&$query, &$rows, &$readonlys) {
$count = parent::get_rows($query, $rows, $readonlys);
$rows['edit_link'] = 'preferences.preferences_categories_ui.edit';
return $count;
}
}
?>

View File

@ -107,6 +107,8 @@
function index()
{
$cats = new preferences_categories_ui();
return $cats->index();
$cats_app = get_var('cats_app',array('GET','POST'));
$extra = get_var('extra',array('GET','POST'));
$global_cats = get_var('global_cats',array('GET','POST'));