Author: nathangray
New Revision: 55922
URL: http://svn.stylite.de/viewvc/egroupware?rev=55922&view=rev
Log:
Add ignore context menu action for element list
Modified:
trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php
trunk/projectmanager/js/app.js
trunk/projectmanager/lang/egw_en.lang
— trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php Thu Apr 28 19:02:35 2016
@@ -788,6 +788,14 @@
‘group’ => $group,
‘disableClass’ => ‘rowNoEdit’,
-
),
-
'ignore' => array(
-
'caption' => 'Ignore that entry',
-
'group' => $group,
-
'disableClass' => 'rowNoEdit',
-
'checkbox' => true,
-
'isChecked' => 'javaScript:app.projectmanager.is_ignored',
-
'onExecute' => 'javaScript:app.projectmanager.ignore_action'
),
'timesheet' => array(
'icon' => 'timesheet/navbar',
@@ -1066,6 +1074,7 @@
}
if (substr($action,0,4) == ‘cat_’) list($action,$cat_id) = explode(’’,$action);
if (substr($action,0,6) == 'erole’) list($action,$erole) = explode(’_’,$action);
-
if (substr($action,0,7) == 'ignore_') list($action,$ignore) = explode('_',$action);
switch($action)
{
@@ -1128,6 +1137,23 @@
$msg = lang(’%1 element(s) updated’,count($checked));
}
}
-
break;
-
case 'ignore':
-
$success = $failed = 0;
-
foreach($checked as $id)
-
{
-
$element = $this->read($id);
-
if(!$this->save(array('pe_status' => $ignore ? 'ignore' : 'new')))
-
{
-
$success++;
-
}
-
else
-
{
-
$failed++;
-
}
-
}
-
$msg = lang('%1 element(s) updated',$success);
-
return $failed==0;
break;
case 'delete':
if (!$this->project->check_acl(EGW_ACL_ADD))
@@ -1221,6 +1247,44 @@
return false;
}
+/**
-
- Run given action on given path(es) and return array/object with values for keys ‘msg’, ‘errs’, ‘dirs’, ‘files’
-
-
-
@param string $action eg. ‘delete’, …
-
-
@param array $selected selected path(s)
-
-
@param string $data Action specific data
-
-
*/
-
public static function ajax_action($action, $selected, $data = array())
-
{
-
-
$response = EGroupware\Api\Json\Response::get();
-
-
switch($action)
-
{
-
case 'ignore':
-
$ui = new projectmanager_elements_ui();
-
$checked = [];
-
foreach($selected as $entry)
-
{
-
list($prefix,$checked[]) = explode('::',$entry);
-
}
-
$msg = '';
-
if($ui->action('ignore_'.(!!$data),$checked,$msg, $add_existing))
-
{
-
// We could just update the selected rows here, but this is easier and gets
-
// the totals too
-
$response->call('egw.refresh',$msg,'projectmanager');
-
}
-
else
-
{
-
$response->error($msg);
-
}
-
break;
-
}
-
-
//error_log(__METHOD__."('$action',".array2string($selected).') returning '.array2string($arr));
-
}
/**
- Download a document with inserted contact(s)
— trunk/projectmanager/js/app.js (original)
+++ trunk/projectmanager/js/app.js Thu Apr 28 19:02:35 2016
@@ -518,6 +518,13 @@
nm.refresh(_id,_type);
}
return false;
-
case 'elements':
-
var nm = this.views.elements.etemplate ? this.views.elements.etemplate.widgetContainer.getWidgetById('nm') : null
-
if(nm)
-
{
-
nm.refresh(_id,_type);
-
}
-
return false;
case 'gantt':
var ids = [];
var gantt = this.views.gantt.etemplate.widgetContainer.getWidgetById('gantt');
@@ -874,6 +881,40 @@
},
/**
-
- Is the selected entry ignored?
- */
- is_ignored: function(action, selected)
- {
-
var ignored = false;
-
-
for(var i = 0; i < selected.length; i++)
-
{
-
var data = egw.dataGetUIDdata(selected[i].id);
-
ignored = ignored || !!(data && data.data && data.data.ignored);
-
}
-
-
return ignored;
- },
-
- /**
-
- Toggle the ignore flag on the selected entries
-
-
-
@param {egwAction} action
-
-
@param {egwActionObject[]} selected
- */
- ignore_action: function(action, selected)
- {
-
var ids = [];
-
for(var i = 0; i < selected.length; i++)
-
{
-
ids.push(selected[i].id);
-
}
-
egw.json('projectmanager_elements_ui::ajax_action', [action.id, ids, action.checked],
-
false, this, true, this
-
).sendRequest(true);
- },
-
- /**
- Enabled check for project element action, used by context menu
-
-
@param {egwAction} action
— trunk/projectmanager/lang/egw_en.lang (original)
+++ trunk/projectmanager/lang/egw_en.lang Thu Apr 28 19:02:35 2016
@@ -197,7 +197,7 @@
if checked the datasources of the elements (eg. infolog entries) will change their status too. projectmanager en If checked the data sources of the elements, e.g. InfoLog entries, will change their status too.
if you see entities (eg. {) in the ganttchart, switch this off. projectmanager en If you see entities (eg. {) in the GanttChart, switch this off.
if you specify an export definition, it will be used when you export projectmanager en If you specify an export definition, it will be used when you export
-ignore that entry projectmanager en Ignore that entry
+ignore that entry projectmanager en Ignore entry
ignored projectmanager en Ignored.
import projectmanager en Import
imports a list of projects from a csv file. does not include project elements. projectmanager en Imports a list of projects from a CSV file. Does not include project elements.
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs