diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php
index 9ebe5ea3d..7a21af57d 100644
--- a/views/bootstrap/class.Bootstrap.php
+++ b/views/bootstrap/class.Bootstrap.php
@@ -1851,6 +1851,45 @@ $(function() {
return '';
} /* }}} */
+ /**
+ * Output left-arrow with link which takes over a number of ids into
+ * a select box.
+ *
+ * Clicking in the button will preset the comma seperated list of ids
+ * in data-ref as options in the select box with name $name
+ *
+ * @param string $name id of select box
+ * @param array $ids list of option values
+ */
+ function printSelectPresetButtonHtml($name, $ids) { /* {{{ */
+?>
+ " data-ref="" data-ids="">
+
+$(document).ready( function() {
+ $('.selectpreset_btn').click(function(ev){
+ ev.preventDefault();
+ if (typeof $(ev.currentTarget).data('ids') != 'undefined') {
+ target = $(ev.currentTarget).data('ref');
+ // Use attr() instead of data() because data() converts to int which cannot be split
+ items = $(ev.currentTarget).attr('data-ids');
+ arr = items.split(",");
+ for(var i in arr) {
+ $("#"+target+" option[value='"+arr[i]+"']").attr("selected", "selected");
+ }
+ $("#"+target).trigger("chosen:updated");
+ }
+ });
+});
+
- ">
-
-params['strictformcheck'];
$dropfolderdir = $this->params['dropfolderdir'];
header('Content-Type: application/javascript');
$this->printDropFolderChooserJs("form1");
+ $this->printSelectPresetButtonJs();
?>
function checkForm()
{
@@ -278,7 +260,7 @@ $(document).ready( function() {
}
}
if($tmp) {
- $this->__takeOverButton("IndReviewer", $tmp);
+ $this->printSelectPresetButtonHtml("IndReviewer", $tmp);
}
/* List all mandatory reviewers */
if($res) {
@@ -361,7 +343,7 @@ $(document).ready( function() {
}
}
if($tmp) {
- $this->__takeOverButton("GrpReviewer", $tmp);
+ $this->printSelectPresetButtonHtml("GrpReviewer", $tmp);
}
/* List all mandatory groups of reviewers */
if($res) {
@@ -439,7 +421,7 @@ $(document).ready( function() {
}
}
if($tmp) {
- $this->__takeOverButton("IndApprover", $tmp);
+ $this->printSelectPresetButtonHtml("IndApprover", $tmp);
}
/* List all mandatory approvers */
if($res) {
@@ -524,7 +506,7 @@ $(document).ready( function() {
}
}
if($tmp) {
- $this->__takeOverButton("GrpApprover", $tmp);
+ $this->printSelectPresetButtonHtml("GrpApprover", $tmp);
}
/* List all mandatory groups of approvers */
if($res) {