1140
1140
return $parsedAllocatedFacilityResources;
1144
* deleteShiftTemplate AJAX called method
1145
* @param sfWebRequest $request
1146
* @return response success or failure string to ouput in feedback flasher.
1148
public function executeDeleteshifttemplate(sfWebRequest $request)
1150
$this->forward404unless($request->isXmlHttpRequest());
1151
//return $this->renderText('Shift Template Deleted');
1152
$shiftTemplateId = $request->getParameter('stId');
1153
$shiftTemplate = Doctrine_Core::getTable('agShiftTemplate')
1154
->findByDql('id = ?', $shiftTemplateId)
1157
$scenShifts = Doctrine_Core::getTable('agScenarioShift')
1158
->findByDql('originator_id = ?', $shiftTemplateId);
1160
$scenShifts->delete();
1162
$result = $shiftTemplate->delete();
1164
//we assume here that if no error was thrown the shift template and associated shifts
1166
return $this->renderText('Shift Template Deleted');
1144
// * deleteShiftTemplate AJAX called method
1145
// * @param sfWebRequest $request
1146
// * @return response success or failure string to ouput in feedback flasher.
1148
// public function executeDeleteshifttemplate(sfWebRequest $request)
1150
// $this->forward404unless($request->isXmlHttpRequest());
1152
// $shiftTemplateId = $request->getParameter('stId');
1153
// $shiftTemplate = Doctrine_Core::getTable('agShiftTemplate')
1154
// ->findByDql('id = ?', $shiftTemplateId)
1157
// $scenShifts = Doctrine_Core::getTable('agScenarioShift')
1158
// ->findByDql('originator_id = ?', $shiftTemplateId);
1160
// $scenShifts->delete();
1162
// $result = $shiftTemplate->delete();
1164
// //we assume here that if no error was thrown the shift template and associated shifts
1165
// //have been deleted
1166
// return $this->renderText('Shift Template Deleted');
1170
1170
* addShiftTemplate AJAX called method to add a shift template