From d654437a54f07a878e4d3774a864afd29d7a933e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 30 Jun 2011 17:35:52 +0000 Subject: [PATCH] - allow confirmation only for multiple selected - confirm, confirm_multiple and allowOnMultiple get now inherited by children (@Andreas: allowOnMultiple does NOT work on children for some reason) - add confirmation for more then one receipient in mail merge - translations for etemplate part --- etemplate/inc/class.bo_merge.inc.php | 16 +++++++++++++++- etemplate/inc/class.nextmatch_widget.inc.php | 2 +- etemplate/js/nextmatch_action.js | 5 +++++ etemplate/lang/egw_de.lang | 3 +++ etemplate/lang/egw_en.lang | 3 +++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index a5d33e2e11..577e862699 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -804,7 +804,7 @@ abstract class bo_merge $retString = ''; if (count($msgs['success'])>0) $retString .= count($msgs['success']).' '.lang('Message(s) send ok.');//implode('
',$msgs['success']); //if (strlen($retString)>0) $retString .= '
'; - if (count($msgs['failed'])>0) $retString .= count($msgs['failed']).' '.lang('Message(s) send failed.').'=>'.implode(', ',$msgs['failed']); + if (count($msgs['failed'])>0) $retString .= count($msgs['failed']).' '.lang('Message(s) send failed!').'=>'.implode(', ',$msgs['failed']); return $retString; break; case 'application/vnd.oasis.opendocument.text': @@ -1025,6 +1025,13 @@ abstract class bo_merge 'group' => 2, 'children' => array(), ); + if ($file['mime'] == 'message/rfc822') + { + // does not work on children for some reason, now handled in felamimail_bo::importMessageToMergeAndSend + //$documents[$file['mime']]['allowOnMultiple'] = $GLOBALS['egw_info']['flags']['currentapp'] == 'addressbook'; + // only need confirmation for multiple receipients for addressbook, as for others we can't do it anyway + if ($GLOBALS['egw_info']['flags']['currentapp'] == 'addressbook') $documents[$file['mime']]['confirm_multiple'] = lang('Do you want to send the message to all selected entries, WITHOUT further editing?'); + } } $documents[$file['mime']]['children'][$prefix.$file['name']] = egw_vfs::decodePath($file['name']); } @@ -1035,6 +1042,13 @@ abstract class bo_merge 'caption' => egw_vfs::decodePath($file['name']), 'group' => 2, ); + if ($file['mime'] == 'message/rfc822') + { + // does not work on children for some reason, now handled in felamimail_bo::importMessageToMergeAndSend + //$documents[$file['mime']]['allowOnMultiple'] = $GLOBALS['egw_info']['flags']['currentapp'] == 'addressbook'; + // only need confirmation for multiple receipients for addressbook, as for others we can't do it anyway + if ($GLOBALS['egw_info']['flags']['currentapp'] == 'addressbook') $documents[$prefix.$file['name']]['confirm_multiple'] = lang('Do you want to send the message to all selected entries, WITHOUT further editing?'); + } } } return array( diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index e405136a62..0201b297b5 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -704,7 +704,7 @@ class nextmatch_widget // add sub-menues if ($action['children']) { - static $inherit_attrs = array('url','popup','nm_action','onExecute','type','egw_open'); + static $inherit_attrs = array('url','popup','nm_action','onExecute','type','egw_open','allowOnMultiple','confirm','confirm_multiple'); $action['children'] = self::egw_actions($action['children'], $template_name, $action['prefix'], $action_links, $max_length, array_intersect_key($action, array_flip($inherit_attrs))); diff --git a/etemplate/js/nextmatch_action.js b/etemplate/js/nextmatch_action.js index f24f1cc3c1..6183e8e48f 100644 --- a/etemplate/js/nextmatch_action.js +++ b/etemplate/js/nextmatch_action.js @@ -141,6 +141,11 @@ function nm_action(_action, _senders) { if (!confirm(confirm_msg)) return; } + // in case we only need to confirm multiple selected (only _action.data.confirm_multiple) + else if (typeof _action.data.confirm_multiple != 'undefined' && (_senders.length > 1 || select_all && select_all.checked)) + { + if (!confirm(_action.data.confirm_multiple)) return; + } var url = '#'; if (typeof _action.data.url != 'undefined') diff --git a/etemplate/lang/egw_de.lang b/etemplate/lang/egw_de.lang index 563fa723a1..7ffeaa1560 100644 --- a/etemplate/lang/egw_de.lang +++ b/etemplate/lang/egw_de.lang @@ -129,6 +129,7 @@ displayed in front of input or input is inserted for a '%s' in the label (label displayed in statusline of browser if input-field gets focus etemplate de wird in der Statuszeile des Browsers angezeigt, wenn das Eingabefeld angesprochen wird displayed in the top line of the groupbox (legend) etemplate de wird oben in der Umrandung der Gruppierung angezeigt (Legende) do you want to save the changes you made in table %s? etemplate de Wollen Sie die Änderungen in der Tabelle '%s' speichern? +do you want to send the message to all selected entries, without further editing? etemplate de Wollen Sie die Nachricht an alle ausgewählten Einträge OHNE weitere Bearbeitung versenden? document '%1' does not exist or is not readable for you! etemplate de Das Dokument '%1' steht nicht zur Verfügung, oder ist für Sie nicht lesbar! documentation etemplate de Dokumentation doesn't matter etemplate de spielt keine Rolle @@ -245,6 +246,8 @@ linkto etemplate de VerknüpfungZu load this template into the editor etemplate de lädt diese Template zum Bearbeiten maximum size for uploads filemanager de Maximale Größe beim Hochladen message ... etemplate de Nachricht ... +message(s) send failed! etemplate de Senden der Nachricht(en) fehlgeschlagen! +message(s) send ok. etemplate de Nachricht(en) erfolgreich versandt. middle etemplate de Mittig minute etemplate de Minute minutes etemplate de Minuten diff --git a/etemplate/lang/egw_en.lang b/etemplate/lang/egw_en.lang index f9a4c2c9fd..0571b5cb48 100644 --- a/etemplate/lang/egw_en.lang +++ b/etemplate/lang/egw_en.lang @@ -129,6 +129,7 @@ displayed in front of input or input is inserted for a '%s' in the label (label displayed in statusline of browser if input-field gets focus etemplate en Displayed in status line of browser if input field gets focus. displayed in the top line of the groupbox (legend) etemplate en Displayed in the top line of the group box (legend). do you want to save the changes you made in table %s? etemplate en Do you want to save the changes you made in table %s? +do you want to send the message to all selected entries, without further editing? etemplate en Do you want to send the message to all selected entries, WITHOUT further editing? document '%1' does not exist or is not readable for you! etemplate en Document '%1' does not exist or is not readable for you! documentation etemplate en Documentation doesn't matter etemplate en Doesn't matter @@ -245,6 +246,8 @@ linkto etemplate en Link to load this template into the editor etemplate en Load template to the editor maximum size for uploads filemanager en Maximum upload size message ... etemplate en Message ... +message(s) send failed! etemplate en Message(s) send failed! +message(s) send ok. etemplate en Message(s) send ok. middle etemplate en Middle minute etemplate en Minute minutes etemplate en Minutes