Author Topic: Applying Start/Due date to all subtasks (resolved)  (Read 3633 times)

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Applying Start/Due date to all subtasks (resolved)
« on: June 14, 2010, 03:48:51 pm »
Hello,

I finally figured out how to do this, I hope some of you will find it usefull.

This hack basically adds a little checkbox for "Apply Duedate to Subtasks" when editing or creating a parent task.

Just add the following lines of code to the files listed bellow.
taskcontroller.class.php line 258
Code: [Select]
$due_date = $task->getDueDate();


taskcontroller.class.php line 261
Code: [Select]
$apply_dd = array_var($task_data, 'apply_duedate_subtasks', '') == "checked";

taskcontroller.class.php line 274
Code: [Select]
if ($apply_dd) {
$sub->setDueDate($due_date);
$sub->save();


}

taskcontroller.class.php line 1063
Code: [Select]
$due_date = $task->getDueDate();

taskcontroller.class.php line 1066
Code: [Select]
$apply_dd = array_var($task_data, 'apply_duedate_subtasks') == "checked";
taskcontroller.class.php line 1079
Code: [Select]
if ($apply_dd) {
$sub->setDueDate($due_date);
$sub->save();
}



actions.php  line 81

Code: [Select]
'apply duedate to subtasks' => 'Apply Due Date to Subtasks',


lang.js line 693
Code: [Select]
'apply duedate to subtasks': 'Apply DueDate to Subtasks',
'duedate': 'Due Date',

add_task.php line 200
Code: [Select]
<?php echo checkbox_field('task[apply_duedate_subtasks]'array_var($task_data'apply_duedate_subtasks'false), array("id" => "$genid-checkapplydd")) ?><label class="checkbox" for="<?php echo "$genid-checkapplydd" ?>"><?php echo lang('apply duedate to subtasks'?></label></div>[/pre]
« Last Edit: June 22, 2010, 01:56:16 pm by fernandog »

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: How to add checkbox: Apply DueDate to All Subtasks
« Reply #1 on: June 15, 2010, 12:01:46 pm »
PS: You can do the same thing for "Start date", simply change "due" to "start",  "Due" to "Start", "apply_dd" to "apply_sd" and "applydd" to "applysd" everywhere in the code
« Last Edit: June 18, 2010, 01:42:43 pm by fernandog »

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Applying Start/Due date to all subtasks (resolved)
« Reply #2 on: June 22, 2010, 02:25:59 pm »
Nice !