[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Products/models/ -> RelationListView.php (source)

   1  <?php
   2  /*+***********************************************************************************

   3   * The contents of this file are subject to the vtiger CRM Public License Version 1.0

   4   * ("License"); You may not use this file except in compliance with the License

   5   * The Original Code is:  vtiger CRM Open Source

   6   * The Initial Developer of the Original Code is vtiger.

   7   * Portions created by vtiger are Copyright (C) vtiger.

   8   * All Rights Reserved.

   9   *************************************************************************************/
  10  
  11  class Products_RelationListView_Model extends Vtiger_RelationListView_Model {
  12  
  13      /**

  14       * Function to get the links for related list

  15       * @return <Array> List of action models <Vtiger_Link_Model>

  16       */
  17  	public function getLinks() {
  18          $relationModel = $this->getRelationModel();
  19          $parentModel = $this->getParentRecordModel();
  20          
  21          $isSubProduct = false;
  22          if($parentModel->getModule()->getName() == $relationModel->getRelationModuleModel()->getName()) {
  23              $isSubProduct = $relationModel->isSubProduct($parentModel->getId());
  24          }
  25          
  26          if(!$isSubProduct){
  27              return parent::getLinks();
  28          }
  29      }
  30      
  31  	public function getHeaders() {
  32          $headerFields = parent::getHeaders();
  33          if($this->getRelationModel()->getRelationModuleModel()->getName() == 'PriceBooks') {
  34              //Added to support Unit Price

  35              $unitPriceField = new Vtiger_Field_Model();
  36              $unitPriceField->set('name', 'unit_price');
  37              $unitPriceField->set('column', 'unit_price');
  38              $unitPriceField->set('label', 'Unit Price');
  39              
  40              $headerFields['unit_price'] = $unitPriceField;
  41              
  42              //Added to support List Price

  43              $field = new Vtiger_Field_Model();
  44              $field->set('name', 'listprice');
  45              $field->set('column', 'listprice');
  46              $field->set('label', 'List Price');
  47              
  48              $headerFields['listprice'] = $field;
  49          }
  50          
  51          return $headerFields;
  52      }
  53      
  54  }


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1