} } // Create and Setup chkActiveFlag protected function chkActiveFlag_Create() { $this->chkActiveFlag = new QCheckBox($this); $this->chkActiveFlag->Name = QApplication::Translate('Active Flag'); $this->chkActiveFlag->Checked = $this->blnEditMode ? $this->objCourier->ActiveFlag : true; } protected function btnDelete_Click($strFormId, $strControlId, $strParameter) { try { $this->objCourier->Delete(); $this->RedirectToListPage(); } catch (QDatabaseExceptionBase $objExc) { if ($objExc->ErrorNumber == 1451) { $this->btnCancel->Warning = 'This courier cannot be deleted because it is associated with one or more shipments.'; } else { throw new QDatabaseExceptionBase(); } } } protected function RedirectToListPage() { QApplication::Redirect('shipping_account_list.php'); } } // Go ahead and run this form object to render the page and its event handlers, using // generated/courier_edit.tpl.php as the included HTML template file CourierEditForm::Run('CourierEditForm', __DOCROOT__ . __SUBDIRECTORY__ . '/admin/courier_edit.tpl.php');
// Include prepend.inc to load Qcodo require '../includes/prepend.inc.php'; /* if you DO NOT have "includes/" in your include_path */ // require('prepend.inc.php'); /* if you DO have "includes/" in your include_path */ // Include the classfile for CourierEditFormBase require __FORMBASE_CLASSES__ . '/CourierEditFormBase.class.php'; // Security check for ALLOW_REMOTE_ADMIN // To allow access REGARDLESS of ALLOW_REMOTE_ADMIN, simply remove the line below QApplication::CheckRemoteAdmin(); /** * This is a quick-and-dirty draft form object to do Create, Edit, and Delete functionality * of the Courier class. It extends from the code-generated * abstract CourierEditFormBase class. * * Any display customizations and presentation-tier logic can be implemented * here by overriding existing or implementing new methods, properties and variables. * * Additional qform control objects can also be defined and used here, as well. * * @package My Application * @subpackage FormDraftObjects * */ class CourierEditForm extends CourierEditFormBase { } // Go ahead and run this form object to render the page and its event handlers, using // generated/courier_edit.tpl.php as the included HTML template file CourierEditForm::Run('CourierEditForm', 'generated/courier_edit.tpl.php');