[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/com_vtiger_workflow/expression_engine/ -> VTExpressionsManager.inc (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  require_once ("include/events/SqlResultIterator.inc");
  11  class VTExpressionsManager{
  12  	function __construct($adb){
  13          $this->adb = $adb;
  14      }
  15  
  16      /** Caching logic **/

  17      private static $cache = array();
  18  	static function addToCache($key, $value) {
  19           self::$cache[$key] = $value;
  20      }
  21  	static function fromCache($key) {
  22          if(isset(self::$cache[$key])) return self::$cache[$key];
  23          return false;
  24      }
  25  	static function clearCache() {
  26          self::$cache = array();
  27      }
  28      /** END **/

  29  
  30  	function fields($moduleName){
  31          global $current_user;
  32          $result = vtws_describe($moduleName, $current_user);
  33          $fields = $result['fields'];
  34          $arr = array();
  35          foreach($fields as $field){
  36              $arr[$field['name']] = $field['label'];
  37          }
  38          return $arr;
  39      }
  40  
  41  	function expressionFunctions() {
  42          return array('concat' => 'concat(a,b)', 'time_diffdays(a,b)' => 'time_diffdays(a,b)', 'time_diffdays(a)' => 'time_diffdays(a)', 'time_diff(a,b)' => 'time_diff(a,b)','time_diff(a)' => 'time_diff(a)',
  43              'add_days' => 'add_days(datefield, noofdays)', 'sub_days' => 'sub_days(datefield, noofdays)', 'add_time(timefield, minutes)' => 'add_time(timefield, minutes)', 'sub_time(timefield, minutes)' => 'sub_time(timefield, minutes)',
  44              'today' => "get_date('today')", 'tomorrow' => "get_date('tomorrow')",  'yesterday' => "get_date('yesterday')");
  45      }
  46  }
  47  
  48  ?>


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