public function SetupAsset($objCaller = null) { // Lookup Object PK information from Query String (if applicable) // Set mode to Edit or New depending on what's found // Overridden from AssetEditFormBase to add the $objCaller parameter $intAssetId = QApplication::QueryString('intAssetId'); if ($intAssetId) { //$objCaller->objAsset = Asset::Load($intAssetId); // To minimize the count of queries $objClauses = array(); array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel)); array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel->Category)); array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel->Manufacturer)); array_push($objClauses, QQ::Expand(QQN::Asset()->ParentAsset)); array_push($objClauses, QQ::Expand(QQN::Asset()->Location)); array_push($objClauses, QQ::Expand(QQN::Asset()->CreatedByObject)); $objCaller->objAsset = Asset::QuerySingle(QQ::Equal(QQN::Asset()->AssetId, $intAssetId), $objClauses); if (!$objCaller->objAsset) { throw new Exception('Could not find a Asset object with PK arguments: ' . $intAssetId); } $objCaller->strTitleVerb = QApplication::Translate('Edit'); $objCaller->blnEditMode = true; $this->blnEditChild = true; } else { $objCaller->objAsset = new Asset(); $objCaller->strTitleVerb = QApplication::Translate('Create'); $objCaller->blnEditMode = false; } QApplication::AuthorizeEntity($objCaller->objAsset, $objCaller->blnEditMode); }
protected function SetupReceipt() { parent::SetupReceipt(); QApplication::AuthorizeEntity($this->objReceipt, $this->blnEditMode); }
protected function SetupAddress() { parent::SetupAddress(); QApplication::AuthorizeEntity($this->objAddress, $this->blnEditMode); }
public function SetupAsset($objCaller = null) { // Lookup Object PK information from Query String (if applicable) // Set mode to Edit or New depending on what's found // Overridden from AssetEditFormBase to add the $objCaller parameter $intAssetId = QApplication::QueryString('intAssetId'); if ($intAssetId) { $objCaller->objAsset = Asset::Load($intAssetId); if (!$objCaller->objAsset) { throw new Exception('Could not find a Asset object with PK arguments: ' . $intAssetId); } $objCaller->strTitleVerb = QApplication::Translate('Edit'); $objCaller->blnEditMode = true; } else { $objCaller->objAsset = new Asset(); $objCaller->strTitleVerb = QApplication::Translate('Create'); $objCaller->blnEditMode = false; } QApplication::AuthorizeEntity($objCaller->objAsset, $objCaller->blnEditMode); }
protected function SetupCompany() { parent::SetupCompany(); QApplication::AuthorizeEntity($this->objCompany, $this->blnEditMode); }
protected function SetupAssetModel() { parent::SetupAssetModel(); QApplication::AuthorizeEntity($this->objAssetModel, $this->blnEditMode); }
protected function SetupShipment() { parent::SetupShipment(); QApplication::AuthorizeEntity($this->objShipment, $this->blnEditMode); }