mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-14 21:17:23 -04:00
Merge pull request #1438 from jekkos/feature/barcode_format
Add function to parse barcode fields (#1243)
This commit is contained in:
@@ -788,7 +788,8 @@ class Config extends Secure_Controller
|
||||
'barcode_page_width' => $this->input->post('barcode_page_width'),
|
||||
'barcode_page_cellspacing' => $this->input->post('barcode_page_cellspacing'),
|
||||
'barcode_generate_if_empty' => $this->input->post('barcode_generate_if_empty') != NULL,
|
||||
'barcode_content' => $this->input->post('barcode_content')
|
||||
'barcode_content' => $this->input->post('barcode_content'),
|
||||
'barcode_formats' => json_encode($this->input->post('barcode_formats'))
|
||||
);
|
||||
|
||||
$result = $this->Appconfig->batch_save($batch_save_data);
|
||||
|
||||
@@ -90,7 +90,8 @@ class Receivings extends Secure_Controller
|
||||
|
||||
$mode = $this->receiving_lib->get_mode();
|
||||
$item_id_or_number_or_item_kit_or_receipt = $this->input->post('item');
|
||||
$quantity = ($mode == 'receive' || $mode == 'requisition') ? 1 : -1;
|
||||
$this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt);
|
||||
$quantity = ($mode == 'receive' || $mode == 'requisition') ? $quantity : -$quantity;
|
||||
$item_location = $this->receiving_lib->get_stock_source();
|
||||
|
||||
if($mode == 'return' && $this->Receiving->is_valid_receipt($item_id_or_number_or_item_kit_or_receipt))
|
||||
|
||||
@@ -324,10 +324,11 @@ class Sales extends Secure_Controller
|
||||
$discount = $this->config->item('default_sales_discount');
|
||||
}
|
||||
|
||||
$mode = $this->sale_lib->get_mode();
|
||||
$quantity = ($mode == 'return') ? -1 : 1;
|
||||
$item_location = $this->sale_lib->get_sale_location();
|
||||
$item_id_or_number_or_item_kit_or_receipt = $this->input->post('item');
|
||||
$this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt);
|
||||
$mode = $this->sale_lib->get_mode();
|
||||
$quantity = ($mode == 'return') ? -$quantity : $quantity;
|
||||
$item_location = $this->sale_lib->get_sale_location();
|
||||
|
||||
if($mode == 'return' && $this->Sale->is_valid_receipt($item_id_or_number_or_item_kit_or_receipt))
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ $lang["config_barcode_configuration"] = "Barcode Configuration";
|
||||
$lang["config_barcode_content"] = "Barcode Content";
|
||||
$lang["config_barcode_first_row"] = "Row 1";
|
||||
$lang["config_barcode_font"] = "Font";
|
||||
$lang["config_barcode_formats"] = "Input Formats";
|
||||
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
|
||||
$lang["config_barcode_height"] = "Height (px)";
|
||||
$lang["config_barcode_id"] = "Item Id/Name";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use emberlabs\Barcode\BarcodeBase;
|
||||
@@ -45,10 +46,37 @@ class Barcode_lib
|
||||
$data['barcode_page_width'] = $this->CI->config->item('barcode_page_width');
|
||||
$data['barcode_page_cellspacing'] = $this->CI->config->item('barcode_page_cellspacing');
|
||||
$data['barcode_generate_if_empty'] = $this->CI->config->item('barcode_generate_if_empty');
|
||||
$data['barcode_formats'] = $this->CI->config->item('barcode_formats');
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function parse_barcode_fields(&$quantity, &$item_id_or_number_or_item_kit_or_receipt)
|
||||
{
|
||||
$barcode_formats = json_decode($this->CI->config->item('barcode_formats'));
|
||||
|
||||
if(!empty($barcode_formats))
|
||||
{
|
||||
foreach($barcode_formats as $barcode_format)
|
||||
{
|
||||
if(preg_match("/$barcode_format/", $item_id_or_number_or_item_kit_or_receipt, $matches) && sizeof($matches) > 1)
|
||||
{
|
||||
$qtyfirst = strpos('d', $barcode_format) - strpos('w', $barcode_format) < 0;
|
||||
$quantity = $matches[$qtyfirst ? 1 : 2];
|
||||
if(strstr($barcode_format, '02'))
|
||||
{
|
||||
$quantity = $quantity / 1000;
|
||||
}
|
||||
$item_id_or_number_or_item_kit_or_receipt = $matches[$qtyfirst ? 2 : 1];
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$quantity = 1;
|
||||
}
|
||||
|
||||
public function validate_barcode($barcode)
|
||||
{
|
||||
$barcode_type = $this->CI->config->item('barcode_type');
|
||||
|
||||
0
application/tests/libraries/Barcode_lib_test.php
Normal file
0
application/tests/libraries/Barcode_lib_test.php
Normal file
@@ -1,19 +1,19 @@
|
||||
<?php echo form_open('config/save_barcode/', array('id' => 'barcode_config_form', 'class' => 'form-horizontal')); ?>
|
||||
<div id="config_wrapper">
|
||||
<fieldset id="config_info">
|
||||
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
|
||||
<ul id="barcode_error_message_box" class="error_message_box"></ul>
|
||||
<div id="config_wrapper">
|
||||
<fieldset id="config_info">
|
||||
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
|
||||
<ul id="barcode_error_message_box" class="error_message_box"></ul>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_type'), 'barcode_type', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_dropdown('barcode_type', $support_barcode, $this->config->item('barcode_type'), array('class' => 'form-control input-sm')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_quality'), 'barcode_quality', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'max' => '100',
|
||||
'min' => '10',
|
||||
@@ -22,12 +22,12 @@
|
||||
'id' => 'barcode_quality',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_quality'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_width'), 'barcode_width', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'step' => '5',
|
||||
'max' => '350',
|
||||
@@ -37,12 +37,12 @@
|
||||
'id' => 'barcode_width',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_width'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_height'), 'barcode_height', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'type' => 'number',
|
||||
'min' => 10,
|
||||
@@ -51,236 +51,250 @@
|
||||
'id' => 'barcode_height',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_height'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_font'), 'barcode_font', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_font',
|
||||
$this->barcode_lib->listfonts("fonts"),
|
||||
$this->config->item('barcode_font'), array('class' => 'form-control input-sm required'));
|
||||
?>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<?php echo form_input(array(
|
||||
'type' => 'number',
|
||||
'min' => '1',
|
||||
'max' => '30',
|
||||
'name' => 'barcode_font_size',
|
||||
'id' => 'barcode_font_size',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_font_size'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_content'), 'barcode_content', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name' => 'barcode_content',
|
||||
'value' => 'id',
|
||||
'checked'=>$this->config->item('barcode_content') === "id")); ?>
|
||||
<?php echo $this->lang->line('config_barcode_id'); ?>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name' => 'barcode_content',
|
||||
'value' => 'number',
|
||||
'checked'=>$this->config->item('barcode_content') === "number")); ?>
|
||||
<?php echo $this->lang->line('config_barcode_number'); ?>
|
||||
</label>
|
||||
 
