From 0f498492b4e9df7b5f12733e844fb14926263f01 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 14 Aug 2014 15:39:05 +0000 Subject: [PATCH] implement some >mark all messages in folder as read< action --- mail/inc/class.mail_ui.inc.php | 10 +++++++++- mail/js/app.js | 15 ++++++++++++--- mail/lang/egw_de.lang | 2 ++ mail/lang/egw_en.lang | 2 ++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 5662aa637a..b90e613933 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -1393,6 +1393,14 @@ class mail_ui 'shortcut' => egw_keymanager::shortcut(egw_keymanager::U, true, true), ), + 'readall' => array( + 'group' => ++$group, + 'caption' => "".lang('mark all as read')."", + 'icon' => 'read_small', + 'onExecute' => 'javaScript:app.mail.mail_flag', + 'hint' => 'mark all messages in folder as read', + 'toolbarDefault' => false + ), 'undelete' => array( 'group' => $group, 'caption' => 'Undelete', @@ -4272,7 +4280,7 @@ class mail_ui if ($_sendJsonResponse) { $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'); } diff --git a/mail/js/app.js b/mail/js/app.js index 0150b5bb98..05f436136b 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -1616,7 +1616,7 @@ app.classes.mail = AppJS.extend( var obj_manager = egw_getObjectManager(this.appname).getObjectById(this.nm_index); var that = this; 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) { @@ -1627,6 +1627,9 @@ app.classes.mail = AppJS.extend( var messageToDisplay = ''; 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 "label1": case "label2": @@ -1666,6 +1669,7 @@ app.classes.mail = AppJS.extend( case "delete": that.mail_callDelete(_action, _elems,rv); break; + case "readall": case "unlabel": case "label1": case "label2": @@ -1806,6 +1810,7 @@ app.classes.mail = AppJS.extend( var classToProcess = _action.id; if (_action.id=='read') classToProcess='seen'; + else if (_action.id=='readall') classToProcess='seen'; else if (_action.id=='label1') classToProcess='labelone'; else if (_action.id=='label2') classToProcess='labeltwo'; else if (_action.id=='label3') classToProcess='labelthree'; @@ -1817,7 +1822,7 @@ app.classes.mail = AppJS.extend( msg = this.mail_getFormData(_elems); msg['all'] = _allMessagesChecked; 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') { //old style, only available for undelete and unlabel (no toggle) 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)); } } + else if (_action.id=='readall') + { + this.mail_flagMessages('read',msg,(do_nmactions?false:true)); + } else { var msg_set = {msg:[]}; @@ -1901,7 +1910,7 @@ app.classes.mail = AppJS.extend( } // only refresh counter. not grid as the ajaxmethod is called asyncronously // 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(); }, diff --git a/mail/lang/egw_de.lang b/mail/lang/egw_de.lang index cc4bcce89e..05ddc732be 100644 --- a/mail/lang/egw_de.lang +++ b/mail/lang/egw_de.lang @@ -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 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 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 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? @@ -233,6 +234,7 @@ mail source mail de Nachrichtenquelltext anzeigen mail-address mail de Mail-Adresse mailaccount mail de Mailkonto mailinglist mail de Mailingliste +mark all as read mail de alle als Gelesen markieren mark as deleted mail de als gelöscht markieren match: mail de Übereinstimmung: matches mail de stimmt überein (*, ? erlaubt) diff --git a/mail/lang/egw_en.lang b/mail/lang/egw_en.lang index 3d44c6f45c..f5131278e3 100644 --- a/mail/lang/egw_en.lang +++ b/mail/lang/egw_en.lang @@ -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 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 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 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? @@ -233,6 +234,7 @@ mail source mail en Mail Source mail-address mail en Mail-Address mailaccount mail en Mailaccount mailinglist mail en Mailinglist +mark all as read mail en mark all as read mark as deleted mail en mark as deleted match: mail en Match: matches mail en matches