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


PHP x2base::view方法代码示例

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


在下文中一共展示了x2base::view方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
 {
     $model = $this->loadModel($id);
     $model->assignedTo = User::getUserLinks($model->assignedTo);
     $type = 'project';
     parent::view($model, $type);
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:11,代码来源:ProjectsController.php

示例3: 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

示例4: 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

示例5: actionView

 public function actionView($id)
 {
     if ($id == 0) {
         $this->redirect(array('index'));
     } else {
         $model = X2Calendar::model()->findByPk($id);
         parent::view($model, 'calendar');
     }
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:9,代码来源:CalendarController.php

示例6: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $model = $this->loadModel($id);
     if (!$this->checkPermissions($model, 'view')) {
         $this->denied();
     }
     // add service case to user's recent item list
     User::addRecentItem('s', $id, Yii::app()->user->getId());
     parent::view($model, 'services');
 }
开发者ID:shayanyi,项目名称:CRM,代码行数:14,代码来源:ServicesController.php

示例7: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $type = 'BugReports';
     $model = $this->loadModel($id);
     if ($this->checkPermissions($model, 'view')) {
         parent::view($model, $type);
     } else {
         $this->redirect('index');
     }
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:14,代码来源:BugReportsController.php

示例8: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  * @param null|Opportunity Set by actionConvertLead in the case that conversion fails
  */
 public function actionView($id, $opportunity = null)
 {
     $type = 'x2Leads';
     $model = $this->loadModel($id);
     if ($this->checkPermissions($model, 'view')) {
         // add opportunity to user's recent item list
         User::addRecentItem('l', $id, Yii::app()->user->getId());
         parent::view($model, $type);
     } else {
         $this->redirect('index');
     }
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:17,代码来源:X2LeadsController.php

示例9: 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

示例10: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $type = 'quotes';
     $model = $this->getModel($id);
     if (!$this->checkPermissions($model, 'view')) {
         $this->denied();
     }
     $quoteProducts = $model->lineItems;
     // add quote to user's recent item list
     User::addRecentItem('q', $id, Yii::app()->user->getId());
     $contactNameId = Fields::nameAndId($model->associatedContacts);
     $contactId = $contactNameId[1];
     parent::view($model, $type, array('orders' => $quoteProducts, 'contactId' => $contactId));
 }
开发者ID:xl602,项目名称:X2CRM,代码行数:18,代码来源:QuotesController.php

示例11: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $model = $this->loadModel($id);
     if (!parent::checkPermissions($model, 'view')) {
         $this->denied();
     }
     // add account to user's recent item list
     User::addRecentItem('a', $id, Yii::app()->user->getId());
     if ($model->checkForDuplicates()) {
         $this->redirect($this->createUrl('/site/duplicateCheck', array('moduleName' => 'accounts', 'modelName' => 'Accounts', 'id' => $id, 'ref' => 'view')));
     } else {
         $model->duplicateChecked();
         parent::view($model, 'accounts');
     }
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:19,代码来源:AccountsController.php

示例12: actionView

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

示例13: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     // $this->layout = '//layouts/column3';
     $contact = $this->loadModel($id);
     $viewPermissions = $contact->assignedTo == Yii::app()->user->getName() || $contact->visibility == 1 || Yii::app()->user->getName() == 'admin';
     /* x2temp */
     $groups = GroupToUser::model()->findAllByAttributes(array('userId' => Yii::app()->user->getId()));
     $temp = array();
     foreach ($groups as $group) {
         $temp[] = $group->groupId;
     }
     if (array_search($contact->assignedTo, $temp) !== false) {
         $viewPermissions = true;
     }
     if ($contact->visibility == '2') {
         $user = User::model()->findByAttributes(array('username' => $contact->assignedTo));
         $groups = GroupToUser::model()->findAllByAttributes(array('userId' => $user->id));
         $tempOne = array();
         foreach ($groups as $group) {
             $tempOne[] = $group->groupId;
         }
         $userGroups = GroupToUser::model()->findAllByAttributes(array('userId' => Yii::app()->user->getId()));
         $tempTwo = array();
         foreach ($userGroups as $userGroup) {
             $tempTwo[] = $userGroup->groupId;
         }
         if (count(array_intersect($tempOne, $tempTwo)) > 0) {
             $viewPermissions = true;
         }
     }
     if (is_numeric($contact->assignedTo)) {
         $contact->assignedTo = Groups::model()->findByPk($contact->assignedTo)->name;
     }
     /* end x2temp */
     if ($viewPermissions) {
         User::addRecentItem('c', $id, Yii::app()->user->getId());
         ////add contact to user's recent item list
         parent::view($contact, 'contacts');
     } else {
         $this->redirect('index');
     }
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:46,代码来源:DefaultController.php

示例14: actionRevisions

 /**
  * This is a prototype function designed to re-build a record from the changelog.
  *
  * This method is largely a work in progress though it is functional right
  * now as is, it could just use some refactoring and improvements. On the
  * "View Changelog" page in the Admin tab there's a link on each Contact
  * changelog entry to view the record at that point in the history. Clicking
  * that link brings you here.
  * @param int $id The ID of the Contact to be viewed
  * @param int $timestamp The timestamp to view the Contact at... this should probably be refactored to changelog ID
  */
 public function actionRevisions($id, $timestamp)
 {
     $contact = $this->loadModel($id);
     // Find all the changelog entries associated with this Contact after the given
     // timestamp. Realistically, this would be more accurate if Changelog ID
     // was used instead of the timestamp.
     $changes = X2Model::model('Changelog')->findAll('type="Contacts" AND itemId="' . $contact->id . '" AND timestamp > ' . $timestamp . ' ORDER BY timestamp DESC');
     // Loop through the changes and apply each one retroactively to the Contact record.
     foreach ($changes as $change) {
         $fieldName = $change->fieldName;
         if ($contact->hasAttribute($fieldName) && $fieldName != 'id') {
             $contact->{$fieldName} = $change->oldValue;
         }
     }
     // Set our widget info
     if (isset($this->portlets['TimeZone'])) {
         $this->portlets['TimeZone']['params']['model'] =& $contact;
     }
     if ($this->checkPermissions($contact, 'view')) {
         if (isset($_COOKIE['vcr-list'])) {
             Yii::app()->user->setState('vcr-list', $_COOKIE['vcr-list']);
         }
         User::addRecentItem('c', $id, Yii::app()->user->getId());
         ////add contact to user's recent item list
         // View the Contact with the data modified to this point
         parent::view($contact, 'contacts');
     } else {
         $this->redirect('index');
     }
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:41,代码来源:ContactsController.php

示例15: actionView

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


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