コード例 #1
0
ファイル: rtmessageadd.php プロジェクト: Akheon23/lms
function MessageAdd($msg, $headers, $files = NULL)
{
    global $DB, $LMS;
    $time = time();
    $head = '';
    if ($headers) {
        foreach ($headers as $idx => $header) {
            $head .= $idx . ": " . $header . "\n";
        }
    }
    $DB->Execute('INSERT INTO rtmessages (ticketid, createtime, subject, body, userid, customerid, mailfrom, inreplyto, messageid, replyto, headers)
			VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($msg['ticketid'], $time, $msg['subject'], preg_replace("/\r/", "", $msg['body']), $msg['userid'], $msg['customerid'], $msg['mailfrom'], $msg['inreplyto'], $msg['messageid'], isset($msg['replyto']) ? $msg['replyto'] : $headers['Reply-To'], $head));
    $mail_dir = ConfigHelper::getConfig('rt.mail_dir');
    if (!empty($files) && !empty($mail_dir)) {
        $id = $DB->GetLastInsertId('rtmessages');
        $dir = $mail_dir . sprintf('/%06d/%06d', $msg['ticketid'], $id);
        @mkdir($mail_dir . sprintf('/%06d', $msg['ticketid']), 0700);
        @mkdir($dir, 0700);
        foreach ($files as $file) {
            $newfile = $dir . '/' . $file['name'];
            if (@rename($file['tmp_name'], $newfile)) {
                $DB->Execute('INSERT INTO rtattachments (messageid, filename, contenttype) 
						VALUES (?,?,?)', array($id, $file['name'], $file['type']));
            }
        }
    }
}
コード例 #2
0
ファイル: setup_functions.php プロジェクト: prezeskk/lms
function module_setup()
{
    global $SMARTY, $DB, $USERPANEL, $layout, $LMS;
    $layout['pagetitle'] = trans('Userpanel Configuration');
    $SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header', ''));
    $SMARTY->assign('company_logo', ConfigHelper::getConfig('userpanel.company_logo', ''));
    $SMARTY->assign('stylelist', getdir(USERPANEL_DIR . DIRECTORY_SEPARATOR . 'style', '^[a-z0-9]*$'));
    $SMARTY->assign('style', ConfigHelper::getConfig('userpanel.style', 'default'));
    $SMARTY->assign('hint', ConfigHelper::getConfig('userpanel.hint', 'modern'));
    $SMARTY->assign('hide_nodes_modules', ConfigHelper::getConfig('userpanel.hide_nodes_modules', 0));
    $SMARTY->assign('reminder_mail_sender', ConfigHelper::getConfig('userpanel.reminder_mail_sender', ''));
    $SMARTY->assign('reminder_mail_subject', ConfigHelper::getConfig('userpanel.reminder_mail_subject', trans('credential reminder')));
    $SMARTY->assign('reminder_mail_body', ConfigHelper::getConfig('userpanel.reminder_mail_body', "ID: %id\nPIN: %pin"));
    $SMARTY->assign('reminder_sms_body', ConfigHelper::getConfig('userpanel.reminder_sms_body', "ID: %id, PIN: %pin"));
    $SMARTY->assign('auth_type', ConfigHelper::getConfig('userpanel.auth_type', 1));
    $SMARTY->assign('force_ssl', ConfigHelper::getConfig('userpanel.force_ssl', ConfigHelper::getConfig('phpui.force_ssl', 1)));
    $enabled_modules = ConfigHelper::getConfig('userpanel.enabled_modules', null, true);
    if (is_null($enabled_modules)) {
        $enabled_modules = array();
        if (!empty($USERPANEL->MODULES)) {
            foreach ($USERPANEL->MODULES as $module) {
                $enabled_modules[] = $module['module'];
            }
        }
        $DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES (?, ?, ?)", array('userpanel', 'enabled_modules', implode(',', $enabled_modules)));
    } else {
        $enabled_modules = explode(',', $enabled_modules);
    }
    $SMARTY->assign('enabled_modules', $enabled_modules);
    $SMARTY->assign('total', sizeof($USERPANEL->MODULES));
    $SMARTY->display('file:' . USERPANEL_DIR . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'setup.html');
}
コード例 #3
0
ファイル: LMSEzpdfTransferForm.php プロジェクト: Akheon23/lms
 protected function main_form($x, $y)
 {
     $balance = $this->data['balance'] < 0 ? -$this->data['balance'] : $this->data['balance'];
     $font_size = 14;
     $lineh = 25;
     $x += ConfigHelper::getConfig('finances.leftmargin', 0, true);
     $y += ConfigHelper::getConfig('finances.bottommargin', 0, true);
     $y += 275;
     $this->backend->addText($x, $y, $font_size, $this->data['d_name']);
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trim($this->data['d_zip'] . ' ' . $this->data['d_city'] . ' ' . $this->data['d_address']));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, format_bankaccount(bankaccount($this->data['id'], $this->data['account'])));
     $y -= $lineh;
     $this->backend->addText($x + 220, $y, $font_size, sprintf('%.2f', $balance));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trans('$a dollars $b cents', to_words(floor($balance)), to_words(round(($balance - floor($balance)) * 100))));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, $this->truncate($this->data['customername']));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, $this->truncate(trim($this->data['zip'] . ' ' . $this->data['city'] . ' ' . $this->data['address'])));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, ConfigHelper::getConfig('finances.pay_title', trans('Not set')));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trans('Customer ID: $a', sprintf('%04d', $this->data['id'])));
 }
