diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 67d2d96883d..29fcbf81180 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3389,6 +3389,8 @@ class Form function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0) { global $langs; + + if ($value_as_key) $array=array_combine($array, $array); $out=''."\n"; + + return $out; + } /** diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 77b71df8083..bbd1cc108b1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -435,7 +435,7 @@ class FormFile // Execute hooks $parameters=array('socid'=>$GLOBALS['socid'],'id'=>$GLOBALS['id'],'modulepart'=>$modulepart); - if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocOptions',$parameters); + if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']); } // Get list of files diff --git a/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt b/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt new file mode 100644 index 00000000000..1076f8b4b2b --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +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 new file mode 100644 index 00000000000..f4599f8fc6b --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css @@ -0,0 +1,31 @@ +/* Multiselect +----------------------------------*/ + +.multiselect { width: 460px; height: 150px; } +.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; } +.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 ul.selected li { } + +.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; } +.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 .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 new file mode 100644 index 00000000000..1234fa7a957 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js @@ -0,0 +1,336 @@ +/* + * 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, + searchable: true, + doubleClickable: true, + animated: 'fast', + show: 'slideDown', + hide: 'slideUp', + dividerLocation: 0.6, + nodeComparator: function(node1,node2) { + var text1 = node1.text(), + text2 = node2.text(); + return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1); + } + }, + _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 = $('
').appendTo(this.container); + this.availableContainer = $('
').appendTo(this.container); + this.selectedActions = $('
0 '+$.ui.multiselect.locale.itemsCount+''+$.ui.multiselect.locale.removeAll+'
').appendTo(this.selectedContainer); + this.availableActions = $('
'+$.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; + + // set dimensions + this.container.width(this.element.width()+1); + this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation)); + this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation))); + + // fix list height to match