コード例 #1
0
ファイル: asset_edit.php プロジェクト: proxymoron/tracmor
 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);
 }
コード例 #2
0
ファイル: receipt_edit.php プロジェクト: proxymoron/tracmor
 protected function SetupReceipt()
 {
     parent::SetupReceipt();
     QApplication::AuthorizeEntity($this->objReceipt, $this->blnEditMode);
 }
コード例 #3
0
ファイル: address_edit.php プロジェクト: proxymoron/tracmor
 protected function SetupAddress()
 {
     parent::SetupAddress();
     QApplication::AuthorizeEntity($this->objAddress, $this->blnEditMode);
 }
コード例 #4
0
ファイル: asset_edit.php プロジェクト: heshuai64/einv2
 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);
 }
コード例 #5
0
ファイル: company_edit.php プロジェクト: heshuai64/einv2
 protected function SetupCompany()
 {
     parent::SetupCompany();
     QApplication::AuthorizeEntity($this->objCompany, $this->blnEditMode);
 }
コード例 #6
0
ファイル: asset_model_edit.php プロジェクト: brustj/tracmor
 protected function SetupAssetModel()
 {
     parent::SetupAssetModel();
     QApplication::AuthorizeEntity($this->objAssetModel, $this->blnEditMode);
 }
コード例 #7
0
ファイル: shipment_edit.php プロジェクト: proxymoron/tracmor
 protected function SetupShipment()
 {
     parent::SetupShipment();
     QApplication::AuthorizeEntity($this->objShipment, $this->blnEditMode);
 }