Merge branch 'alexcloutier-feat/searchCapabilities'
commit
c2d3a827bd
|
@ -1280,13 +1280,20 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
[baseWhere addObject: privacySQLString];
|
||||
|
||||
if ([title length])
|
||||
[baseWhere
|
||||
addObject: [NSString stringWithFormat: @"c_title isCaseInsensitiveLike: '%%%@%%'",
|
||||
if ([filters length])
|
||||
{
|
||||
if ([filters isEqualToString:@"title_Category_Location"] || [filters isEqualToString:@"entireContent"])
|
||||
{
|
||||
[baseWhere addObject: [NSString stringWithFormat: @"(c_title isCaseInsensitiveLike: '%%%@%%' OR c_category isCaseInsensitiveLike: '%%%@%%' OR c_location isCaseInsensitiveLike: '%%%@%%')",
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"],
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"],
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"]]];
|
||||
}
|
||||
}
|
||||
else
|
||||
[baseWhere addObject: [NSString stringWithFormat: @"c_title isCaseInsensitiveLike: '%%%@%%'",
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"]]];
|
||||
|
||||
if ([filters length])
|
||||
[baseWhere addObject: [NSString stringWithFormat: @"(%@)", filters]];
|
||||
|
||||
/* prepare mandatory fields */
|
||||
|
||||
fields = [NSMutableArray arrayWithArray: _fields];
|
||||
|
|
|
@ -225,8 +225,14 @@
|
|||
"view_future" = "All Future Events";
|
||||
"view_selectedday" = "Selected Day";
|
||||
|
||||
"view_current" = "Current tasks";
|
||||
"view_not_started" = "Not started tasks";
|
||||
"view_overdue" = "Overdue tasks";
|
||||
"view_incomplete" = "Incomplete tasks";
|
||||
|
||||
"View:" = "View:";
|
||||
"Title or Description" = "Title or Description";
|
||||
"Title, category or location" = "Title, category or location";
|
||||
"Entire content" = "Entire content";
|
||||
|
||||
"Search" = "Search";
|
||||
"Search attendees" = "Search attendees";
|
||||
|
|
|
@ -39,14 +39,14 @@ static NSArray *filters = nil;
|
|||
+ (void) initialize
|
||||
{
|
||||
static NSString *quals[]
|
||||
= { // @"view_all",
|
||||
= {@"view_all",
|
||||
@"view_today", @"view_next7", @"view_next14",
|
||||
@"view_next31", @"view_thismonth", @"view_future",
|
||||
@"view_selectedday" };
|
||||
|
||||
if (!filters)
|
||||
{
|
||||
filters = [NSArray arrayWithObjects: quals count: 7];
|
||||
filters = [NSArray arrayWithObjects: quals count: 8];
|
||||
[filters retain];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,8 @@
|
|||
NSMutableDictionary *componentsData;
|
||||
NSCalendarDate *startDate;
|
||||
NSCalendarDate *endDate;
|
||||
NSString *title;
|
||||
NSString *value;
|
||||
NSString *criteria;
|
||||
NSString *userLogin;
|
||||
BOOL dayBasedView;
|
||||
WORequest *request;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,7 @@
|
|||
/* UIxCalMainView.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
* Copyright (C) 2006-2014 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -132,6 +131,30 @@
|
|||
return yearMenuItems;
|
||||
}
|
||||
|
||||
- (NSArray *) tasksFilters
|
||||
{
|
||||
return [NSArray arrayWithObjects: @"view_all", @"view_today", @"view_next7",
|
||||
@"view_next14", @"view_next31", @"view_thismonth",
|
||||
@"view_not_started", @"view_overdue", @"view_incomplete", nil];
|
||||
}
|
||||
|
||||
- (NSString *) tasksFilterLabel
|
||||
{
|
||||
return [self labelForKey: [self valueForKey:@"taskFilter"]];
|
||||
}
|
||||
|
||||
- (NSString *) selectedTasksFilter
|
||||
{
|
||||
NSString *selectedFilter;
|
||||
|
||||
selectedFilter = [self queryParameterForKey: @"tasksFilterpopup"];
|
||||
|
||||
if (![selectedFilter length])
|
||||
selectedFilter = @"view_today";
|
||||
|
||||
return selectedFilter;
|
||||
}
|
||||
|
||||
- (void) setYearMenuItem: (NSNumber *) aYearMenuItem
|
||||
{
|
||||
yearMenuItem = aYearMenuItem;
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:label="OGo:label"
|
||||
>
|
||||
xmlns:label="OGo:label">
|
||||
|
||||
<div class="filterPanel" data-search="events">
|
||||
<div class="menu" id="eventSearchMenu">
|
||||
<ul class="choiceMenu">
|
||||
<li data-option="title"><var:string label:value="Title or Description"/></li>
|
||||
<li data-option="title"><var:string label:value="Title"/></li>
|
||||
<li data-option="title_Category_Location"><var:string label:value="Title, category or location"/></li>
|
||||
<li data-option="entireContent"><var:string label:value="Entire content"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
<span class="searchBox" style="float: right">
|
||||
|
@ -25,6 +27,6 @@
|
|||
item="filter" string="filterLabel" value="filter"
|
||||
selection="selectedFilter"
|
||||
const:name="filterpopup"
|
||||
const:onchange="return onListFilterChange();" />
|
||||
const:onchange="return onEventsListFilterChange();" />
|
||||
</div>
|
||||
</container>
|
||||
|
|
|
@ -165,6 +165,7 @@
|
|||
<td id="eventStartHeader" class="headerCell headerDateTime sortableTableHeader"><var:string label:value="Start"/></td>
|
||||
<td id="eventEndHeader" class="headerCell headerDateTime sortableTableHeader"><var:string label:value="End"/></td>
|
||||
<td id="eventLocationHeader" class="headerCell headerLocation sortableTableHeader"><var:string label:value="Location"/></td>
|
||||
<td id="eventCategoryHeader" class="headerCell headerCategory sortableTableHeader"><var:string label:value="Category"/></td>
|
||||
<td id="eventCalendarNameHeader" class="headerCell headerCalendarName sortableTableHeader"><var:string label:value="Calendar"/></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -175,7 +176,9 @@
|
|||
<div class="filterPanel" data-search="tasks">
|
||||
<div class="menu" id="taskSearchMenu">
|
||||
<ul class="choiceMenu">
|
||||
<li data-option="title"><var:string label:value="Title or Description"/></li>
|
||||
<li data-option="title"><var:string label:value="Title"/></li>
|
||||
<li data-option="title_Category_Location"><var:string label:value="Title, category or location"/></li>
|
||||
<li data-option="entireContent"><var:string label:value="Entire content"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
<span class="searchBox" style="float: right">
|
||||
|
@ -184,7 +187,19 @@
|
|||
autocomplete="off" type="text"
|
||||
menuid="taskSearchMenu" />
|
||||
</span>
|
||||
<input id="showHideCompletedTasks" type="checkbox" class="checkBox" var:checked="showCompletedTasks"/><var:string label:value="Show completed tasks"/>
|
||||
<span>
|
||||
<var:string label:value="View:" />
|
||||
<var:popup list="tasksFilters"
|
||||
const:id="tasksFilterpopup"
|
||||
item="taskFilter" string="tasksFilterLabel" value="taskFilter"
|
||||
selection="selectedTasksFilter"
|
||||
const:name="tasksFilterpopup"
|
||||
const:onchange="return onTasksListFilterChange();" />
|
||||
</span>
|
||||
<span>
|
||||
<input id="showHideCompletedTasks" type="checkbox" class="checkBox" var:checked="showCompletedTasks"/>
|
||||
<var:string label:value="Show completed tasks" />
|
||||
</span>
|
||||
</div>
|
||||
<table id="tasksList" cellspacing="0">
|
||||
<thead>
|
||||
|
@ -194,7 +209,7 @@
|
|||
<td id="taskTitleHeader" class="headerCell headerTitle sortableTableHeader"><var:string label:value="Title"/></td>
|
||||
<td id="taskEndHeader" class="headerCell headerDateTime sortableTableHeader"><var:string label:value="Due Date"/></td>
|
||||
<td id="taskLocationHeader" class="headerCell headerLocation sortableTableHeader"><var:string label:value="Location"/></td>
|
||||
<td id="taskCategoryHeader" class="headerCell headerLocation sortableTableHeader"><var:string label:value="Category"/></td>
|
||||
<td id="taskCategoryHeader" class="headerCell headerCategory sortableTableHeader"><var:string label:value="Category"/></td>
|
||||
<td id="taskCalendarNameHeader" class="headerCell headerCalendarName sortableTableHeader"><var:string label:value="Calendar"/></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var listFilter = 'view_today';
|
||||
var eventListFilter = 'view_today';
|
||||
var taskListFilter = 'view_today';
|
||||
|
||||
var listOfSelection = null;
|
||||
var selectedCalendarCell = null;
|
||||
|
@ -899,7 +900,7 @@ function performDeleteEventCallback(http) {
|
|||
/* in dateselector */
|
||||
function onDaySelect(node) {
|
||||
var day = node.getAttribute('day');
|
||||
var needRefresh = (listFilter == 'view_selectedday'
|
||||
var needRefresh = (eventListFilter == 'view_selectedday'
|
||||
&& day != currentDay);
|
||||
|
||||
var td = $(node).getParentWithTagName("td");
|
||||
|
@ -932,7 +933,7 @@ function onDateSelectorGotoMonth(event) {
|
|||
|
||||
function onCalendarGotoDay(node) {
|
||||
var day = node.getAttribute("date");
|
||||
var needRefresh = (listFilter == 'view_selectedday' && day != currentDay);
|
||||
var needRefresh = (eventListFilter == 'view_selectedday' && day != currentDay);
|
||||
|
||||
changeDateSelectorDisplay(day);
|
||||
changeCalendarDisplay( { "day": day } );
|
||||
|
@ -1042,6 +1043,12 @@ function eventsListCallback(http) {
|
|||
if (data[i][7])
|
||||
td.update(data[i][7]); // location
|
||||
|
||||
td = createElement("td");
|
||||
row.appendChild(td);
|
||||
td.observe("mousedown", listRowMouseDownHandler, true);
|
||||
if (data[i][10])
|
||||
td.update(data[i][10]); // category
|
||||
|
||||
td = createElement("td");
|
||||
row.appendChild(td);
|
||||
td.observe("mousedown", listRowMouseDownHandler, true);
|
||||
|
@ -2242,41 +2249,44 @@ function refreshCurrentFolder(id) {
|
|||
|
||||
/* refreshes the "unifinder" list */
|
||||
function refreshEvents() {
|
||||
var titleSearch;
|
||||
var specificSearch;
|
||||
var value = search["events"]["value"];
|
||||
|
||||
if (value && value.length)
|
||||
titleSearch = "&search=" + escape(value.utf8encode());
|
||||
specificSearch = ("&search=" + search["events"]["criteria"]
|
||||
+ "&value=" + escape(value.utf8encode()));
|
||||
else
|
||||
titleSearch = "";
|
||||
specificSearch = "";
|
||||
|
||||
refreshAlarms();
|
||||
|
||||
return _loadEventHref("eventslist?asc=" + sorting["event-ascending"]
|
||||
+ "&sort=" + sorting["event-attribute"]
|
||||
+ "&day=" + currentDay
|
||||
+ titleSearch
|
||||
+ "&filterpopup=" + listFilter);
|
||||
+ specificSearch
|
||||
+ "&filterpopup=" + eventListFilter);
|
||||
}
|
||||
|
||||
function refreshTasks(setUserDefault) {
|
||||
var titleSearch;
|
||||
var specificSearch;
|
||||
var value = search["tasks"]["value"];
|
||||
|
||||
if (value && value.length)
|
||||
titleSearch = "&search=" + escape(value.utf8encode());
|
||||
specificSearch = ("&search=" + search["tasks"]["criteria"]
|
||||
+ "&value=" + escape(value.utf8encode()));
|
||||
else
|
||||
titleSearch = "";
|
||||
specificSearch = "";
|
||||
|
||||
if (setUserDefault == 1)
|
||||
titleSearch += "&setud=1";
|
||||
specificSearch += "&setud=1";
|
||||
|
||||
refreshAlarms();
|
||||
|
||||
return _loadTasksHref("taskslist?show-completed=" + showCompletedTasks
|
||||
+ "&asc=" + sorting["task-ascending"]
|
||||
+ "&sort=" + sorting["task-attribute"]
|
||||
+ titleSearch);
|
||||
+ specificSearch
|
||||
+ "&filterpopup=" + taskListFilter);
|
||||
}
|
||||
|
||||
function refreshEventsAndDisplay() {
|
||||
|
@ -2284,15 +2294,26 @@ function refreshEventsAndDisplay() {
|
|||
changeCalendarDisplay();
|
||||
}
|
||||
|
||||
function onListFilterChange() {
|
||||
function onEventsListFilterChange() {
|
||||
var node = $("filterpopup");
|
||||
|
||||
listFilter = node.value;
|
||||
// log ("listFilter = " + listFilter);
|
||||
eventListFilter = node.value;
|
||||
|
||||
return refreshEvents();
|
||||
}
|
||||
|
||||
function onTasksListFilterChange() {
|
||||
var node = $("tasksFilterpopup");
|
||||
|
||||
taskListFilter = node.value;
|
||||
|
||||
$("showHideCompletedTasks").disabled = taskListFilter == "view_overdue" ||
|
||||
taskListFilter == "view_incomplete" ||
|
||||
taskListFilter == "view_not_started";
|
||||
|
||||
return refreshTasks();
|
||||
}
|
||||
|
||||
function selectMonthInMenu(menu, month) {
|
||||
var entries = $(menu).select("LI");
|
||||
for (i = 0; i < entries.length; i++) {
|
||||
|
@ -2487,7 +2508,7 @@ function onCalendarSelectEvent(event, willShowContextualMenu) {
|
|||
|
||||
function onCalendarSelectDay(event) {
|
||||
var day = this.getAttribute("day");
|
||||
var needRefresh = (listFilter == 'view_selectedday' && day != currentDay);
|
||||
var needRefresh = (eventListFilter == 'view_selectedday' && day != currentDay);
|
||||
|
||||
setSelectedDayDate(day);
|
||||
changeDateSelectorDisplay(day);
|
||||
|
@ -2771,12 +2792,12 @@ function getMenus() {
|
|||
onCalendarNew, onCalendarRemove,
|
||||
"-", onCalendarExport, onCalendarImport,
|
||||
null, "-", null, "-", onMenuSharing);
|
||||
menus["eventSearchMenu"] = new Array(setSearchCriteria);
|
||||
menus["eventSearchMenu"] = new Array(setSearchCriteria, setSearchCriteria, setSearchCriteria);
|
||||
|
||||
menus["tasksListMenu"] = new Array (editEvent, newTask, "-",
|
||||
marksTasksAsCompleted, deleteEvent, "-",
|
||||
onMenuRawTask);
|
||||
menus["taskSearchMenu"] = new Array(setSearchCriteria);
|
||||
menus["taskSearchMenu"] = new Array(setSearchCriteria, setSearchCriteria, setSearchCriteria);
|
||||
|
||||
var calendarsMenu = $("calendarsMenu");
|
||||
if (calendarsMenu)
|
||||
|
@ -3283,6 +3304,7 @@ function configureLists() {
|
|||
|
||||
var input = $("showHideCompletedTasks");
|
||||
input.observe("click", onShowCompletedTasks);
|
||||
|
||||
if (showCompletedTasks)
|
||||
input.checked = true;
|
||||
|
||||
|
@ -3413,7 +3435,7 @@ function onDocumentKeydown(event) {
|
|||
&& keyCode == "A".charCodeAt(0)) { // Ctrl-A
|
||||
onSelectAll(event);
|
||||
Event.stop(event);
|
||||
}
|
||||
}
|
||||
else if (((isMac() && event.metaKey == 1) || (!isMac() && event.ctrlKey == 1))
|
||||
&& keyCode == "C".charCodeAt(0)) { // Ctrl-C
|
||||
copyEventToClipboard();
|
||||
|
@ -3444,7 +3466,7 @@ function initScheduler() {
|
|||
|
||||
if (!$(document.body).hasClassName("popup")) {
|
||||
var node = $("filterpopup");
|
||||
listFilter = node.value;
|
||||
eventListFilter = node.value;
|
||||
|
||||
var tabsContainer = $("schedulerTabs");
|
||||
var controller = new SOGoTabsController();
|
||||
|
@ -3457,6 +3479,7 @@ function initScheduler() {
|
|||
else {
|
||||
showCompletedTasks = 0;
|
||||
}
|
||||
|
||||
initDateSelectorEvents();
|
||||
initCalendarSelector();
|
||||
configureSearchField();
|
||||
|
|
|
@ -428,7 +428,8 @@ TD.headerTitle
|
|||
{ width: 20%; }
|
||||
|
||||
TD.headerLocation,
|
||||
TD.headerCalendarName
|
||||
TD.headerCalendarName,
|
||||
TD.headerCategory
|
||||
{ min-width: 15em;
|
||||
width: 15em; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue