mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
add confirm box before changing owner
This commit is contained in:
parent
6c7d397837
commit
769706fe9c
|
@ -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;
|
||||
});
|
||||
*/
|
||||
<?php if($this->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" : "<i class='fa fa-user'></i> <?= getMLText("batch_change_owner") ?>",
|
||||
"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" : "<?= getMLText("cancel") ?>",
|
||||
"class" : "btn-cancel",
|
||||
"callback": function() {
|
||||
}
|
||||
}]);
|
||||
});
|
||||
<?php else: ?>
|
||||
$('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" : "<i class='fa fa-user'></i> <?= getMLText("batch_change_owner") ?>",
|
||||
"className" : "btn-danger",
|
||||
},
|
||||
"cancel": {
|
||||
"label" : " <?= getMLText("cancel") ?>",
|
||||
"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;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
<?php endif; ?>
|
||||
});
|
||||
<?php
|
||||
// $this->printFolderChooserJs("form1");
|
||||
|
@ -837,9 +902,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'), "<i class=\"fa fa-user\"></i> ".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'), "<i class=\"fa fa-user\"></i> ".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)), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_owner"), false, true)."\n";
|
||||
|
||||
$content = ob_get_clean();
|
||||
$this->printAccordion(getMLText('batch_change_owner'), $content);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user