public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) { // Call the Parent try { parent::__construct($objParentObject, $strControlId); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // Setup Callback and Template $this->strTemplate = 'AssetsauditlogEditPanel.tpl.php'; $this->strClosePanelMethod = $strClosePanelMethod; // Construct the AssetsauditlogMetaControl // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent $this->mctAssetsauditlog = AssetsauditlogMetaControl::Create($this, $intId); // Call MetaControl's methods to create qcontrols based on Assetsauditlog's data fields $this->lblId = $this->mctAssetsauditlog->lblId_Create(); $this->txtAsin = $this->mctAssetsauditlog->txtAsin_Create(); $this->txtEmail = $this->mctAssetsauditlog->txtEmail_Create(); $this->calTakenDate = $this->mctAssetsauditlog->calTakenDate_Create(); $this->calActualReturnDate = $this->mctAssetsauditlog->calActualReturnDate_Create(); $this->calRealReturnDate = $this->mctAssetsauditlog->calRealReturnDate_Create(); $this->txtFullName = $this->mctAssetsauditlog->txtFullName_Create(); // Create Buttons and Actions on this Form $this->btnSave = new QButton($this); $this->btnSave->Text = QApplication::Translate('Save'); $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click')); $this->btnSave->CausesValidation = $this; $this->btnCancel = new QButton($this); $this->btnCancel->Text = QApplication::Translate('Cancel'); $this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click')); $this->btnDelete = new QButton($this); $this->btnDelete->Text = QApplication::Translate('Delete'); $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('Assetsauditlog') . '?')); $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click')); $this->btnDelete->Visible = $this->mctAssetsauditlog->EditMode; }
/** * Static Helper Method to Create using QueryString arguments * * @param mixed $objParentObject QForm or QPanel which will be using this AssetsauditlogMetaControl * @param QMetaControlCreateType $intCreateType rules governing Assetsauditlog object creation - defaults to CreateOrEdit * @return AssetsauditlogMetaControl */ public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) { $intId = QApplication::QueryString('intId'); return AssetsauditlogMetaControl::Create($objParentObject, $intId, $intCreateType); }