11 changed files with 0 additions and 285 deletions
-
20apps/tasks/ajax/addtaskform.php
-
32apps/tasks/ajax/edittask.php
-
24apps/tasks/ajax/edittaskform.php
-
24apps/tasks/ajax/getdetails.php
-
62apps/tasks/js/tasks.js
-
15apps/tasks/templates/part.addtaskform.php
-
42apps/tasks/templates/part.details.php
-
5apps/tasks/templates/part.edittaskform.php
-
22apps/tasks/templates/part.property.php
-
36apps/tasks/templates/part.taskform.php
-
3apps/tasks/templates/part.tasks.php
@ -1,20 +0,0 @@ |
|||
<?php |
|||
|
|||
// Init owncloud
|
|||
OCP\JSON::checkLoggedIn(); |
|||
OCP\JSON::checkAppEnabled('tasks'); |
|||
|
|||
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true); |
|||
$category_options = OC_Calendar_App::getCategoryOptions(); |
|||
$percent_options = range(0, 100, 10); |
|||
$priority_options = OC_Task_App::getPriorityOptions(); |
|||
$tmpl = new OCP\Template('tasks','part.addtaskform'); |
|||
$tmpl->assign('calendars',$calendars); |
|||
$tmpl->assign('category_options', $category_options); |
|||
$tmpl->assign('percent_options', $percent_options); |
|||
$tmpl->assign('priority_options', $priority_options); |
|||
$tmpl->assign('details', new OC_VObject('VTODO')); |
|||
$tmpl->assign('categories', ''); |
|||
$page = $tmpl->fetchPage(); |
|||
|
|||
OCP\JSON::success(array('data' => array( 'page' => $page ))); |
|||
@ -1,32 +0,0 @@ |
|||
<?php |
|||
|
|||
// Init owncloud
|
|||
OCP\JSON::checkLoggedIn(); |
|||
OCP\JSON::checkAppEnabled('tasks'); |
|||
OCP\JSON::callCheck(); |
|||
|
|||
$l10n = new OC_L10N('tasks'); |
|||
|
|||
$id = $_POST['id']; |
|||
$vcalendar = OC_Calendar_App::getVCalendar($id); |
|||
|
|||
$errors = OC_Task_App::validateRequest($_POST); |
|||
if (!empty($errors)) { |
|||
OCP\JSON::error(array('data' => array( 'errors' => $errors ))); |
|||
exit(); |
|||
} |
|||
|
|||
OC_Task_App::updateVCalendarFromRequest($_POST, $vcalendar); |
|||
OC_Calendar_Object::edit($id, $vcalendar->serialize()); |
|||
|
|||
$priority_options = OC_Task_App::getPriorityOptions(); |
|||
$tmpl = new OCP\Template('tasks','part.details'); |
|||
$tmpl->assign('priority_options', $priority_options); |
|||
$tmpl->assign('details', $vcalendar->VTODO); |
|||
$tmpl->assign('id', $id); |
|||
$page = $tmpl->fetchPage(); |
|||
|
|||
$user_timezone = OC_Calendar_App::getTimezone(); |
|||
$task = OC_Task_App::arrayForJSON($id, $vcalendar->VTODO, $user_timezone); |
|||
|
|||
OCP\JSON::success(array('data' => array( 'id' => $id, 'page' => $page, 'task' => $task ))); |
|||
@ -1,24 +0,0 @@ |
|||
<?php |
|||
|
|||
// Init owncloud
|
|||
OCP\JSON::checkLoggedIn(); |
|||
OCP\JSON::checkAppEnabled('tasks'); |
|||
|
|||
$id = $_GET['id']; |
|||
$details = OC_Calendar_App::getVCalendar($id)->VTODO; |
|||
$categories = $details->getAsString('CATEGORIES'); |
|||
|
|||
$category_options = OC_Calendar_App::getCategoryOptions(); |
|||
$percent_options = range(0, 100, 10); |
|||
$priority_options = OC_Task_App::getPriorityOptions(); |
|||
|
|||
$tmpl = new OCP\Template('tasks','part.edittaskform'); |
|||
$tmpl->assign('category_options', $category_options); |
|||
$tmpl->assign('percent_options', $percent_options); |
|||
$tmpl->assign('priority_options', $priority_options); |
|||
$tmpl->assign('id',$id); |
|||
$tmpl->assign('details',$details); |
|||
$tmpl->assign('categories', $categories); |
|||
$page = $tmpl->fetchPage(); |
|||
|
|||
OCP\JSON::success(array('data' => array( 'page' => $page ))); |
|||
@ -1,24 +0,0 @@ |
|||
<?php |
|||
|
|||
// Init owncloud
|
|||
OCP\JSON::checkLoggedIn(); |
|||
OCP\JSON::checkAppEnabled('tasks'); |
|||
|
|||
$l10n = new OC_L10N('tasks'); |
|||
|
|||
$id = $_GET['id']; |
|||
$task = OC_Calendar_Object::find($id); |
|||
$details = OC_VObject::parse($task['calendardata']); |
|||
if (!$details){ |
|||
OCP\JSON::error(); |
|||
exit; |
|||
} |
|||
|
|||
$priority_options = OC_Task_App::getPriorityOptions(); |
|||
$tmpl = new OCP\Template('tasks','part.details'); |
|||
$tmpl->assign('priority_options', $priority_options); |
|||
$tmpl->assign('details',$details->VTODO); |
|||
$tmpl->assign('id',$id); |
|||
$page = $tmpl->fetchPage(); |
|||
|
|||
OCP\JSON::success(array('data' => array( 'id' => $id, 'page' => $page ))); |
|||
@ -1,15 +0,0 @@ |
|||
<form id="tasks_addtaskform"> |
|||
<?php if(count($_['calendars'])==1): ?>
|
|||
<input type="hidden" name="id" value="<?php echo $_['calendars'][0]['id']; ?>"> |
|||
<?php else: ?>
|
|||
<label for="id"><?php echo $l->t('Calendar'); ?></label>
|
|||
<select name="id" size="1"> |
|||
<?php foreach($_['calendars'] as $calendar): ?>
|
|||
<option value="<?php echo $calendar['id']; ?>"><?php echo $calendar['displayname']; ?></option>
|
|||
<?php endforeach; ?>
|
|||
</select> |
|||
<br> |
|||
<?php endif; ?>
|
|||
<?php echo $this->inc('part.taskform'); ?>
|
|||
<input type="submit" name="submit" value="<?php echo $l->t('Create Task'); ?>"> |
|||
</form> |
|||
@ -1,42 +0,0 @@ |
|||
<?php if(isset($_['details']->SUMMARY)): ?>
|
|||
<table> |
|||
<?php |
|||
echo $this->inc('part.property', array('label' => $l->t('Summary'), 'property' => $_['details']->SUMMARY)); |
|||
if(isset($_['details']->LOCATION)): |
|||
echo $this->inc('part.property', array('label' => $l->t('Location'), 'property' => $_['details']->LOCATION)); |
|||
endif; |
|||
if(isset($_['details']->CATEGORIES)): |
|||
echo $this->inc('part.property', array('label' => $l->t('Categories'), 'property' => $_['details']->CATEGORIES)); |
|||
endif; |
|||
if(isset($_['details']->DUE)): |
|||
echo $this->inc('part.property', array('label' => $l->t('Due'), 'property' => $_['details']->DUE[0])); |
|||
endif; |
|||
if(isset($_['details']->PRIORITY)): |
|||
echo $this->inc('part.property', array('label' => $l->t('Priority'), 'property' => $_['details']->PRIORITY[0], 'options' => $_['priority_options'])); |
|||
endif; |
|||
if($_['details']->__isset('PERCENT-COMPLETE') || isset($_['details']->COMPLETED)): |
|||
?>
|
|||
<tr> |
|||
<th> |
|||
<?php echo $l->t('Complete') ?>
|
|||
</th> |
|||
<td> |
|||
<?php if($_['details']->__isset('PERCENT-COMPLETE')): |
|||
echo $_['details']->__get('PERCENT-COMPLETE')->value.' % '; |
|||
endif; |
|||
if(isset($_['details']->COMPLETED)): |
|||
echo $l->t('on '). $l->l('datetime', $_['details']->COMPLETED[0]->getDateTime()); |
|||
endif; |
|||
echo '</tr>'; |
|||
endif; |
|||
if(isset($_['details']->DESCRIPTION)): |
|||
echo $this->inc('part.property', array('label' => $l->t('Description'), 'property' => $_['details']->DESCRIPTION)); |
|||
endif; ?>
|
|||
</table> |
|||
<form> |
|||
<input type="button" id="tasks_delete" value="<?php echo $l->t('Delete');?>"> |
|||
<input type="button" id="tasks_edit" value="<?php echo $l->t('Edit');?>"> |
|||
</form> |
|||
<?php else: ?>
|
|||
<?php //var_dump($_['details']); ?>
|
|||
<?php endif ?>
|
|||
@ -1,5 +0,0 @@ |
|||
<form id="tasks_edittaskform"> |
|||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>"> |
|||
<?php echo $this->inc('part.taskform'); ?>
|
|||
<input type="submit" name="submit" value="<?php echo $l->t('Update Task'); ?>"> |
|||
</form> |
|||
@ -1,22 +0,0 @@ |
|||
<tr> |
|||
<th> |
|||
<?php echo $_['label'] ?>
|
|||
</th> |
|||
<td> |
|||
<?php |
|||
switch (get_class($_['property'])) |
|||
{ |
|||
case 'Sabre_VObject_Element_DateTime': |
|||
echo $l->l('datetime', $_['property']->getDateTime()); |
|||
break; |
|||
default: |
|||
$value = $_['property']->value; |
|||
if (isset($_['options'])) |
|||
{ |
|||
$value = $_['options'][$value]; |
|||
} |
|||
echo nl2br($value); |
|||
} |
|||
?>
|
|||
</td> |
|||
</tr> |
|||
@ -1,36 +0,0 @@ |
|||
<label for="summary"><?php echo $l->t('Summary'); ?></label>
|
|||
<input type="text" id="summary" name="summary" placeholder="<?php echo $l->t('Summary of the task');?>" value="<?php echo isset($_['details']->SUMMARY) ? $_['details']->SUMMARY[0]->value : '' ?>"> |
|||
<br> |
|||
<label for="location"><?php echo $l->t('Location'); ?></label>
|
|||
<input type="text" id="location" name="location" placeholder="<?php echo $l->t('Location of the task');?>" value="<?php echo isset($_['details']->LOCATION) ? $_['details']->LOCATION[0]->value : '' ?>"> |
|||
<br> |
|||
<label for="categories"><?php echo $l->t('Categories'); ?></label>
|
|||
<input id="categories" name="categories" type="text" placeholder="<?php echo $l->t('Separate categories with commas'); ?>" value="<?php echo isset($_['categories']) ? $_['categories'] : '' ?>"> |
|||
<a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo OCP\image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a> |
|||
<br> |
|||
<label for="due"><?php echo $l->t('Due'); ?></label>
|
|||
<input type="text" id="due" name="due" placeholder="<?php echo $l->t('Due date') ?>" value="<?php echo isset($_['details']->DUE) ? $l->l('datetime', $_['details']->DUE[0]->getDateTime()) : '' ?>"> |
|||
<br> |
|||
<select name="percent_complete" id="percent_complete"> |
|||
<?php |
|||
foreach($_['percent_options'] as $percent){ |
|||
echo '<option value="' . $percent . '"' . (($_['details']->__get('PERCENT-COMPLETE') && $percent == $_['details']->__get('PERCENT-COMPLETE')->value) ? ' selected="selected"' : '') . '>' . $percent . ' %</option>'; |
|||
} |
|||
?>
|
|||
</select> |
|||
<label for="percent_complete"><?php echo $l->t('Complete'); ?></label>
|
|||
<span id="complete"<?php echo ($_['details']->__get('PERCENT-COMPLETE') && $_['details']->__get('PERCENT-COMPLETE')->value == 100) ? '' : ' style="display:none;"' ?>><label for="completed"><?php echo $l->t('completed on'); ?></label>
|
|||
<input type="text" id="completed" name="completed" value="<?php echo isset($_['details']->COMPLETED) ? $l->l('datetime', $_['details']->COMPLETED[0]->getDateTime()) : '' ?>"></span> |
|||
<br> |
|||
<label for="priority"><?php echo $l->t('Priority'); ?></label>
|
|||
<select name="priority"> |
|||
<?php |
|||
foreach($_['priority_options'] as $priority => $label){ |
|||
echo '<option value="' . $priority . '"' . ((isset($_['details']->PRIORITY) && $priority == $_['details']->PRIORITY->value) ? ' selected="selected"' : '') . '>' . $label . '</option>'; |
|||
} |
|||
?>
|
|||
</select> |
|||
<br> |
|||
<label for="description"><?php echo $l->t('Description'); ?></label><br>
|
|||
<textarea placeholder="<?php echo $l->t('Description of the task');?>" name="description"><?php echo isset($_['details']->DESCRIPTION) ? $_['details']->DESCRIPTION[0]->value : '' ?></textarea>
|
|||
<br> |
|||
@ -1,3 +0,0 @@ |
|||
<?php foreach( $_['tasks'] as $task ): ?>
|
|||
<li data-id="<?php echo $task['id']; ?>"><a href="index.php?id=<?php echo $task['id']; ?>"><?php echo $task['name']; ?></a> </li>
|
|||
<?php endforeach; ?>
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue