58
58
public function setup()
60
sfProjectConfiguration::getActive()->loadHelpers(array ('Helper','Url', 'Asset', 'Tag'));
61
$this->wikiUrl = url_for('@wiki');
62
//get default staff resource types for this scenario
63
$dsrt = agScenarioResourceHelper::returnDefaultStaffResourceTypes($this->scenario_id);
64
if (count($dsrt) > 0) {
65
$defaultStaffResourceTypes = $dsrt;
67
$defaultStaffResourceTypes =
68
agDoctrineQuery::create()
69
->select('srt.id, srt.staff_resource_type')
70
->from('agStaffResourceType srt')
71
->execute(array(), Doctrine_Core::HYDRATE_SCALAR);
73
foreach($defaultStaffResourceTypes as $dsrt){
74
$defaultStaffTypes[$dsrt['srt_id']] = $dsrt['srt_staff_resource_type'];
76
//get default facility resource types for this scenario
77
$dfrt = agScenarioResourceHelper::returnDefaulFacilityResourceTypes($this->scenario_id);
78
if (count($dfrt) > 0) {
79
$defaultFacilityResourceTypes = $dfrt;
81
$defaultFacilityResourceTypes =
82
agDoctrineQuery::create()
83
->select('frt.id, frt.facility_resource_type')
84
->from('agFacilityResourceType frt')
85
->execute(array(), Doctrine_Core::HYDRATE_SCALAR);
87
// $defaultFacilityTypes = array('' => '');
88
foreach($defaultFacilityResourceTypes as $dfrt){
89
$defaultFacilityTypes[$dfrt['frt_id']] = $dfrt['frt_facility_resource_type'];
60
sfProjectConfiguration::getActive()->loadHelpers(array ('Helper','Url', 'Asset', 'Tag'));
61
$this->wikiUrl = url_for('@wiki');
97
68
'scenario_id' => new sfWidgetFormInputHidden,
99
70
'facility_resource_type_id' =>
100
new sfWidgetFormChoice(array('choices' => $defaultFacilityTypes),
101
array('label' => 'Facility Resource Type','class' => 'filter')
103
// new sfWidgetFormDoctrineChoice(
105
// 'model' => $this->getRelatedModelName('agFacilityResourceType'),
106
// 'add_empty' => false,'method' => 'getFacilityResourceType','label' => 'Facility Resource Type'
107
// //'query' => $this::$staticLists['agFacilityResourceType']
71
new sfWidgetFormDoctrineChoice(
73
'model' => $this->getRelatedModelName('agFacilityResourceType'),
75
'method' => 'getFacilityResourceType',
76
'label' => 'Facility Resource Type'
112
80
'staff_resource_type_id' =>
113
new sfWidgetFormChoice(array('choices' => $defaultStaffTypes),
114
array('label' => 'Staff Resource Type <a href="' . $this->wikiUrl . '/doku.php?id=tooltip:staff_resources&do=export_xhtmlbody" class="tooltipTrigger" title="Search Name">?</a>','class' => 'filter')
116
// new sfWidgetFormDoctrineChoice(
118
// 'model' => $this->getRelatedModelName('agStaffResourceType'),
119
// 'add_empty' => false,
120
// 'method' => 'getStaffResourceType','label' => 'Staff Resource Type'
81
new sfWidgetFormDoctrineChoice(
83
'model' => $this->getRelatedModelName('agStaffResourceType'),
85
'method' => 'getStaffResourceType',
86
'label' => 'Staff Resource Type <a href="' . $this->wikiUrl . '/doku.php?id=tooltip:staff_resources&do=export_xhtmlbody" class="tooltipTrigger" title="Search Name">?</a>'
124
90
'task_id' => new sfWidgetFormDoctrineChoice(