mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-02-18 14:48:42 -05:00
This commit is contained in:
@@ -108,7 +108,26 @@ class Config extends Secure_Controller
|
||||
|
||||
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
|
||||
}
|
||||
|
||||
|
||||
public function save_email()
|
||||
{
|
||||
$batch_save_data = array(
|
||||
'protocol' => $this->input->post('protocol'),
|
||||
'mailpath' => $this->input->post('mailpath'),
|
||||
'smtp_host' => $this->input->post('smtp_host'),
|
||||
'smtp_user' => $this->input->post('smtp_user'),
|
||||
'smtp_pass' => $this->input->post('smtp_pass'),
|
||||
'smtp_port' => $this->input->post('smtp_port'),
|
||||
'smtp_timeout' => $this->input->post('smtp_timeout'),
|
||||
'smtp_crypto' => $this->input->post('smtp_crypto')
|
||||
);
|
||||
|
||||
$result = $this->Appconfig->batch_save($batch_save_data);
|
||||
$success = $result ? TRUE : FALSE;
|
||||
|
||||
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
|
||||
}
|
||||
|
||||
public function save_message()
|
||||
{
|
||||
$batch_save_data = array(
|
||||
|
||||
@@ -10,6 +10,7 @@ class Sales extends Secure_Controller
|
||||
|
||||
$this->load->library('sale_lib');
|
||||
$this->load->library('barcode_lib');
|
||||
$this->load->library('email_lib');
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -413,32 +414,32 @@ class Sales extends Secure_Controller
|
||||
|
||||
$result = FALSE;
|
||||
$message = $this->lang->line('sales_invoice_no_email');
|
||||
if(isset($sale_data["customer_email"]) && !empty($sale_data["customer_email"]))
|
||||
|
||||
if(!empty($sale_data['customer_email']))
|
||||
{
|
||||
$this->load->library('email');
|
||||
$this->email->from($this->config->item('email'), $this->config->item('company'));
|
||||
$this->email->to($sale_data['customer_email']);
|
||||
$this->email->subject($this->lang->line('sales_invoice') . ' ' . $sale_data['invoice_number']);
|
||||
$to = $sale_data['customer_email'];
|
||||
$subject = $this->lang->line('sales_invoice') . ' ' . $sale_data['invoice_number'];
|
||||
|
||||
$text = $this->config->item('invoice_email_message');
|
||||
$text = str_replace('$INV', $sale_data['invoice_number'], $text);
|
||||
$text = str_replace('$CO', 'POS ' . $sale_data['sale_id'], $text);
|
||||
$text = $this->_substitute_customer($text,(object) $sale_data);
|
||||
$this->email->message($text);
|
||||
$text = $this->_substitute_customer($text, (object) $sale_data);
|
||||
|
||||
// generate email attachment: invoice in pdf format
|
||||
$html = $this->load->view('sales/invoice_email', $sale_data, TRUE);
|
||||
// load pdf helper
|
||||
$this->load->helper(array('dompdf', 'file'));
|
||||
$file_content = pdf_create($html, '', FALSE);
|
||||
$filename = sys_get_temp_dir() . '/'. $this->lang->line('sales_invoice') . '-' . str_replace('/', '-' , $sale_data["invoice_number"]) . '.pdf';
|
||||
$filename = sys_get_temp_dir() . '/' . $this->lang->line('sales_invoice') . '-' . str_replace('/', '-' , $sale_data['invoice_number']) . '.pdf';
|
||||
write_file($filename, $file_content);
|
||||
|
||||
$result = $this->email_lib->sendEmail($to, $subject, $text, $filename);
|
||||
|
||||
$this->email->attach($filename);
|
||||
$result = $this->email->send();
|
||||
$message = $this->lang->line($result ? 'sales_invoice_sent' : 'sales_invoice_unsent') . ' ' . $sale_data["customer_email"];
|
||||
$message = $this->lang->line($result ? 'sales_invoice_sent' : 'sales_invoice_unsent') . ' ' . $to;
|
||||
}
|
||||
|
||||
echo json_encode(array('success' => $result, 'message' => $message, 'id' => $sale_id));
|
||||
|
||||
$this->sale_lib->clear_all();
|
||||
|
||||
return $result;
|
||||
@@ -450,22 +451,23 @@ class Sales extends Secure_Controller
|
||||
|
||||
$result = FALSE;
|
||||
$message = $this->lang->line('sales_receipt_no_email');
|
||||
if(isset($sale_data["customer_email"]) && !empty( $sale_data["customer_email"]))
|
||||
|
||||
if(!empty($sale_data['customer_email']))
|
||||
{
|
||||
$sale_data['barcode'] = $this->barcode_lib->generate_receipt_barcode($sale_data['sale_id']);
|
||||
|
||||
$this->load->library('email');
|
||||
$config['mailtype'] = 'html';
|
||||
$this->email->initialize($config);
|
||||
$this->email->from($this->config->item('email'), $this->config->item('company'));
|
||||
$this->email->to($sale_data['customer_email']);
|
||||
$this->email->subject($this->lang->line('sales_receipt'));
|
||||
$this->email->message($this->load->view('sales/receipt_email', $sale_data, TRUE));
|
||||
$result = $this->email->send();
|
||||
$message = $this->lang->line($result ? 'sales_receipt_sent' : 'sales_receipt_unsent') . ' ' . $sale_data["customer_email"];
|
||||
$to = $sale_data['customer_email'];
|
||||
$subject = $this->lang->line('sales_receipt');
|
||||
|
||||
$text = $this->load->view('sales/receipt_email', $sale_data, TRUE);
|
||||
|
||||
$result = $this->email_lib->sendEmail($to, $subject, $text);
|
||||
|
||||
$message = $this->lang->line($result ? 'sales_receipt_sent' : 'sales_receipt_unsent') . ' ' . $to;
|
||||
}
|
||||
|
||||
echo json_encode(array('success' => $result, 'message' => $message, 'id' => $sale_id));
|
||||
|
||||
$this->sale_lib->clear_all();
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "MWSt 2";
|
||||
$lang["config_default_tax_rate_number"] = "MWSt Rate";
|
||||
$lang["config_default_tax_rate_required"] = "MWSt ist erforderlich";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "Einstellungen";
|
||||
$lang["config_general_configuration"] = "Einstellungen";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Tax 2 Rate";
|
||||
$lang["config_default_tax_rate_number"] = "The default tax rate must be a number";
|
||||
$lang["config_default_tax_rate_required"] = "The default tax rate is a required field";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "General";
|
||||
$lang["config_general_configuration"] = "General Configuration";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Impuesto 2";
|
||||
$lang["config_default_tax_rate_number"] = "El Impuesto Predeterminado debe ser un número";
|
||||
$lang["config_default_tax_rate_required"] = "El Impuesto Predeterminado es requerido";
|
||||
$lang["config_default_tax_name_required"] = "El nombre del impuesto predeterminado es requerido";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "General";
|
||||
$lang["config_general_configuration"] = "Configuración General";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Taux d'Imposition 2";
|
||||
$lang["config_default_tax_rate_number"] = "Le taux d'imposition doit etre un nombre";
|
||||
$lang["config_default_tax_rate_required"] = "Le taux d'imposition par défaut est requis";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "General";
|
||||
$lang["config_general_configuration"] = "General Configuration";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Porez 2 %";
|
||||
$lang["config_default_tax_rate_number"] = "Zadani porez mora biti broj";
|
||||
$lang["config_default_tax_rate_required"] = "Zadani porez je potreban";
|
||||
$lang["config_default_tax_name_required"] = "Naziv poreza je poteban";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "Opća";
|
||||
$lang["config_general_configuration"] = "Opća konfiguracija";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Adó 2";
|
||||
$lang["config_default_tax_rate_number"] = "Az alapértelmezett adónak számnak kell lennie";
|
||||
$lang["config_default_tax_rate_required"] = "Az alapértelmezett adó kötelező mező";
|
||||
$lang["config_default_tax_name_required"] = "Alapértelmezett adó név kötelező mező";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "Általános";
|
||||
$lang["config_general_configuration"] = "Általános beállitás";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Tarif Pajak 2";
|
||||
$lang["config_default_tax_rate_number"] = "Tarif Pajak Biasa harus angka";
|
||||
$lang["config_default_tax_rate_required"] = "Tarif Pajak Biasa wajib diisi";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "General";
|
||||
$lang["config_general_configuration"] = "General Configuration";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "VAT 2 %";
|
||||
$lang["config_default_tax_rate_number"] = "Het percentage VAT moet een nummer zijn";
|
||||
$lang["config_default_tax_rate_required"] = "Het percentage VAT moet ingevuld worden";
|
||||
$lang["config_default_tax_name_required"] = "De naam van de VAT moet ingevuld worden";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "Algemene";
|
||||
$lang["config_general_configuration"] = "Algemene Instellingen";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Imposto 2 Tarifa";
|
||||
$lang["config_default_tax_rate_number"] = "A taxa de Imposto padrão deve ser um número";
|
||||
$lang["config_default_tax_rate_required"] = "A taxa de Imposto padrão é um campo obrigatório";
|
||||
$lang["config_default_tax_name_required"] = "Nome da taxa padrão é requerida";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Fax";
|
||||
$lang["config_general"] = "Gerais";
|
||||
$lang["config_general_configuration"] = "Configurações Gerais";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "ставка налога 2";
|
||||
$lang["config_default_tax_rate_number"] = "Обычный ставка налога должен быть цифра";
|
||||
$lang["config_default_tax_rate_required"] = "Обычный ставка налога обязательный пробел";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Факс";
|
||||
$lang["config_general"] = "General";
|
||||
$lang["config_general_configuration"] = "General Configuration";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "อัตราภาษี 2";
|
||||
$lang["config_default_tax_rate_number"] = "อัตราภาษีเริ่มต้นต้องเป็นตัวเลข";
|
||||
$lang["config_default_tax_rate_required"] = "อัตราภาษีเริ่มต้นต้องกรอก";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "แฟ็กซ์";
|
||||
$lang["config_general"] = "ตั้งค่าทั่วไป";
|
||||
$lang["config_general_configuration"] = "ตั้งค่าทั่วไป";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "Vergi Oranı 2";
|
||||
$lang["config_default_tax_rate_number"] = "Varsayılan Vergi Oranı sayı olmalıdır";
|
||||
$lang["config_default_tax_rate_required"] = "Varsayılan Vergi Oranı zorunlu alandır";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "Faks";
|
||||
$lang["config_general"] = "General";
|
||||
$lang["config_general_configuration"] = "General Configuration";
|
||||
|
||||
@@ -70,6 +70,15 @@ $lang["config_default_tax_rate_2"] = "稅率 2";
|
||||
$lang["config_default_tax_rate_number"] = "預設稅率必需為數字";
|
||||
$lang["config_default_tax_rate_required"] = "預設稅率為必填";
|
||||
$lang["config_default_tax_name_required"] = "The default tax name is a required field";
|
||||
$lang["config_email"] = "Email";
|
||||
$lang["config_email_protocol"] = "Protocol";
|
||||
$lang["config_email_mailpath"] = "Path to Sendmail";
|
||||
$lang["config_email_smtp_host"] = "SMTP Server";
|
||||
$lang["config_email_smtp_port"] = "SMTP Port";
|
||||
$lang["config_email_smtp_crypto"] = "SMTP Encryption";
|
||||
$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)";
|
||||
$lang["config_email_smtp_user"] = "SMTP Username";
|
||||
$lang["config_email_smtp_pass"] = "SMTP Password";
|
||||
$lang["config_fax"] = "傳真";
|
||||
$lang["config_general"] = "General";
|
||||
$lang["config_general_configuration"] = "General Configuration";
|
||||
|
||||
49
application/libraries/Email_lib.php
Normal file
49
application/libraries/Email_lib.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Email_lib
|
||||
{
|
||||
private $CI;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->CI =& get_instance();
|
||||
|
||||
$this->CI->load->library('email');
|
||||
|
||||
$config = array(
|
||||
'mailtype' => 'html',
|
||||
'useragent' => 'OSPOS',
|
||||
'validate' => TRUE,
|
||||
'protocol' => $this->CI->config->item('protocol'),
|
||||
'mailpath' => $this->CI->config->item('mailpath'),
|
||||
'smtp_host' => $this->CI->config->item('smtp_host'),
|
||||
'smtp_user' => $this->CI->config->item('smtp_user'),
|
||||
'smtp_pass' => $this->CI->config->item('smtp_pass'),
|
||||
'smtp_port' => $this->CI->config->item('smtp_port'),
|
||||
'smtp_timeout' => $this->CI->config->item('smtp_timeout'),
|
||||
'smtp_crypto' => $this->CI->config->item('smtp_crypto')
|
||||
);
|
||||
|
||||
$this->CI->email->initialize($config);
|
||||
}
|
||||
|
||||
/*
|
||||
* Email sending function
|
||||
* Example of use: $response = sendEmail('john@doe.com', 'Hello', 'This is a message', $filename);
|
||||
*/
|
||||
public function sendEmail($to, $subject, $message, $attachment = NULL)
|
||||
{
|
||||
$this->CI->email->from($this->CI->config->item('email'), $this->CI->config->item('company'));
|
||||
$this->CI->email->to($to);
|
||||
$this->CI->email->subject($subject);
|
||||
$this->CI->email->message($message);
|
||||
if( !empty($attachment) )
|
||||
{
|
||||
$this->CI->email->attach($attachment);
|
||||
}
|
||||
|
||||
return $this->CI->email->send();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
141
application/views/configs/email_config.php
Normal file
141
application/views/configs/email_config.php
Normal file
@@ -0,0 +1,141 @@
|
||||
<?php echo form_open('config/save_email/', array('id' => 'email_config_form', 'enctype' => 'multipart/form-data', 'class' => 'form-horizontal')); ?>
|
||||
<div id="config_wrapper">
|
||||
<fieldset id="config_email">
|
||||
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
|
||||
<ul id="email_error_message_box" class="error_message_box"></ul>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_protocol'), 'protocol', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_dropdown('protocol', array(
|
||||
'mail' => 'mail',
|
||||
'sendmail' => 'sendmail',
|
||||
'smtp' => 'smtp'
|
||||
),
|
||||
$this->config->item('protocol'), array('class' => 'form-control input-sm', 'id' => 'protocol'));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_mailpath'), 'mailpath', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-xs-4">
|
||||
<?php echo form_input(array(
|
||||
'name' => 'mailpath',
|
||||
'id' => 'mailpath',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('mailpath'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_smtp_host'), 'smtp_host', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-xs-2">
|
||||
<?php echo form_input(array(
|
||||
'name' => 'smtp_host',
|
||||
'id' => 'smtp_host',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('smtp_host'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_smtp_port'), 'smtp_port', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-xs-2">
|
||||
<?php echo form_input(array(
|
||||
'name' => 'smtp_port',
|
||||
'id' => 'smtp_port',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('smtp_port'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_smtp_crypto'), 'smtp_crypto', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_dropdown('smtp_crypto', array(
|
||||
'' => 'None',
|
||||
'tls' => 'TLS',
|
||||
'ssl' => 'SSL'
|
||||
),
|
||||
$this->config->item('smtp_crypto'), array('class' => 'form-control input-sm', 'id' => 'smtp_crypto'));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_smtp_timeout'), 'smtp_timeout', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-xs-2">
|
||||
<?php echo form_input(array(
|
||||
'name' => 'smtp_timeout',
|
||||
'id' => 'smtp_timeout',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('smtp_timeout'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_smtp_user'), 'smtp_user', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon input-sm"><span class="glyphicon glyphicon-user"></span></span>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'smtp_user',
|
||||
'id' => 'smtp_user',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('smtp_user'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_email_smtp_pass'), 'smtp_pass', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon input-sm"><span class="glyphicon glyphicon-asterisk"></span></span>
|
||||
<?php echo form_password(array(
|
||||
'name' => 'smtp_pass',
|
||||
'id' => 'smtp_pass',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('smtp_pass'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php echo form_submit(array(
|
||||
'name' => 'submit_form',
|
||||
'id' => 'submit_form',
|
||||
'value' => $this->lang->line('common_submit'),
|
||||
'class' => 'btn btn-primary btn-sm pull-right')); ?>
|
||||
</fieldset>
|
||||
</div>
|
||||
<?php echo form_close(); ?>
|
||||
|
||||
<script type='text/javascript'>
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#email_config_form').validate($.extend(form_support.handler, {
|
||||
errorLabelContainer: "#email_error_message_box"
|
||||
}));
|
||||
|
||||
var check_protocol = function() {
|
||||
if($("#protocol").val() == 'sendmail')
|
||||
{
|
||||
$("#mailpath").prop('disabled', false);
|
||||
$("#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', true);
|
||||
}
|
||||
else if($("#protocol").val() == 'smtp')
|
||||
{
|
||||
$("#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', false);
|
||||
$("#mailpath").prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#mailpath, #smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', true);
|
||||
}
|
||||
};
|
||||
|
||||
$("#protocol").change(check_protocol).ready(check_protocol);
|
||||
});
|
||||
</script>
|
||||
@@ -105,7 +105,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm no-gutter">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_country_codes'), 'country_codes', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-1'>
|
||||
<?php echo form_input('country_codes', $this->config->item('country_codes'), array('class'=>'form-control input-sm')); ?>
|
||||
|
||||
@@ -2,54 +2,60 @@
|
||||
|
||||
<ul class="nav nav-tabs" data-tabs="tabs">
|
||||
<li class="active" role="presentation">
|
||||
<a data-toggle="tab" href="#info" title="<?php echo $this->lang->line('config_info_configuration'); ?>"><?php echo $this->lang->line('config_info'); ?></a>
|
||||
<a data-toggle="tab" href="#info_tab" title="<?php echo $this->lang->line('config_info_configuration'); ?>"><?php echo $this->lang->line('config_info'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#general" title="<?php echo $this->lang->line('config_general_configuration'); ?>"><?php echo $this->lang->line('config_general'); ?></a>
|
||||
<a data-toggle="tab" href="#general_tab" title="<?php echo $this->lang->line('config_general_configuration'); ?>"><?php echo $this->lang->line('config_general'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#locale" title="<?php echo $this->lang->line('config_locale_configuration'); ?>"><?php echo $this->lang->line('config_locale'); ?></a>
|
||||
<a data-toggle="tab" href="#locale_tab" title="<?php echo $this->lang->line('config_locale_configuration'); ?>"><?php echo $this->lang->line('config_locale'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#barcode" title="<?php echo $this->lang->line('config_barcode_configuration'); ?>"><?php echo $this->lang->line('config_barcode'); ?></a>
|
||||
<a data-toggle="tab" href="#barcode_tab" title="<?php echo $this->lang->line('config_barcode_configuration'); ?>"><?php echo $this->lang->line('config_barcode'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#stock" title="<?php echo $this->lang->line('config_location_configuration'); ?>"><?php echo $this->lang->line('config_location'); ?></a>
|
||||
<a data-toggle="tab" href="#stock_tab" title="<?php echo $this->lang->line('config_location_configuration'); ?>"><?php echo $this->lang->line('config_location'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#receipt" title="<?php echo $this->lang->line('config_receipt_configuration'); ?>"><?php echo $this->lang->line('config_receipt'); ?></a>
|
||||
<a data-toggle="tab" href="#receipt_tab" title="<?php echo $this->lang->line('config_receipt_configuration'); ?>"><?php echo $this->lang->line('config_receipt'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#invoice" title="<?php echo $this->lang->line('config_invoice_configuration'); ?>"><?php echo $this->lang->line('config_invoice'); ?></a>
|
||||
<a data-toggle="tab" href="#invoice_tab" title="<?php echo $this->lang->line('config_invoice_configuration'); ?>"><?php echo $this->lang->line('config_invoice'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#message" title="<?php echo $this->lang->line('config_message_configuration'); ?>"><?php echo $this->lang->line('config_message'); ?></a>
|
||||
<a data-toggle="tab" href="#email_tab" title="<?php echo $this->lang->line('config_email_configuration'); ?>"><?php echo $this->lang->line('config_email'); ?></a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a data-toggle="tab" href="#message_tab" title="<?php echo $this->lang->line('config_message_configuration'); ?>"><?php echo $this->lang->line('config_message'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="info">
|
||||
<div class="tab-pane fade in active" id="info_tab">
|
||||
<?php $this->load->view("configs/info_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="general">
|
||||
<div class="tab-pane" id="general_tab">
|
||||
<?php $this->load->view("configs/general_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="locale">
|
||||
<div class="tab-pane" id="locale_tab">
|
||||
<?php $this->load->view("configs/locale_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="barcode">
|
||||
<div class="tab-pane" id="barcode_tab">
|
||||
<?php $this->load->view("configs/barcode_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="stock">
|
||||
<div class="tab-pane" id="stock_tab">
|
||||
<?php $this->load->view("configs/stock_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="receipt">
|
||||
<div class="tab-pane" id="receipt_tab">
|
||||
<?php $this->load->view("configs/receipt_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="invoice">
|
||||
<div class="tab-pane" id="invoice_tab">
|
||||
<?php $this->load->view("configs/invoice_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="message">
|
||||
<div class="tab-pane" id="email_tab">
|
||||
<?php $this->load->view("configs/email_config"); ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="message_tab">
|
||||
<?php $this->load->view("configs/message_config"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="config_wrapper">
|
||||
<fieldset id="config_message">
|
||||
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
|
||||
<ul id="general_error_message_box" class="error_message_box"></ul>
|
||||
<ul id="message_error_message_box" class="error_message_box"></ul>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_msg_uid'), 'msg_uid', array('class'=>'control-label col-xs-2 required')); ?>
|
||||
@@ -73,7 +73,7 @@ $(document).ready(function()
|
||||
{
|
||||
$('#message_config_form').validate($.extend(form_support.handler, {
|
||||
|
||||
errorLabelContainer: "#general_error_message_box",
|
||||
errorLabelContainer: "#message_error_message_box",
|
||||
|
||||
rules:
|
||||
{
|
||||
|
||||
@@ -46,7 +46,12 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('country_codes', 'us'),
|
||||
('notify_horizontal_position', 'right'),
|
||||
('notify_vertical_position', 'top'),
|
||||
('payment_options_order', 'cashdebitcredit');
|
||||
('payment_options_order', 'cashdebitcredit'),
|
||||
('protocol', 'mail'),
|
||||
('mailpath', '/usr/sbin/sendmail'),
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl');
|
||||
|
||||
DELETE FROM `ospos_app_config` WHERE `key` = 'use_invoice_template';
|
||||
|
||||
|
||||
@@ -71,7 +71,12 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('msg_pwd', ''),
|
||||
('notify_horizontal_position', 'right'),
|
||||
('notify_vertical_position', 'top'),
|
||||
('payment_options_order', 'cashdebitcredit');
|
||||
('payment_options_order', 'cashdebitcredit'),
|
||||
('protocol', 'mail'),
|
||||
('mailpath', '/usr/sbin/sendmail'),
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -71,7 +71,12 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('msg_pwd', ''),
|
||||
('notify_horizontal_position', 'right'),
|
||||
('notify_vertical_position', 'top'),
|
||||
('payment_options_order', 'cashdebitcredit');
|
||||
('payment_options_order', 'cashdebitcredit'),
|
||||
('protocol', 'mail'),
|
||||
('mailpath', '/usr/sbin/sendmail'),
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -71,7 +71,12 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('msg_pwd', ''),
|
||||
('notify_horizontal_position', 'right'),
|
||||
('notify_vertical_position', 'top'),
|
||||
('payment_options_order', 'cashdebitcredit');
|
||||
('payment_options_order', 'cashdebitcredit'),
|
||||
('protocol', 'mail'),
|
||||
('mailpath', '/usr/sbin/sendmail'),
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -69,6 +69,15 @@ config_default_tax_rate_2,Adó 2,MWSt 2,VAT 2 %,Impuesto 2,Tax 2 Rate,Taux d'Imp
|
||||
config_default_tax_rate_number,Az alapértelmezett adónak számnak kell lennie,MWSt Rate,Het percentage VAT moet een nummer zijn,El Impuesto Predeterminado debe ser un número,The default tax rate must be a number,Le taux d'imposition doit etre un nombre,預設稅率必需為數字,Обычный ставка налога должен быть цифра,อัตราภาษีเริ่มต้นต้องเป็นตัวเลข,Varsayılan Vergi Oranı sayı olmalıdır,Tarif Pajak Biasa harus angka,A taxa de Imposto padrão deve ser um número,Zadani porez mora biti broj
|
||||
config_default_tax_rate_required,Az alapértelmezett adó kötelező mező,MWSt ist erforderlich,Het percentage VAT moet ingevuld worden,El Impuesto Predeterminado es requerido,The default tax rate is a required field,Le taux d'imposition par défaut est requis,預設稅率為必填,Обычный ставка налога обязательный пробел,อัตราภาษีเริ่มต้นต้องกรอก,Varsayılan Vergi Oranı zorunlu alandır,Tarif Pajak Biasa wajib diisi,A taxa de Imposto padrão é um campo obrigatório,Zadani porez je potreban
|
||||
config_default_tax_name_required,Alapértelmezett adó név kötelező mező,The default tax name is a required field,De naam van de VAT moet ingevuld worden,El nombre del impuesto predeterminado es requerido,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,Nome da taxa padrão é requerida,Naziv poreza je poteban
|
||||
config_email,Email,Email,Email,Email,Email,Email,Email,Email,Email,Email,Email,Email,Email
|
||||
config_email_protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol,Protocol
|
||||
config_email_mailpath,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail,Path to Sendmail
|
||||
config_email_smtp_host,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server,SMTP Server
|
||||
config_email_smtp_port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port,SMTP Port
|
||||
config_email_smtp_crypto,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption,SMTP Encryption
|
||||
config_email_smtp_timeout,SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s),SMTP Timeout (s)
|
||||
config_email_smtp_user,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username,SMTP Username
|
||||
config_email_smtp_pass,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password,SMTP Password
|
||||
config_fax,Fax,Fax,Fax,Fax,Fax,Fax,傳真,Факс,แฟ็กซ์,Faks,Fax,Fax,Fax
|
||||
config_general,Általános,Einstellungen,Algemene,General,General,General,General,General,ตั้งค่าทั่วไป,General,General,Gerais,Opća
|
||||
config_general_configuration,Általános beállitás,Einstellungen,Algemene Instellingen,Configuración General,General Configuration,General Configuration,General Configuration,General Configuration,ตั้งค่าทั่วไป,General Configuration,General Configuration,Configurações Gerais,Opća konfiguracija
|
||||
|
||||
|
Reference in New Issue
Block a user