Skip to content
Permalink
Browse files

adjusted the task priorities to respect the sysval lookups

  • Loading branch information
caseysoftware committed Jun 22, 2014
1 parent 7494827 commit eb659437c61ec44df60ce639e3f3503c11539a85
Showing with 11 additions and 10 deletions.
  1. +10 −9 includes/cleanup_functions.php
  2. +1 −1 modules/tasks/todo.php
@@ -4241,6 +4241,8 @@ function __extract_from_listtasks($userFilter, $AppUI, $proj)
*/
function __extract_from_tasks_todo($selected, $task_priority)
{
$priorities = w2PgetSysval('TaskPriority');

$q = new w2p_Database_Query;
foreach ($selected as $key => $val) {
if ($task_priority == 'c') {
@@ -4253,17 +4255,16 @@ function __extract_from_tasks_todo($selected, $task_priority)
// delete task
$q->setDelete('tasks');
$q->addWhere('task_id=' . (int) $val);
} else
if ($task_priority > -2 && $task_priority < 2) {
// set priority
$q->addTable('tasks');
$q->addUpdate('task_priority', $task_priority);
$q->addWhere('task_id=' . (int) $val);
}
} else {
$task_priority = min($task_priority, max(array_keys($priorities)));
$task_priority = max($task_priority, min(array_keys($priorities)));

$q->addTable('tasks');
$q->addUpdate('task_priority', $task_priority);
$q->addWhere('task_id=' . (int) $val);
}
}
$q->exec();
echo db_error();
$q->clear();
}
}

@@ -95,7 +95,7 @@
}
}

$priorities = array('1' => 'high', '0' => 'normal', '-1' => 'low');
$priorities = w2PgetSysval('TaskPriority');
$durnTypes = w2PgetSysVal('TaskDurationType');

if ('todo' == $a) {

0 comments on commit eb65943

Please sign in to comment.
You can’t perform that action at this time.