[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/SalesOrder/ -> SalesOrderPDFController.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  include_once  'include/InventoryPDFController.php';
  11  include_once dirname(__FILE__). '/SalesOrderPDFHeaderViewer.php';
  12  class Vtiger_SalesOrderPDFController extends Vtiger_InventoryPDFController{
  13  	function buildHeaderModelTitle() {
  14          $singularModuleNameKey = 'SINGLE_'.$this->moduleName;
  15          $translatedSingularModuleLabel = getTranslatedString($singularModuleNameKey, $this->moduleName);
  16          if($translatedSingularModuleLabel == $singularModuleNameKey) {
  17              $translatedSingularModuleLabel = getTranslatedString($this->moduleName, $this->moduleName);
  18          }
  19          return sprintf("%s: %s", $translatedSingularModuleLabel, $this->focusColumnValue('salesorder_no'));
  20      }
  21  
  22  	function getHeaderViewer() {
  23          $headerViewer = new SalesOrderPDFHeaderViewer();
  24          $headerViewer->setModel($this->buildHeaderModel());
  25          return $headerViewer;
  26      }
  27      
  28  	function buildHeaderModelColumnLeft() {
  29          $modelColumnLeft = parent::buildHeaderModelColumnLeft();
  30          return $modelColumnLeft;
  31      }
  32      
  33  	function buildHeaderModelColumnCenter() {
  34          $subject = $this->focusColumnValue('subject');
  35          $customerName = $this->resolveReferenceLabel($this->focusColumnValue('account_id'), 'Accounts');
  36          $contactName = $this->resolveReferenceLabel($this->focusColumnValue('contact_id'), 'Contacts');
  37          $purchaseOrder = $this->focusColumnValue('vtiger_purchaseorder');
  38          $quoteName = $this->resolveReferenceLabel($this->focusColumnValue('quote_id'), 'Quotes');
  39          
  40          $subjectLabel = getTranslatedString('Subject', $this->moduleName);
  41          $quoteNameLabel = getTranslatedString('Quote Name', $this->moduleName);
  42          $customerNameLabel = getTranslatedString('Customer Name', $this->moduleName);
  43          $contactNameLabel = getTranslatedString('Contact Name', $this->moduleName);
  44          $purchaseOrderLabel = getTranslatedString('Purchase Order', $this->moduleName);
  45  
  46          $modelColumn1 = array(
  47                  $subjectLabel        =>    $subject,
  48                  $customerNameLabel    =>    $customerName,
  49                  $contactNameLabel    =>    $contactName,
  50                  $purchaseOrderLabel =>  $purchaseOrder,
  51                  $quoteNameLabel => $quoteName
  52              );
  53          return $modelColumn1;
  54      }
  55  
  56  	function buildHeaderModelColumnRight() {
  57          $issueDateLabel = getTranslatedString('Issued Date', $this->moduleName);
  58          $validDateLabel = getTranslatedString('Due Date', $this->moduleName);
  59          $billingAddressLabel = getTranslatedString('Billing Address', $this->moduleName);
  60          $shippingAddressLabel = getTranslatedString('Shipping Address', $this->moduleName);
  61  
  62  
  63          $modelColumn2 = array(
  64                  'dates' => array(
  65                      $issueDateLabel  => $this->formatDate(date("Y-m-d")),
  66                      $validDateLabel => $this->formatDate($this->focusColumnValue('duedate')),
  67                  ),
  68                  $billingAddressLabel  => $this->buildHeaderBillingAddress(),
  69                  $shippingAddressLabel => $this->buildHeaderShippingAddress()
  70              );
  71          return $modelColumn2;
  72      }
  73  
  74  	function getWatermarkContent() {
  75          return $this->focusColumnValue('sostatus');
  76      }
  77  }
  78  ?>


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