implement some >mark all messages in folder as read< action

This commit is contained in:
Klaus Leithoff 2014-08-14 15:39:05 +00:00
parent d84b700517
commit 0f498492b4
4 changed files with 25 additions and 4 deletions

View File

@ -1393,6 +1393,14 @@ class mail_ui
'shortcut' => egw_keymanager::shortcut(egw_keymanager::U, true, true), 'shortcut' => egw_keymanager::shortcut(egw_keymanager::U, true, true),
), ),
'readall' => array(
'group' => ++$group,
'caption' => "<font color='#ff0000'>".lang('mark all as read')."</font>",
'icon' => 'read_small',
'onExecute' => 'javaScript:app.mail.mail_flag',
'hint' => 'mark all messages in folder as read',
'toolbarDefault' => false
),
'undelete' => array( 'undelete' => array(
'group' => $group, 'group' => $group,
'caption' => 'Undelete', 'caption' => 'Undelete',
@ -4272,7 +4280,7 @@ class mail_ui
if ($_sendJsonResponse) if ($_sendJsonResponse)
{ {
$response = egw_json_response::get(); $response = egw_json_response::get();
if ($query['filter'] && ($flag2check==$query['filter'] || stripos($query['filter'],$flag2check)!==false)) if ((isset($_messageList['all']) && $_messageList['all']) || ($query['filter'] && ($flag2check==$query['filter'] || stripos($query['filter'],$flag2check)!==false)))
{ {
$response->call('egw.refresh',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang($_flag),$folder),'mail'); $response->call('egw.refresh',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang($_flag),$folder),'mail');
} }

View File

@ -1616,7 +1616,7 @@ app.classes.mail = AppJS.extend(
var obj_manager = egw_getObjectManager(this.appname).getObjectById(this.nm_index); var obj_manager = egw_getObjectManager(this.appname).getObjectById(this.nm_index);
var that = this; var that = this;
var rvMain = false; var rvMain = false;
if (obj_manager && _elems.length>1 && obj_manager.getAllSelected()) if ((obj_manager && _elems.length>1 && obj_manager.getAllSelected()) || _action.id=='readall')
{ {
if (_confirm) if (_confirm)
{ {
@ -1627,6 +1627,9 @@ app.classes.mail = AppJS.extend(
var messageToDisplay = ''; var messageToDisplay = '';
switch (_action.id) switch (_action.id)
{ {
case "readall":
messageToDisplay = this.egw.lang("Do you really want to mark ALL messages as read in the current folder?")+" ";
break;
case "unlabel": case "unlabel":
case "label1": case "label1":
case "label2": case "label2":
@ -1666,6 +1669,7 @@ app.classes.mail = AppJS.extend(
case "delete": case "delete":
that.mail_callDelete(_action, _elems,rv); that.mail_callDelete(_action, _elems,rv);
break; break;
case "readall":
case "unlabel": case "unlabel":
case "label1": case "label1":
case "label2": case "label2":
@ -1806,6 +1810,7 @@ app.classes.mail = AppJS.extend(
var classToProcess = _action.id; var classToProcess = _action.id;
if (_action.id=='read') classToProcess='seen'; if (_action.id=='read') classToProcess='seen';
else if (_action.id=='readall') classToProcess='seen';
else if (_action.id=='label1') classToProcess='labelone'; else if (_action.id=='label1') classToProcess='labelone';
else if (_action.id=='label2') classToProcess='labeltwo'; else if (_action.id=='label2') classToProcess='labeltwo';
else if (_action.id=='label3') classToProcess='labelthree'; else if (_action.id=='label3') classToProcess='labelthree';
@ -1817,7 +1822,7 @@ app.classes.mail = AppJS.extend(
msg = this.mail_getFormData(_elems); msg = this.mail_getFormData(_elems);
msg['all'] = _allMessagesChecked; msg['all'] = _allMessagesChecked;
if (msg['all']=='cancel') return false; if (msg['all']=='cancel') return false;
msg['activeFilters'] = this.mail_getActiveFilters(_action); msg['activeFilters'] = (_action.id=='readall'?false:this.mail_getActiveFilters(_action));
if (_action.id.substring(0,2)=='un') { if (_action.id.substring(0,2)=='un') {
//old style, only available for undelete and unlabel (no toggle) //old style, only available for undelete and unlabel (no toggle)
if ( _action.id=='unlabel') // this means all labels should be removed if ( _action.id=='unlabel') // this means all labels should be removed
@ -1833,6 +1838,10 @@ app.classes.mail = AppJS.extend(
this.mail_flagMessages(_action.id,msg,(do_nmactions?false:true)); this.mail_flagMessages(_action.id,msg,(do_nmactions?false:true));
} }
} }
else if (_action.id=='readall')
{
this.mail_flagMessages('read',msg,(do_nmactions?false:true));
}
else else
{ {
var msg_set = {msg:[]}; var msg_set = {msg:[]};
@ -1901,7 +1910,7 @@ app.classes.mail = AppJS.extend(
} }
// only refresh counter. not grid as the ajaxmethod is called asyncronously // only refresh counter. not grid as the ajaxmethod is called asyncronously
// on flagging, only seen/unseen has effect on counterdisplay // on flagging, only seen/unseen has effect on counterdisplay
if (_action.id=='read') this.mail_refreshFolderStatus(_folder,'thisfolderonly',false,true); if (_action.id=='read' || _action.id=='readall') this.mail_refreshFolderStatus(_folder,'thisfolderonly',false,true);
//this.mail_refreshFolderStatus(); //this.mail_refreshFolderStatus();
}, },

View File

@ -95,6 +95,7 @@ displaying plain messages is disabled mail de Die Anzeige von reinen Text E-Mail
do not auto create folders mail de Automatische Ordnererstellung verhindern für do not auto create folders mail de Automatische Ordnererstellung verhindern für
do you really want to apply %1 to all messages in the current view? mail de Wollen Sie wirklich %1 auf alle Nachrichten in der aktuellen Ansicht anwenden? do you really want to apply %1 to all messages in the current view? mail de Wollen Sie wirklich %1 auf alle Nachrichten in der aktuellen Ansicht anwenden?
do you really want to delete folder %1 ? mail de Wollen Sie den Ordner %1 wirklich löschen? do you really want to delete folder %1 ? mail de Wollen Sie den Ordner %1 wirklich löschen?
do you really want to mark ALL messages as read in the current folder? mail de Wollen Sie wirklich alle eMails im aktuellen Ordner als gelesen markieren?
do you really want to toggle flag %1 for all messages in current view? mail de Wollen Sie wirklich den Wert für %1 für alle Nachrichten in der aktuellen Ansicht umschalten? do you really want to toggle flag %1 for all messages in current view? mail de Wollen Sie wirklich den Wert für %1 für alle Nachrichten in der aktuellen Ansicht umschalten?
do you want to be asked for confirmation before attaching selected messages to new mail? mail de Möchten Sie vor dem Anhängen von einer oder mehreren (ausgewählten) E-Mails an eine neue E-Mail gefragt werden? do you want to be asked for confirmation before attaching selected messages to new mail? mail de Möchten Sie vor dem Anhängen von einer oder mehreren (ausgewählten) E-Mails an eine neue E-Mail gefragt werden?
do you want to be asked for confirmation before moving selected messages to another folder? mail de Möchten Sie vor dem Verschieben von E-Mails in andere Ordner gefragt werden? do you want to be asked for confirmation before moving selected messages to another folder? mail de Möchten Sie vor dem Verschieben von E-Mails in andere Ordner gefragt werden?
@ -233,6 +234,7 @@ mail source mail de Nachrichtenquelltext anzeigen
mail-address mail de Mail-Adresse mail-address mail de Mail-Adresse
mailaccount mail de Mailkonto mailaccount mail de Mailkonto
mailinglist mail de Mailingliste mailinglist mail de Mailingliste
mark all as read mail de alle als Gelesen markieren
mark as deleted mail de als gelöscht markieren mark as deleted mail de als gelöscht markieren
match: mail de Übereinstimmung: match: mail de Übereinstimmung:
matches mail de stimmt überein (*, ? erlaubt) matches mail de stimmt überein (*, ? erlaubt)

View File

@ -95,6 +95,7 @@ displaying plain messages is disabled mail en displaying plain messages is disab
do not auto create folders mail en do not auto create folders do not auto create folders mail en do not auto create folders
do you really want to apply %1 to all messages in the current view? mail en Do you really want to apply %1 to ALL messages in the current view? do you really want to apply %1 to all messages in the current view? mail en Do you really want to apply %1 to ALL messages in the current view?
do you really want to delete folder %1 ? mail en Do you really want to DELETE Folder %1 ? do you really want to delete folder %1 ? mail en Do you really want to DELETE Folder %1 ?
do you really want to mark ALL messages as read in the current folder? mail en Do you really want to mark ALL messages as read in the current folder?
do you really want to toggle flag %1 for all messages in current view? mail en Do you really want to toggle flag %1 for ALL messages in current view? do you really want to toggle flag %1 for all messages in current view? mail en Do you really want to toggle flag %1 for ALL messages in current view?
do you want to be asked for confirmation before attaching selected messages to new mail? mail en Do you want to be asked for confirmation before attaching selected messages to new mail? do you want to be asked for confirmation before attaching selected messages to new mail? mail en Do you want to be asked for confirmation before attaching selected messages to new mail?
do you want to be asked for confirmation before moving selected messages to another folder? mail en Do you want to be asked for confirmation before moving selected messages to another folder? do you want to be asked for confirmation before moving selected messages to another folder? mail en Do you want to be asked for confirmation before moving selected messages to another folder?
@ -233,6 +234,7 @@ mail source mail en Mail Source
mail-address mail en Mail-Address mail-address mail en Mail-Address
mailaccount mail en Mailaccount mailaccount mail en Mailaccount
mailinglist mail en Mailinglist mailinglist mail en Mailinglist
mark all as read mail en mark all as read
mark as deleted mail en mark as deleted mark as deleted mail en mark as deleted
match: mail en Match: match: mail en Match:
matches mail en matches matches mail en matches