forked from extern/egroupware
- got delegation and link via context working
- fixed sometimes not working context, because row id was not set - disabling close and close all if not applicable
This commit is contained in:
parent
30b922f30e
commit
19cb4ca8d4
@ -166,12 +166,19 @@ class infolog_ui
|
|||||||
{
|
{
|
||||||
$info['class'] .= 'rowNoEdit ';
|
$info['class'] .= 'rowNoEdit ';
|
||||||
}
|
}
|
||||||
$readonlys["close[$id]"] = $done || ($readonlys["edit_status[$id]"] =
|
if (($readonlys["close[$id]"] = $done || ($readonlys["edit_status[$id]"] =
|
||||||
!($editrights || $isresposible));
|
!($editrights || $isresposible))))
|
||||||
$readonlys["close_all[$id]"] = ($done) || !$info['info_anz_subs'] || ($readonlys["edit_status[$id]"] =
|
{
|
||||||
!($editrights || $isresposible)); // this one is supressed, when you are not allowed to edit, or not responsible, or the entry is closed
|
$info['class'] .= 'rowNoClose ';
|
||||||
// and has no children. If you want that this one is shown if there are children regardless of the status of the current or its childs,
|
}
|
||||||
// then modify ($done) to ($done && !$info['info_anz_subs'])
|
// this one is supressed, when you are not allowed to edit, or not responsible, or the entry is closed
|
||||||
|
// and has no children. If you want that this one is shown if there are children regardless of the status of the current or its childs,
|
||||||
|
// then modify ($done) to ($done && !$info['info_anz_subs'])
|
||||||
|
if (($readonlys["close_all[$id]"] = ($done) || !$info['info_anz_subs'] || ($readonlys["edit_status[$id]"] =
|
||||||
|
!($editrights || $isresposible))))
|
||||||
|
{
|
||||||
|
$info['class'] .= 'rowNoCloseAll ';
|
||||||
|
}
|
||||||
$readonlys["edit_status[$id]"] = $readonlys["edit_percent[$id]"] =
|
$readonlys["edit_status[$id]"] = $readonlys["edit_percent[$id]"] =
|
||||||
!$editrights && !$isresposible &&
|
!$editrights && !$isresposible &&
|
||||||
!$this->bo->check_access($info,EGW_ACL_UNDELETE); // undelete is handled like status edit
|
!$this->bo->check_access($info,EGW_ACL_UNDELETE); // undelete is handled like status edit
|
||||||
@ -261,6 +268,7 @@ class infolog_ui
|
|||||||
unset($query['no_actions']);
|
unset($query['no_actions']);
|
||||||
egw_cache::setSession('infolog', $query['session_for'].'session_data', $query);
|
egw_cache::setSession('infolog', $query['session_for'].'session_data', $query);
|
||||||
$query['actions'] = $this->get_actions($query);
|
$query['actions'] = $this->get_actions($query);
|
||||||
|
$query['row_id'] = 'info_id';
|
||||||
}
|
}
|
||||||
$orginal_colfilter = $query['col_filter'];
|
$orginal_colfilter = $query['col_filter'];
|
||||||
if ($query['filter'] == 'bydate')
|
if ($query['filter'] == 'bydate')
|
||||||
@ -512,20 +520,13 @@ class infolog_ui
|
|||||||
if(in_array($multi_action, array('link', 'responsible')))
|
if(in_array($multi_action, array('link', 'responsible')))
|
||||||
{
|
{
|
||||||
$values['nm']['action'] .= '_' . key($values[$multi_action . '_action']);
|
$values['nm']['action'] .= '_' . key($values[$multi_action . '_action']);
|
||||||
}
|
|
||||||
// Action has a parameter - cat_id, percent, etc
|
|
||||||
if (in_array($multi_action, array('link', 'cat', 'completion', 'responsible')))
|
|
||||||
{
|
|
||||||
if(is_array($values[$multi_action]))
|
if(is_array($values[$multi_action]))
|
||||||
{
|
{
|
||||||
$values[$multi_action] = implode(',',$values[$multi_action]);
|
$values[$multi_action] = implode(',',$values[$multi_action]);
|
||||||
}
|
}
|
||||||
$values['nm']['action'] .= '_' . $values[$multi_action];
|
$values['nm']['action'] .= '_' . $values[$multi_action];
|
||||||
}
|
}
|
||||||
// Action changes views (sub / parent)
|
|
||||||
if (in_array($multi_action, array('sp'))) {
|
|
||||||
$values['nm']['action'] = 'view';
|
|
||||||
}
|
|
||||||
if ($this->action($values['nm']['action'], $values['nm']['selected'], $values['nm']['select_all'],
|
if ($this->action($values['nm']['action'], $values['nm']['selected'], $values['nm']['select_all'],
|
||||||
$success, $failed, $action_msg, $values['nm'], $msg, $values['nm']['checkboxes']['no_notifications']))
|
$success, $failed, $action_msg, $values['nm'], $msg, $values['nm']['checkboxes']['no_notifications']))
|
||||||
{
|
{
|
||||||
@ -567,7 +568,6 @@ class infolog_ui
|
|||||||
{
|
{
|
||||||
$values['nm']['order'] = 'info_datemodified';
|
$values['nm']['order'] = 'info_datemodified';
|
||||||
$values['nm']['sort'] = 'DESC';
|
$values['nm']['sort'] = 'DESC';
|
||||||
$values['nm']['row_id'] = 'info_id';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$values['nm']['session_for'] && $this->called_by) $values['nm']['session_for'] = $this->called_by;
|
if (!$values['nm']['session_for'] && $this->called_by) $values['nm']['session_for'] = $this->called_by;
|
||||||
@ -803,7 +803,7 @@ class infolog_ui
|
|||||||
'popup' => egw_link::get_registry('infolog', 'add_popup'),
|
'popup' => egw_link::get_registry('infolog', 'add_popup'),
|
||||||
'group' => $group=1,
|
'group' => $group=1,
|
||||||
),
|
),
|
||||||
'sp' => array(
|
'view' => array(
|
||||||
'caption' => 'View subs',
|
'caption' => 'View subs',
|
||||||
'icon' => 'view',
|
'icon' => 'view',
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
@ -905,6 +905,7 @@ class infolog_ui
|
|||||||
'caption' => 'Close',
|
'caption' => 'Close',
|
||||||
'icon' => 'done',
|
'icon' => 'done',
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
|
'disableClass' => 'rowNoClose',
|
||||||
),
|
),
|
||||||
'close_all' => array(
|
'close_all' => array(
|
||||||
'caption' => 'Close all',
|
'caption' => 'Close all',
|
||||||
@ -912,6 +913,7 @@ class infolog_ui
|
|||||||
'group' => $group,
|
'group' => $group,
|
||||||
'hint' => 'Sets the status of this entry and its subs to done',
|
'hint' => 'Sets the status of this entry and its subs to done',
|
||||||
'allowOnMultiple' => false,
|
'allowOnMultiple' => false,
|
||||||
|
'disableClass' => 'rowNoCloseAll',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
++$group; // integration with other apps
|
++$group; // integration with other apps
|
||||||
@ -971,7 +973,7 @@ class infolog_ui
|
|||||||
function action($action, $checked, $use_all, &$success, &$failed, &$action_msg,
|
function action($action, $checked, $use_all, &$success, &$failed, &$action_msg,
|
||||||
array $query, &$msg, $skip_notifications = false)
|
array $query, &$msg, $skip_notifications = false)
|
||||||
{
|
{
|
||||||
//echo "<p>infolog_ui::action('$action',".print_r($checked,true).','.(int)$use_all.",...)</p>\n";
|
//echo '<p>'.__METHOD__."('$action',".array2string($checked).','.(int)$use_all.",...)</p>\n";
|
||||||
$success = $failed = 0;
|
$success = $failed = 0;
|
||||||
if ($use_all)
|
if ($use_all)
|
||||||
{
|
{
|
||||||
@ -1052,7 +1054,6 @@ class infolog_ui
|
|||||||
// Fall through
|
// Fall through
|
||||||
|
|
||||||
case 'view':
|
case 'view':
|
||||||
// todo: implement or better move code from index to here
|
|
||||||
return $this->index(array(),'sp',$checked,0);
|
return $this->index(array(),'sp',$checked,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1116,7 +1117,8 @@ class infolog_ui
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'status':
|
case 'status':
|
||||||
if(in_array($settings, $this->bo->status[$entry['info_type']])) {
|
if(in_array($settings, $this->bo->status[$entry['info_type']]))
|
||||||
|
{
|
||||||
$action_msg = lang('changed status to %1', lang($this->bo->status[$entry['info_type']][$settings]));
|
$action_msg = lang('changed status to %1', lang($this->bo->status[$entry['info_type']][$settings]));
|
||||||
if($settings != 'done' && $entry['info_status'] == 'done' && $entry['info_percent'] == 100)
|
if($settings != 'done' && $entry['info_status'] == 'done' && $entry['info_percent'] == 100)
|
||||||
{
|
{
|
||||||
@ -1152,11 +1154,11 @@ class infolog_ui
|
|||||||
|
|
||||||
case 'responsible':
|
case 'responsible':
|
||||||
list($add_remove, $users) = explode('_', $settings, 2);
|
list($add_remove, $users) = explode('_', $settings, 2);
|
||||||
$action_msg = lang('changed responsible') . ' - ' . ($add_remove == 'add' ? lang('added') : lang('removed')) . ' ';
|
$action_msg = $add_remove == 'add' ? lang('added') : lang('removed') . ' ';
|
||||||
$users = explode(',', $users);
|
|
||||||
$names = array();
|
$names = array();
|
||||||
foreach($users as $account_id) {
|
foreach(explode(',', $users) as $account_id)
|
||||||
$names[] = common::display_fullname($GLOBALS['egw']->accounts->id2name($account_id));
|
{
|
||||||
|
$names[] = common::grab_owner_name($account_id);
|
||||||
}
|
}
|
||||||
$action_msg .= implode(', ', $names);
|
$action_msg .= implode(', ', $names);
|
||||||
$function = $add_remove == 'add' ? 'array_merge' : 'array_diff';
|
$function = $add_remove == 'add' ? 'array_merge' : 'array_diff';
|
||||||
|
@ -1,53 +1,53 @@
|
|||||||
/**
|
/**
|
||||||
* Javascript used on the infolog index page
|
* EGroupware infolog javascript code used on index page
|
||||||
|
*
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
|
* @package infolog
|
||||||
|
* @link http://www.egroupware.org
|
||||||
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var infolog_popup_action, infolog_popup_senders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Javascript handling for multiple entry actions
|
* Open popup for a certain action requiring further input
|
||||||
|
*
|
||||||
|
* @param _action
|
||||||
|
* @param _senders
|
||||||
*/
|
*/
|
||||||
function do_infolog_action(selbox) {
|
|
||||||
if(selbox.value == "") return;
|
|
||||||
var prefix = selbox.id.substring(0,selbox.id.indexOf('['));
|
|
||||||
var popup = document.getElementById(prefix + '[' + selbox.value + '_popup]');
|
|
||||||
if(popup) {
|
|
||||||
popup.style.display = 'block';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
selbox.form.submit();
|
|
||||||
selbox.value = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function open_popup(_action, _senders)
|
function open_popup(_action, _senders)
|
||||||
{
|
{
|
||||||
var prefix = 'exec';
|
var prefix = 'exec';
|
||||||
var popup = document.getElementById(prefix + '[' + _action.id + '_popup]');
|
var popup = document.getElementById(prefix + '[' + _action.id + '_popup]');
|
||||||
if(popup) {
|
|
||||||
|
if (popup) {
|
||||||
|
infolog_popup_action = _action;
|
||||||
|
infolog_popup_senders = _senders;
|
||||||
popup.style.display = 'block';
|
popup.style.display = 'block';
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide popup and clear values
|
* Submit a popup action
|
||||||
*/
|
*/
|
||||||
function hide_popup(element, div_id, submit) {
|
function submit_popup(button)
|
||||||
|
{
|
||||||
|
button.form.submit_button.value = button.name; // set name of button (sub-action)
|
||||||
|
|
||||||
|
// call regular nm_action to transmitt action and senders correct
|
||||||
|
nm_action(infolog_popup_action, infolog_popup_senders);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide popup
|
||||||
|
*/
|
||||||
|
function hide_popup(element, div_id)
|
||||||
|
{
|
||||||
var prefix = element.id.substring(0,element.id.indexOf('['));
|
var prefix = element.id.substring(0,element.id.indexOf('['));
|
||||||
var popup = document.getElementById(prefix+'['+div_id+']');
|
var popup = document.getElementById(prefix+'['+div_id+']');
|
||||||
|
|
||||||
// Get action command
|
|
||||||
var action = div_id.substring(0,div_id.length-6);
|
|
||||||
var action_input = document.getElementById('exec[nm][action]');
|
|
||||||
|
|
||||||
// Hide popup
|
// Hide popup
|
||||||
if(popup) {
|
if(popup) {
|
||||||
popup.style.display = 'none';
|
popup.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submit form
|
|
||||||
if(submit && action && action_input) {
|
|
||||||
// Set action so it comes back
|
|
||||||
action_input.value = action;
|
|
||||||
element.form.submit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -2,15 +2,15 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<overlay>
|
<overlay>
|
||||||
<template id="infolog.index.header_left" template="" lang="" group="0" version="1.0.1.001">
|
<template id="infolog.index.header_left" template="" lang="" group="0" version="1.0.1.001">
|
||||||
<description value="InfoLog" class="headertext bold"/>
|
<description class="headertext bold" value="InfoLog"/>
|
||||||
<styles>.bold { font-weight: bold; }</styles>
|
<styles>.bold { font-weight: bold; }</styles>
|
||||||
</template>
|
</template>
|
||||||
<template id="infolog.index.header_right" template="" lang="" group="0" version="1.7.001">
|
<template id="infolog.index.header_right" template="" lang="" group="0" version="1.7.001">
|
||||||
<hbox>
|
<hbox>
|
||||||
<description value="Add:" class="headertext"/>
|
<description class="headertext" value="Add:"/>
|
||||||
<button label="ToDo" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&type=task&action=$cont[action]&action_id=$cont[action_id]&cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;" id="add[task]" image="task" statustext="Add a new ToDo"/>
|
<button image="task" label="ToDo" id="add[task]" statustext="Add a new ToDo" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&type=task&action=$cont[action]&action_id=$cont[action_id]&cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
|
||||||
<button label="Phonecall" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&type=phone&action=$cont[action]&action_id=$cont[action_id]&cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;" id="add[phone]" image="phone" statustext="Add a new Phonecall"/>
|
<button image="phone" label="Phonecall" id="add[phone]" statustext="Add a new Phonecall" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&type=phone&action=$cont[action]&action_id=$cont[action_id]&cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
|
||||||
<button label="Note" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&type=note&action=$cont[action]&action_id=$cont[action_id]&cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;" id="add[note]" image="note" statustext="Add a new Note"/>
|
<button image="note" label="Note" id="add[note]" statustext="Add a new Note" onclick="window.open(egw::link('/index.php','menuaction=infolog.infolog_ui.edit&type=note&action=$cont[action]&action_id=$cont[action_id]&cat_id=$cont[cat_id]'),'_blank','dependent=yes,width=750,height=600,scrollbars=yes,status=yes'); return false;"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</template>
|
</template>
|
||||||
<template id="infolog.index.rows" template="" lang="" group="0" version="1.9.002">
|
<template id="infolog.index.rows" template="" lang="" group="0" version="1.9.002">
|
||||||
@ -206,8 +206,8 @@
|
|||||||
<description value="Select users or groups"/>
|
<description value="Select users or groups"/>
|
||||||
<listbox type="select-account" class="action_popup-content" id="responsible" rows="5" options="both"/>
|
<listbox type="select-account" class="action_popup-content" id="responsible" rows="5" options="both"/>
|
||||||
<hbox>
|
<hbox>
|
||||||
<button label="Add" id="responsible_action[add]"/>
|
<button label="Add" id="responsible_action[add]" onclick="submit_popup(this); return false;"/>
|
||||||
<button id="responsible_action[delete]" label="Delete"/>
|
<button id="responsible_action[delete]" label="Delete" onclick="submit_popup(this); return false;"/>
|
||||||
<buttononly label="Cancel" onclick="hide_popup(this,'responsible_popup');"/>
|
<buttononly label="Cancel" onclick="hide_popup(this,'responsible_popup');"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</vbox>
|
</vbox>
|
||||||
@ -217,8 +217,8 @@
|
|||||||
<description class="promptheader" value="Add / Remove link"/>
|
<description class="promptheader" value="Add / Remove link"/>
|
||||||
<link-entry id="link" class="action_popup-content"/>
|
<link-entry id="link" class="action_popup-content"/>
|
||||||
<hbox>
|
<hbox>
|
||||||
<button label="Add" id="link_action[add]"/>
|
<button label="Add" id="link_action[add]" onclick="submit_popup(this); return false;"/>
|
||||||
<button id="link_action[delete]" label="Delete"/>
|
<button id="link_action[delete]" label="Delete" onclick="submit_popup(this); return false;"/>
|
||||||
<buttononly label="Cancel" onclick="hide_popup(this,'link_popup');"/>
|
<buttononly label="Cancel" onclick="hide_popup(this,'link_popup');"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
Loading…
Reference in New Issue
Block a user