当前位置: 首页>>代码示例>>PHP>>正文


PHP Contacts::getContactLinks方法代码示例

本文整理汇总了PHP中Contacts::getContactLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP Contacts::getContactLinks方法的具体用法?PHP Contacts::getContactLinks怎么用?PHP Contacts::getContactLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contacts的用法示例。


在下文中一共展示了Contacts::getContactLinks方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $type = 'sales';
     $model = $this->loadModel($id);
     $model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
     parent::view($model, $type);
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:11,代码来源:DefaultController.php

示例2: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $type = 'quotes';
     $model = $this->loadModel($id);
     $model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
     // find associated products and their quantities
     $quoteProducts = QuoteProduct::model()->findAllByAttributes(array('quoteId' => $model->id));
     $orders = array();
     // array of product-quantity pairs
     $total = 0;
     // total price for the quote
     foreach ($quoteProducts as $qp) {
         $price = $qp->price * $qp->quantity;
         if ($qp->adjustmentType == 'percent') {
             $price += $price * ($qp->adjustment / 100);
             $qp->adjustment = "{$qp->adjustment}%";
         } else {
             $price += $qp->adjustment;
         }
         $orders[] = array('name' => $qp->name, 'id' => $qp->productId, 'unit' => $qp->price, 'quantity' => $qp->quantity, 'adjustment' => $qp->adjustment, 'price' => $price);
         $order = end($orders);
         $total += $order['price'];
     }
     $dataProvider = new CArrayDataProvider($orders, array('keyField' => 'name', 'sort' => array('attributes' => array('name', 'unit', 'quantity', 'adjustment', 'price')), 'pagination' => array('pageSize' => false)));
     parent::view($model, $type, array('dataProvider' => $dataProvider, 'total' => $total));
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:30,代码来源:DefaultController.php

示例3: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $model = $this->loadModel($id);
     $model->assignedTo = User::getUserLinks($model->assignedTo);
     $model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
     $type = 'case';
     parent::view($model, $type);
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:12,代码来源:CasesController.php

示例4: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $type = 'opportunities';
     $model = $this->loadModel($id);
     $model->associatedContacts = Contacts::getContactLinks($model->associatedContacts);
     if ($this->checkPermissions($model, 'view')) {
         // add opportunity to user's recent item list
         User::addRecentItem('o', $id, Yii::app()->user->getId());
         parent::view($model, $type);
     } else {
         $this->redirect('index');
     }
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:17,代码来源:OpportunitiesController.php

示例5: search

 public function search()
 {
     // Warning: Please modify the following code to remove attributes that
     // should not be searched.
     $criteria = new CDbCriteria();
     $fields = Fields::model()->findAllByAttributes(array('modelName' => 'Accounts'));
     foreach ($fields as $field) {
         $fieldName = $field->fieldName;
         switch ($field->type) {
             case 'boolean':
                 $criteria->compare($field->fieldName, $this->compareBoolean($this->{$fieldName}), true);
                 break;
             case 'link':
                 $criteria->compare($field->fieldName, $this->compareLookup($field, $this->{$fieldName}), true);
                 break;
             case 'assignment':
                 $criteria->compare($field->fieldName, $this->compareAssignment($this->{$fieldName}), true);
                 break;
             default:
                 $criteria->compare($field->fieldName, $this->{$fieldName}, true);
         }
     }
     $dataProvider = new SmartDataProvider(get_class($this), array('sort' => array('defaultOrder' => 'name ASC'), 'pagination' => array('pageSize' => ProfileChild::getResultsPerPage()), 'criteria' => $criteria));
     $arr = $dataProvider->getData();
     foreach ($arr as $account) {
         $account->assignedTo = User::getUserLinks($account->assignedTo);
         $account->associatedContacts = Contacts::getContactLinks($account->associatedContacts);
     }
     $dataProvider->setData($arr);
     return $dataProvider;
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:31,代码来源:Accounts.php


注:本文中的Contacts::getContactLinks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。