Display reminders in details view

This commit is contained in:
raimund-schluessler 2014-04-14 23:01:07 +02:00
parent 6e38fd5dea
commit 59576d4538
4 changed files with 70 additions and 20 deletions

View file

@ -890,14 +890,20 @@
#task-details .body .section.date .section-title.repeat {
margin-top: -2px;
}
#task-details .body .section .section-description {
#task-details .body .section.detail-reminder .section-description {
display: none;
font-size: 11px;
margin-top: -6px;
}
#task-details .body .section .section-description.repeat {
#task-details .body .section.detail-reminder .section-description.repeat {
display: block;
}
#task-details .body .section.detail-reminder.date .section-description {
display: block;
}
#task-details .body .section.detail-reminder.date .section-title {
margin-top: -2px;
}
input,
textarea {
-moz-user-select: text;

View file

@ -910,12 +910,22 @@
}
}
}
.section-description{
display: none;
font-size: 11px;
margin-top:-6px;
&.repeat{
display:block;
&.detail-reminder{
.section-description{
display: none;
font-size: 11px;
margin-top:-6px;
&.repeat{
display:block;
}
}
&.date{
.section-description{
display: block;
}
.section-title{
margin-top:-2px;
}
}
}
}

View file

@ -22,6 +22,7 @@
namespace OCA\Tasks_enhanced;
use Sabre\VObject;
// use OCA\Tasks_enhanced\App;
Class helper {
@ -38,6 +39,19 @@ Class helper {
$task['note'] = $vtodo->getAsString('DESCRIPTION');
$task['location'] = $vtodo->getAsString('LOCATION');
$task['categories'] = $vtodo->getAsArray('CATEGORIES');
$start = $vtodo->DTSTART;
if ($start) {
try {
$start = $start->getDateTime();
$start->setTimezone(new \DateTimeZone($user_timezone));
$task['start'] = $start->format('Ymd\THis');
} catch(\Exception $e) {
$task['start'] = 'undefined';
\OCP\Util::writeLog('tasks_enhanced', $e->getMessage(), \OCP\Util::ERROR);
}
} else {
$task['start'] = 'undefined';
}
$due = $vtodo->DUE;
if ($due) {
try {
@ -51,12 +65,34 @@ Class helper {
} else {
$task['due'] = 'undefined';
}
$reminder = $vtodo->REMINDER;
$reminder = $vtodo->VALARM;
if($reminder) {
try {
$reminder = $reminder->getDateTime();
$reminder->setTimezone(new \DateTimeZone($user_timezone));
$task['reminder'] = $reminder->format('Ymd\THis');
$reminderType = $reminder->TRIGGER['VALUE']->value;
$reminderTrigger = $reminder->TRIGGER->value;
$reminderAction = $reminder->ACTION->value;
if($reminderType == 'DATE-TIME'){
$reminderDate = $reminder->TRIGGER->getDateTime();
$reminderDate->setTimezone(new \DateTimeZone($user_timezone));
$reminderDate = $reminderDate->format('Ymd\THis');
} elseif ($reminderType == 'DURATION' && $start) {
$parsed = VObject\DateTimeParser::parseDuration($reminder->TRIGGER,true);
// Calculate the reminder date from duration and start date
$reminderDate = $start->modify($parsed)->format('Ymd\THis');
} else {
$reminderDate = 'undefined';
}
$task['reminder'] = array(
'type' => $reminderType,
'trigger' => $reminderTrigger,
'action' => $reminderAction,
'date' => $reminderDate
);
} catch(\Exception $e) {
$task['reminder'] = 'undefined';
\OCP\Util::writeLog('tasks_enhanced', $e->getMessage(), \OCP\Util::ERROR);

View file

@ -30,25 +30,23 @@
<input class="datepicker-input medium focus" type="text" key-value="" value="{{ task.due | dateTaskList }}" datepicker="due">
</div>
</div>
<!--
<div class="section detail-reminder" ng-class="{'date':isDue(task.reminder), 'editing':route.parameter=='reminder'}" ng-click="editReminder()" stop-event="click"
<div class="section detail-reminder" ng-class="{'date':isDue(task.reminder.date), 'editing':route.parameter=='reminder'}" ng-click="editReminder()" stop-event="click"
oc-click-focus="{selector: 'div.detail-reminder input.datepicker-input', timeout: 0}">
<span class="icon detail-reminder" ng-class="{'overdue':isOverDue(task.reminder)}"></span>
<div class="section-title" ng-class="{'overdue':isOverDue(task.reminder)}" ng-hide="route.parameter=='reminder'">
<text rel="">{{ task.reminder | timeDetails }}</text>
<span class="icon detail-reminder" ng-class="{'overdue':isOverDue(task.reminder.date)}"></span>
<div class="section-title" ng-class="{'overdue':isOverDue(task.reminder.date)}" ng-hide="route.parameter=='reminder'">
<text rel="">{{ task.reminder.date | timeDetails }}</text>
</div>
<div class="section-description">{{ task.reminder | dateDetailsShort }}</div>
<div class="section-description">{{ task.reminder.date | dateDetailsShort }}</div>
<a class="detail-delete" ng-click="deleteReminder()" stop-event="click">
<span class="icon detail-delete"></span>
</a>
<span class="icon detail-save" ng-click="endEdit()" stop-event="click"></span>
<div class="section-edit" ng-show="route.parameter=='reminder'">
<input class="datepicker-input medium focus" type="text" key-value="" value="{{ task.reminder | dateTaskList }}" datepicker="reminder">
<input class="datepicker-input medium focus" type="text" key-value="" value="{{ task.reminder.date | dateTaskList }}" datepicker="reminder">
</div>
</div>
<ul class="subtasks buffer">
</ul>
-->
<div class="note">
<div class="note-body selectable" ng-click="editNote()" stop-event="click" oc-click-focus="{selector: '.expandingArea textarea', timeout: 0}">
<!--