summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Controller/App.php10
-rw-r--r--app/Controller/Calendar.php79
-rw-r--r--app/Core/Helper.php90
-rw-r--r--app/Core/Response.php17
-rw-r--r--app/Locale/da_DK/translations.php49
-rw-r--r--app/Locale/de_DE/translations.php51
-rw-r--r--app/Locale/es_ES/translations.php49
-rw-r--r--app/Locale/fi_FI/translations.php49
-rw-r--r--app/Locale/fr_FR/translations.php49
-rw-r--r--app/Locale/hu_HU/translations.php49
-rw-r--r--app/Locale/it_IT/translations.php49
-rw-r--r--app/Locale/ja_JP/translations.php49
-rw-r--r--app/Locale/pl_PL/translations.php49
-rw-r--r--app/Locale/pt_BR/translations.php49
-rw-r--r--app/Locale/ru_RU/translations.php49
-rw-r--r--app/Locale/sv_SE/translations.php49
-rw-r--r--app/Locale/th_TH/translations.php49
-rw-r--r--app/Locale/zh_CN/translations.php49
-rw-r--r--app/Model/Acl.php1
-rw-r--r--app/Model/Board.php23
-rw-r--r--app/Model/Color.php105
-rw-r--r--app/Model/DateParser.php12
-rw-r--r--app/Model/Swimlane.php18
-rw-r--r--app/Model/TaskExport.php2
-rw-r--r--app/Model/TaskFilter.php117
-rw-r--r--app/Model/TaskStatus.php17
-rw-r--r--app/ServiceProvider/ClassProvider.php2
-rw-r--r--app/Template/app/projects.php1
-rw-r--r--app/Template/app/subtasks.php2
-rw-r--r--app/Template/app/tasks.php2
-rw-r--r--app/Template/board/filters.php8
-rw-r--r--app/Template/board/task.php4
-rw-r--r--app/Template/calendar/show.php29
-rw-r--r--app/Template/calendar/sidebar.php40
-rw-r--r--app/Template/layout.php1
-rw-r--r--app/Template/task/details.php2
-rw-r--r--app/Template/task/table.php2
37 files changed, 1234 insertions, 38 deletions
diff --git a/app/Controller/App.php b/app/Controller/App.php
index aa2673a1..80d4f275 100644
--- a/app/Controller/App.php
+++ b/app/Controller/App.php
@@ -196,4 +196,14 @@ class App extends Base
);
}
}
+
+ /**
+ * Colors stylesheet
+ *
+ * @access public
+ */
+ public function colors()
+ {
+ $this->response->css($this->color->getCss());
+ }
}
diff --git a/app/Controller/Calendar.php b/app/Controller/Calendar.php
new file mode 100644
index 00000000..6b0c8619
--- /dev/null
+++ b/app/Controller/Calendar.php
@@ -0,0 +1,79 @@
+<?php
+
+namespace Controller;
+
+/**
+ * Project Calendar controller
+ *
+ * @package controller
+ * @author Frederic Guillot
+ * @author Timo Litzbarski
+ */
+class Calendar extends Base
+{
+ /**
+ * Show calendar view
+ *
+ * @access public
+ */
+ public function show()
+ {
+ $project = $this->getProject();
+
+ $this->response->html($this->template->layout('calendar/show', array(
+ 'check_interval' => $this->config->get('board_private_refresh_interval'),
+ 'users_list' => $this->projectPermission->getMemberList($project['id'], true, true),
+ 'categories_list' => $this->category->getList($project['id'], true, true),
+ 'columns_list' => $this->board->getColumnsList($project['id'], true),
+ 'swimlanes_list' => $this->swimlane->getList($project['id'], true),
+ 'colors_list' => $this->color->getList(true),
+ 'status_list' => $this->taskStatus->getList(true),
+ 'project' => $project,
+ 'title' => t('Calendar for "%s"', $project['name']),
+ 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()),
+ )));
+ }
+
+ /**
+ * Get tasks to display on the calendar
+ *
+ * @access public
+ */
+ public function events()
+ {
+ $this->response->json(
+ $this->taskFilter
+ ->create()
+ ->filterByProject($this->request->getIntegerParam('project_id'))
+ ->filterByCategory($this->request->getIntegerParam('category_id', -1))
+ ->filterByOwner($this->request->getIntegerParam('owner_id', -1))
+ ->filterByColumn($this->request->getIntegerParam('column_id', -1))
+ ->filterBySwimlane($this->request->getIntegerParam('swimlane_id', -1))
+ ->filterByColor($this->request->getStringParam('color_id'))
+ ->filterByStatus($this->request->getIntegerParam('is_active', -1))
+ ->filterByDueDateRange(
+ $this->request->getStringParam('start'),
+ $this->request->getStringParam('end')
+ )
+ ->toCalendarEvents()
+ );
+ }
+
+ /**
+ * Update task due date
+ *
+ * @access public
+ */
+ public function save()
+ {
+ if ($this->request->isAjax() && $this->request->isPost()) {
+
+ $values = $this->request->getJson();
+
+ $this->taskModification->update(array(
+ 'id' => $values['task_id'],
+ 'date_due' => $values['date_due'],
+ ));
+ }
+ }
+}
diff --git a/app/Core/Helper.php b/app/Core/Helper.php
index e9fa1868..146cb2f8 100644
--- a/app/Core/Helper.php
+++ b/app/Core/Helper.php
@@ -104,9 +104,9 @@ class Helper
* @param string $filename Filename
* @return string
*/
- public function css($filename)
+ public function css($filename, $is_file = true)
{
- return '<link rel="stylesheet" href="'.$filename.'?'.filemtime($filename).'" media="screen">';
+ return '<link rel="stylesheet" href="'.$filename.($is_file ? '?'.filemtime($filename) : '').'" media="screen">';
}
/**
@@ -417,7 +417,7 @@ class Helper
}
/**
- * URL query string
+ * Generate controller/action url for templates
*
* u('task', 'show', array('task_id' => $task_id))
*
@@ -429,17 +429,40 @@ class Helper
*/
public function u($controller, $action, array $params = array(), $csrf = false)
{
- $html = '?controller='.$controller.'&amp;action='.$action;
+ $values = array(
+ 'controller' => $controller,
+ 'action' => $action,
+ );
if ($csrf) {
$params['csrf_token'] = Security::getCSRFToken();
}
- foreach ($params as $key => $value) {
- $html .= '&amp;'.$key.'='.$value;
- }
+ $values += $params;
- return $html;
+ return '?'.http_build_query($values, '', '&amp;');
+ }
+
+ /**
+ * Generate controller/action url
+ *
+ * l('task', 'show', array('task_id' => $task_id))
+ *
+ * @param string $controller Controller name
+ * @param string $action Action name
+ * @param array $params Url parameters
+ * @return string
+ */
+ public function url($controller, $action, array $params = array())
+ {
+ $values = array(
+ 'controller' => $controller,
+ 'action' => $action,
+ );
+
+ $values += $params;
+
+ return '?'.http_build_query($values, '');
}
/**
@@ -656,4 +679,55 @@ class Helper
return $default_value;
}
+
+ /**
+ * Get calendar translations
+ *
+ * @access public
+ * @return string
+ */
+ public function getCalendarTranslations()
+ {
+ return json_encode(array(
+ 'Today' => t('Today'),
+ 'Jan' => t('Jan'),
+ 'Feb' => t('Feb'),
+ 'Mar' => t('Mar'),
+ 'Apr' => t('Apr'),
+ 'May' => t('May'),
+ 'Jun' => t('Jun'),
+ 'Jul' => t('Jul'),
+ 'Aug' => t('Aug'),
+ 'Sep' => t('Sep'),
+ 'Oct' => t('Oct'),
+ 'Nov' => t('Nov'),
+ 'Dec' => t('Dec'),
+ 'January' => t('January'),
+ 'February' => t('February'),
+ 'March' => t('March'),
+ 'April' => t('April'),
+ 'May' => t('May'),
+ 'June' => t('June'),
+ 'July' => t('July'),
+ 'August' => t('August'),
+ 'September' => t('September'),
+ 'October' => t('October'),
+ 'November' => t('November'),
+ 'December' => t('December'),
+ 'Sunday' => t('Sunday'),
+ 'Monday' => t('Monday'),
+ 'Tuesday' => t('Tuesday'),
+ 'Wednesday' => t('Wednesday'),
+ 'Thursday' => t('Thursday'),
+ 'Friday' => t('Friday'),
+ 'Saturday' => t('Saturday'),
+ 'Sun' => t('Sun'),
+ 'Mon' => t('Mon'),
+ 'Tue' => t('Tue'),
+ 'Wed' => t('Wed'),
+ 'Thu' => t('Thu'),
+ 'Fri' => t('Fri'),
+ 'Sat' => t('Sat'),
+ ));
+ }
}
diff --git a/app/Core/Response.php b/app/Core/Response.php
index 6534d64f..1ce42ad3 100644
--- a/app/Core/Response.php
+++ b/app/Core/Response.php
@@ -168,6 +168,23 @@ class Response
}
/**
+ * Send a css response
+ *
+ * @access public
+ * @param string $data Raw data
+ * @param integer $status_code HTTP status code
+ */
+ public function css($data, $status_code = 200)
+ {
+ $this->status($status_code);
+
+ header('Content-Type: text/css; charset=utf-8');
+ echo $data;
+
+ exit;
+ }
+
+ /**
* Send a binary response
*
* @access public
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index 3287aa51..5af587f4 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index c85c97c6..662046ce 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -647,5 +647,54 @@ return array(
'Application default' => 'Anwendungsstandard',
'Language:' => 'Sprache:',
'Timezone:' => 'Zeitzone:',
- // 'Next' => '',
+ 'All columns' => 'Alle Spalten',
+ 'Calendar for "%s"' => 'Kalender für "%s"',
+ 'Filter by column' => 'Spalte filtern',
+ 'Filter by status' => 'Status filtern',
+ 'Calendar' => 'Kalender',
+ 'Today' => 'Heute',
+ 'Jan ' => 'Jan',
+ 'Feb' => 'Feb',
+ 'Mar' => 'Mar',
+ 'Apr' => 'Apr',
+ 'May' => 'Mai',
+ 'Jun' => 'Jun',
+ 'Jul' => 'Jul',
+ 'Aug' => 'Aug',
+ 'Sep' => 'Sep',
+ 'Oct' => 'Okt',
+ 'Nov' => 'Nov',
+ 'Dec' => 'Dez',
+ 'January' => 'Januar',
+ 'February' => 'Februar',
+ 'March' => 'März',
+ 'April' => 'April',
+ 'June' => 'Juni',
+ 'July' => 'Juli',
+ 'August' => 'August',
+ 'September' => 'September',
+ 'October' => 'Oktober',
+ 'November' => 'November',
+ 'December' => 'Dezember',
+ 'Sunday' => 'Sonntag',
+ 'Monday' => 'Montag',
+ 'Tuesday' => 'Dienstag',
+ 'Wednesday' => 'Mittwoch',
+ 'Thursday' => 'Donnerstag',
+ 'Friday' => 'Freitag',
+ 'Saturday' => 'Samstag',
+ 'Sun' => 'So',
+ 'Mon' => 'Mo',
+ 'Tue' => 'Di',
+ 'Wed' => 'Mi',
+ 'Thu' => 'Do',
+ 'Fri' => 'Fr',
+ 'Sat' => 'Sa',
+ 'Next' => 'Nächste',
+ // '#%d' => '',
+ 'Filter by color' => 'Farbe filtern',
+ 'Filter by swimlane' => 'Swimlane filtern',
+ 'All swimlanes' => 'Alle Swimlanes',
+ 'All colors' => 'Alle Farben',
+ // 'All status' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index 5dafde9f..9c50e1a7 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index c3f1fbd1..b1dff1ad 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index d0673042..c40cee9e 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -647,6 +647,55 @@ return array(
'Application default' => 'Valeur par défaut de l\'application',
'Language:' => 'Langue :',
'Timezone:' => 'Fuseau horaire :',
+ 'All columns' => 'Toutes les colonnes',
+ 'Calendar for "%s"' => 'Agenda pour le projet « %s »',
+ 'Filter by column' => 'Filtrer par colonne',
+ 'Filter by status' => 'Filtrer par status',
+ 'Calendar' => 'Agenda',
+ 'Today' => 'Aujourd\'hui',
+ 'Jan ' => 'Janv',
+ 'Feb' => 'Fév',
+ 'Mar' => 'Mars',
+ 'Apr' => 'Avr',
+ 'May' => 'Mai',
+ 'Jun' => 'Juin',
+ 'Jul' => 'Juil',
+ 'Aug' => 'Août',
+ 'Sep' => 'Sept',
+ 'Oct' => 'Oct',
+ 'Nov' => 'Nov',
+ 'Dec' => 'Déc',
+ 'January' => 'Janvier',
+ 'February' => 'Février',
+ 'March' => 'Mars',
+ 'April' => 'Avril',
+ 'May' => 'Mai',
+ 'June' => 'Juin',
+ 'July' => 'Juillet',
+ 'August' => 'Août',
+ 'September' => 'Septembre',
+ 'October' => 'Octobre',
+ 'November' => 'Novembre',
+ 'December' => 'Décembre',
+ 'Sunday' => 'Dimanche',
+ 'Monday' => 'Lundi',
+ 'Tuesday' => 'Mardi',
+ 'Wednesday' => 'Mercredi',
+ 'Thursday' => 'Jeudi',
+ 'Friday' => 'Vendredi',
+ 'Saturday' => 'Samedi',
+ 'Sun' => 'Dim',
+ 'Mon' => 'Lun',
+ 'Tue' => 'Mar',
+ 'Wed' => 'Mer',
+ 'Thu' => 'Jeu',
+ 'Fri' => 'Ven',
+ 'Sat' => 'Sam',
'Next' => 'Suivant',
'#%d' => 'n˚%d',
+ 'Filter by color' => 'Filtrer par couleur',
+ 'Filter by swimlane' => 'Filtrer par swimlanes',
+ 'All swimlanes' => 'Toutes les swimlanes',
+ 'All colors' => 'Toutes les couleurs',
+ 'All status' => 'Tous les états',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index b879b787..d011a0a4 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index 0777e171..a5350f71 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index f4f5215f..53b10212 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 408828ae..6de3ff70 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index f155b045..e5dfcb25 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -647,5 +647,54 @@ return array(
'Application default' => 'Aplicação padrão',
'Language:' => 'Idioma',
'Timezone:' => 'Fuso horário',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
'Next' => 'Próximo',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index a857de30..daf325df 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index ae805d4b..fb347dbd 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -647,5 +647,54 @@ return array(
'Application default' => 'Applikationsstandard',
'Language:' => 'Språk',
'Timezone:' => 'Tidszon',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
'Next' => 'Nästa',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index f091020f..ac6b82f6 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index cd423d00..362ac825 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -647,5 +647,54 @@ return array(
// 'Application default' => '',
// 'Language:' => '',
// 'Timezone:' => '',
+ // 'All columns' => '',
+ // 'Calendar for "%s"' => '',
+ // 'Filter by column' => '',
+ // 'Filter by status' => '',
+ // 'Calendar' => '',
+ // 'Today' => '',
+ // 'Jan ' => '',
+ // 'Feb' => '',
+ // 'Mar' => '',
+ // 'Apr' => '',
+ // 'May' => '',
+ // 'Jun' => '',
+ // 'Jul' => '',
+ // 'Aug' => '',
+ // 'Sep' => '',
+ // 'Oct' => '',
+ // 'Nov' => '',
+ // 'Dec' => '',
+ // 'January' => '',
+ // 'February' => '',
+ // 'March' => '',
+ // 'April' => '',
+ // 'June' => '',
+ // 'July' => '',
+ // 'August' => '',
+ // 'September' => '',
+ // 'October' => '',
+ // 'November' => '',
+ // 'December' => '',
+ // 'Sunday' => '',
+ // 'Monday' => '',
+ // 'Tuesday' => '',
+ // 'Wednesday' => '',
+ // 'Thursday' => '',
+ // 'Friday' => '',
+ // 'Saturday' => '',
+ // 'Sun' => '',
+ // 'Mon' => '',
+ // 'Tue' => '',
+ // 'Wed' => '',
+ // 'Thu' => '',
+ // 'Fri' => '',
+ // 'Sat' => '',
// 'Next' => '',
+ // '#%d' => '',
+ // 'Filter by color' => '',
+ // 'Filter by swimlane' => '',
+ // 'All swimlanes' => '',
+ // 'All colors' => '',
+ // 'All status' => '',
);
diff --git a/app/Model/Acl.php b/app/Model/Acl.php
index 599ff055..f6c54814 100644
--- a/app/Model/Acl.php
+++ b/app/Model/Acl.php
@@ -37,6 +37,7 @@ class Acl extends Base
'project' => array('show', 'tasks', 'search', 'activity'),
'subtask' => '*',
'task' => '*',
+ 'calendar' => '*',
);
/**
diff --git a/app/Model/Board.php b/app/Model/Board.php
index 550009fa..d5b83283 100644
--- a/app/Model/Board.php
+++ b/app/Model/Board.php
@@ -258,16 +258,19 @@ class Board extends Base
*
* @access public
* @param integer $project_id
+ * @param boolean $prepend Prepend default value
* @return array
*/
- public function getColumnStats($project_id)
+ public function getColumnStats($project_id, $prepend = false)
{
- return $this->db
- ->table(Task::TABLE)
- ->eq('project_id', $project_id)
- ->eq('is_active', 1)
- ->groupBy('column_id')
- ->listing('column_id', 'COUNT(*) AS total');
+ $listing = $this->db
+ ->table(Task::TABLE)
+ ->eq('project_id', $project_id)
+ ->eq('is_active', 1)
+ ->groupBy('column_id')
+ ->listing('column_id', 'COUNT(*) AS total');
+
+ return $prepend ? array(-1 => t('All columns')) + $listing : $listing;
}
/**
@@ -287,11 +290,13 @@ class Board extends Base
*
* @access public
* @param integer $project_id Project id
+ * @param boolean $prepend Prepend a default value
* @return array
*/
- public function getColumnsList($project_id)
+ public function getColumnsList($project_id, $prepend = false)
{
- return $this->db->table(self::TABLE)->eq('project_id', $project_id)->asc('position')->listing('id', 'title');
+ $listing = $this->db->table(self::TABLE)->eq('project_id', $project_id)->asc('position')->listing('id', 'title');
+ return $prepend ? array(-1 => t('All columns')) + $listing : $listing;
}
/**
diff --git a/app/Model/Color.php b/app/Model/Color.php
index 8668cf0f..241a97c7 100644
--- a/app/Model/Color.php
+++ b/app/Model/Color.php
@@ -3,7 +3,7 @@
namespace Model;
/**
- * Color model (TODO: model for the future color picker)
+ * Color model
*
* @package model
* @author Frederic Guillot
@@ -11,14 +11,60 @@ namespace Model;
class Color extends Base
{
/**
+ * Default colors
+ *
+ * @access private
+ * @var array
+ */
+ private $default_colors = array(
+ 'yellow' => array(
+ 'name' => 'Yellow',
+ 'background' => 'rgb(245, 247, 196)',
+ 'border' => 'rgb(223, 227, 45)',
+ ),
+ 'blue' => array(
+ 'name' => 'Blue',
+ 'background' => 'rgb(219, 235, 255)',
+ 'border' => 'rgb(168, 207, 255)',
+ ),
+ 'green' => array(
+ 'name' => 'Green',
+ 'background' => 'rgb(189, 244, 203)',
+ 'border' => 'rgb(74, 227, 113)',
+ ),
+ 'purple' => array(
+ 'name' => 'Purple',
+ 'background' => 'rgb(223, 176, 255)',
+ 'border' => 'rgb(205, 133, 254)',
+ ),
+ 'red' => array(
+ 'name' => 'Red',
+ 'background' => 'rgb(255, 187, 187)',
+ 'border' => 'rgb(255, 151, 151)',
+ ),
+ 'orange' => array(
+ 'name' => 'Orange',
+ 'background' => 'rgb(255, 215, 179)',
+ 'border' => 'rgb(255, 172, 98)',
+ ),
+ 'grey' => array(
+ 'name' => 'Grey',
+ 'background' => 'rgb(238, 238, 238)',
+ 'border' => 'rgb(204, 204, 204)',
+ ),
+ );
+
+ /**
* Get available colors
*
* @access public
* @return array
*/
- public function getList()
+ public function getList($prepend = false)
{
- return array(
+ $listing = $prepend ? array('' => t('All colors')) : array();
+
+ return $listing + array(
'yellow' => t('Yellow'),
'blue' => t('Blue'),
'green' => t('Green'),
@@ -39,4 +85,57 @@ class Color extends Base
{
return 'yellow'; // TODO: make this parameter configurable
}
+
+ /**
+ * Get Bordercolor from string
+ *
+ * @access public
+ * @param string $color_id Color id
+ * @return string
+ */
+ public function getBorderColor($color_id)
+ {
+ if (isset($this->default_colors[$color_id])) {
+ return $this->default_colors[$color_id]['border'];
+ }
+
+ return $this->default_colors[$this->getDefaultColor()]['border'];
+ }
+
+ /**
+ * Get background color from the color_id
+ *
+ * @access public
+ * @param string $color_id Color id
+ * @return string
+ */
+ public function getBackgroundColor($color_id)
+ {
+ if (isset($this->default_colors[$color_id])) {
+ return $this->default_colors[$color_id]['background'];
+ }
+
+ return $this->default_colors[$this->getDefaultColor()]['background'];
+ }
+
+ /**
+ * Get CSS stylesheet of all colors
+ *
+ * @access public
+ * @return string
+ */
+ public function getCss()
+ {
+ $buffer = '';
+
+ foreach ($this->default_colors as $color => $values) {
+ $buffer .= 'td.color-'.$color.',';
+ $buffer .= 'div.color-'.$color.' {';
+ $buffer .= 'background-color: '.$values['background'].';';
+ $buffer .= 'border-color: '.$values['border'];
+ $buffer .= '}';
+ }
+
+ return $buffer;
+ }
}
diff --git a/app/Model/DateParser.php b/app/Model/DateParser.php
index 518a4f3f..53fc9b76 100644
--- a/app/Model/DateParser.php
+++ b/app/Model/DateParser.php
@@ -99,6 +99,18 @@ class DateParser extends Base
}
/**
+ * Get a timetstamp from an ISO date format
+ *
+ * @access public
+ * @param string $date Date format
+ * @return integer
+ */
+ public function getTimestampFromIsoFormat($date)
+ {
+ return $this->resetDateToMidnight(strtotime($date));
+ }
+
+ /**
* Format date (form display)
*
* @access public
diff --git a/app/Model/Swimlane.php b/app/Model/Swimlane.php
index 069f14b6..7a88cec1 100644
--- a/app/Model/Swimlane.php
+++ b/app/Model/Swimlane.php
@@ -161,20 +161,20 @@ class Swimlane extends Base
*
* @access public
* @param integer $project_id Project id
+ * @param boolean $prepend Prepend default value
* @return array
*/
- public function getSwimlanesList($project_id)
+ public function getList($project_id, $prepend = false)
{
- $swimlanes = $this->db->table(self::TABLE)
- ->eq('project_id', $project_id)
- ->orderBy('position', 'asc')
- ->listing('id', 'name');
+ $swimlanes = array();
+ $swimlanes[] = $this->db->table(Project::TABLE)->eq('id', $project_id)->findOneColumn('default_swimlane');
- $swimlanes[0] = $this->db->table(Project::TABLE)
- ->eq('id', $project_id)
- ->findOneColumn('default_swimlane');
+ $swimlanes = array_merge(
+ $swimlanes,
+ $this->db->table(self::TABLE)->eq('project_id', $project_id)->orderBy('name', 'asc')->listing('id', 'name')
+ );
- return $swimlanes;
+ return $prepend ? array(-1 => t('All swimlanes')) + $swimlanes : $swimlanes;
}
/**
diff --git a/app/Model/TaskExport.php b/app/Model/TaskExport.php
index 1592deb1..9545d062 100644
--- a/app/Model/TaskExport.php
+++ b/app/Model/TaskExport.php
@@ -24,7 +24,7 @@ class TaskExport extends Base
public function export($project_id, $from, $to)
{
$tasks = $this->getTasks($project_id, $from, $to);
- $swimlanes = $this->swimlane->getSwimlanesList($project_id);
+ $swimlanes = $this->swimlane->getList($project_id);
$results = array($this->getColumns());
foreach ($tasks as &$task) {
diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php
new file mode 100644
index 00000000..eac90aab
--- /dev/null
+++ b/app/Model/TaskFilter.php
@@ -0,0 +1,117 @@
+<?php
+
+namespace Model;
+
+/**
+ * Task Filter
+ *
+ * @package model
+ * @author Frederic Guillot
+ */
+class TaskFilter extends Base
+{
+ private $query;
+
+ public function create()
+ {
+ $this->query = $this->db->table(Task::TABLE);
+ return $this;
+ }
+
+ public function filterByProject($project_id)
+ {
+ if ($project_id > 0) {
+ $this->query->eq('project_id', $project_id);
+ }
+
+ return $this;
+ }
+
+ public function filterByCategory($category_id)
+ {
+ if ($category_id >= 0) {
+ $this->query->eq('category_id', $category_id);
+ }
+
+ return $this;
+ }
+
+ public function filterByOwner($owner_id)
+ {
+ if ($owner_id >= 0) {
+ $this->query->eq('owner_id', $owner_id);
+ }
+
+ return $this;
+ }
+
+ public function filterByColor($color_id)
+ {
+ if ($color_id !== '') {
+ $this->query->eq('color_id', $color_id);
+ }
+
+ return $this;
+ }
+
+ public function filterByColumn($column_id)
+ {
+ if ($column_id >= 0) {
+ $this->query->eq('column_id', $column_id);
+ }
+
+ return $this;
+ }
+
+ public function filterBySwimlane($swimlane_id)
+ {
+ if ($swimlane_id >= 0) {
+ $this->query->eq('swimlane_id', $swimlane_id);
+ }
+
+ return $this;
+ }
+
+ public function filterByStatus($is_active)
+ {
+ if ($is_active >= 0) {
+ $this->query->eq('is_active', $is_active);
+ }
+
+ return $this;
+ }
+
+ public function filterByDueDateRange($start, $end)
+ {
+ $this->query->gte('date_due', $this->dateParser->getTimestampFromIsoFormat($start));
+ $this->query->lte('date_due', $this->dateParser->getTimestampFromIsoFormat($end));
+
+ return $this;
+ }
+
+ public function findAll()
+ {
+ return $this->query->findAll();
+ }
+
+ public function toCalendarEvents()
+ {
+ $events = array();
+
+ foreach ($this->query->findAll() as $task) {
+ $events[] = array(
+ 'id' => $task['id'],
+ 'title' => t('#%d', $task['id']).' '.$task['title'],
+ 'start' => date('Y-m-d', $task['date_due']),
+ 'end' => date('Y-m-d', $task['date_due']),
+ 'allday' => true,
+ 'backgroundColor' => $this->color->getBackgroundColor($task['color_id']),
+ 'borderColor' => $this->color->getBorderColor($task['color_id']),
+ 'textColor' => 'black',
+ 'url' => $this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])),
+ );
+ }
+
+ return $events;
+ }
+}
diff --git a/app/Model/TaskStatus.php b/app/Model/TaskStatus.php
index 225b3933..30a65e1e 100644
--- a/app/Model/TaskStatus.php
+++ b/app/Model/TaskStatus.php
@@ -13,6 +13,23 @@ use Event\TaskEvent;
class TaskStatus extends Base
{
/**
+ * Return the list of statuses
+ *
+ * @access public
+ * @param boolean $prepend Prepend default value
+ * @return array
+ */
+ public function getList($prepend = false)
+ {
+ $listing = $prepend ? array(-1 => t('All status')) : array();
+
+ return $listing + array(
+ Task::STATUS_OPEN => t('Open'),
+ Task::STATUS_CLOSED => t('Closed'),
+ );
+ }
+
+ /**
* Return true if the task is closed
*
* @access public
diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php
index 3177276a..983eb30b 100644
--- a/app/ServiceProvider/ClassProvider.php
+++ b/app/ServiceProvider/ClassProvider.php
@@ -39,6 +39,7 @@ class ClassProvider implements ServiceProviderInterface
'TaskDuplication',
'TaskExport',
'TaskFinder',
+ 'TaskFilter',
'TaskModification',
'TaskPaginator',
'TaskPermission',
@@ -51,6 +52,7 @@ class ClassProvider implements ServiceProviderInterface
'Webhook',
),
'Core' => array(
+ 'Helper',
'Template',
'Session',
'MemoryCache',
diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php
index 409697ac..724a6a5d 100644
--- a/app/Template/app/projects.php
+++ b/app/Template/app/projects.php
@@ -17,6 +17,7 @@
<?php if ($this->isManager($project['id'])): ?>
<?= $this->a('<i class="fa fa-cog"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>&nbsp;
<?php endif ?>
+ <?= $this->a('<i class="fa fa-calendar"></i>', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>&nbsp;
<?= $this->a($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
</td>
<td class="dashboard-project-stats">
diff --git a/app/Template/app/subtasks.php b/app/Template/app/subtasks.php
index 7081b174..2ad343e5 100644
--- a/app/Template/app/subtasks.php
+++ b/app/Template/app/subtasks.php
@@ -11,7 +11,7 @@
</tr>
<?php foreach ($subtasks as $subtask): ?>
<tr>
- <td class="task-table task-<?= $subtask['color_id'] ?>">
+ <td class="task-table color-<?= $subtask['color_id'] ?>">
<?= $this->a('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?>
</td>
<td>
diff --git a/app/Template/app/tasks.php b/app/Template/app/tasks.php
index a3d78a9d..dc485d7b 100644
--- a/app/Template/app/tasks.php
+++ b/app/Template/app/tasks.php
@@ -11,7 +11,7 @@
</tr>
<?php foreach ($tasks as $task): ?>
<tr>
- <td class="task-table task-<?= $task['color_id'] ?>">
+ <td class="task-table color-<?= $task['color_id'] ?>">
<?= $this->a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</td>
<td>
diff --git a/app/Template/board/filters.php b/app/Template/board/filters.php
index 36259820..1f0afe9c 100644
--- a/app/Template/board/filters.php
+++ b/app/Template/board/filters.php
@@ -23,13 +23,19 @@
<i class="fa fa-dashboard fa-fw"></i>
<?= $this->a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
</li>
+ <li>
+ <i class="fa fa-calendar fa-fw"></i>
+ <?= $this->a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
+ </li>
<?php if ($this->acl->isManagerActionAllowed($project['id'])): ?>
<li>
<i class="fa fa-line-chart fa-fw"></i>
<?= $this->a(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
</li>
- <li><i class="fa fa-cog fa-fw"></i>
+ <li>
+ <i class="fa fa-cog fa-fw"></i>
<?= $this->a(t('Configure'), 'project', 'show', array('project_id' => $project['id'])) ?>
+ </li>
<?php endif ?>
</ul>
</div> \ No newline at end of file
diff --git a/app/Template/board/task.php b/app/Template/board/task.php
index 6700b693..66ddee60 100644
--- a/app/Template/board/task.php
+++ b/app/Template/board/task.php
@@ -1,6 +1,6 @@
<?php if ($not_editable): ?>
-<div class="task-board task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>">
+<div class="task-board color-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>">
<?= $this->a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
@@ -30,7 +30,7 @@
<?php else: ?>
-<div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"
+<div class="task-board draggable-item color-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"
data-task-id="<?= $task['id'] ?>"
data-owner-id="<?= $task['owner_id'] ?>"
data-category-id="<?= $task['category_id'] ?>"
diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php
new file mode 100644
index 00000000..aae856f4
--- /dev/null
+++ b/app/Template/calendar/show.php
@@ -0,0 +1,29 @@
+<section id="main">
+ <div class="page-header">
+ <ul>
+ <li><i class="fa fa-table fa-fw"></i><?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
+ </ul>
+ </div>
+ <section class="sidebar-container">
+
+ <?= $this->render('calendar/sidebar', array(
+ 'project' => $project,
+ 'users_list' => $users_list,
+ 'categories_list' => $categories_list,
+ 'columns_list' => $columns_list,
+ 'swimlanes_list' => $swimlanes_list,
+ 'colors_list' => $colors_list,
+ 'status_list' => $status_list
+ )) ?>
+
+ <div class="sidebar-content">
+ <div id="calendar"
+ data-save-url="<?= $this->u('calendar', 'save', array('project_id' => $project['id'])) ?>"
+ data-check-url="<?= $this->u('calendar', 'events', array('project_id' => $project['id'])) ?>"
+ data-check-interval="<?= $check_interval ?>"
+ data-translations='<?= $this->getCalendarTranslations() ?>'
+ >
+ </div>
+ </div>
+ </section>
+</section>
diff --git a/app/Template/calendar/sidebar.php b/app/Template/calendar/sidebar.php
new file mode 100644
index 00000000..599b2912
--- /dev/null
+++ b/app/Template/calendar/sidebar.php
@@ -0,0 +1,40 @@
+<div class="sidebar">
+ <ul class="no-bullet">
+ <li>
+ <?= t('Filter by user') ?>
+ </li>
+ <li>
+ <?= $this->formSelect('owner_id', $users_list, array(), array(), 'calendar-filter') ?>
+ </li>
+ <li>
+ <?= t('Filter by category') ?>
+ </li>
+ <li>
+ <?= $this->formSelect('category_id', $categories_list, array(), array(), 'calendar-filter') ?>
+ </li>
+ <li>
+ <?= t('Filter by column') ?>
+ </li>
+ <li>
+ <?= $this->formSelect('column_id', $columns_list, array(), array(), 'calendar-filter') ?>
+ </li>
+ <li>
+ <?= t('Filter by swimlane') ?>
+ </li>
+ <li>
+ <?= $this->formSelect('swimlane_id', $swimlanes_list, array(), array(), 'calendar-filter') ?>
+ </li>
+ <li>
+ <?= t('Filter by color') ?>
+ </li>
+ <li>
+ <?= $this->formSelect('color_id', $colors_list, array(), array(), 'calendar-filter') ?>
+ </li>
+ <li>
+ <?= t('Filter by status') ?>
+ </li>
+ <li>
+ <?= $this->formSelect('is_active', $status_list, array(), array(), 'calendar-filter') ?>
+ </li>
+ </ul>
+</div>
diff --git a/app/Template/layout.php b/app/Template/layout.php
index 9aa34905..283a85f8 100644
--- a/app/Template/layout.php
+++ b/app/Template/layout.php
@@ -14,6 +14,7 @@
<?= $this->js('assets/js/app.js') ?>
<?php endif ?>
+ <?= $this->css($this->u('app', 'colors'), false) ?>
<?= $this->css('assets/css/app.css') ?>
<link rel="icon" type="image/png" href="assets/img/favicon.png">
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index 50145da4..3205514c 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -1,4 +1,4 @@
-<div class="task-<?= $task['color_id'] ?> task-show-details">
+<div class="color-<?= $task['color_id'] ?> task-show-details">
<h2><?= $this->e('#'.$task['id'].' '.$task['title']) ?></h2>
<?php if ($task['score']): ?>
<span class="task-score"><?= $this->e($task['score']) ?></span>
diff --git a/app/Template/task/table.php b/app/Template/task/table.php
index 689cdcc4..e8ca7c51 100644
--- a/app/Template/task/table.php
+++ b/app/Template/task/table.php
@@ -12,7 +12,7 @@
</tr>
<?php foreach ($tasks as $task): ?>
<tr>
- <td class="task-table task-<?= $task['color_id'] ?>">
+ <td class="task-table color-<?= $task['color_id'] ?>">
<?= $this->a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>