summaryrefslogtreecommitdiffstats
path: root/apps/tasks
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-07-21 00:52:49 +0200
committerBart Visscher <bartv@thisnet.nl>2012-07-21 00:52:49 +0200
commitad12e13f1473dfdf963bb69a196de5aa16e7ebe8 (patch)
tree8487d0ba7f6a50a55e94edef987e086036b4ade4 /apps/tasks
parent060b8865a4701cfe400e424765031c219330fa1a (diff)
downloadnextcloud-server-ad12e13f1473dfdf963bb69a196de5aa16e7ebe8.tar.gz
nextcloud-server-ad12e13f1473dfdf963bb69a196de5aa16e7ebe8.zip
Tasks: Remove unused code
Diffstat (limited to 'apps/tasks')
-rw-r--r--apps/tasks/ajax/addtaskform.php20
-rw-r--r--apps/tasks/ajax/edittask.php32
-rw-r--r--apps/tasks/ajax/edittaskform.php24
-rw-r--r--apps/tasks/ajax/getdetails.php24
-rw-r--r--apps/tasks/js/tasks.js62
-rw-r--r--apps/tasks/templates/part.addtaskform.php15
-rw-r--r--apps/tasks/templates/part.details.php42
-rw-r--r--apps/tasks/templates/part.edittaskform.php5
-rw-r--r--apps/tasks/templates/part.property.php22
-rw-r--r--apps/tasks/templates/part.taskform.php36
-rw-r--r--apps/tasks/templates/part.tasks.php3
11 files changed, 0 insertions, 285 deletions
diff --git a/apps/tasks/ajax/addtaskform.php b/apps/tasks/ajax/addtaskform.php
deleted file mode 100644
index d86232e2da5..00000000000
--- a/apps/tasks/ajax/addtaskform.php
+++ /dev/null
@@ -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 )));
diff --git a/apps/tasks/ajax/edittask.php b/apps/tasks/ajax/edittask.php
deleted file mode 100644
index e1475c7d45a..00000000000
--- a/apps/tasks/ajax/edittask.php
+++ /dev/null
@@ -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 )));
diff --git a/apps/tasks/ajax/edittaskform.php b/apps/tasks/ajax/edittaskform.php
deleted file mode 100644
index e5a0a7297c5..00000000000
--- a/apps/tasks/ajax/edittaskform.php
+++ /dev/null
@@ -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 )));
diff --git a/apps/tasks/ajax/getdetails.php b/apps/tasks/ajax/getdetails.php
deleted file mode 100644
index 4ce469e0c9c..00000000000
--- a/apps/tasks/ajax/getdetails.php
+++ /dev/null
@@ -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 )));
diff --git a/apps/tasks/js/tasks.js b/apps/tasks/js/tasks.js
index bc92965bb0b..de627927507 100644
--- a/apps/tasks/js/tasks.js
+++ b/apps/tasks/js/tasks.js
@@ -469,67 +469,5 @@ $(document).ready(function(){
return false;
});
- $('#tasks_addtaskform input[type="submit"]').live('click',function(){
- $.post('ajax/addtask.php',$('#tasks_addtaskform').serialize(),function(jsondata){
- if(jsondata.status == 'success'){
- $('#task_details').data('id',jsondata.data.id);
- $('#task_details').html(jsondata.data.page);
- $('#tasks_list').append(OC.Tasks.create_task_div(jsondata.data.task));
- }
- else{
- alert(jsondata.data.message);
- }
- }, 'json');
- return false;
- });
-
- $('#tasks_edit').live('click',function(){
- var id = $('#task_details').data('id');
- $.getJSON('ajax/edittaskform.php',{'id':id},function(jsondata){
- if(jsondata.status == 'success'){
- $('#task_details').html(jsondata.data.page);
- $('#task_details #categories').multiple_autocomplete({source: categories});
- }
- else{
- alert(jsondata.data.message);
- }
- });
- return false;
- });
-
- $('#tasks_edittaskform #percent_complete').live('change',function(event){
- if ($(event.target).val() == 100){
- $('#tasks_edittaskform #complete').show();
- }else{
- $('#tasks_edittaskform #complete').hide();
- }
- });
-
- $('#tasks_edittaskform input[type="submit"]').live('click',function(){
- $.post('ajax/edittask.php',$('#tasks_edittaskform').serialize(),function(jsondata){
- $('.error_msg').remove();
- $('.error').removeClass('error');
- if(jsondata.status == 'success'){
- var id = jsondata.data.id;
- $('#task_details').data('id',id);
- $('#task_details').html(jsondata.data.page);
- var task = jsondata.data.task;
- $('#tasks .task[data-id='+id+']')
- .data('task', task)
- .html(OC.Tasks.create_task_div(task).html());
- }
- else{
- var errors = jsondata.data.errors;
- for (k in errors){
- $('#'+k).addClass('error')
- .after('<span class="error_msg">'+errors[k]+'</span>');
- }
- $('.error_msg').effect('highlight', {}, 3000);
- $('.error').effect('highlight', {}, 3000);
- }
- }, 'json');
- return false;
- });
-
OCCategories.app = 'calendar';
});
diff --git a/apps/tasks/templates/part.addtaskform.php b/apps/tasks/templates/part.addtaskform.php
deleted file mode 100644
index 0fad5592aa7..00000000000
--- a/apps/tasks/templates/part.addtaskform.php
+++ /dev/null
@@ -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>
diff --git a/apps/tasks/templates/part.details.php b/apps/tasks/templates/part.details.php
deleted file mode 100644
index 89636b6e762..00000000000
--- a/apps/tasks/templates/part.details.php
+++ /dev/null
@@ -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 ?>
diff --git a/apps/tasks/templates/part.edittaskform.php b/apps/tasks/templates/part.edittaskform.php
deleted file mode 100644
index fe123f07ac6..00000000000
--- a/apps/tasks/templates/part.edittaskform.php
+++ /dev/null
@@ -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>
diff --git a/apps/tasks/templates/part.property.php b/apps/tasks/templates/part.property.php
deleted file mode 100644
index 591fd363e6f..00000000000
--- a/apps/tasks/templates/part.property.php
+++ /dev/null
@@ -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>
diff --git a/apps/tasks/templates/part.taskform.php b/apps/tasks/templates/part.taskform.php
deleted file mode 100644
index 0a25ed33c91..00000000000
--- a/apps/tasks/templates/part.taskform.php
+++ /dev/null
@@ -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>
diff --git a/apps/tasks/templates/part.tasks.php b/apps/tasks/templates/part.tasks.php
deleted file mode 100644
index 50be1cd6bed..00000000000
--- a/apps/tasks/templates/part.tasks.php
+++ /dev/null
@@ -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; ?>