Example #1
0
 /**
  * class constructor
  */
 function Config_Lms($table = false)
 {
     parent::Config($table);
     if ($table === false) {
         $this->table = $GLOBALS['prefix_lms'] . '_setting';
     } else {
         $this->table = $table;
     }
 }
Example #2
0
 /**
  * class constructor
  */
 function Config_Scs($table = false)
 {
     parent::Config($table);
     if ($table === false) {
         $this->table = $GLOBALS['prefix_scs'] . '_setting';
     } else {
         $this->table = $table;
     }
     $this->table_root = $GLOBALS['prefix_scs'] . '_rules_root';
 }
Example #3
0
 function __construct($name)
 {
     // Use parent constructor to place configurable information into the
     // central config table in a namespace of "plugin.<id>"
     parent::Config("plugin.{$name}");
     foreach ($this->getOptions() as $name => $field) {
         if ($this->exists($name)) {
             $this->config[$name]['value'] = $field->to_php($this->get($name));
         } elseif ($default = $field->get('default')) {
             $this->defaults[$name] = $default;
         }
     }
 }
Example #4
0
 function OsticketConfig($section = null)
 {
     parent::Config($section);
     if (count($this->config) == 0) {
         // Fallback for osticket < 1.7@852ca89e
         $sql = 'SELECT * FROM ' . $this->table . ' WHERE id = 1';
         if (($res = db_query($sql)) && db_num_rows($res)) {
             foreach (db_fetch_array($res) as $key => $value) {
                 $this->config[$key] = array('value' => $value);
             }
         }
     }
     //Get the default time zone
     // We can't JOIN timezone table above due to upgrade support.
     if ($this->get('default_timezone_id')) {
         if (!$this->exists('tz_offset')) {
             $this->persist('tz_offset', Timezone::getOffsetById($this->get('default_timezone_id')));
         }
     } else {
         // Previous osTicket versions saved the offset value instead of
         // a timezone instance. This is compatibility for the upgrader
         $this->persist('tz_offset', 0);
     }
     return true;
 }
Example #5
0
 function __construct()
 {
     parent::Config("mysqlsearch");
 }
/**
 * Generate new workbook 'DC_Statistics_<timestamp>.xlsx'
 *
 * @param array $DProps
 * @param PHPExcel $objPHPExcel
 * @param string $thisDate
 */
function writeExcelReport(&$DProps, $objPHPExcel, $thisDate)
{
    ReportStats::get()->report('Info', 'User: '******'Doc']['User'] . ' Version: ' . $DProps['Doc']['version']);
    // Crude status reporting
    $config = new Config();
    $config->Config();
    addColumnIndices($DProps);
    // Generate new workbook 'DC_Statistics_<timestamp>.xlsx'
    setDocumentProperties($objPHPExcel, $thisDate, $config->ParameterArray['OrgName'], $DProps);
    list($DCStats, $Rack_Inv, $limitedUser) = writeDCInventory($DProps, $objPHPExcel, $thisDate);
    ReportStats::get()->report('Info', 'DC Inventory');
    if (!$limitedUser) {
        writeDCStatsSummary($DProps, $objPHPExcel, $DCStats, $thisDate);
        ReportStats::get()->report('Info', 'DC Stats');
    }
    writeRackInventory($DProps, $objPHPExcel, $Rack_Inv, $thisDate);
    ReportStats::get()->report('Info', 'Rack Inventory');
    writeFrontPage($DProps, $config, $objPHPExcel, $thisDate);
    ReportStats::get()->report('Info', 'Front Page');
    JobQueue::updateStatus(session_id(), "Preparing to transmit file");
}
Example #7
0
 function SlaConfig($id)
 {
     parent::Config("sla.{$id}");
 }
Example #8
0
 function ConfigHtml($config_code, $back_url)
 {
     parent::Config($config_code);
     $this->backUrl = $back_url;
 }