コード例 #4
0
ファイル: invoice_pdf.php プロジェクト: kornelek/lms
function invoice_body()
{
    global $invoice, $pdf;
    if (isset($invoice['invoice'])) {
        $template = ConfigHelper::getConfig('invoices.cnote_template_file');
    } else {
        $template = ConfigHelper::getConfig('invoices.template_file');
    }
    switch ($template) {
        case "standard":
            invoice_body_standard();
            break;
        case "FT-0100":
            invoice_body_ft0100();
            break;
        default:
            if (file_exists($template)) {
                require $template;
            } else {
                //go to LMS modules directory
                require MODULES_DIR . '/' . $template;
            }
    }
    if (!isset($invoice['last'])) {
        new_page();
    }
}
コード例 #5
0
ファイル: LMSTcpdfDebitNote.php プロジェクト: itav/lms
 public function note_recipient()
 {
     $oldy = $this->backend->GetY();
     $recipient = '<b>' . trans('Note recipient:') . '</b><br>';
     $recipient .= $this->data['name'] . '<br>';
     $recipient .= $this->data['address'] . '<br>';
     $recipient .= $this->data['zip'] . ' ' . $this->data['city'] . '<br>';
     if ($this->data['ten']) {
         $recipient .= trans('TEN') . ': ' . $this->data['ten'] . '<br>';
     } elseif ($this->data['ssn']) {
         $recipient .= trans('SSN') . ': ' . $this->data['ssn'] . '<br>';
     }
     $this->backend->SetFont('arial', '', 10);
     $this->backend->writeHTMLCell(80, '', 125, 50, $recipient, 0, 1, 0, true, 'L');
     $y = $this->backend->GetY();
     if (ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_bankaccount', true))) {
         $bankaccount = trans('Bank account:') . ' <b>' . format_bankaccount(bankaccount($this->data['customerid'], $this->data['account'])) . '</b>';
         $this->backend->SetFont('arial', 'B', 8);
         $this->backend->writeHTMLCell('', '', 125, $oldy + round(($y - $oldy - 8) / 2), $bankaccount, 0, 1, 0, true, 'L');
     }
     if (ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_credentials', true))) {
         $pin = '<b>' . trans('Customer ID: $a', sprintf('%04d', $this->data['customerid'])) . '</b><br>';
         $pin .= '<b>PIN: ' . sprintf('%04d', $this->data['customerpin']) . '</b><br>';
         $this->backend->SetFont('arial', 'B', 8);
         $this->backend->writeHTMLCell('', '', 125, $oldy + round(($y - $oldy) / 2), $pin, 0, 1, 0, true, 'L');
     }
     $this->backend->SetY($y);
 }
コード例 #6
0
ファイル: LMSHtmlDocument.php プロジェクト: Akheon23/lms
 public function WriteToBrowser($filename = null)
 {
     $this->PrepareFullContents();
     header('Content-Type: ' . ConfigHelper::getConfig($this->config_section . '.content_type'));
     if (!is_null($filename)) {
         header('Content-Disposition: inline; filename=' . $filename);
     }
     echo $this->contents;
 }
コード例 #7
0
ファイル: functions.php プロジェクト: kornelek/lms
 function module_setup()
 {
     global $SMARTY, $LMS;
     $SMARTY->assign('disable_transferform', ConfigHelper::getConfig('userpanel.disable_transferform'));
     $SMARTY->assign('disable_invoices', ConfigHelper::getConfig('userpanel.disable_invoices'));
     $SMARTY->assign('invoice_duplicate', ConfigHelper::getConfig('userpanel.invoice_duplicate'));
     $SMARTY->assign('show_tariffname', ConfigHelper::getConfig('userpanel.show_tariffname'));
     $SMARTY->assign('show_speeds', ConfigHelper::getConfig('userpanel.show_speeds'));
     $SMARTY->display('module:finances:setup.html');
 }
