Merge branch 'master' of ssh://git.kolabsys.com/git/roundcube

This commit is contained in:
Thomas Bruederli 2012-07-17 13:53:29 +02:00
commit ccd75c9ac1
9 changed files with 47 additions and 14 deletions

View file

@ -1340,7 +1340,7 @@ class calendar extends rcube_plugin
$rrule .= $k . '=' . $val . ';';
}
return $rrule;
return rtrim($rrule, ';');
}
/**

View file

@ -129,10 +129,10 @@ class kolab_format_task extends kolab_format_xcal
$tags = array();
if ($this->data['status'] == 'COMPLETED' || $this->data['complete'] == 100)
$tags[] = 'complete';
$tags[] = 'x-complete';
if ($this->data['priority'] == 1)
$tags[] = 'flagged';
$tags[] = 'x-flagged';
if (!empty($this->data['alarms']))
$tags[] = 'x-has-alarms';

View file

@ -28,7 +28,7 @@ abstract class kolab_format_xcal extends kolab_format
{
public $CTYPE = 'application/calendar+xml';
public static $fulltext_cols = array('title', 'description', 'location', 'attendees:name', 'attendees:email');
public static $fulltext_cols = array('title', 'description', 'location', 'attendees:name', 'attendees:email', 'categories');
protected $sensitivity_map = array(
'public' => kolabformat::ClassPublic,

View file

@ -219,10 +219,10 @@ class tasklist_kolab_driver extends tasklist_driver
$counts = array('all' => 0, 'flagged' => 0, 'today' => 0, 'tomorrow' => 0, 'overdue' => 0, 'nodate' => 0);
foreach ($lists as $list_id) {
$folder = $this->folders[$list_id];
foreach ((array)$folder->select(array(array('tags','!~','complete'))) as $record) {
foreach ((array)$folder->select(array(array('tags','!~','x-complete'))) as $record) {
$rec = $this->_to_rcube_task($record);
if ($rec['complete']) // don't count complete tasks
if ($rec['complete'] >= 1.0) // don't count complete tasks
continue;
$counts['all']++;
@ -265,9 +265,9 @@ class tasklist_kolab_driver extends tasklist_driver
// query Kolab storage
$query = array();
if ($filter['mask'] & tasklist::FILTER_MASK_COMPLETE)
$query[] = array('tags','~','complete');
$query[] = array('tags','~','x-complete');
else
$query[] = array('tags','!~','complete');
$query[] = array('tags','!~','x-complete');
// full text search (only works with cache enabled)
if ($filter['search']) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -13,13 +13,13 @@
*/
#taskbar a.button-tasklist span.button-inner {
background-image: url(taskbaricon.png);
background-image: url(buttons.png);
background-position: 0 0;
}
#taskbar a.button-tasklist:hover span.button-inner,
#taskbar a.button-tasklist.button-selected span.button-inner {
background-position: 0 -44px;
background-position: 0 -26px;
}
#sidebar {
@ -165,6 +165,7 @@
display: inline-block;
color: #004458;
margin-right: 0.5em;
margin-bottom: 0.4em;
min-width: 1.2em;
cursor: pointer;
}
@ -215,6 +216,11 @@
white-space: nowrap;
}
#taskstoolbar a.button.newtask {
background-image: url(buttons.png);
background-position: center -53px;
}
.tasklistview #quicksearchbar {
top: -7px;
}

View file

@ -49,7 +49,7 @@ function rcube_tasklist(settings)
var selector = 'all';
var tagsfilter = null;
var filtermask = FILTER_MASK_ALL;
var loadstate = { filter:-1, lists:'' };
var loadstate = { filter:-1, lists:'', search:null };
var idcount = 0;
var saving_lock;
var ui_loading;
@ -310,7 +310,7 @@ function rcube_tasklist(settings)
var active = active_lists(),
basefilter = filtermask == FILTER_MASK_COMPLETE ? FILTER_MASK_COMPLETE : FILTER_MASK_ALL,
reload = active.join(',') != loadstate.lists || basefilter != loadstate.filter;
reload = active.join(',') != loadstate.lists || basefilter != loadstate.filter || loadstate.search != search_query;
if (active.length && reload) {
ui_loading = rcmail.set_busy(true, 'loading');
@ -333,6 +333,8 @@ function rcube_tasklist(settings)
listdata = {};
loadstate.lists = response.lists;
loadstate.filter = response.filter;
loadstate.search = response.search;
for (var i=0; i < response.data.length; i++) {
listdata[response.data[i].id] = response.data[i];
}
@ -379,6 +381,12 @@ function rcube_tasklist(settings)
$.each(newtags, function(i, tag){
$('<li>').attr('rel', tag).data('value', tag).html(Q(tag)).appendTo(rcmail.gui_objects.tagslist);
});
// re-sort tags list
$(rcmail.gui_objects.tagslist).children('li').sortElements(function(a,b){
console.log($.text([a]), $.text([b]))
return $.text([a]).toLowerCase() > $.text([b]).toLowerCase() ? 1 : -1;
});
}
/**
@ -1130,6 +1138,25 @@ function rcube_tasklist(settings)
};
})(jQuery);
// from http://james.padolsey.com/javascript/sorting-elements-with-jquery/
jQuery.fn.sortElements = (function(){
var sort = [].sort;
return function(comparator, getSortable) {
getSortable = getSortable || function(){ return this };
var last = null;
return sort.call(this, comparator).each(function(i){
// at this point the array is sorted, so we can just detach each one from wherever it is, and add it after the last
var node = $(getSortable.call(this));
var parent = node.parent();
if (last) last.after(node);
else parent.prepend(node);
last = node;
});
};
})();
/* tasklist plugin UI initialization */
var rctasks;

View file

@ -313,7 +313,7 @@ class tasklist extends rcube_plugin
*/
public function fetch_counts()
{
$lists = null;
$lists = get_input_value('lists', RCUBE_INPUT_GPC);;
$counts = $this->driver->count_tasks($lists);
$this->rc->output->command('plugin.update_counts', $counts);
}
@ -389,7 +389,7 @@ class tasklist extends rcube_plugin
// sort tasks according to their hierarchy level and due date
usort($data, array($this, 'task_sort_cmp'));
$this->rc->output->command('plugin.data_ready', array('filter' => $f, 'lists' => $lists, 'data' => $data, 'tags' => array_values(array_unique($tags))));
$this->rc->output->command('plugin.data_ready', array('filter' => $f, 'lists' => $lists, 'search' => $search, 'data' => $data, 'tags' => array_values(array_unique($tags))));
}
/**