diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index d98183e2c..dceff5da4 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -75,6 +75,7 @@ $(document).ready( function() { window.location.href = url; }); +/* $('#changeowner').on('click', function(e) { e.preventDefault(); var url = ""; @@ -89,6 +90,70 @@ $(document).ready( function() { url += '&'+$.param(values); window.location.href = url; }); +*/ +getParam('theme') !== 'bootstrap4'): ?> + $('body').on('click', 'a.change-owner-btn', function(ev){ + ev.preventDefault(); + ev.stopPropagation(); + confirmmsg = $(ev.currentTarget).attr('confirmmsg'); + href = $(ev.currentTarget).attr('href'); + bootbox.dialog(confirmmsg, [{ + "label" : " ", + "class" : "btn-danger", + "callback": function() { + var url = ""; + url = href+'&newowner='+($('#newowner').val()); + var inputs = $('input[name^=\"marks\"]'); + var values = {}; + inputs.each(function() { + if(this.checked) + values[this.name] = 1; + }); + url += '&'+$.param(values); + window.location.href = url; + } + }, { + "label" : "", + "class" : "btn-cancel", + "callback": function() { + } + }]); + }); + + $('body').on('click', 'a.change-owner-btn', function(ev){ + ev.preventDefault(); + ev.stopPropagation(); + confirmmsg = $(ev.currentTarget).attr('confirmmsg'); + href = $(ev.currentTarget).attr('href'); + bootbox.confirm({ + "message": confirmmsg, + "buttons": { + "confirm": { + "label" : " ", + "className" : "btn-danger", + }, + "cancel": { + "label" : " ", + "className" : "btn-secondary", + } + }, + "callback": function(result) { + if(result) { + var url = ""; + url = href+'&newowner='+($('#newowner').val()); + var inputs = $('input[name^=\"marks\"]'); + var values = {}; + inputs.each(function() { + if(this.checked) + values[this.name] = 1; + }); + url += '&'+$.param(values); + window.location.href = url; + } + } + }); + }); + }); printFolderChooserJs("form1"); @@ -857,9 +922,13 @@ function typeahead() { /* {{{ */ 'class'=>'chzn-select', 'options'=>$options, 'placeholder'=>getMLText('select_users'), + 'attributes'=>array(array('style', 'width: 100%;')) ) ); - print $this->html_link('Search', array_merge($_GET, array('action'=>'changeowner')), array('class'=>'btn btn-primary', 'id'=>'changeowner'), " ".getMLText("batch_change_owner"), false, true)."\n"; +// print $this->html_link('Search', array_merge($_GET, array('action'=>'changeowner')), array('class'=>'btn btn-primary', 'id'=>'changeowner'), " ".getMLText("batch_change_owner"), false, true)."\n"; + + print $this->html_link('Search', array_merge($_GET, array('action'=>'changeowner')), array('class'=>'btn btn-primary change-owner-btn mt-4', 'confirmmsg'=>htmlspecialchars(getMLText("confirm_change_owner", array ()), ENT_QUOTES)), " ".getMLText("batch_change_owner"), false, true)."\n"; + $content = ob_get_clean(); $this->printAccordion(getMLText('batch_change_owner'), $content); } diff --git a/views/bootstrap4/styles/application.js b/views/bootstrap4/styles/application.js index 4c2d9078a..bcf9d170d 100644 --- a/views/bootstrap4/styles/application.js +++ b/views/bootstrap4/styles/application.js @@ -62,7 +62,7 @@ function initMost() { $(".chzn-select").select2({ theme: "bootstrap4", - width: '100%', + width: 'resolve', templateResult: chzn_template_func//, //templateSelection: chzn_template_func });