コード例 #8
0
ファイル: Userpanel.class.php プロジェクト: prezeskk/lms
 public function __construct(&$DB, &$SESSION)
 {
     // ustawia zmienne klasy
     $this->DB =& $DB;
     $this->SESSION =& $SESSION;
     $module_order = ConfigHelper::getConfig('userpanel.module_order', '', true);
     if (strlen($module_order)) {
         $this->module_order = array_flip(explode(',', $module_order));
     }
 }
コード例 #9
0
ファイル: LMSHtmlDebitNote.php プロジェクト: Akheon23/lms
 public function Draw($data)
 {
     parent::Draw($data);
     $template_file = ConfigHelper::getConfig('notes.template_file');
     if (!$this->smarty->templateExists($template_file)) {
         $template_file = 'note' . DIRECTORY_SEPARATOR . $template_file;
     }
     $this->smarty->assign('note', $this->data);
     $this->contents .= $this->smarty->fetch($template_file);
 }
コード例 #10
0
ファイル: netdevmap.php プロジェクト: Akheon23/lms
function pngdrawtext($image, $font, $x, $y, $text, $color, $bgcolor)
{
    if (ConfigHelper::getConfig('phpui.gd_translate_to')) {
        $text = iconv('UTF-8', ConfigHelper::getConfig('phpui.gd_translate_to'), $text);
    }
    imagestring($image, $font, $x + 1, $y + 1, $text, $bgcolor);
    imagestring($image, $font, $x + 1, $y - 1, $text, $bgcolor);
    imagestring($image, $font, $x - 1, $y + 1, $text, $bgcolor);
    imagestring($image, $font, $x - 1, $y - 1, $text, $bgcolor);
    imagestring($image, $font, $x, $y, $text, $color);
}
コード例 #11
0
ファイル: LMSHtmlReceipt.php プロジェクト: itav/lms
 public function Draw($data)
 {
     parent::Draw($data);
     $template_file = ConfigHelper::getConfig('receipts.template_file');
     if (!$this->smarty->templateExists('file:' . $template_file)) {
         $template_file = 'receipt' . DIRECTORY_SEPARATOR . $template_file;
     }
     $this->smarty->assign('type', $this->data['which']);
     $this->smarty->assign('receipt', $this->data);
     $this->contents .= $this->smarty->fetch('file:' . $template_file);
 }
コード例 #12
0
ファイル: LMS.setup.php プロジェクト: oswida/lms
function module_get_timestamp($tpl_name, &$tpl_timestamp, $smarty_obj)
{
    global $LMS;
    $template = explode(':', $tpl_name);
    $template_path = ConfigHelper::getConfig('directories.userpanel_dir') . '/modules/' . $template[0] . '/templates/' . $template[1];
    if (file_exists($template_path)) {
        $tpl_timestamp = filectime($template_path);
        return true;
    } else {
        return false;
    }
}
コード例 #13
0
 public function smartyCashImportOKBS(Smarty $hook_data)
 {
     $template_dirs = $hook_data->getTemplateDir();
     $plugin_templates = PLUGINS_DIR . DIRECTORY_SEPARATOR . LMSCustomersAgePlugin::PLUGIN_DIRECTORY_NAME . DIRECTORY_SEPARATOR . 'templates';
     $custom_templates_dir = ConfigHelper::getConfig('phpui.custom_templates_dir');
     if (!empty($custom_templates_dir) && file_exists($plugin_templates . DIRECTORY_SEPARATOR . $custom_templates_dir) && !is_file($plugin_tempaltes . DIRECTORY_SEPARATOR . $custom_templates_dir)) {
         $plugin_templates = PLUGINS_DIR . DIRECTORY_SEPARATOR . LMSCustomersAgePlugin::PLUGIN_DIRECTORY_NAME . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $custom_templates_dir;
     }
     array_unshift($template_dirs, $plugin_templates);
     $hook_data->setTemplateDir($template_dirs);
     return $hook_data;
 }