|
||||
 
|
||||
<label class="checkbox-inline">
|
||||
<?php echo form_checkbox(array(
|
||||
'name' => 'barcode_generate_if_empty',
|
||||
'value' => 'barcode_generate_if_empty',
|
||||
'checked'=>$this->config->item('barcode_generate_if_empty'))); ?>
|
||||
<?php echo $this->lang->line('config_barcode_generate_if_empty'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_font'), 'barcode_font', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_font',
|
||||
$this->barcode_lib->listfonts("fonts"),
|
||||
$this->config->item('barcode_font'), array('class' => 'form-control input-sm required'));
|
||||
?>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<?php echo form_input(array(
|
||||
'type' => 'number',
|
||||
'min' => '1',
|
||||
'max' => '30',
|
||||
'name' => 'barcode_font_size',
|
||||
'id' => 'barcode_font_size',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_font_size'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_content'), 'barcode_content', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name' => 'barcode_content',
|
||||
'value' => 'id',
|
||||
'checked'=>$this->config->item('barcode_content') === "id")); ?>
|
||||
<?php echo $this->lang->line('config_barcode_id'); ?>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name' => 'barcode_content',
|
||||
'value' => 'number',
|
||||
'checked'=>$this->config->item('barcode_content') === "number")); ?>
|
||||
<?php echo $this->lang->line('config_barcode_number'); ?>
|
||||
</label>
|
||||
 
