ReservationDelete.php

Go to the documentation of this file.
00001 <?php
00003 // {{{ license
00004 
00005 // +----------------------------------------------------------------------+
00006 // | FastFrame Application Framework                                      |
00007 // +----------------------------------------------------------------------+
00008 // | Copyright (c) 2002-2006 The Codejanitor Group                        |
00009 // +----------------------------------------------------------------------+
00010 // | This source file is subject to the GNU Lesser Public License (LGPL), |
00011 // | that is bundled with this package in the file LICENSE, and is        |
00012 // | available at through the world-wide-web at                           |
00013 // | http://www.fsf.org/copyleft/lesser.html                              |
00014 // | If you did not receive a copy of the LGPL and are unable to          |
00015 // | obtain it through the world-wide-web, you can get it by writing the  |
00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
00017 // | MA 02111-1307, USA.                                                  |
00018 // +----------------------------------------------------------------------+
00019 // | Authors: Jason Rust <jrust@codejanitor.com>                          |
00020 // +----------------------------------------------------------------------+
00021 
00022 // }}}
00023 // {{{ requires
00024 
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Action/Form.php';
00026 
00027 // }}}
00028 // {{{ class FF_Action_Delete_Reservation
00029 
00040 // }}}
00041 class FF_Action_Delete_Reservation extends FF_Action_Form {
00042     // {{{ createFormElements()
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     // {{{ getSingularText()
00065 
00072     function getSingularText()
00073     {
00074         return _('Reservation');
00075     }
00076 
00077     // }}}
00078     // {{{ getPluralText()
00079 
00087     function getPluralText()
00088     {
00089         return _('Reservations');
00090     }
00091 
00092     // }}}
00093     // {{{ getTableData()
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     // {{{ getTableHeaderText()
00123 
00130     function getTableHeaderText()
00131     {
00132         return sprintf(_('Delete %s'), $this->getSingularText());
00133     }
00134 
00135     // }}}
00136     // {{{ getFormDefaults()
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     // {{{ setSubmitActionId()
00155 
00162     function setSubmitActionId()
00163     {
00164         $this->formActionId = ACTION_DELETE_RESERVATION_SUBMIT;
00165     }
00166 
00167     // }}}
00168 }
00169 ?>

Generated on Fri Jun 23 11:38:17 2006 for FastFrame by  doxygen 1.4.4