コード例 #14
0
ファイル: LMSPluginManager.php プロジェクト: itav/lms
 /**
  * Loads plugins
  *
  * @throws Exception Throws exception if plugin not found
  */
 public function __construct()
 {
     $dirs = getdir(PLUGINS_DIR, '^[0-9a-zA-Z]+$');
     if (empty($dirs)) {
         return;
     }
     asort($dirs);
     $plugins_config = ConfigHelper::getConfig('phpui.plugins');
     $plugins_tuples = empty($plugins_config) ? array() : preg_split('/[;,\\s\\t\\n]+/', $plugins_config, -1, PREG_SPLIT_NO_EMPTY);
     $plugin_priorities = array();
     foreach ($plugins_tuples as $idx => $plugin_tuple) {
         $plugin_props = explode(':', $plugin_tuple);
         $plugin_priorities[$plugin_props[0]] = count($plugin_props) == 2 ? intval($plugin_props[1]) : SubjectInterface::LAST_PRIORITY;
         $plugins_tuples[$idx] = $plugin_props[0];
     }
     foreach ($dirs as $plugin_name) {
         if (class_exists($plugin_name)) {
             $plugin_name::loadLocales();
             $plugin_info = array('name' => $plugin_name, 'enabled' => false, 'new_style' => true, 'dbcurrschversion' => null, 'dbschversion' => defined($plugin_name . '::PLUGIN_DBVERSION') ? constant($plugin_name . '::PLUGIN_DBVERSION') : null, 'fullname' => defined($plugin_name . '::PLUGIN_NAME') ? trans(constant($plugin_name . '::PLUGIN_NAME')) : null, 'description' => defined($plugin_name . '::PLUGIN_DESCRIPTION') ? trans(constant($plugin_name . '::PLUGIN_DESCRIPTION')) : null, 'author' => defined($plugin_name . '::PLUGIN_AUTHOR') ? constant($plugin_name . '::PLUGIN_AUTHOR') : null);
             if (array_key_exists($plugin_name, $plugin_priorities)) {
                 $plugin = new $plugin_name();
                 if (!$plugin instanceof LMSPlugin) {
                     throw new Exception("Plugin object must be instance of LMSPlugin class");
                 }
                 $plugin_info = array_merge($plugin_info, array('enabled' => true, 'priority' => $plugin_priorities[$plugin_name], 'dbcurrschversion' => $plugin->getDbSchemaVersion()));
                 $this->registerObserver($plugin, $plugin_info['priority']);
             }
             $this->new_style_plugins[$plugin_name] = $plugin_info;
         } else {
             writesyslog("Unknown plugin {$plugin_name} at position {$position}", LOG_ERR);
             continue;
         }
     }
     $files = getdir(LIB_DIR . DIRECTORY_SEPARATOR . 'plugins', '^[0-9a-zA-Z_\\-]+\\.php$');
     if (empty($files)) {
         return;
     }
     asort($files);
     $old_plugins = array_diff($plugins_tuples, array_keys($this->new_style_plugins));
     foreach ($files as $plugin_name) {
         if (!is_readable(LIB_DIR . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $plugin_name)) {
             continue;
         }
         $plugin_name = str_replace('.php', '', $plugin_name);
         $plugin_info = array('name' => $plugin_name, 'enabled' => false, 'new_style' => false);
         if (array_key_exists($plugin_name, $plugin_priorities)) {
             $plugin_info['enabled'] = true;
         }
         $this->old_style_plugins[$plugin_name] = $plugin_info;
     }
 }
