diff --git a/app/Core/Helper.php b/app/Core/Helper.php
index d60e29d4e..57d1b98ad 100644
--- a/app/Core/Helper.php
+++ b/app/Core/Helper.php
@@ -49,6 +49,33 @@ class Helper
return $this->container[$name];
}
+ /**
+ * Get the age of an item in quasi human readable format.
+ * It's in this format: <1h , NNh, NNd
+ *
+ * @access public
+ * @param integer $timestamp Unix timestamp of the artifact for which age will be calculated
+ * @param integer $now Compare with this timestamp (Default value is the current unix timestamp)
+ * @return string
+ */
+ public function getTaskAge($timestamp, $now = null)
+ {
+ if ($now === null) {
+ $now = time();
+ }
+
+ $diff = $now - $timestamp;
+
+ if ($diff < 3600) {
+ return t('<1h');
+ }
+ else if ($diff < 86400) {
+ return t('%dh', $diff / 3600);
+ }
+
+ return t('%dd', ($now - $timestamp) / 86400);
+ }
+
/**
* Proxy cache helper for acl::isManagerActionAllowed()
*
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index db91895f4..b6186a334 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index 967d5f62b..f954ce78c 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index c69d90843..60a90c9ab 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index 0dd29c37c..420546461 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index 7872dec4b..26372c485 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -721,4 +721,7 @@ return array(
'fixes' => 'corrige',
'is fixed by' => 'est corrigée par',
'This task' => 'Cette tâche',
+ '<1h' => '<1h',
+ '%dh' => '%dh',
+ '%b %e' => '%e %b',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index 1f8de0eaa..487492b2d 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index afd41d5cc..f395caffa 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index 9d06b83fe..ab62128c4 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 2ebfc2191..688230faf 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index ded6e0dbb..d7759fc81 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index de7925160..0afd3643d 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index 838b426a9..c9a9b041a 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index 66c7712b4..502b1135f 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index 32278e217..756907084 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -719,4 +719,7 @@ return array(
// 'fixes' => '',
// 'is fixed by' => '',
// 'This task' => '',
+ // '<1h' => '',
+ // '%dh' => '',
+ // '%b %e' => '',
);
diff --git a/app/Template/board/task.php b/app/Template/board/task.php
index 075eab92e..638078c3a 100644
--- a/app/Template/board/task.php
+++ b/app/Template/board/task.php
@@ -20,10 +20,6 @@
-
- = $this->e($task['score']) ?>
-
-
= $this->a($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
@@ -59,7 +55,7 @@
= $this->a(
- (! empty($task['owner_id']) ? t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')),
+ (! empty($task['owner_id']) ? ($task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')),
'board',
'changeAssignee',
array('task_id' => $task['id'], 'project_id' => $task['project_id']),
@@ -68,13 +64,9 @@
t('Change assignee')
) ?>
-
- = getAgeShort ($task['date_creation']) ?>
- = getAgeShort ($task['date_moved']) ?>
-
-
- = $this->e($task['score']) ?>
-
+
+ = $this->getTaskAge($task['date_creation']) ?>
+ = $this->getTaskAge($task['date_moved']) ?>
= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
@@ -99,40 +91,34 @@
-
-
-
diff --git a/app/functions.php b/app/functions.php
index a748f0054..439375be9 100644
--- a/app/functions.php
+++ b/app/functions.php
@@ -63,31 +63,9 @@ function dt($format, $timestamp)
* @todo Improve this function
* @return mixed
*/
-function p($value, $t1, $t2) {
+function p($value, $t1, $t2)
+{
return $value > 1 ? $t2 : $t1;
}
-/**
- * Get the age of an item in quasi human readable format.
- * It's in this format: <1h , NNh, NNd
- *
- * @access public
- * @param int $time
- * Unix timestamp of the artifact for which age will be calculated
- * @param int $currenttime
- * Comepare with timestamp. Default current unix timestamp
- * @return string
- */
-function getAgeShort($time, $currenttime = NULL) {
- if (! $currenttime) {
- $currenttime = time ();
- }
- $diff = $currenttime - $time;
- if ($diff < 3600)
- return "<1h";
- elseif ($diff < 86400) {
- return intval ( ($diff / 3600) ) . "h";
- }
- return intval ( ((floor ( $currenttime ) - floor ( $time )) / 86400) ) . "d";
-}
diff --git a/assets/css/app.css b/assets/css/app.css
index 04eaca540..acb1e0429 100644
--- a/assets/css/app.css
+++ b/assets/css/app.css
@@ -783,11 +783,10 @@ a.filter-on {
/* task inside the board */
.task-board {
position: relative;
- margin-right: 5px;
- margin-bottom: 10px;
+ margin-bottom: 5px;
border: 1px solid #000;
- padding: 5px;
- font-size: 95%;
+ padding: 3px;
+ font-size: 0.9em;
word-wrap: break-word;
}
@@ -811,7 +810,7 @@ div.task-board-recent {
.task-board-title {
margin-top: 10px;
- font-size: 110%;
+ font-size: 1.1em;
}
.task-board-title a {
@@ -819,7 +818,7 @@ div.task-board-recent {
}
.task-board-user {
- font-size: 80%;
+ font-size: 0.8em;
}
.task-board-current-user a {
@@ -848,32 +847,14 @@ a.task-board-nobody {
font-size: 0.9em;
color: #000;
border: 1px solid #555;
- border-radius: 4px;
padding: 2px;
padding-right: 5px;
padding-left: 5px;
}
-.task-board-footer {
- height: 25px;
-}
-
-.task-board-date {
- position: absolute;
- bottom: 0;
- left: 1px;
- font-weight: bold;
- color: #000;
-}
-
-.task-board-date-overdue {
- color: #D90000;
-}
-
.task-board-icons {
- position: absolute;
- bottom: 0;
- right: 5px;
+ text-align: right;
+ margin-top: 8px;
}
.task-board-icons a {
@@ -890,16 +871,43 @@ a.task-board-nobody {
opacity: 1.0;
}
+.task-board-date {
+ font-weight: bold;
+ color: #000;
+}
+
+.task-board-date-overdue {
+ color: #D90000;
+}
+
/* task score */
.task-score {
font-weight: bold;
position: absolute;
+ font-size: 1.6em;
+ right: 5px;
+ bottom: 5px;
}
-.task-board .task-score {
- font-size: 1.5em;
- right: 5px;
- top: 0;
+/* task age */
+.task-days-age {
+ font-size: 0.8em;
+ border: #888 1px solid;
+ border-radius:2px;
+ padding: 1px 4px 1px 2px;
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+.task-days-incolumn {
+ font-size: 0.8em;
+ border: #888 1px solid;
+ border-left: none;
+ margin-left: -5px;
+ border-radius:2px;
+ padding: 1px 2px 1px 4px;
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
}
/* task view */
@@ -988,26 +996,6 @@ a.task-board-nobody {
padding: 3px;
}
-.task-days-age {
- font-size: 0.8em;
- border: #888 1px solid;
- border-radius:2px;
- padding: 1px 4px 1px 2px;
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-.task-days-incolumn {
- font-size: 0.8em;
- border: #888 1px solid;
- border-left: none;
- margin-left: -5px;
- border-radius:2px;
- padding: 1px 2px 1px 4px;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
.task-link-closed {
text-decoration: line-through;
}
diff --git a/assets/css/src/task.css b/assets/css/src/task.css
index c16304a61..7a5b61c94 100644
--- a/assets/css/src/task.css
+++ b/assets/css/src/task.css
@@ -1,11 +1,10 @@
/* task inside the board */
.task-board {
position: relative;
- margin-right: 5px;
- margin-bottom: 10px;
+ margin-bottom: 5px;
border: 1px solid #000;
- padding: 5px;
- font-size: 95%;
+ padding: 3px;
+ font-size: 0.9em;
word-wrap: break-word;
}
@@ -29,7 +28,7 @@ div.task-board-recent {
.task-board-title {
margin-top: 10px;
- font-size: 110%;
+ font-size: 1.1em;
}
.task-board-title a {
@@ -37,7 +36,7 @@ div.task-board-recent {
}
.task-board-user {
- font-size: 80%;
+ font-size: 0.8em;
}
.task-board-current-user a {
@@ -66,32 +65,14 @@ a.task-board-nobody {
font-size: 0.9em;
color: #000;
border: 1px solid #555;
- border-radius: 4px;
padding: 2px;
padding-right: 5px;
padding-left: 5px;
}
-.task-board-footer {
- height: 25px;
-}
-
-.task-board-date {
- position: absolute;
- bottom: 0;
- left: 1px;
- font-weight: bold;
- color: #000;
-}
-
-.task-board-date-overdue {
- color: #D90000;
-}
-
.task-board-icons {
- position: absolute;
- bottom: 0;
- right: 5px;
+ text-align: right;
+ margin-top: 8px;
}
.task-board-icons a {
@@ -108,16 +89,43 @@ a.task-board-nobody {
opacity: 1.0;
}
+.task-board-date {
+ font-weight: bold;
+ color: #000;
+}
+
+.task-board-date-overdue {
+ color: #D90000;
+}
+
/* task score */
.task-score {
font-weight: bold;
position: absolute;
+ font-size: 1.6em;
+ right: 5px;
+ bottom: 5px;
}
-.task-board .task-score {
- font-size: 1.5em;
- right: 5px;
- top: 0;
+/* task age */
+.task-days-age {
+ font-size: 0.8em;
+ border: #888 1px solid;
+ border-radius:2px;
+ padding: 1px 4px 1px 2px;
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+.task-days-incolumn {
+ font-size: 0.8em;
+ border: #888 1px solid;
+ border-left: none;
+ margin-left: -5px;
+ border-radius:2px;
+ padding: 1px 2px 1px 4px;
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
}
/* task view */
@@ -206,26 +214,6 @@ a.task-board-nobody {
padding: 3px;
}
-.task-days-age {
- font-size: 0.8em;
- border: #888 1px solid;
- border-radius:2px;
- padding: 1px 4px 1px 2px;
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-.task-days-incolumn {
- font-size: 0.8em;
- border: #888 1px solid;
- border-left: none;
- margin-left: -5px;
- border-radius:2px;
- padding: 1px 2px 1px 4px;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
.task-link-closed {
text-decoration: line-through;
}