|
||||
 
|
||||
<label class="checkbox-inline">
|
||||
<?php echo form_checkbox(array(
|
||||
'name' => 'barcode_generate_if_empty',
|
||||
'value' => 'barcode_generate_if_empty',
|
||||
'checked'=>$this->config->item('barcode_generate_if_empty'))); ?>
|
||||
<?php echo $this->lang->line('config_barcode_generate_if_empty'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_formats'), 'barcode_formats', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-4'>
|
||||
<?php
|
||||
$barcode_formats = json_decode($this->config->item('barcode_formats'));
|
||||
echo form_dropdown(array(
|
||||
'name' => 'barcode_formats[]',
|
||||
'id' => 'barcode_formats',
|
||||
'options' => !empty($barcode_formats) ? array_combine($barcode_formats, $barcode_formats) : array(),
|
||||
'multiple' => 'multiple',
|
||||
'data-role' => 'tagsinput'));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_layout'), 'barcode_layout', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-group form-group-sm row">
|
||||
<label class="control-label col-sm-1"><?php echo $this->lang->line('config_barcode_first_row').' '; ?></label>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_first_row', array(
|
||||
'not_show' => $this->lang->line('config_none'),
|
||||
'name' => $this->lang->line('items_name'),
|
||||
'category' => $this->lang->line('items_category'),
|
||||
'cost_price' => $this->lang->line('items_cost_price'),
|
||||
'unit_price' => $this->lang->line('items_unit_price'),
|
||||
'company_name' => $this->lang->line('suppliers_company_name')
|
||||
),
|
||||
$this->config->item('barcode_first_row'), array('class' => 'form-control input-sm')); ?>
|
||||
</div>
|
||||
<label class="control-label col-sm-1"><?php echo $this->lang->line('config_barcode_second_row').' '; ?></label>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_second_row', array(
|
||||
'not_show' => $this->lang->line('config_none'),
|
||||
'name' => $this->lang->line('items_name'),
|
||||
'category' => $this->lang->line('items_category'),
|
||||
'cost_price' => $this->lang->line('items_cost_price'),
|
||||
'unit_price' => $this->lang->line('items_unit_price'),
|
||||
'item_code' => $this->lang->line('items_item_number'),
|
||||
'company_name' => $this->lang->line('suppliers_company_name')
|
||||
),
|
||||
$this->config->item('barcode_second_row'), array('class' => 'form-control input-sm')); ?>
|
||||
</div>
|
||||
<label class="control-label col-sm-1"><?php echo $this->lang->line('config_barcode_third_row').' '; ?></label>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_third_row', array(
|
||||
'not_show' => $this->lang->line('config_none'),
|
||||
'name' => $this->lang->line('items_name'),
|
||||
'category' => $this->lang->line('items_category'),
|
||||
'cost_price' => $this->lang->line('items_cost_price'),
|
||||
'unit_price' => $this->lang->line('items_unit_price'),
|
||||
'item_code' => $this->lang->line('items_item_number'),
|
||||
'company_name' => $this->lang->line('suppliers_company_name')
|
||||
),
|
||||
$this->config->item('barcode_third_row'), array('class' => 'form-control input-sm')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-group form-group-sm row">
|
||||
<label class="control-label col-sm-1"><?php echo $this->lang->line('config_barcode_first_row').' '; ?></label>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_first_row', array(
|
||||
'not_show' => $this->lang->line('config_none'),
|
||||
'name' => $this->lang->line('items_name'),
|
||||
'category' => $this->lang->line('items_category'),
|
||||
'cost_price' => $this->lang->line('items_cost_price'),
|
||||
'unit_price' => $this->lang->line('items_unit_price'),
|
||||
'company_name' => $this->lang->line('suppliers_company_name')
|
||||
),
|
||||
$this->config->item('barcode_first_row'), array('class' => 'form-control input-sm')); ?>
|
||||
</div>
|
||||
<label class="control-label col-sm-1"><?php echo $this->lang->line('config_barcode_second_row').' '; ?></label>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_second_row', array(
|
||||
'not_show' => $this->lang->line('config_none'),
|
||||
'name' => $this->lang->line('items_name'),
|
||||
'category' => $this->lang->line('items_category'),
|
||||
'cost_price' => $this->lang->line('items_cost_price'),
|
||||
'unit_price' => $this->lang->line('items_unit_price'),
|
||||
'item_code' => $this->lang->line('items_item_number'),
|
||||
'company_name' => $this->lang->line('suppliers_company_name')
|
||||
),
|
||||
$this->config->item('barcode_second_row'), array('class' => 'form-control input-sm')); ?>
|
||||
</div>
|
||||
<label class="control-label col-sm-1"><?php echo $this->lang->line('config_barcode_third_row').' '; ?></label>
|
||||
<div class='col-sm-2'>
|
||||
<?php echo form_dropdown('barcode_third_row', array(
|
||||
'not_show' => $this->lang->line('config_none'),
|
||||
'name' => $this->lang->line('items_name'),
|
||||
'category' => $this->lang->line('items_category'),
|
||||
'cost_price' => $this->lang->line('items_cost_price'),
|
||||
'unit_price' => $this->lang->line('items_unit_price'),
|
||||
'item_code' => $this->lang->line('items_item_number'),
|
||||
'company_name' => $this->lang->line('suppliers_company_name')
|
||||
),
|
||||
$this->config->item('barcode_third_row'), 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_barcode_number_in_row'), 'barcode_num_in_row', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'barcode_num_in_row',
|
||||
'id' => 'barcode_num_in_row',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_num_in_row'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_page_width'), 'barcode_page_width', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class="col-sm-2">
|
||||
<div class='input-group'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'barcode_page_width',
|
||||
'id' => 'barcode_page_width',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_page_width'))); ?>
|
||||
<span class="input-group-addon input-sm">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_page_cellspacing'), 'barcode_page_cellspacing', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-sm-2'>
|
||||
<div class="input-group">
|
||||
<?php echo form_input(array(
|
||||
'name' => 'barcode_page_cellspacing',
|
||||
'id' => 'barcode_page_cellspacing',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_page_cellspacing'))); ?>
|
||||
<span class="input-group-addon input-sm">px</span>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_page_width'), 'barcode_page_width', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class="col-sm-2">
|
||||
<div class='input-group'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'barcode_page_width',
|
||||
'id' => 'barcode_page_width',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_page_width'))); ?>
|
||||
<span class="input-group-addon input-sm">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_barcode_page_cellspacing'), 'barcode_page_cellspacing', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-sm-2'>
|
||||
<div class="input-group">
|
||||
<?php echo form_input(array(
|
||||
'name' => 'barcode_page_cellspacing',
|
||||
'id' => 'barcode_page_cellspacing',
|
||||
'class' => 'form-control input-sm required',
|
||||
'value'=>$this->config->item('barcode_page_cellspacing'))); ?>
|
||||
<span class="input-group-addon input-sm">px</span>
|
||||
</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()
|
||||
{
|
||||
$('#barcode_config_form').validate($.extend(form_support.handler, {
|
||||
$('#barcode_config_form').validate($.extend(form_support.handler, {
|
||||
|
||||
errorLabelContainer: "#barcode_error_message_box",
|
||||
errorLabelContainer: "#barcode_error_message_box",
|
||||
|
||||
rules:
|
||||
{
|
||||
barcode_width:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_height:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_quality:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_font_size:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_num_in_row:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_page_width:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_page_cellspacing:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
}
|
||||
},
|
||||
rules:
|
||||
{
|
||||
barcode_width:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_height:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_quality:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_font_size:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_num_in_row:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_page_width:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
barcode_page_cellspacing:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
}
|
||||
},
|
||||
|
||||
messages:
|
||||
{
|
||||
barcode_width:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_width_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_width_number'); ?>"
|
||||
},
|
||||
barcode_height:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_height_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_height_number'); ?>"
|
||||
},
|
||||
barcode_quality:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_quality_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_quality_number'); ?>"
|
||||
},
|
||||
barcode_font_size:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_font_size_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_font_size_number'); ?>"
|
||||
},
|
||||
barcode_num_in_row:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_num_in_row_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_num_in_row_number'); ?>"
|
||||
},
|
||||
barcode_page_width:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_page_width_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_page_width_number'); ?>"
|
||||
},
|
||||
barcode_page_cellspacing:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_page_cellspacing_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_page_cellspacing_number'); ?>"
|
||||
}
|
||||
}
|
||||
}));
|
||||
messages:
|
||||
{
|
||||
barcode_width:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_width_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_width_number'); ?>"
|
||||
},
|
||||
barcode_height:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_height_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_height_number'); ?>"
|
||||
},
|
||||
barcode_quality:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_quality_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_quality_number'); ?>"
|
||||
},
|
||||
barcode_font_size:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_font_size_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_font_size_number'); ?>"
|
||||
},
|
||||
barcode_num_in_row:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_num_in_row_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_num_in_row_number'); ?>"
|
||||
},
|
||||
barcode_page_width:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_page_width_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_page_width_number'); ?>"
|
||||
},
|
||||
barcode_page_cellspacing:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('config_default_barcode_page_cellspacing_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('config_default_barcode_page_cellspacing_number'); ?>"
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -85,10 +85,11 @@
|
||||
'value' => 'gcaptcha_enable',
|
||||
'checked' => $this->config->item('gcaptcha_enable'))); ?>
|
||||
 
