diff --git a/COPYRIGHT b/COPYRIGHT index c0d8389369c..fd54e10f354 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -9,41 +9,41 @@ More information: http://www.gnu.org/licenses/gpl-3.0.txt Dolibarr uses some external libraries released under different licenses. This is compatibility summary: -Component Version License GPL Compatible Usage +Component Version License GPL Compatible Usage ------------------------------------------------------------------------------------- PHP libraries: -AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package) -CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG -FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management -FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management -GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) -NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) -odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files -PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files -PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests -TCPDF 6.0.093 LGPL-3+ Yes PDF generation +AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package) +CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG +FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management +FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management +GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) +NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) +odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files +PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files +PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests +TCPDF 6.0.093 LGPL-3+ Yes PDF generation JS libraries: -jQuery 1.8.2 MIT License Yes JS library -jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI -jQuery UI Multiselect ? GPL and MIT License Yes JS library plugin for sexier multiselect -jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) -jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors -jQuery DataTables 1.9.4 BSD Yes JS library for tables output -jQuery FileUpload 5.0.3 GPL and MIT License Yes JS library to upload files -jQuery Flot 0.7 MIT License Yes JS library to build graph -jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) -jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place) -jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups) -jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors -jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors -jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors -jQuery Layout 1.3.0rc30.74 GPL and MIT License Yes JS library plugin Layout (RC-29.15) -jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used) -jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) -jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker -jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips -jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) +jQuery 1.8.2 MIT License Yes JS library +jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI +jQuery multiple-select 1.1.0 MIT License Yes JS library plugin for sexier multiselect +jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) +jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors +jQuery DataTables 1.9.4 BSD Yes JS library for tables output +jQuery FileUpload 5.0.3 GPL and MIT License Yes JS library to upload files +jQuery Flot 0.7 MIT License Yes JS library to build graph +jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) +jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place) +jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups) +jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors +jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors +jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors +jQuery Layout 1.3.0rc30.74 GPL and MIT License Yes JS library plugin Layout (RC-29.15) +jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used) +jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) +jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker +jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips +jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) For licenses compatibility informations: http://www.fsf.org/licensing/licenses/index_html diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eb7b3d8af4f..bade0344680 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4032,9 +4032,10 @@ class Form * @param int $translate Translate and encode value * @param int $maxlen Length maximum for labels * @param int $disabled Html select box is disabled - * @param int $sort 'ASC' or 'DESC' =Sort on label, '' or 'NONE'=Do not sort + * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort * @param string $morecss Add more class to css styles * @return string HTML select string. + * @see multiselectarray */ static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='') { @@ -4092,54 +4093,65 @@ class Form * * @param string $htmlname Name of select * @param array $array Array with key+value - * @param array $selected Preselected keys + * @param array $selected Array with key+value preselected * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $value_as_key 1 to use value as key * @param string $option Valeur de l'option en fonction du type choisi * @param int $translate Translate and encode value + * @param int $width Force width of select box. May be used only when using jquery couch. * @return string HTML multiselect string + * @see selectarray */ - function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0) + static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0, $width=0) { global $conf, $langs; - $out = ''."\n"; if (is_array($array) && ! empty($array)) { if ($value_as_key) $array=array_combine($array, $array); - if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && is_array($selected) && ! empty($selected)) - { - foreach ($selected as $selected_value) - { - foreach($array as $key => $value) - { - if ($selected_value == $key) - { - $value=$array[$selected_value]; - $out.= ''."\n"; - unset($array[$key]); - } - } - } - - if (! empty($array)) - { - foreach ($array as $key => $value) - { - $out.= ''."\n"; - } - } - } - else + if (! empty($array)) { foreach ($array as $key => $value) { @@ -4150,7 +4162,7 @@ class Form } $out.= '>'; - $newval = ($translate ? $langs->trans(ucfirst($value)) : $value); + $newval = ($translate ? $langs->trans($value) : $value); $newval = ($key_in_label ? $key.' - '.$newval : $newval); $out.= dol_htmlentitiesbr($newval); $out.= ''."\n"; diff --git a/htdocs/includes/jquery/plugins/multiple-select/LICENSE b/htdocs/includes/jquery/plugins/multiple-select/LICENSE new file mode 100644 index 00000000000..c3ebd2b5248 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2012-2014 Zhixin Wen + +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. \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/README.md b/htdocs/includes/jquery/plugins/multiple-select/README.md new file mode 100644 index 00000000000..81b82ba74c0 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/README.md @@ -0,0 +1,96 @@ +# Multiple Select + +Multiple select is a jQuery plugin to select multiple elements with checkboxes :). + +To get started checkout examples and documentation at http://wenzhixin.net.cn/p/multiple-select + +## Contributors + +Multiple select is due to the excellent work of the following contributors: + + + + +< + + + + + + + +
文翼GitHub/wenzhixin
Gaurav JassalGitHub/creativeaura
guliGitHub/guli
jwheadonGitHub/jwheadon
yxGitHub/qqfish
Tobias MaceyGitHub/blarghmatey
Jona GoldmanGitHub/jonagoldman
Alex JeffreyGitHub/ajeffrey
+ +## Changelog + +### 1.1.0 + +* Fix #63: Add ```keepOpen``` option. +* Fix #62: Fix ```isOpen``` and ```filter``` options are both true bug. +* Fix #57: Fire onCheckAll event when literally select. +* Add data attributes for support. +* Fix #55: Add ```name``` option. + +### 1.0.9 + +* Fix #42: Add ```styler``` option to custom item style. +* Fix firefox click bug. +* Add ```allSelected```, ```minumimCountSelected``` and ```countSelected``` options. +* Fix #35: Add ```onFocus``` and ```onBlur``` events. +* Fix #25: Add ```focus``` and ```blur``` methods. +* Fix #31: Trigger the onCheckAll & onUncheckAll events when use filter to select all. + +### 1.0.8 + +* Update the license to The MIT License. +* Fix #47: Add ```No matches found``` message when there are no results found. +* Fix #43: Add ```position``` option. + +### 1.0.7 + +* Fix #44: The filters not working bugs. + +### 1.0.6 + +* Fix #21: Add ```single``` option. +* Add ```override``` option. +* Add ```container``` option. +* Fix #29: Update the optgroups select text. +* Fix #30: Image is not shown in Firefox 25.0.1. +* Fix #22: fix group filter problem. + +### 1.0.5 + +* Update the button text witdh. +* Add keyboard support. + +### 1.0.4 + +* Fix #12: Add ```width``` option. +* Fix #11: Add callback events. +* Add ```maxHeight``` option. + +### 1.0.3 + +* Fix #4: Add ```filter``` option. +* Support mobile devices. +* Fix #6: Add ```refresh``` method. + +### 1.0.2 + +* Fix #7: Add ```selected``` and ```disabled``` options. +* Fix #5: Add ```checkAll``` and ```uncheckAll``` methods. + +### 1.0.1 + +* Fix #3: Add optgroups support. +* Add ```placeholder``` option. +* Fix #2: use prop method instead of attr. + +### 1.0.0 + +* Initial release + +## LICENSE + +[The MIT License](https://github.com/wenzhixin/multiple-select/blob/master/LICENSE) \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js b/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js new file mode 100644 index 00000000000..32e6635bbaa --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js @@ -0,0 +1,466 @@ +/** + * @author zhixin wen + * @version 1.1.0 + * + * http://wenzhixin.net.cn/p/multiple-select/ + */ + +(function($) { + + 'use strict'; + + function MultipleSelect($el, options) { + var that = this, + name = $el.attr('name') || options.name || '', + elWidth = $el.width(); + + this.$el = $el.hide(); + this.options = options; + + this.$parent = $('
'); + this.$choice = $(''); + this.$drop = $('
'); + this.$el.after(this.$parent); + this.$parent.append(this.$choice); + this.$parent.append(this.$drop); + + if (this.$el.prop('disabled')) { + this.$choice.addClass('disabled'); + } + this.$choice.css('width', elWidth + 'px'); + this.$drop.css({ + width: (options.width || elWidth) + 'px' + }); + + if (!this.options.keepOpen) { + $('body').click(function(e) { + if ($(e.target)[0] === that.$choice[0] || + $(e.target).parents('.ms-choice')[0] === that.$choice[0]) { + return; + } + if (($(e.target)[0] === that.$drop[0] || + $(e.target).parents('.ms-drop')[0] !== that.$drop[0]) && + that.options.isOpen) { + that.close(); + } + }); + } + + this.selectAllName = 'name="selectAll' + name + '"'; + this.selectGroupName = 'name="selectGroup' + name + '"'; + this.selectItemName = 'name="selectItem' + name + '"'; + } + + MultipleSelect.prototype = { + constructor : MultipleSelect, + + init: function() { + var that = this, + html = []; + if (this.options.filter) { + html.push( + '' + ); + } + html.push(''); + this.$drop.html(html.join('')); + this.$drop.find('ul').css('max-height', this.options.maxHeight + 'px'); + this.$drop.find('.multiple').css('width', this.options.multipleWidth + 'px'); + + this.$searchInput = this.$drop.find('.ms-search input'); + this.$selectAll = this.$drop.find('input[' + this.selectAllName + ']'); + this.$selectGroups = this.$drop.find('input[' + this.selectGroupName + ']'); + this.$selectItems = this.$drop.find('input[' + this.selectItemName + ']:enabled'); + this.$disableItems = this.$drop.find('input[' + this.selectItemName + ']:disabled'); + this.$noResults = this.$drop.find('.ms-no-results'); + this.events(); + this.update(); + + if (this.options.isOpen) { + this.open(); + } + }, + + optionToHtml: function(i, elm, group, groupDisabled) { + var that = this, + $elm = $(elm), + html = [], + multiple = this.options.multiple, + disabled, + type = this.options.single ? 'radio' : 'checkbox'; + + if ($elm.is('option')) { + var value = $elm.val(), + text = $elm.text(), + selected = $elm.prop('selected'), + style = this.options.styler(value) ? ' style="' + this.options.styler(value) + '"' : ''; + + disabled = groupDisabled || $elm.prop('disabled'); + html.push( + '', + '', + ' ', + text, + '', + '' + ); + } else if (!group && $elm.is('optgroup')) { + var _group = 'group_' + i, + label = $elm.attr('label'); + + disabled = $elm.prop('disabled'); + html.push( + '
  • ', + '', + '
  • '); + $.each($elm.children(), function(i, elm) { + html.push(that.optionToHtml(i, elm, _group, disabled)); + }); + } + return html.join(''); + }, + + events: function() { + var that = this; + this.$choice.off('click').on('click', function(e) { + e.preventDefault(); + that[that.options.isOpen ? 'close' : 'open'](); + }) + .off('focus').on('focus', this.options.onFocus) + .off('blur').on('blur', this.options.onBlur); + + this.$parent.off('keydown').on('keydown', function(e) { + switch (e.which) { + case 27: // esc key + that.close(); + that.$choice.focus(); + break; + } + }); + this.$searchInput.off('keyup').on('keyup', function() { + that.filter(); + }); + this.$selectAll.off('click').on('click', function() { + var checked = $(this).prop('checked'), + $items = that.$selectItems.filter(':visible'); + if ($items.length === that.$selectItems.length) { + that[checked ? 'checkAll' : 'uncheckAll'](); + } else { // when the filter option is true + that.$selectGroups.prop('checked', checked); + $items.prop('checked', checked); + that.options[checked ? 'onCheckAll' : 'onUncheckAll'](); + that.update(); + } + }); + this.$selectGroups.off('click').on('click', function() { + var group = $(this).parent().attr('data-group'), + $items = that.$selectItems.filter(':visible'), + $children = $items.filter('[data-group="' + group + '"]'), + checked = $children.length !== $children.filter(':checked').length; + $children.prop('checked', checked); + that.updateSelectAll(); + that.update(); + that.options.onOptgroupClick({ + label: $(this).parent().text(), + checked: checked, + children: $children.get() + }); + }); + this.$selectItems.off('click').on('click', function() { + that.updateSelectAll(); + that.update(); + that.updateOptGroupSelect(); + that.options.onClick({ + label: $(this).parent().text(), + value: $(this).val(), + checked: $(this).prop('checked') + }); + }); + }, + + open: function() { + if (this.$choice.hasClass('disabled')) { + return; + } + this.options.isOpen = true; + this.$choice.find('>div').addClass('open'); + this.$drop.show(); + if (this.options.container) { + var offset = this.$drop.offset(); + this.$drop.appendTo($(this.options.container)); + this.$drop.offset({ top: offset.top, left: offset.left }); + } + if (this.options.filter) { + this.$searchInput.val(''); + this.filter(); + } + this.options.onOpen(); + }, + + close: function() { + this.options.isOpen = false; + this.$choice.find('>div').removeClass('open'); + this.$drop.hide(); + if (this.options.container) { + this.$parent.append(this.$drop); + this.$drop.css({ + 'top': 'auto', + 'left': 'auto' + }) + } + this.options.onClose(); + }, + + update: function() { + var selects = this.getSelects('text'), + $span = this.$choice.find('>span'); + if (selects.length === this.$selectItems.length + this.$disableItems.length && this.options.allSelected) { + $span.removeClass('placeholder').html(this.options.allSelected); + } else if (selects.length > this.options.minumimCountSelected && this.options.countSelected) { + $span.removeClass('placeholder').html(this.options.countSelected + .replace('#', selects.length) + .replace('%', this.$selectItems.length + this.$disableItems.length)); + } else if (selects.length) { + $span.removeClass('placeholder').html(selects.join(', ')); + } else { + $span.addClass('placeholder').html(this.options.placeholder); + } + // set selects to select + this.$el.val(this.getSelects()); + }, + + updateSelectAll: function() { + var $items = this.$selectItems.filter(':visible'); + this.$selectAll.prop('checked', $items.length && + $items.length === $items.filter(':checked').length); + if (this.$selectAll.prop('checked')) { + this.options.onCheckAll(); + } + }, + + updateOptGroupSelect: function() { + var $items = this.$selectItems.filter(':visible'); + $.each(this.$selectGroups, function(i, val) { + var group = $(val).parent().attr('data-group'), + $children = $items.filter('[data-group="' + group + '"]'); + $(val).prop('checked', $children.length && + $children.length === $children.filter(':checked').length); + }); + }, + + //value or text, default: 'value' + getSelects: function(type) { + var that = this, + texts = [], + values = []; + this.$drop.find('input[' + this.selectItemName + ']:checked').each(function() { + texts.push($(this).parent().text()); + values.push($(this).val()); + }); + + if (type === 'text' && this.$selectGroups.length) { + texts = []; + this.$selectGroups.each(function() { + var html = [], + text = $.trim($(this).parent().text()), + group = $(this).parent().data('group'), + $children = that.$drop.find('[' + that.selectItemName + '][data-group="' + group + '"]'), + $selected = $children.filter(':checked'); + + if ($selected.length === 0) { + return; + } + + html.push('['); + html.push(text); + if ($children.length > $selected.length) { + var list = []; + $selected.each(function() { + list.push($(this).parent().text()); + }); + html.push(': ' + list.join(', ')); + } + html.push(']'); + texts.push(html.join('')); + }); + } + return type === 'text' ? texts : values; + }, + + setSelects: function(values) { + var that = this; + this.$selectItems.prop('checked', false); + $.each(values, function(i, value) { + that.$selectItems.filter('[value="' + value + '"]').prop('checked', true); + }); + this.$selectAll.prop('checked', this.$selectItems.length === + this.$selectItems.filter(':checked').length); + this.update(); + }, + + enable: function() { + this.$choice.removeClass('disabled'); + }, + + disable: function() { + this.$choice.addClass('disabled'); + }, + + checkAll: function() { + this.$selectItems.prop('checked', true); + this.$selectGroups.prop('checked', true); + this.$selectAll.prop('checked', true); + this.update(); + this.options.onCheckAll(); + }, + + uncheckAll: function() { + this.$selectItems.prop('checked', false); + this.$selectGroups.prop('checked', false); + this.$selectAll.prop('checked', false); + this.update(); + this.options.onUncheckAll(); + }, + + focus: function() { + this.$choice.focus(); + this.options.onFocus(); + }, + + blur: function() { + this.$choice.blur(); + this.options.onBlur(); + }, + + refresh: function() { + this.init(); + }, + + filter: function() { + var that = this, + text = $.trim(this.$searchInput.val()).toLowerCase(); + if (text.length === 0) { + this.$selectItems.parent().show(); + this.$disableItems.parent().show(); + this.$selectGroups.parent().show(); + } else { + this.$selectItems.each(function() { + var $parent = $(this).parent(); + $parent[$parent.text().toLowerCase().indexOf(text) < 0 ? 'hide' : 'show'](); + }); + this.$disableItems.parent().hide(); + this.$selectGroups.each(function() { + var $parent = $(this).parent(); + var group = $parent.attr('data-group'), + $items = that.$selectItems.filter(':visible'); + $parent[$items.filter('[data-group="' + group + '"]').length === 0 ? 'hide' : 'show'](); + }); + + //Check if no matches found + if (this.$selectItems.filter(':visible').length) { + this.$selectAll.parent().show(); + this.$noResults.hide(); + } else { + this.$selectAll.parent().hide(); + this.$noResults.show(); + } + } + this.updateOptGroupSelect(); + this.updateSelectAll(); + } + }; + + $.fn.multipleSelect = function() { + var option = arguments[0], + args = arguments, + + value, + allowedMethods = [ + 'getSelects', 'setSelects', + 'enable', 'disable', + 'checkAll', 'uncheckAll', + 'focus', 'blur', + 'refresh' + ]; + + this.each(function() { + var $this = $(this), + data = $this.data('multipleSelect'), + options = $.extend({}, $.fn.multipleSelect.defaults, + $this.data(), typeof option === 'object' && option); + + if (!data) { + data = new MultipleSelect($this, options); + $this.data('multipleSelect', data); + } + + if (typeof option === 'string') { + if ($.inArray(option, allowedMethods) < 0) { + throw "Unknown method: " + option; + } + value = data[option](args[1]); + } else { + data.init(); + } + }); + + return value ? value : this; + }; + + $.fn.multipleSelect.defaults = { + name: '', + isOpen: false, + placeholder: '', + selectAll: true, + selectAllText: 'Select all', + allSelected: 'All selected', + minumimCountSelected: 3, + countSelected: '# of % selected', + multiple: false, + multipleWidth: 80, + single: false, + filter: false, + width: undefined, + maxHeight: 250, + container: null, + position: 'bottom', + keepOpen: false, + + styler: function() {return false;}, + + onOpen: function() {return false;}, + onClose: function() {return false;}, + onCheckAll: function() {return false;}, + onUncheckAll: function() {return false;}, + onFocus: function() {return false;}, + onBlur: function() {return false;}, + onOptgroupClick: function() {return false;}, + onClick: function() {return false;} + }; +})(jQuery); diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css new file mode 100644 index 00000000000..d824e0c7a2b --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css @@ -0,0 +1,183 @@ +/** + * @author zhixin wen + */ + +.ms-parent { + display: inline-block; + position: relative; + vertical-align: middle; +} + +.ms-choice { + display: block; + height: 26px; + padding: 0; + overflow: hidden; + cursor: pointer; + border: 1px solid #aaa; + text-align: left; + white-space: nowrap; + line-height: 26px; + color: #444; + text-decoration: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + background-color: #fff; +} + +.ms-choice.disabled { + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.ms-choice > span { + position: absolute; + top: 0; + left: 0; + right: 20px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: block; + padding-left: 8px; +} + +.ms-choice > span.placeholder { + color: #999; +} + +.ms-choice > div { + position: absolute; + top: 0; + right: 0; + width: 20px; + height: 25px; + background: url('multiple-select.png') right top no-repeat; +} + +.ms-choice > div.open { + background: url('multiple-select.png') left top no-repeat; +} + +.ms-drop { + overflow: hidden; + display: none; + margin-top: -1px; + padding: 0; + position: absolute; + z-index: 1000; + background: #fff; + color: #000; + border: 1px solid #aaa; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.ms-drop.bottom { + top: 100%; + -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 4px 5px rgba(0, 0, 0, .15); +} + +.ms-drop.top { + bottom: 100%; + -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); +} + +.ms-search { + display: inline-block; + margin: 0; + min-height: 26px; + padding: 4px; + position: relative; + white-space: nowrap; + width: 100%; + z-index: 10000; +} + +.ms-search input { + width: 100%; + height: auto !important; + min-height: 24px; + padding: 0 20px 0 5px; + margin: 0; + outline: 0; + font-family: sans-serif; + font-size: 1em; + border: 1px solid #aaa; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + background: #fff url('multiple-select.png') no-repeat 100% -22px; + background: url('multiple-select.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('multiple-select.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); +} + +.ms-search, .ms-search input { + -webkit-box-sizing: border-box; + -khtml-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} + +.ms-drop ul { + overflow: auto; + margin: 0; + padding: 5px 8px; +} + +.ms-drop ul > li { + list-style: none; + display: list-item; + background-image: none; + position: static; +} + +.ms-drop ul > li .disabled { + opacity: .35; + filter: Alpha(Opacity=35); +} + +.ms-drop ul > li.multiple { + display: block; + float: left; +} + +.ms-drop ul > li.group { + clear: both; +} + +.ms-drop ul > li.multiple label { + width: 100%; + display: block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.ms-drop ul > li label.optgroup { + font-weight: bold; +} + +.ms-drop input[type="checkbox"] { + vertical-align: middle; +} + +.ms-drop .ms-no-results { + display: none; +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json new file mode 100644 index 00000000000..dd636fda7e0 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json @@ -0,0 +1,28 @@ +{ + "name": "multiple-select", + "version": "1.1.0", + "title": "Multiple Select", + "description": "Multiple select is a jQuery plugin to select multiple elements with checkboxes :).", + "author": { + "name": "zhixin wen", + "email": "wenzhixin2010@gmail.com", + "url": "http://wenzhixin.net.cn/" + }, + "licenses": [ + { + "type": "MIT License", + "url": "http://opensource.org/licenses/MIT" + } + ], + "dependencies": { + "jquery": ">=1.7" + }, + "keywords": ["multiple.select", "select.list", "multiple.choose", "checkbox"], + "homepage": "http://wenzhixin.net.cn/p/multiple-select/", + "demo": "http://wenzhixin.net.cn/p/multiple-select/#examples", + "bugs": { + "url": "https://github.com/wenzhixin/multiple-select/issues" + }, + "docs": "http://wenzhixin.net.cn/p/multiple-select/#documentation", + "download": "https://github.com/wenzhixin/multiple-select/archive/master.zip" +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png new file mode 100644 index 00000000000..2a7ba608ea8 Binary files /dev/null and b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png differ diff --git a/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt b/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt deleted file mode 100644 index 1076f8b4b2b..00000000000 --- a/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 Michael Aufreiter, http://www.quasipartikel.at - -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. \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css b/htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css deleted file mode 100644 index 7d3a44801d2..00000000000 --- a/htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css +++ /dev/null @@ -1,31 +0,0 @@ -/* Multiselect -----------------------------------*/ - -.ui-multiselect { border: solid 1px; font-size: 0.8em; } -.ui-multiselect ul { -moz-user-select: none; } -.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; padding-right: 18px; overflow: hidden; } -.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;} -.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; } - -.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; } -.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; } - -.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; } -.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; } -.ui-multiselect ul.available li { padding-left: 10px; } - -.ui-multiselect div.right-column { border-left: 1px solid; } - -.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;} -.ui-multiselect .ui-state-hover { border: none; } -.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;} - -.ui-multiselect .add-all { float: right; padding: 7px;} -.ui-multiselect .remove-all { float: right; padding: 7px;} -.ui-multiselect .search { float: left; padding: 4px;} -.ui-multiselect .count { float: left; padding: 7px;} - -.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; } -.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; } - -.ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; } \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js b/htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js deleted file mode 100644 index eb4578fc782..00000000000 --- a/htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js +++ /dev/null @@ -1,480 +0,0 @@ -/* - * jQuery UI Multiselect - * - * Authors: - * Michael Aufreiter (quasipartikel.at) - * Yanick Rochon (yanick.rochon[at]gmail[dot]com) - * - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://www.quasipartikel.at/multiselect/ - * - * - * Depends: - * ui.core.js - * ui.sortable.js - * - * Optional: - * localization (http://plugins.jquery.com/project/localisation) - * scrollTo (http://plugins.jquery.com/project/ScrollTo) - * - * Todo: - * Make batch actions faster - * Implement dynamic insertion through remote calls - */ - - -(function($) { - -$.widget("ui.multiselect", { - options: { - sortable: true, - dragToAdd: true, - searchable: true, - doubleClickable: true, - animated: 'fast', - show: 'slideDown', - hide: 'slideUp', - dividerLocation: 0.6, - selectedContainerOnLeft: true, - width: null, - height: null, - nodeComparator: function(node1,node2) { - var text1 = node1.text(), - text2 = node2.text(); - return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1); - }, - includeRemoveAll: true, - includeAddAll: true, - pressEnterKeyToAddAll: false - }, - _create: function() { - this.element.hide(); - this.id = this.element.attr("id"); - this.container = $('
    ').insertAfter(this.element); - this.count = 0; // number of currently selected options - this.selectedContainer = $('
    '); - if (this.options.selectedContainerOnLeft) { - this.selectedContainer.appendTo(this.container); - this.availableContainer = $('
    ').appendTo(this.container); - this.availableContainer.addClass('right-column'); - } - else - { - this.availableContainer = $('
    ').appendTo(this.container); - this.selectedContainer.appendTo(this.container); - this.selectedContainer.addClass('right-column'); - } - this.selectedActions = $('
    0 '+$.ui.multiselect.locale.itemsCount+''+(this.options.includeRemoveAll?''+$.ui.multiselect.locale.removeAll+'':' ')+'
    ').appendTo(this.selectedContainer); - this.availableActions = $('
    '+(this.options.includeAddAll?''+$.ui.multiselect.locale.addAll+'':' ')+'
    ').appendTo(this.availableContainer); - this.selectedList = $('
    ').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer); - this.availableList = $('
    ').bind('selectstart', function(){return false;}).appendTo(this.availableContainer); - - var that = this; - - var width = this.options.width; - if (!width) { - width = this.element.width(); - } - var height = this.options.height; - if (!height) { - height = this.element.height(); - } - - // set dimensions - this.container.width(width-2); - if (this.options.selectedContainerOnLeft) { - this.selectedContainer.width(Math.floor(width*this.options.dividerLocation)-1); - this.availableContainer.width(Math.floor(width*(1-this.options.dividerLocation))-2); - } - else - { - this.selectedContainer.width(Math.floor(width*this.options.dividerLocation)-2); - this.availableContainer.width(Math.floor(width*(1-this.options.dividerLocation))-1); - } - - // fix list height to match