mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-16 12:57:32 -04:00
Add configuration options for notification alignment (#478)
Fix country code edit bug (#497) Review xss filtering in load_config hook (#39)
This commit is contained in:
@@ -64,6 +64,8 @@ class Config extends Secure_area
|
||||
'receiving_calculate_average_price'=>$this->input->post('receiving_calculate_average_price') != null,
|
||||
'lines_per_page'=>$this->input->post('lines_per_page'),
|
||||
'default_sales_discount'=>$this->input->post('default_sales_discount'),
|
||||
'config_notify_horizontal_position'=>$this->input->post('config_notify_horizontal_position'),
|
||||
'config_notify_vertical_position'=>$this->input->post('config_notify_vertical_position'),
|
||||
'custom1_name'=>$this->input->post('custom1_name'),
|
||||
'custom2_name'=>$this->input->post('custom2_name'),
|
||||
'custom3_name'=>$this->input->post('custom3_name'),
|
||||
|
||||
@@ -10,7 +10,7 @@ function load_config()
|
||||
}
|
||||
|
||||
//Set language from config database
|
||||
$language = $CI->security->xss_clean($CI->config->item('language'));
|
||||
$language = $CI->config->item('language');
|
||||
|
||||
//Loads all the language files from the language directory
|
||||
if(!empty($language))
|
||||
@@ -36,7 +36,7 @@ function load_config()
|
||||
//Set timezone from config database
|
||||
if($CI->config->item('timezone'))
|
||||
{
|
||||
date_default_timezone_set($CI->security->xss_clean($CI->config->item('timezone')));
|
||||
date_default_timezone_set($CI->config->item('timezone'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Website";
|
||||
$lang["config_datetimeformat"] = "Datum und Zeit";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Website";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Sitio Web";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Site-web";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "web strana";
|
||||
$lang["config_datetimeformat"] = "Oblik datuma i vremena";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Weboldal";
|
||||
$lang["config_datetimeformat"] = "Dátum és idő formátum";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Situs Perusahaan";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Website";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Site da internet";
|
||||
$lang["config_datetimeformat"] = "Formato da data e hora";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Веб-сайт";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "เว็บไซต์";
|
||||
$lang["config_datetimeformat"] = "รูปแบบวันเวลา";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "Website";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -150,3 +150,4 @@ $lang["config_website"] = "網站";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
$lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_notify_alignment"] = "Notification Popup Position";
|
||||
|
||||
@@ -95,6 +95,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_notify_alignment'), 'config_notify_horizontal_position', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-group form-group-sm row">
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('config_notify_vertical_position', array(
|
||||
'top' => 'Top',
|
||||
'bottom' => 'Bottom'
|
||||
),
|
||||
$this->config->item('config_notify_vertical_position'), array('class'=>'form-control input-sm')); ?>
|
||||
</div>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('config_notify_horizontal_position', array(
|
||||
'left' => 'Left',
|
||||
'center' => 'Center',
|
||||
'right' => 'Right'
|
||||
),
|
||||
$this->config->item('config_notify_horizontal_position'), array('class'=>'form-control input-sm')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom1'), 'config_custom1', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
@@ -227,6 +250,7 @@
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$("#backup_db").click(function() {
|
||||
window.location='<?php echo site_url('config/backup_db') ?>';
|
||||
});
|
||||
|
||||
@@ -92,12 +92,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm no-gutter">
|
||||
<?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')); ?>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<div class="checkbox col-xs-1">
|
||||
<a href="http://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes" target="_blank"><span class="glyphicon glyphicon-info-sign" data-toggle="tootltip" data-placement="right" title="<?php echo $this->lang->line('config_country_codes_tooltip'); ?>"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
<!-- start mincss template tags -->
|
||||
<link rel="stylesheet" type="text/css" href="dist/bootstrap.min.css?rel=9ed20b1ee8"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/jquery-ui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=c7aa3101ab"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=baddd589ff"/>
|
||||
<!-- end mincss template tags -->
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=4c4f6f548e" language="javascript"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=104339e3c2" language="javascript"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -90,6 +90,12 @@
|
||||
|
||||
document.getElementById('liveclock').innerHTML = phpjsDate("<?php echo $this->config->item('dateformat').' '.$this->config->item('timeformat') ?>", now);
|
||||
}
|
||||
|
||||
$.notifyDefaults({ placement: {
|
||||
align: '<?php echo $this->config->item('config_notify_horizontal_position'); ?>',
|
||||
from: '<?php echo $this->config->item('config_notify_vertical_position'); ?>'
|
||||
}});
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
@@ -360,13 +360,13 @@ if (isset($success))
|
||||
<tr>
|
||||
<td><?php echo $this->lang->line('sales_payment');?></td>
|
||||
<td>
|
||||
<?php echo form_dropdown('payment_type', $payment_options, array(), array('id'=>'payment_types', 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'auto', 'disabled'=>'')); ?>
|
||||
<?php echo form_dropdown('payment_type', $payment_options, array(), array('id'=>'payment_types', 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'auto', 'disabled'=>'disabled')); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span id="amount_tendered_label"><?php echo $this->lang->line('sales_amount_tendered'); ?></span></td>
|
||||
<td>
|
||||
<?php echo form_input(array('name'=>'amount_tendered', 'id'=>'amount_tendered', 'class'=>'form-control input-sm disabled', 'disabled'=>'', 'value'=>to_currency_no_money($amount_due), 'size'=>'5', 'tabindex'=>$tabindex)); ?>
|
||||
<?php echo form_input(array('name'=>'amount_tendered', 'id'=>'amount_tendered', 'class'=>'form-control input-sm disabled', 'disabled'=>'disabled', 'value'=>to_currency_no_money($amount_due), 'size'=>'5', 'tabindex'=>$tabindex)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -172,3 +172,7 @@ label.required
|
||||
position: relative;
|
||||
top: 100px;
|
||||
}
|
||||
|
||||
.no-gutter [class*="-1"] {
|
||||
padding-right:0;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('receipt_show_description', '1'),
|
||||
('receipt_show_serialnumber', '1'),
|
||||
('invoice_enable', '1'),
|
||||
('country_codes', 'us');
|
||||
('country_codes', 'us'),
|
||||
('notify_horziontal_position', 'right'),
|
||||
('notify_vertical_position', 'top');
|
||||
|
||||
UPDATE `ospos_modules` SET `sort` = 110 WHERE `name_lang_key` = 'module_config';
|
||||
|
||||
|
||||
2
dist/opensourcepos.min.css
vendored
2
dist/opensourcepos.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/opensourcepos.min.js
vendored
2
dist/opensourcepos.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -69,11 +69,11 @@
|
||||
<link rel="stylesheet" type="text/css" href="templates/spacelab/css/bootstrap.min.css?rel=9ed20b1ee8"/>
|
||||
<!-- start mincss template tags -->
|
||||
<link rel="stylesheet" type="text/css" href="dist/jquery-ui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=c7aa3101ab"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=baddd589ff"/>
|
||||
<!-- end mincss template tags -->
|
||||
<link rel="stylesheet" type="text/css" href="templates/spacelab/css/style.css"/>
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=4c4f6f548e" language="javascript"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=104339e3c2" language="javascript"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
@@ -148,4 +148,5 @@ config_use_invoice_template,Számla sablon használata,Verwende Rechnungsvorlage
|
||||
config_website,Weboldal,Website,Website,Sitio Web,Website,Site-web,網站,Веб-сайт,เว็บไซต์,Website,Situs Perusahaan,Site da internet,web strana
|
||||
config_datetimeformat,Dátum és idő formátum,Datum und Zeit,Date and Time format,Date and Time format,Date and Time format,Date and Time format,Date and Time format,Date and Time format,รูปแบบวันเวลา,Date and Time format,Date and Time format,Formato da data e hora,Oblik datuma i vremena
|
||||
config_country_codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes,Country Codes
|
||||
config_country_codes_tooltip,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.
|
||||
config_country_codes_tooltip,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.,Comma separated list of country codes for nominatim address lookup.
|
||||
config_notify_alignment,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position,Notification Popup Position
|
||||
|
Reference in New Issue
Block a user