00001 <?php
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Action/Form.php';
00026
00027
00028
00029
00040
00041 class FF_Action_Delete_Reservation extends FF_Action_Form {
00042
00043
00051 function createFormElements()
00052 {
00053 $this->o_form->addElement('hidden', 'actionId');
00054 $this->o_form->addElement('hidden', 'objectId');
00055 $this->o_form->addElement('hidden', 'returnActionId');
00056 $this->o_form->addElement('submit', 'submitbutton');
00057 $this->o_form->addElement('textarea', 'deleteComment', null, array('cols' => 35, 'rows' => 7));
00058 if ($this->o_perms->hasPerm('can_force_override')) {
00059 $this->o_form->addElement('checkbox', 'forceOverride');
00060 }
00061 }
00062
00063
00064
00065
00072 function getSingularText()
00073 {
00074 return _('Reservation');
00075 }
00076
00077
00078
00079
00087 function getPluralText()
00088 {
00089 return _('Reservations');
00090 }
00091
00092
00093
00094
00103 function getTableData()
00104 {
00105 $tmp_help = _('You can optionally use this textarea to add a comment which will be emailed to the borrower specifying why the reservation was deleted.');
00106 $a_headers[] = array(
00107 'title' => sprintf(_('Reason for Delete (optional) %s'), $this->o_output->getHelpLink($tmp_help)),
00108 'data' => $this->o_renderer->elementToHtml('deleteComment'),
00109 );
00110 if ($this->o_perms->hasPerm('can_force_override')) {
00111 $tmp_help = _('By checking this box you can force an override, even if no override code has been entered.');
00112 $a_headers[] = array(
00113 'title' => sprintf(_('Force Override %s'), $this->o_output->getHelpLink($tmp_help)),
00114 'data' => $this->o_renderer->elementToHtml('forceOverride'),
00115 );
00116 }
00117
00118 return $a_headers;
00119 }
00120
00121
00122
00123
00130 function getTableHeaderText()
00131 {
00132 return sprintf(_('Delete %s'), $this->getSingularText());
00133 }
00134
00135
00136
00137
00145 function getFormDefaults()
00146 {
00147 $a_fields = array();
00148 $a_fields['objectId'] = FF_Request::getParam('objectId', 'g');
00149 $a_fields['returnActionId'] = FF_Request::getParam('returnActionId', 'g');
00150 return $a_fields;
00151 }
00152
00153
00154
00155
00162 function setSubmitActionId()
00163 {
00164 $this->formActionId = ACTION_DELETE_RESERVATION_SUBMIT;
00165 }
00166
00167
00168 }
00169 ?>