コード例 #15
0
ファイル: dbrecover.php プロジェクト: jarecky/lms
function DBLoad($filename = NULL)
{
    global $DB, $SYSLOG;
    if (!$filename) {
        return FALSE;
    }
    $finfo = pathinfo($filename);
    $ext = $finfo['extension'];
    if ($ext == 'gz' && extension_loaded('zlib')) {
        $file = gzopen($filename, 'r');
    } else {
        $file = fopen($filename, 'r');
    }
    if (!$file) {
        return FALSE;
    }
    $DB->BeginTrans();
    // przyspieszmy działanie jeżeli baza danych obsługuje transakcje
    while (!feof($file)) {
        $line = fgets($file, 8192);
        if ($line != '') {
            $line = str_replace(";\n", '', $line);
            $DB->Execute($line);
        }
    }
    $DB->CommitTrans();
    if (extension_loaded('zlib') && $ext == 'gz') {
        gzclose($file);
    } else {
        fclose($file);
    }
    // Okej, zróbmy parę bzdurek db depend :S
    // Postgres sux ! (warden)
    // Tak, a łyżka na to 'niemożliwe' i poleciała za wanną potrącając bannanem musztardę (lukasz)
    switch (ConfigHelper::getConfig('database.type')) {
        case 'postgres':
            // actualize postgres sequences ...
            foreach ($DB->ListTables() as $tablename) {
                // ... where we have *_id_seq
                if (!in_array($tablename, array('rtattachments', 'dbinfo', 'invoicecontents', 'receiptcontents', 'documentcontents', 'stats', 'eventassignments', 'sessions'))) {
                    $DB->Execute("SELECT setval('" . $tablename . "_id_seq',max(id)) FROM " . $tablename);
                }
            }
            break;
    }
    if ($SYSLOG) {
        $SYSLOG->AddMessage(SYSLOG_RES_DBBACKUP, SYSLOG_OPER_DBBACKUPRECOVER, array('filename' => $filename), null);
    }
}
コード例 #16
0
ファイル: ULMS.class.php プロジェクト: vargburzum/lms
    public function GetCustomerTickets($id)
    {
        $queues = array();
        if (ConfigHelper::getConfig('userpanel.tickets_from_selected_queues')) {
            $queues = $this->DB->GetCol('SELECT id FROM rtqueues
				WHERE id IN (' . str_replace(';', ',', ConfigHelper::getConfig('userpanel.queues')) . ')');
        }
        $tickets = $this->DB->GetAll('SELECT * FROM rttickets WHERE customerid=?' . (isset($queues) && !empty($queues) ? ' AND queueid IN (' . implode(',', $queues) . ')' : '') . ' ORDER BY createtime DESC', array($id));
        if (!empty($tickets)) {
            foreach ($tickets as $idx => $ticket) {
                $tickets[$idx]['queuename'] = $this->DB->GetOne('SELECT name FROM rtqueues WHERE id = ?', array($ticket['queueid']));
            }
        }
        return $tickets;
    }
コード例 #17
0
ファイル: setup_functions.php プロジェクト: oswida/lms
function module_setup()
{
    global $SMARTY, $DB, $USERPANEL, $layout, $LMS;
    $layout['pagetitle'] = trans('Userpanel Configuration');
    $SMARTY->assign('stylelist', getdir(USERPANEL_DIR . '/style', '^[a-z0-9]*$'));
    $SMARTY->assign('style', ConfigHelper::getConfig('userpanel.style', 'default'));
    $SMARTY->assign('hint', ConfigHelper::getConfig('userpanel.hint', 'modern'));
    $SMARTY->assign('hide_nodes_modules', ConfigHelper::getConfig('userpanel.hide_nodes_modules', 0));
    $SMARTY->assign('reminder_mail_sender', ConfigHelper::getConfig('userpanel.reminder_mail_sender', ''));
    $SMARTY->assign('reminder_mail_subject', ConfigHelper::getConfig('userpanel.reminder_mail_subject', trans('credential reminder')));
    $SMARTY->assign('reminder_mail_body', ConfigHelper::getConfig('userpanel.reminder_mail_body', "ID: %id\nPIN: %pin"));
    $SMARTY->assign('reminder_sms_body', ConfigHelper::getConfig('userpanel.reminder_sms_body', "ID: %id, PIN: %pin"));
    $SMARTY->assign('total', sizeof($USERPANEL->MODULES));
    $SMARTY->display(USERPANEL_DIR . '/templates/setup.html');
}
コード例 #18
0
ファイル: domainlist.php プロジェクト: oswida/lms
function GetDomainList($order = 'name,asc', $customer = '', $filtr = '')
{
    global $DB;
    list($order, $direction) = sscanf($order, '%[^,],%s');
    $direction != 'desc' ? $direction = 'asc' : ($direction = 'desc');
    switch ($order) {
        case 'id':
            $sqlord = " ORDER BY d.id {$direction}";
            break;
        case 'description':
            $sqlord = " ORDER BY d.description {$direction}";
            break;
        case 'customer':
            $sqlord = " ORDER BY customername {$direction}";
            break;
        case 'type':
            $sqlord = " ORDER BY type {$direction}";
            break;
        default:
            $sqlord = " ORDER BY d.name {$direction}";
            break;
    }
    if ($filtr == '0-9') {
        if (ConfigHelper::getConfig('database.type') == 'postgres') {
            $where[] = "d.name ~ '^[0-9]'";
        } else {
            $where[] = "d.name REGEXP '^[0-9]'";
        }
    } else {
        if ($filtr) {
            $filtr = substr($filtr, 0, 1);
            $where[] = 'd.name ?LIKE? ' . $DB->Escape("{$filtr}%");
        }
    }
    if ($customer != '') {
        $where[] = 'd.ownerid = ' . intval($customer);
    }
    $where = !empty($where) ? ' WHERE ' . implode(' AND ', $where) : '';
    $list = $DB->GetAll('SELECT d.id AS id, d.name AS name, d.description, 
		d.ownerid, d.type, (SELECT COUNT(*) FROM passwd WHERE domainid = d.id) AS cnt, ' . $DB->Concat('lastname', "' '", 'c.name') . ' AS customername 
		FROM domains d
		LEFT JOIN customers c ON (d.ownerid = c.id)' . $where . ($sqlord != '' ? $sqlord : ''));
    $list['total'] = sizeof($list);
    $list['order'] = $order;
    $list['direction'] = $direction;
    $list['customer'] = $customer;
    return $list;
}
コード例 #19
0
ファイル: LMSHtmlInvoice.php プロジェクト: itav/lms
 public function Draw($data)
 {
     parent::Draw($data);
     if (isset($this->data['invoice'])) {
         $template_file = ConfigHelper::getConfig('invoices.cnote_template_file');
     } else {
         $template_file = ConfigHelper::getConfig('invoices.template_file');
     }
     if (!$this->smarty->templateExists('file:' . $template_file)) {
         $template_file = 'invoice' . DIRECTORY_SEPARATOR . $template_file;
     }
     $this->smarty->assign('type', $this->data['type']);
     $this->smarty->assign('duplicate', $this->data['type'] == trans('DUPLICATE'));
     $this->smarty->assign('invoice', $this->data);
     $this->contents .= $this->smarty->fetch('file:' . $template_file);
 }
コード例 #20
0
 /**
  * Fetch a template's modification time from database
  *
  * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source.
  * @param string $name template name
  * @return integer timestamp (epoch) the template was modified
  */
 protected function fetchTimestamp($name)
 {
     global $module_dir;
     $module = $_GET['m'];
     $style = ConfigHelper::getConfig('userpanel.style', 'default');
     $template_path = $module_dir . $module . DIRECTORY_SEPARATOR . 'style' . DIRECTORY_SEPARATOR . $style . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $name;
     if (file_exists($template_path)) {
         return filectime($template_path);
     } else {
         $template_path = $module_dir . $module . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $name;
         if (file_exists($template_path)) {
             return filectime($template_path);
         } else {
             return 0;
         }
     }
 }
コード例 #21
0
ファイル: LMSInvoice.php プロジェクト: Akheon23/lms
 public function Draw($data)
 {
     parent::Draw($data);
     if (isset($this->data['invoice'])) {
         $template = ConfigHelper::getConfig('invoices.cnote_template_file');
     } else {
         $template = ConfigHelper::getConfig('invoices.template_file');
     }
     switch ($template) {
         case "standard":
             $this->invoice_body_standard();
             break;
         case "FT-0100":
             $this->invoice_body_ft0100();
             break;
     }
 }
コード例 #22
0
ファイル: tcpdf.php プロジェクト: bochniak/lms-1
 public function Footer()
 {
     $cur_y = $this->y;
     $this->SetTextColor(0, 0, 0);
     $line_width = 0.85 / $this->k;
     $this->SetLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
     /* print barcode with invoice number in footer */
     $barcode = $this->getBarcode();
     if (!empty($barcode) && ConfigHelper::getConfig('invoices.template_file') == 'standard') {
         $this->Ln($line_width);
         $style = array('position' => 'L', 'align' => 'L', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'padding' => 0, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'times', 'fontsize' => 6, 'stretchtext' => 0);
         $this->write1DBarcode($barcode, 'C128', '', $cur_y + $line_width - 0.25, '', $this->footer_margin - 2, 0.3, $style, '');
         /* draw line */
         $this->SetY($cur_y);
         $this->SetX($this->original_rMargin);
         $this->Cell(0, 0, '', array('T' => array('width' => 0.1)), 0, 'L');
     }
 }
コード例 #23
0
ファイル: LMSPluginManager.php プロジェクト: oswida/lms
 /**
  * Loads plugins
  * 
  * @throws Exception Throws exception if plugin not found
  */
 public function __construct()
 {
     $plugins_config = ConfigHelper::getConfig('phpui.plugins');
     if ($plugins_config) {
         $plugins_tuples = explode(';', $plugins_config);
         foreach ($plugins_tuples as $position => $plugin_tuple) {
             list($plugin_name, $plugin_priority) = explode(":", $plugin_tuple);
             if (!class_exists($plugin_name)) {
                 throw new Exception("Unknown plugin {$plugin_name} at position {$position}");
             }
             $plugin = new $plugin_name();
             if (!$plugin instanceof LMSPlugin) {
                 throw new Exception("Plugin object must be instance of LMSPlugin class");
             }
             if ($plugin_priority === null) {
                 $plugin_priority = SubjectInterface::LAST_PRIORITY;
             }
             $this->registerObserver($plugin, $plugin_priority);
         }
     }
 }
コード例 #24
0
ファイル: invoice_pdf.php プロジェクト: kornelek/lms
function invoice_body()
{
    global $invoice, $pdf;
    if (isset($invoice['invoice'])) {
        $template = ConfigHelper::getConfig('invoices.cnote_template_file');
    } else {
        $template = ConfigHelper::getConfig('invoices.template_file');
    }
    switch ($template) {
        case "standard":
            invoice_body_standard();
            break;
        case "FT-0100":
            invoice_body_ft0100();
            break;
        default:
            require $template;
    }
    if (!isset($invoice['last'])) {
        new_page();
    }
}
コード例 #25
0
ファイル: rtticketedit.php プロジェクト: askipl/lms
	$ncategories[] = $category;
}
$categories = $ncategories;

$layout['pagetitle'] = trans('Ticket Edit: $a',sprintf("%06d",$ticket['ticketid']));

$SESSION->save('backto', $_SERVER['QUERY_STRING']);

if (!ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.big_networks', false)))
{
        $SMARTY->assign('customerlist', $LMS->GetAllCustomerNames());
}

$queuelist = $LMS->GetQueueNames();
if (ConfigHelper::getConfig('userpanel.limit_ticket_movements_to_selected_queues')) {
	$selectedqueues = explode(';', ConfigHelper::getConfig('userpanel.queues'));
	if (in_array($ticket['queueid'], $selectedqueues))
		foreach ($queuelist as $idx => $queue)
			if (!in_array($queue['id'], $selectedqueues))
				unset($queuelist[$idx]);
}

$SMARTY->assign('ticket', $ticket);
$SMARTY->assign('queuelist', $queuelist);
$SMARTY->assign('categories', $categories);
$SMARTY->assign('userlist', $LMS->GetUserNames());
$SMARTY->assign('error', $error);
$SMARTY->display('rt/rtticketedit.html');

?>
コード例 #26
0
ファイル: netdevlist.php プロジェクト: askipl/lms
$listdata['order'] = $netdevlist['order'];
$listdata['direction'] = $netdevlist['direction'];
$listdata['status'] = $s;
$listdata['invprojectid'] = $p;
$listdata['netnode'] = $n;
$listdata['producer'] = $producer;
$listdata['model'] = $model;
unset($netdevlist['total']);
unset($netdevlist['order']);
unset($netdevlist['direction']);

if(!isset($_GET['page']))
        $SESSION->restore('ndlp', $_GET['page']);
	
$page = (! $_GET['page'] ? 1 : $_GET['page']);
$pagelimit = ConfigHelper::getConfig('phpui.nodelist_pagelimit', $listdata['total']);
$start = ($page - 1) * $pagelimit;

$SESSION->save('ndlp', $page);

$SESSION->save('backto', $_SERVER['QUERY_STRING']);

$SMARTY->assign('page',$page);
$SMARTY->assign('pagelimit',$pagelimit);
$SMARTY->assign('start',$start);
$SMARTY->assign('netdevlist',$netdevlist);
$SMARTY->assign('listdata',$listdata);
$SMARTY->assign('netnodes', $DB->GetAll("SELECT id, name FROM netnodes ORDER BY name"));
$SMARTY->assign('NNprojects', $DB->GetAll("SELECT * FROM invprojects WHERE type<>? ORDER BY name",
	array(INV_PROJECT_SYSTEM)));
$SMARTY->assign('producers', $producers);
コード例 #27
0
ファイル: lms-notify.php プロジェクト: kornelek/lms
    $notifications[$type]['header'] = ConfigHelper::getConfig($config_section . '.' . $type . '_header', "#!/bin/bash\n\nipset flush {$type}\n");
    $notifications[$type]['rule'] = ConfigHelper::getConfig($config_section . '.' . $type . '_rule', "ipset add {$type} %i\n");
    $notifications[$type]['footer'] = ConfigHelper::getConfig($config_section . '.' . $type . '_footer', '');
}
if (in_array('mail', $channels) && empty($mail_from)) {
    die("Fatal error: mailfrom unset! Can't continue, exiting." . PHP_EOL);
}
if (!empty($auth) && !preg_match('/^LOGIN|PLAIN|CRAM-MD5|NTLM$/i', $auth)) {
    die("Fatal error: smtp_auth setting not supported! Can't continue, exiting." . PHP_EOL);
}
//$currtime = localtime2() + $timeoffset;
$currtime = localtime2();
//$daystart = intval($currtime / 86400) * 86400 - $timeoffset;
$daystart = intval($currtime / 86400) * 86400;
$dayend = $daystart + 86399;
$deadline = ConfigHelper::getConfig('payments.deadline', ConfigHelper::getConfig('invoices.paytime', 0));
// Include required files (including sequence is important)
require_once LIB_DIR . DIRECTORY_SEPARATOR . 'language.php';
include_once LIB_DIR . DIRECTORY_SEPARATOR . 'definitions.php';
require_once LIB_DIR . DIRECTORY_SEPARATOR . 'unstrip.php';
require_once LIB_DIR . DIRECTORY_SEPARATOR . 'common.php';
if (ConfigHelper::checkConfig('phpui.logging') && class_exists('SYSLOG')) {
    $SYSLOG = new SYSLOG($DB);
} else {
    $SYSLOG = null;
}
// Initialize Session, Auth and LMS classes
$AUTH = NULL;
$LMS = new LMS($DB, $AUTH, $SYSLOG);
$LMS->ui_lang = $_ui_language;
$LMS->lang = $_language;
コード例 #28
0
ファイル: rtsearch.php プロジェクト: prezeskk/lms
    } else {
        foreach ($search['categories'] as $catid => $val) {
            $search['catids'][] = $catid;
        }
    }
    if (!$error) {
        $queue = RTSearch($search, $o);
        $queuedata['total'] = $queue['total'];
        $queuedata['order'] = $queue['order'];
        $queuedata['direction'] = $queue['direction'];
        $queuedata['queue'] = isset($search['queue']) ? $search['queue'] : 0;
        unset($queue['total']);
        unset($queue['order']);
        unset($queue['direction']);
        $page = !isset($_GET['page']) ? 1 : $_GET['page'];
        $pagelimit = ConfigHelper::getConfig('phpui.ticketlist_pagelimit', $queuedata['total']);
        $start = ($page - 1) * $pagelimit;
        $SESSION->save('rtp', $page);
        $SESSION->save('rtsearch', $search);
        $SMARTY->assign('queue', $queue);
        $SMARTY->assign('queuedata', $queuedata);
        $SMARTY->assign('pagelimit', $pagelimit);
        $SMARTY->assign('page', $page);
        $SMARTY->assign('start', $start);
        $SMARTY->assign('search', $search);
        $SMARTY->display('rt/rtsearchresults.html');
        $SESSION->close();
        die;
    }
} else {
    if (!empty($categories)) {
コード例 #29
0
         $a['at'] = $d . '/' . $m;
     } else {
         list($d, $m) = explode('/', $a['at']);
     }
     if (!$error) {
         if ($d > 30 || $d < 1 || $d > 28 && $m == 2) {
             $error['at'] = trans('This month doesn\'t contain specified number of days');
         }
         if ($m > 6 || $m < 1) {
             $error['at'] = trans('Incorrect month number (max.6)!');
         }
         $at = ($m - 1) * 100 + $d;
     }
     break;
 case YEARLY:
     if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.use_current_payday', false)) && !$a['at']) {
         $d = date('j', time());
         $m = date('n', time());
         $a['at'] = $d . '/' . $m;
     } elseif (!preg_match('/^[0-9]{2}\\/[0-9]{2}$/', $a['at'])) {
         $error['at'] = trans('Incorrect date format! Enter date in DD/MM format!');
     } else {
         list($d, $m) = explode('/', $a['at']);
     }
     if (!$error) {
         if ($d > 30 || $d < 1 || $d > 28 && $m == 2) {
             $error['at'] = trans('This month doesn\'t contain specified number of days');
         }
         if ($m > 12 || $m < 1) {
             $error['at'] = trans('Incorrect month number');
         }
コード例 #30
0
ファイル: documentlist.php プロジェクト: prezeskk/lms
    $SESSION->save('docls', $s);
}
$documentlist = GetDocumentList($o, array('type' => $t, 'customer' => $c, 'numberplan' => $p, 'from' => $from, 'to' => $to, 'status' => $s));
$listdata['total'] = $documentlist['total'];
$listdata['order'] = $documentlist['order'];
$listdata['direction'] = $documentlist['direction'];
$listdata['type'] = $t;
$listdata['customer'] = $c;
$listdata['numberplan'] = $p;
$listdata['from'] = $from;
$listdata['to'] = $to;
$listdata['status'] = $s;
unset($documentlist['total']);
unset($documentlist['order']);
unset($documentlist['direction']);
$pagelimit = ConfigHelper::getConfig('phpui.documentlist_pagelimit');
$page = !isset($_GET['page']) ? ceil($listdata['total'] / $pagelimit) : intval($_GET['page']);
$start = ($page - 1) * $pagelimit;
$layout['pagetitle'] = trans('Documents List');
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
if ($docid = $SESSION->get('documentprint')) {
    $SMARTY->assign('docid', $docid);
    $SESSION->remove('documentprint');
}
if ($listdata['total']) {
    $SMARTY->assign('docrights', $DB->GetAllByKey('SELECT doctype, rights
			FROM docrights WHERE userid = ? AND rights > 1', 'doctype', array($AUTH->id)));
}
if (!ConfigHelper::checkConfig('phpui.big_networks')) {
    $SMARTY->assign('customers', $LMS->GetCustomerNames());
}