當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView方法代碼示例

本文整理匯總了PHP中ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView方法的典型用法代碼示例。如果您正苦於以下問題:PHP ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView方法的具體用法?PHP ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView怎麽用?PHP ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ZurmoDefaultViewUtil的用法示例。


在下文中一共展示了ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionCreateProductFromProductTemplate

 /**
  * Create product from product template when user select a product
  * template while adding a product in product portlet view
  * @param string $relationModuleId
  * @param int $portletId
  * @param string $uniqueLayoutId
  * @param int $id
  * @param int $relationModelId
  * @param string $relationAttributeName
  * @param string $relationModelClassName
  */
 public function actionCreateProductFromProductTemplate($relationModuleId, $portletId, $uniqueLayoutId, $id, $relationModelId, $relationAttributeName, $relationModelClassName = null, $redirect = true)
 {
     if ($relationModelClassName == null) {
         $relationModelClassName = Yii::app()->getModule($relationModuleId)->getPrimaryModelName();
     }
     $productTemplate = static::getModelAndCatchNotFoundAndDisplayError('ProductTemplate', intval($id));
     $product = new Product();
     $product->name = $productTemplate->name;
     $product->description = $productTemplate->description;
     $product->quantity = 1;
     $product->productTemplate = $productTemplate;
     $sellPrice = new CurrencyValue();
     $sellPrice->value = $productTemplate->sellPrice->value;
     $sellPrice->currency = $productTemplate->sellPrice->currency;
     $product->priceFrequency = $productTemplate->priceFrequency;
     $product->sellPrice = $sellPrice;
     $product->type = $productTemplate->type;
     $controllerUtil = static::getZurmoControllerUtil();
     $controllerUtil->resolveStageDefaultValue($product);
     foreach ($productTemplate->productCategories as $productCategory) {
         $product->productCategories->add($productCategory);
     }
     $relatedModel = $relationModelClassName::getById((int) $relationModelId);
     $product->{$relationAttributeName} = $relatedModel;
     $this->addRelatedModelAccountToModel($product, $relatedModel);
     $product->save();
     ZurmoControllerUtil::updatePermissionsWithDefaultForModelByCurrentUser($product);
     if ((bool) $redirect) {
         $isViewLocked = ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView');
         $redirectUrl = Yii::app()->createUrl('/' . $relationModuleId . '/default/details', array('id' => $relationModelId));
         $this->redirect(array('/' . $relationModuleId . '/defaultPortlet/modalRefresh', 'portletId' => $portletId, 'uniqueLayoutId' => $uniqueLayoutId, 'redirectUrl' => $redirectUrl, 'portletParams' => array('relationModuleId' => $relationModuleId, 'relationModelId' => $relationModelId), 'portletsAreRemovable' => !$isViewLocked));
     }
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:44,代碼來源:DefaultController.php

示例2: resolvePortletConfigurableParams

 /**
  * Resolves portlet configurable parameters
  * @param boolean $portletsAreMovable
  * @param boolean $portletsAreRemovable
  */
 protected function resolvePortletConfigurableParams(&$portletsAreMovable, &$portletsAreRemovable)
 {
     assert('is_bool($portletsAreMovable)');
     assert('is_bool($portletsAreRemovable)');
     $getData = GetUtil::getData();
     if (isset($getData['lockPortlets'])) {
         $lockPortlets = (bool) $getData['lockPortlets'];
         if ($lockPortlets) {
             ZurmoDefaultViewUtil::setLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView', true);
         } else {
             ZurmoDefaultViewUtil::setLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView', false);
         }
     }
     $isViewLocked = ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView');
     //Default case for the first time
     if ($isViewLocked === null) {
         ZurmoDefaultViewUtil::setLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView', true);
         $isViewLocked = true;
     }
     if ($isViewLocked == true) {
         $portletsAreRemovable = false;
         $portletsAreMovable = false;
     }
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:29,代碼來源:ConfigurableDetailsAndRelationsView.php

示例3: actionSelectFromRelatedListSave

 /**
  * In a detail view, after you hit select from a sub view a modal listview will appear. If you select a row
  * in that view, then this action is called. This action will relate the selected model to the detail view model.
  * Then it will redirect to a portlet action that refreshes the portlet. Some parameters are passed to that
  * redirect that ensure continuity on futher actions that rely on existing $_GET information.
  * @param string $modelId
  * @param string $portletId
  * @param string $uniqueLayoutId
  * @param string $relationAttributeName
  * @param string $relationModelId
  * @param string $relationModuleId
  * @param null|string $relationModelClassName
  */
 public function actionSelectFromRelatedListSave($modelId, $portletId, $uniqueLayoutId, $relationAttributeName, $relationModelId, $relationModuleId, $relationModelClassName = null)
 {
     if ($relationModelClassName == null) {
         $relationModelClassName = Yii::app()->getModule($relationModuleId)->getPrimaryModelName();
     }
     $relationModel = $relationModelClassName::getById((int) $relationModelId);
     $modelClassName = $this->getModule()->getPrimaryModelName();
     $model = $modelClassName::getById((int) $modelId);
     $redirectUrl = $this->createUrl('/' . $relationModuleId . '/default/details', array('id' => $relationModelId));
     if (!$model->{$relationAttributeName}->contains($relationModel)) {
         $model->{$relationAttributeName}->add($relationModel);
         if (!$model->save()) {
             $this->processSelectFromRelatedListSaveFails($model);
         }
     } else {
         $this->processSelectFromRelatedListSaveAlreadyConnected($model);
     }
     $isViewLocked = ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView');
     $this->redirect(array('/' . $relationModuleId . '/defaultPortlet/modalRefresh', 'id' => $relationModelId, 'portletId' => $portletId, 'uniqueLayoutId' => $uniqueLayoutId, 'redirectUrl' => $redirectUrl, 'portletParams' => array('relationModuleId' => $relationModuleId, 'relationModelId' => $relationModelId), 'portletsAreRemovable' => !$isViewLocked));
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:33,代碼來源:ZurmoPortletController.php

示例4: actionAddOpportunityRelation

 public function actionAddOpportunityRelation($relationModuleId, $portletId, $uniqueLayoutId, $id, $relationModelId, $relationAttributeName, $redirect)
 {
     $opportunityProduct = OpportunityProduct::GetById(intval($id));
     $opportunity = Opportunity::GetById(intval($relationModelId));
     if ($opportunityProduct->opportunity != $opportunity) {
         $opportunityProduct->opportunity = $opportunity;
         $opportunityProduct->save();
     }
     if ((bool) $redirect) {
         $isViewLocked = ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView('lockPortletsForDetailsAndRelationsView');
         $redirectUrl = Yii::app()->createUrl('/' . $relationModuleId . '/default/details', array('id' => $relationModelId));
         $this->redirect(array('/' . $relationModuleId . '/defaultPortlet/modalRefresh', 'portletId' => $portletId, 'uniqueLayoutId' => $uniqueLayoutId, 'redirectUrl' => $redirectUrl, 'portletParams' => array('relationModuleId' => $relationModuleId, 'relationModelId' => $relationModelId), 'portletsAreRemovable' => !$isViewLocked));
     }
 }
開發者ID:RamaKavanan,項目名稱:BaseVersion,代碼行數:14,代碼來源:DefaultController.php


注:本文中的ZurmoDefaultViewUtil::getLockKeyForDetailsAndRelationsView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。