Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 protected function SetupReceipt()
 {
     parent::SetupReceipt();
     QApplication::AuthorizeEntity($this->objReceipt, $this->blnEditMode);
 }
Ejemplo n.º 3
0
 protected function SetupAddress()
 {
     parent::SetupAddress();
     QApplication::AuthorizeEntity($this->objAddress, $this->blnEditMode);
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 protected function SetupCompany()
 {
     parent::SetupCompany();
     QApplication::AuthorizeEntity($this->objCompany, $this->blnEditMode);
 }
Ejemplo n.º 6
0
 protected function SetupAssetModel()
 {
     parent::SetupAssetModel();
     QApplication::AuthorizeEntity($this->objAssetModel, $this->blnEditMode);
 }
Ejemplo n.º 7
0
 protected function SetupShipment()
 {
     parent::SetupShipment();
     QApplication::AuthorizeEntity($this->objShipment, $this->blnEditMode);
 }