Ejemplo n.º 1
0
 public function __construct($objParentObject, $strClosePanelMethod, $objAssetModel = null, $strControlId = null)
 {
     try {
         parent::__construct($objParentObject, $strClosePanelMethod, $objAssetModel, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Create the Image File Control
     $this->ifcImage_Create();
     // Create all custom asset model fields
     $this->customFields_Create();
     $this->UpdateCustomFields();
     // Modify Code Generated Controls
     $this->lstCategory->Required = true;
     $this->lstManufacturer->Required = true;
     $this->btnSave->RemoveAllActions('onclick');
     $this->btnSave->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnSave_Click'));
     $this->btnSave->CausesValidation = QCausesValidation::SiblingsOnly;
     // Add Enter Key Events to each control except the Cancel Button
     $arrControls = array($this->txtShortDescription, $this->lstCategory, $this->lstManufacturer, $this->txtAssetModelCode, $this->txtLongDescription, $this->ifcImage);
     foreach ($arrControls as $ctlControl) {
         $ctlControl->CausesValidation = true;
         $ctlControl->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, 'btnSave_Click'));
         $ctlControl->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     }
     $this->strOverflow = QOverflow::Auto;
 }
 public function __construct($objParentObject, $strClosePanelMethod, $arrayModelId)
 {
     try {
         parent::__construct($objParentObject, $strClosePanelMethod);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->arrModelsToEdit = $arrayModelId;
     //Set Edit Display Logic of Built-In Fields
     $objRoleEntityQtypeBuiltInAuthorization = RoleEntityQtypeBuiltInAuthorization::LoadByRoleIdEntityQtypeIdAuthorizationId(QApplication::$objRoleModule->RoleId, 4, 2);
     if ($objRoleEntityQtypeBuiltInAuthorization && $objRoleEntityQtypeBuiltInAuthorization->AuthorizedFlag) {
         $this->blnEditBuiltInFields = true;
     } else {
         $this->blnEditBuiltInFields = false;
     }
     $this->txtLongDescription->Enabled = false;
     // Create Asset Custom Fields
     $this->UpdateCustomFields();
     // Create Checkboxes
     $this->chkCategory_Create();
     $this->chkManufacturer_Create();
     $this->chkLongDescription_Create();
     $this->btnApply_Create();
     // Load Custom Fields
     $objCustomFieldArray = CustomField::LoadObjCustomFieldArray(EntityQtype::AssetModel, false);
     if ($objCustomFieldArray) {
         $this->arrCustomFields = CustomField::CustomFieldControlsCreate($objCustomFieldArray, false, $this, true, true, false);
         foreach ($this->arrCustomFields as $field) {
             $field['input']->Enabled = false;
             $this->arrCheckboxes[$field['input']->strControlId] = new QCheckBox($this, 'chk' . $field['input']->strControlId);
             $this->arrCheckboxes[$field['input']->strControlId]->Checked = false;
             $this->arrCheckboxes[$field['input']->strControlId]->AddAction(new QClickEvent(), new QJavaScriptAction("enableInput(this)"));
             $this->arrCheckboxes[$field['input']->strControlId]->Enabled = $field['blnEdit'];
         }
     }
     $this->btnSave->CausesValidation = QCausesValidation::SiblingsOnly;
     $this->Overflow = QOverflow::Auto;
     // Modify Code Generated Controls
     // $this->btnSave->RemoveAllActions('onclick');
     //$this->btnSave->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnSave_Click'));
 }