|
||||
 
|
||||
<a href="https://www.google.com/recaptcha/admin" target="_blank">
|
||||
<span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_gcaptcha_tooltip'); ?>"></span>
|
||||
</a>
|
||||
<label class="control-label">
|
||||
<a href="https://www.google.com/recaptcha/admin" target="_blank">
|
||||
<span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_gcaptcha_tooltip'); ?>"></span>
|
||||
</a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -143,8 +144,9 @@
|
||||
'value' => 'statistics',
|
||||
'checked' => $this->config->item('statistics'))); ?>
|
||||
 
|
||||
 
|
||||
<span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_statistics_tooltip'); ?>"></span>
|
||||
<label class="control-label">
|
||||
<span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_statistics_tooltip'); ?>"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -98,8 +98,10 @@
|
||||
$this->config->item('cash_decimals'), array('class' => 'form-control input-sm'));
|
||||
?>
|
||||
</div>
|
||||
<div class="checkbox col-xs-1">
|
||||
<span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_cash_decimals_tooltip'); ?>"></span>
|
||||
<div class='col-xs-1'>
|
||||
<label class="control-label">
|
||||
<span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_cash_decimals_tooltip'); ?>"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -129,8 +131,10 @@
|
||||
<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 col-xs-1">
|
||||
<a href="http://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes" target="_blank"><span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_country_codes_tooltip'); ?>"></span></a>
|
||||
<div class="col-xs-1">
|
||||
<label class="control-label">
|
||||
<a href="http://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes" target="_blank"><span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_country_codes_tooltip'); ?>"></span></a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
|
||||
<ul id="mailchimp_error_message_box" class="error_message_box"></ul>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_mailchimp_api_key'), 'mailchimp_api_key', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
@@ -16,8 +16,10 @@
|
||||
'value' => $mailchimp['api_key'])); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkbox col-xs-1">
|
||||
<a href="http://eepurl.com/b9a05b" target="_blank"><span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_mailchimp_tooltip'); ?>"></span></a>
|
||||
<div class="col-xs-1">
|
||||
<label class="control-label">
|
||||
<a href="http://eepurl.com/b9a05b" target="_blank"><span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="right" title="<?php echo $this->lang->line('config_mailchimp_tooltip'); ?>"></span></a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +28,7 @@
|
||||
<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_dropdown('mailchimp_list_id',
|
||||
<?php echo form_dropdown('mailchimp_list_id',
|
||||
$mailchimp['lists'],
|
||||
$mailchimp['list_id'],
|
||||
array('id' => 'mailchimp_list_id', 'class' => 'form-control input-sm')); ?>
|
||||
@@ -55,7 +57,7 @@ $(document).ready(function()
|
||||
},
|
||||
{
|
||||
data: $.extend(csrf_form_base(), {
|
||||
'mailchimp_api_key': $('#mailchimp_api_key').val()
|
||||
'mailchimp_api_key': $('#mailchimp_api_key').val()
|
||||
}),
|
||||
success: function(response) {
|
||||
$.notify(response.message, { type: response.success ? 'success' : 'danger'} );
|
||||
@@ -79,7 +81,7 @@ $(document).ready(function()
|
||||
dataType: 'json'
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
errorLabelContainer: '#mailchimp_error_message_box'
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<link rel="stylesheet" href="bower_components/bootstrap-daterangepicker/daterangepicker.css" />
|
||||
<link rel="stylesheet" href="bower_components/chartist/dist/chartist.min.css" />
|
||||
<link rel="stylesheet" href="bower_components/chartist-plugin-tooltip/dist/chartist-plugin-tooltip.css" />
|
||||
<link rel="stylesheet" href="bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css" />
|
||||
<!-- endbower -->
|
||||
<!-- start css template tags -->
|
||||
<link rel="stylesheet" type="text/css" href="css/bootstrap.autocomplete.css"/>
|
||||
@@ -58,6 +59,7 @@
|
||||
<script src="bower_components/remarkable-bootstrap-notify/bootstrap-notify.js"></script>
|
||||
<script src="bower_components/js-cookie/src/js.cookie.js"></script>
|
||||
<script src="bower_components/blockUI/jquery.blockUI.js"></script>
|
||||
<script src="bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js"></script>
|
||||
<!-- endbower -->
|
||||
<!-- start js template tags -->
|
||||
<script type="text/javascript" src="js/imgpreview.full.jquery.js"></script>
|
||||
@@ -70,11 +72,11 @@
|
||||
<![endif]-->
|
||||
<!-- 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=19bc919eca"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=ed0bdc0047"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/style.css"/>
|
||||
<!-- end mincss template tags -->
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=df78eb75fa"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=a705d36dce"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"jquery-form": "~3.46.0",
|
||||
"jquery-validate": "~1.13.1",
|
||||
"jquery": "~1.12.4",
|
||||
"jquery": "~2.1.1",
|
||||
"jquery-ui": "1.11.4",
|
||||
"bootstrap3-dialog": "https://github.com/nakupanda/bootstrap3-dialog.git#master",
|
||||
"jasny-bootstrap": "~3.1.3",
|
||||
@@ -43,7 +43,8 @@
|
||||
"chartist-plugin-barlabels": "https://github.com/mtgibbs/chartist-plugin-barlabels.git#~0.0.5",
|
||||
"remarkable-bootstrap-notify": "~3.1.3",
|
||||
"js-cookie": "^2.1.3",
|
||||
"blockUI": "*"
|
||||
"blockUI": "*",
|
||||
"bootstrap-tagsinput": "^0.8.0"
|
||||
},
|
||||
"overrides": {
|
||||
"jquery-ui": {
|
||||
|
||||
@@ -69,7 +69,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('last_used_invoice_number', '0'),
|
||||
('last_used_quote_number', '0'),
|
||||
('line_sequence', '0'),
|
||||
('dinner_table_enable','');
|
||||
('dinner_table_enable', '');
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_customer_packages`
|
||||
@@ -241,10 +241,10 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
UPDATE ospos_items SET receiving_quantity = 1 WHERE receiving_quantity = 0;
|
||||
|
||||
-- long alternate description
|
||||
|
||||
|
||||
ALTER TABLE `ospos_sales_items`
|
||||
MODIFY COLUMN `description` varchar(255) DEFAULT NULL;
|
||||
|
||||
|
||||
-- fix tax category maintenance
|
||||
|
||||
DELETE FROM `ospos_tax_categories` where tax_category_id in (0, 1, 2, 3);
|
||||
@@ -303,3 +303,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('gcaptcha_enable', '0'),
|
||||
('gcaptcha_secret_key', ''),
|
||||
('gcaptcha_site_key', '');
|
||||
|
||||
|
||||
-- add Barcode formats
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('barcode_formats', '[]');
|
||||
|
||||
@@ -29,6 +29,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('tax_included', '0'),
|
||||
('barcode_content', 'id'),
|
||||
('barcode_type', 'Code39'),
|
||||
('barcode_formats', '[]'),
|
||||
('barcode_width', '250'),
|
||||
('barcode_height', '50'),
|
||||
('barcode_quality', '100'),
|
||||
|
||||
@@ -29,6 +29,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('tax_included', '0'),
|
||||
('barcode_content', 'id'),
|
||||
('barcode_type', 'Code39'),
|
||||
('barcode_formats', '[]'),
|
||||
('barcode_width', '250'),
|
||||
('barcode_height', '50'),
|
||||
('barcode_quality', '100'),
|
||||
|
||||
@@ -29,6 +29,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('tax_included', '0'),
|
||||
('barcode_content', 'id'),
|
||||
('barcode_type', 'Code39'),
|
||||
('barcode_formats', '[]'),
|
||||
('barcode_width', '250'),
|
||||
('barcode_height', '50'),
|
||||
('barcode_quality', '100'),
|
||||
|
||||
@@ -138,6 +138,14 @@ button.btn.dropdown-toggle.btn-sm
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.bootstrap-tagsinput
|
||||
{
|
||||
background-color: white;
|
||||
color: black;
|
||||
border: 2px solid #dce4ec;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
label.required
|
||||
{
|
||||
color:red;
|
||||
|
||||
8
public/dist/opensourcepos.min.css
vendored
8
public/dist/opensourcepos.min.css
vendored
File diff suppressed because one or more lines are too long
64
public/dist/opensourcepos.min.js
vendored
64
public/dist/opensourcepos.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -265,18 +265,14 @@
|
||||
var rows = $(selector.join(",")).length;
|
||||
if (rows > 0 && rows < 15) {
|
||||
var ids = response.id.split(":");
|
||||
$.get({
|
||||
url: [url || resource + '/get_row', id].join("/"),
|
||||
success: function (response) {
|
||||
$.each(selector, function (index, element) {
|
||||
var id = $(element).data('uniqueid');
|
||||
table().updateByUniqueId({id: id, row: response[id] || response});
|
||||
});
|
||||
dialog_support.init("a.modal-dlg");
|
||||
highlight_row(ids);
|
||||
},
|
||||
dataType: 'json'
|
||||
});
|
||||
$.get([url || resource + '/get_row', id].join("/"), {}, function (response) {
|
||||
$.each(selector, function (index, element) {
|
||||
var id = $(element).data('uniqueid');
|
||||
table().updateByUniqueId({id: id, row: response[id] || response});
|
||||
});
|
||||
dialog_support.init("a.modal-dlg");
|
||||
highlight_row(ids);
|
||||
}, 'json');
|
||||
} else {
|
||||
// call hightlight function once after refresh
|
||||
options.load_callback = function () {
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
],
|
||||
"homepage": "https://github.com/Teleborder/FileSaver.js"
|
||||
},
|
||||
"jquery@1.12.4": {
|
||||
"jquery@2.1.4": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
],
|
||||
@@ -109,6 +109,20 @@
|
||||
"homepage": "https://github.com/wenzhixin/bootstrap-table",
|
||||
"repository": "git+https://github.com/wenzhixin/bootstrap-table"
|
||||
},
|
||||
"bootstrap-tagsinput@0.8.0": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"homepage": "https://github.com/TimSchlechter/bootstrap-tagsinput",
|
||||
"repository": "https://github.com/timschlechter/bootstrap-tagsinput"
|
||||
},
|
||||
"bootstrap@3.3.7": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"homepage": "http://getbootstrap.com",
|
||||
"repository": "git+https://github.com/twbs/bootstrap"
|
||||
},
|
||||
"html2canvas@0.4.1": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
@@ -124,13 +138,6 @@
|
||||
"homepage": "https://github.com/jasny/bootstrap",
|
||||
"repository": "git+https://github.com/jasny/bootstrap"
|
||||
},
|
||||
"bootstrap@3.3.7": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"homepage": "http://getbootstrap.com",
|
||||
"repository": "git+https://github.com/twbs/bootstrap"
|
||||
},
|
||||
"jquery-validation@1.13.1": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
@@ -138,13 +145,6 @@
|
||||
"repository": "https://github.com/jzaefferer/jquery-validation",
|
||||
"homepage": "http://jqueryvalidation.org/"
|
||||
},
|
||||
"jspdf-autotable@2.0.14": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"homepage": "https://github.com/simonbengtsson/jspdf-autotable",
|
||||
"repository": "git+https://github.com/simonbengtsson/jsPDF-AutoTable"
|
||||
},
|
||||
"remarkable-bootstrap-notify@3.1.3": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
@@ -152,6 +152,13 @@
|
||||
"homepage": "http://bootstrap-notify.remabledesigns.com/",
|
||||
"repository": "https://github.com/mouse0270/bootstrap-notify"
|
||||
},
|
||||
"jspdf-autotable@2.0.14": {
|
||||
"licenses": [
|
||||
"MIT"
|
||||
],
|
||||
"homepage": "https://github.com/simonbengtsson/jspdf-autotable",
|
||||
"repository": "git+https://github.com/simonbengtsson/jsPDF-AutoTable"
|
||||
},
|
||||
"smalot-bootstrap-datetimepicker@2.4.4": {
|
||||
"licenses": [
|
||||
"Apache 2.0",
|
||||
|
||||
444
vendor/composer/LICENSE
vendored
444
vendor/composer/LICENSE
vendored
@@ -1,433 +1,21 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: Composer
|
||||
Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be>
|
||||
Source: https://github.com/composer/composer
|
||||
|
||||
Files: *
|
||||
Copyright: 2016, Nils Adermann <naderman@naderman.de>
|
||||
2016, Jordi Boggiano <j.boggiano@seld.be>
|
||||
License: Expat
|
||||
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
|
||||
|
||||
Files: res/cacert.pem
|
||||
Copyright: 2015, Mozilla Foundation
|
||||
License: MPL-2.0
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
Files: src/Composer/Util/RemoteFilesystem.php
|
||||
src/Composer/Util/TlsHelper.php
|
||||
Copyright: 2016, Nils Adermann <naderman@naderman.de>
|
||||
2016, Jordi Boggiano <j.boggiano@seld.be>
|
||||
2013, Evan Coury <me@evancoury.com>
|
||||
License: Expat and BSD-2-Clause
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
License: BSD-2-Clause
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
.
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
License: Expat
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
License: MPL-2.0
|
||||
1. Definitions
|
||||
--------------
|
||||
.
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
.
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
.
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
.
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
.
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
.
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
.
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
.
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
.
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
.
|
||||
1.8. "License"
|
||||
means this document.
|
||||
.
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
.
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
.
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
.
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
.
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
.
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
.
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
.
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
.
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
.
|
||||
2.1. Grants
|
||||
.
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
.
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
.
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
.
|
||||
2.2. Effective Date
|
||||
.
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
.
|
||||
2.3. Limitations on Grant Scope
|
||||
.
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
.
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
.
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
.
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
.
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
.
|
||||
2.4. Subsequent Licenses
|
||||
.
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
.
|
||||
2.5. Representation
|
||||
.
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
.
|
||||
2.6. Fair Use
|
||||
.
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
.
|
||||
2.7. Conditions
|
||||
.
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
.
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
.
|
||||
3.1. Distribution of Source Form
|
||||
.
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
.
|
||||
3.2. Distribution of Executable Form
|
||||
.
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
.
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
.
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
.
|
||||
3.3. Distribution of a Larger Work
|
||||
.
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
.
|
||||
3.4. Notices
|
||||
.
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
.
|
||||
3.5. Application of Additional Terms
|
||||
.
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
.
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
.
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
.
|
||||
5. Termination
|
||||
--------------
|
||||
.
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
.
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
.
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
.
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
.
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
.
|
||||
8. Litigation
|
||||
-------------
|
||||
.
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
.
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
.
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
.
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
.
|
||||
10.1. New Versions
|
||||
.
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
.
|
||||
10.2. Effect of New Versions
|
||||
.
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
.
|
||||
10.3. Modified Versions
|
||||
.
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
.
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
.
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
.
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
.
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
.
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
.
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
.
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
.
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
|
||||
Reference in New Issue
Block a user