switch filter (all|global|own) and access column off for all global categories

This commit is contained in:
Ralf Becker 2012-02-15 10:25:41 +00:00
parent 0d5d839b30
commit 0b3f4a04f0
3 changed files with 9 additions and 4 deletions

View File

@ -369,6 +369,9 @@ class admin_categories
$rows['appname'] = $query['appname'];
$rows['edit_link'] = $this->edit_link;
// disable access column for global categories
if ($GLOBALS['egw_info']['flags']['currentapp'] == 'admin') $rows['no_access'] = true;
$GLOBALS['egw_info']['flags']['app_header'] = lang($this->appname).' - '.lang('categories').
($query['appname'] != categories::GLOBAL_APPNAME ? ': '.lang($query['appname']) : '');
@ -384,6 +387,7 @@ class admin_categories
public function index(array $content=null,$msg='')
{
//_debug_array($_GET);
if ($this->appname != 'admin') translation::add_app('admin'); // need admin translations
if(!isset($content))
{
@ -403,7 +407,6 @@ class admin_categories
{
$content['nm'] = array(
'get_rows' => $this->get_rows, // I method/callback to request the data for the rows eg. 'notes.bo.get_rows'
'no_filter' => ($appname == categories::GLOBAL_APPNAME),// Can't have personal categories in global
'options-filter' => array(
'' => lang('All categories'),
categories::GLOBAL_ACCOUNT => lang('Global categories'),
@ -432,6 +435,8 @@ class admin_categories
}
$content['nm']['appname'] = $appname = $_GET['appname'] ? $_GET['appname'] : $appname;
$content['nm']['actions'] = $this->get_actions($appname);
// switch filter off for application global cats too, not only for super-global ones
$content['nm']['no_filter'] = $GLOBALS['egw_info']['flags']['currentapp'] == 'admin';
$content['nm']['global_cats'] = true;
if (isset($_GET['global_cats']) && empty($_GET['global_cats'] ))

View File

@ -2,7 +2,7 @@
/**
* EGroupware - eTemplates for Application admin
* http://www.egroupware.org
* generated by soetemplate::dump4setup() 2012-02-15 10:30
* generated by soetemplate::dump4setup() 2012-02-15 11:24
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package admin
@ -69,7 +69,7 @@ $templ_data[] = array('name' => 'admin.categories.index','template' => '','lang'
width: 100%
}','modified' => '1310572522',);
$templ_data[] = array('name' => 'admin.categories.index.rows','template' => '','lang' => '','group' => '0','version' => '1.9.002','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:30:"$row_cont[id] $row_cont[class]";s:1:"I";s:2:"30";s:1:"J";s:2:"1%";s:1:"G";s:2:"80";s:1:"F";s:2:"40";}i:1;a:10:{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:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"name";s:3:"app";s:5:"label";s:11:"Application";s:4:"size";s:1:",";}s:1:"D";a:4:{s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:5:"Owner";s:4:"name";s:5:"owner";s:4:"size";s:8:"all,both";}s:1:"E";a:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"size";s:3:"All";s:4:"name";s:6:"access";s:5:"label";s:7:"Private";}s:1:"F";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:"G";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Color";s:4:"name";s:5:"color";}s:1:"H";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Modified";s:4:"name";s:8:"last_mod";}s:1:"I";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:"J";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:10:{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:6:"select";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:5:{s:4:"type";s:8:"checkbox";s:4:"size";s:14:"private,public";s:5:"align";s:6:"center";s:4:"name";s:14:"${row}[access]";s:8:"readonly";s:1:"1";}s:1:"F";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:"G";a:2:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[data][color]";}s:1:"H";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:"I";a:3:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[subs]";s:5:"align";s:6:"center";}s:1:"J";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:199:"window.open(egw::link(\'/index.php\',\'menuaction={$cont[edit_link]}&cat_id=$row_cont[id]&appname=$cont[appname]\'),\'_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:10;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.categories.index.rows','template' => '','lang' => '','group' => '0','version' => '1.9.002','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:7:{s:2:"c1";s:2:"th";s:2:"c2";s:30:"$row_cont[id] $row_cont[class]";s:1:"I";s:2:"30";s:1:"J";s:2:"1%";s:1:"G";s:2:"80";s:1:"F";s:2:"40";s:1:"E";s:11:",@no_access";}i:1;a:10:{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:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"name";s:3:"app";s:5:"label";s:11:"Application";s:4:"size";s:1:",";}s:1:"D";a:4:{s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:5:"Owner";s:4:"name";s:5:"owner";s:4:"size";s:8:"all,both";}s:1:"E";a:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"size";s:3:"All";s:4:"name";s:6:"access";s:5:"label";s:7:"Private";}s:1:"F";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:"G";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Color";s:4:"name";s:5:"color";}s:1:"H";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Modified";s:4:"name";s:8:"last_mod";}s:1:"I";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:"J";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:10:{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:6:"select";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:5:{s:4:"type";s:8:"checkbox";s:4:"size";s:14:"private,public";s:5:"align";s:6:"center";s:4:"name";s:14:"${row}[access]";s:8:"readonly";s:1:"1";}s:1:"F";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:"G";a:2:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[data][color]";}s:1:"H";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:"I";a:3:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[subs]";s:5:"align";s:6:"center";}s:1:"J";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:199:"window.open(egw::link(\'/index.php\',\'menuaction={$cont[edit_link]}&cat_id=$row_cont[id]&appname=$cont[appname]\'),\'_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:10;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

@ -8,7 +8,7 @@
<column/>
<column/>
<column/>
<column/>
<column disabled="@no_access"/>
<column width="40"/>
<column width="80"/>
<column/>