Author: leithoff
New Revision: 55716
URL: http://svn.stylite.de/viewvc/egroupware?rev=55716&view=rev
Log:
first step to allow for a date-range-filter on ui, allows quicksearch too; not yet available on selected-mail-operations
Modified:
trunk/mail/inc/class.mail_ui.inc.php
trunk/mail/js/app.js
trunk/mail/templates/default/app.css
trunk/mail/templates/default/index.xet
trunk/mail/templates/pixelegg/app.css
trunk/mail/templates/pixelegg/app.less
— trunk/mail/inc/class.mail_ui.inc.php (original)
+++ trunk/mail/inc/class.mail_ui.inc.php Tue Apr 12 14:53:50 2016
@@ -96,7 +96,7 @@
‘text’ => ‘whole message’, // lang(‘whole message’)
‘larger’ => ‘greater than’, // lang(‘greater than’)
‘smaller’ => ‘less than’, // lang(‘less than’)
-// ‘custom’ => ‘Selected range’,// lang(‘Selected range’)
-
'bydate' => 'Selected date range (with quicksearch)',// lang('Selected date range (with quicksearch)')
);
/**
@@ -541,6 +541,8 @@
$content[self::$nm_index][‘filter2’] = $GLOBALS[‘egw_info’][‘user’][‘preferences’][‘mail’][‘ShowDetails’];
$etpl = new etemplate_new('mail.index');
-
//apply infolog_filter_change javascript method (hide/show of date filter form) over onchange filter
-
$content[self::$nm_index]['cat_id_onchange'] = "app.mail.mail_searchtype_change()";
// Start at 2 so auto-added copy+paste actions show up as second group
// Needed because there's no 'select all' action to push things down
$group=1;
@@ -1283,7 +1285,6 @@
$mail_ui = new mail_ui(true); // run constructor for current profile
if (empty($query[‘selectedFolder’])) $query[‘selectedFolder’] = $mail_ui->mail_bo->profileID.self::$delimiter.‘INBOX’;
}
//error_log(__METHOD__.__LINE__.' SelectedFolder:'.$query['selectedFolder'].' Start:'.$query['start'].' NumRows:'.$query['num_rows'].array2string($query['order']).'->'.array2string($query['sort']));
//Mail::$debugTimes=true;
if (Mail::$debugTimes) $starttime = microtime(true);
@@ -1322,7 +1323,7 @@
$maxMessages = $query[‘num_rows’];
//error_log(METHOD.LINE.array2string($query));
$sort = ($query[‘order’]==‘address’?($toSchema?‘toaddress’:‘fromaddress’):$query[‘order’]);
@@ -1332,8 +1333,11 @@
Mail::$supportsORinQuery[$mail_ui->mail_bo->profileID]=true;
}
}
-
//$cutoffdate = egw_time::to('now','ts')-(3600*24*3);//SINCE, enddate
-
//$cutoffdate2 = egw_time::to('now','ts');//-(3600*24*2);//BEFORE, startdate
-
//error_log(__METHOD__.__LINE__.' Startdate:'.$query['startdate'].' Enddate'.$query['enddate']);
-
$cutoffdate = $cutoffdate2 = null;
-
if ($query['startdate']) $cutoffdate = egw_time::to($query['startdate'],'ts');//SINCE, enddate
-
if ($query['enddate']) $cutoffdate2 = egw_time::to($query['enddate'],'ts');//BEFORE, startdate
-
//error_log(__METHOD__.__LINE__.' Startdate:'.$cutoffdate2.' Enddate'.$cutoffdate);
$filter = array(
'filterName' => (Mail::$supportsORinQuery[$mail_ui->mail_bo->profileID]?lang('quicksearch'):lang('subject')),
'type' => ($query['cat_id']?$query['cat_id']:(Mail::$supportsORinQuery[$mail_ui->mail_bo->profileID]?'quick':'subject')),
@@ -1341,6 +1345,17 @@
‘status’ => ‘any’,
//‘range’=>“BETWEEN”,‘since’=> date(“d-M-Y”, $cutoffdate),‘before’=> date(“d-M-Y”, $cutoffdate2)
);
-
if ($query['enddate']||$query['startdate']) {
-
$filter['range'] = "BETWEEN";
-
if ($cutoffdate) {
-
$filter[(empty($cutoffdate2)?'date':'since')] = date("d-M-Y", $cutoffdate);
-
if (empty($cutoffdate2)) $filter['range'] = "SINCE";
-
}
-
if ($cutoffdate2) {
-
$filter[(empty($cutoffdate)?'date':'before')] = date("d-M-Y", $cutoffdate2);
-
if (empty($cutoffdate)) $filter['range'] = "BEFORE";
-
}
-
}
}
else
{
— trunk/mail/js/app.js (original)
+++ trunk/mail/js/app.js Tue Apr 12 14:53:50 2016
@@ -168,7 +168,6 @@
var nm = this.et2.getWidgetById(this.nm_index);
this.mail_isMainWindow = true;
this.mail_disablePreviewArea(true);
//Get initial folder status
this.mail_refreshFolderStatus(undefined,undefined,false);
@@ -184,8 +183,9 @@
tree_wdg.set_onopenstart(jQuery.proxy(this.openstart_tree, this));
tree_wdg.set_onopenend(jQuery.proxy(this.openend_tree, this));
}
-
// Show vacation notice on load for the current profile (if not called by mail_searchtype_change())
-
var alreadyrefreshed = this.mail_searchtype_change();
-
if (!alreadyrefreshed) this.mail_callRefreshVacationNotice();
break;
case 'mail.display':
var self = this;
@@ -1214,6 +1214,42 @@
},
/**
-
- Enable or disable the date filter
-
-
- If the searchtype (cat_id) is set to something that needs dates, we enable the
-
- header_right template. Otherwise, it is disabled.
-
*/
-
mail_searchtype_change: function()
-
{
-
var filter = this.et2.getWidgetById('cat_id');
-
var nm = this.et2.getWidgetById(this.nm_index);
-
var dates = this.et2.getWidgetById('mail.index.datefilter');
-
if(nm && filter)
-
{
-
switch(filter.getValue())
-
{
-
case 'bydate':
-
-
if (filter && dates)
-
{
-
dates.set_disabled(false);
-
if (this.et2.getWidgetById('startdate')) jQuery(this.et2.getWidgetById('startdate').getDOMNode()).find('input').focus();
-
}
-
this.mail_callRefreshVacationNotice();
-
return true;
-
default:
-
if (dates)
-
{
-
dates.set_disabled(true);
-
}
-
this.mail_callRefreshVacationNotice();
-
return true;
-
}
-
}
-
return false;
-
},
-
-
/**
- mail_refreshFilter2Options, function to call with appropriate data to refresh the filter2 options for the active server
-
-
@param {object} _data
@@ -1261,14 +1297,14 @@
},
/**
-
- mail_refreshFilterOptions, function to call with appropriate data to refresh the filter options for the active server
-
- mail_refreshCatIdOptions, function to call with appropriate data to refresh the filter options for the active server
-
-
@param {object} _data
-
*/
mail_refreshCatIdOptions: function(_data)
{
@@ -1490,8 +1526,9 @@
*
* @param {boolean} _isPopup
*/
- mail_refreshMessageGrid: function(_isPopup) {
@@ -1501,7 +1538,25 @@
{
nm = this.et2.getWidgetById(this.nm_index);
}
-
var dates = this.et2.getWidgetById('mail.index.datefilter');
-
var filter = this.et2.getWidgetById('cat_id');
-
if(nm && filter)
-
{
-
nm.activeFilters["startdate"]=null;
-
nm.activeFilters["enddate"]=null;
-
switch(filter.getValue())
-
{
-
case 'bydate':
-
-
if (filter && dates)
-
{
-
if (this.et2.getWidgetById('startdate') && this.et2.getWidgetById('startdate').get_value()) nm.activeFilters["startdate"] = this.et2.getWidgetById('startdate').date;
-
if (this.et2.getWidgetById('enddate') && this.et2.getWidgetById('enddate').get_value()) nm.activeFilters["enddate"] = this.et2.getWidgetById('enddate').date;
-
}
-
}
-
}
nm.applyFilters(); // this should refresh the active folder
-
if (_refreshVacationNotice) this.mail_callRefreshVacationNotice();
},
/**
— trunk/mail/templates/default/app.css (original)
+++ trunk/mail/templates/default/app.css Tue Apr 12 14:53:50 2016
@@ -661,6 +661,9 @@
#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubject > span {
white-space: nowrap;
}
+#mail-index_mail-index-header_right {
- display: inline-flex;
+}
div.mailPreviewHeaders div.mail_extraEmails.visible,
div.mailPreviewHeaders #mail-index_previewAttachmentArea.visible {
position: absolute;
— trunk/mail/templates/default/index.xet (original)
+++ trunk/mail/templates/default/index.xet Tue Apr 12 14:53:50 2016
@@ -4,7 +4,7 @@
@@ -70,7 +70,7 @@
@@ -120,12 +120,16 @@
-
<hbox id="mail.index.datefilter" class="mail-index_datefilter">
-
<date id="startdate" label="Start" onchange="app.mail.mail_refreshMessageGrid(false,true);"/>
-
<date id="enddate" label="End" onchange="app.mail.mail_refreshMessageGrid(false,true);"/>
-
</hbox>
-
<hbox id="mail.index.quotabox" class="mail-index_quotabox"><progress id="nm[quotainpercent]" label="@nm[quota]" class="@nm[quotaclass]"/></hbox>
— trunk/mail/templates/pixelegg/app.css (original)
+++ trunk/mail/templates/pixelegg/app.css Tue Apr 12 14:53:50 2016
@@ -661,6 +661,9 @@
}
#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubject > span {
white-space: nowrap;
+}
+#mail-index_mail-index-header_right {
- display: inline-flex;
}
div.mailPreviewHeaders div.mail_extraEmails.visible,
div.mailPreviewHeaders #mail-index_previewAttachmentArea.visible {
— trunk/mail/templates/pixelegg/app.less (original)
+++ trunk/mail/templates/pixelegg/app.less Tue Apr 12 14:53:50 2016
@@ -1255,6 +1255,9 @@
background-color: transparent;
width: 100%;
}
+#mail-index_mail-index-header_right {
- display: inline-flex;
+}
#mail-index_mailPreview {
overflow: hidden;
position: relative;
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