fix not working timesheet status and category actions: "disableClass", "enableClass" and "enableId" are now handled by action system itself, one should not set an explicit "enabled" attribute anymore

This commit is contained in:
Ralf Becker 2013-08-26 08:24:50 +00:00
parent 0ae2ebad94
commit 0de6ab1b35
3 changed files with 5 additions and 19 deletions

View File

@ -576,9 +576,9 @@ class nextmatch_widget
* - string 'iconUrl' full url of icon, better use 'icon'
* - boolean|string 'allowOnMultiple' should action be shown if multiple lines are marked, or string 'only', default true!
* - boolean|string 'enabled' is action available, or string with javascript function to call, default true!
* - string 'disableClass' class name to use with enabled='javaScript:nm_not_disableClass'
* - string 'disableClass' class name to disable an action
* (add that css class in get_rows(), if row lacks rights for an action)
* - boolena 'hideOnDisabled' hide disabled actions, default false
* - boolean 'hideOnDisabled' hide disabled actions, default false
* - string 'type' type of action, default 'popup' for contenxt menus, 'drag' or 'drop'
* - boolean 'default' is that action the default action, default false
* - array 'children' array with actions of submenu
@ -669,19 +669,6 @@ class nextmatch_widget
}
$action['id'] = $prefix.$id;
// set certain enable functions
foreach(array(
'enableClass' => 'javaScript:nm_enableClass',
'disableClass' => 'javaScript:nm_not_disableClass',
'enableId' => 'javaScript:nm_enableId',
) as $attr => $check)
{
if (isset($action[$attr]) && !isset($action['enabled']))
{
$action['enabled'] = $check;
}
}
// add all first level popup actions plus ones with enabled = 'javaScript:...' to action_links
if ((!isset($action['type']) || in_array($action['type'],array('popup','drag'))) && // popup is the default
($first_level || substr($action['enabled'],0,11) == 'javaScript:'))

View File

@ -370,8 +370,8 @@ egwAction.prototype.updateActions = function(_actions, _app)
if (typeof elem.confirm != "undefined") elem.confirm = egw.lang(elem.confirm);
if (typeof elem.confirm_multiple != "undefined") elem.confirm_multiple = egw.lang(elem.confirm_multiple);
// set certain enabled functions
if (typeof elem.enabled == "undefined")
// set certain enabled functions (if enabled is on it's default of true)
if (elem.enabled === true)
{
if (typeof elem.enableClass != "undefined")
{

View File

@ -957,7 +957,7 @@ class timesheet_ui extends timesheet_bo
'hint' => 'Apply the action on the whole query, NOT only the shown timesheets!!!',
'group' => ++$group,
),
'cat' => nextmatch_widget::category_action(
'cat' => etemplate_widget_nextmatch::category_action(
'timesheet',++$group,'Change category','cat_'
),
'status' => array(
@ -1013,7 +1013,6 @@ class timesheet_ui extends timesheet_bo
{
if ($actions[$action]['enabled'])
{
$actions[$action]['enabled'] = 'javaScript:nm_not_disableClass'; // required!
$actions[$action]['disableClass'] = 'rowNoEdit';
}
}