Author Topic: Default "Assigned to" : Me when creating subtasks  (Read 6588 times)

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Default "Assigned to" : Me when creating subtasks
« on: June 18, 2010, 01:35:12 pm »
Hi there,

Can anyone tell me how to default "Assigned to:" field to "Me" (logged user) when creating a subtask?

This dropdown box is in applications/ views/task/task_list.php

Code: [Select]
<?php echo assign_to_select_box("task[assigned_to]"$task_list->getProject(), null, array('id' => 'addTaskAssignTo' $task_list->getId())) ?>
This little change will save me much trouble, as my team often accidentally assigns subtask to other people!!
 ;D
Thank you!

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Default "Assigned to" : Me when creating subtasks
« Reply #1 on: June 22, 2010, 10:35:27 am »
Third parameter is $selected, null in your example

Code: [Select]
* @param integer $selected ID of selected user

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Default "Assigned to" : Me when creating subtasks
« Reply #2 on: June 23, 2010, 11:50:37 am »
Hi Cabeza,

You are saying i should use "$selected" instead of "null"?

I tried this but unfortunately it did not work. Dropdown list still defaults to "Anyone".

The option "Me" is not even in this dropdown list, the way it is on the dropdown used in "edit task".

Any other ideas?

Thanks for your help

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Default "Assigned to" : Me when creating subtasks
« Reply #3 on: June 23, 2010, 12:26:42 pm »
This code
Code: [Select]
<?php
 
echo assign_to_select_box("task[assigned_to]"$task_list->getProject(), 1, array('id' => 'addTaskAssignTo' $task_list->getId())) 
?>

 

should assign it to user with id=1 by default.

Is it not working?

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Default "Assigned to" : Me when creating subtasks
« Reply #4 on: June 23, 2010, 12:36:33 pm »
Nope, it still defaults to "anyone".


fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Default "Assigned to" : Me when creating subtasks
« Reply #5 on: June 23, 2010, 12:44:26 pm »
Remember this is on "task_list.php" which is not the same dropdown menu as in the "edit task" view ("add_task.php).


cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Default "Assigned to" : Me when creating subtasks
« Reply #6 on: June 23, 2010, 01:56:11 pm »
That parameter is being ignored in application/helpers/application.php , lines starting at  428.

To solve it check ExtJS class Ext.form.ComboBox and how to set the selected value (Ext API is friendly).

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Default "Assigned to" : Me when creating subtasks
« Reply #7 on: July 16, 2010, 05:04:09 pm »
Hi again Cabeza,

I was never able to figure this one out. Think you can give me a bit more help?

Thanks!

Fernando