Skip to content

Commit

Permalink
Manual assignment page includes a hidden 'showforce' input.
Browse files Browse the repository at this point in the history
This ensures that API requests, such as are generated when a user sorts a
column, override conflicts automatically. (The manual assignment page
overrides conflicts automatically.)
  • Loading branch information
kohler committed Nov 12, 2020
1 parent e5a77c5 commit 7b2ddab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions manualassign.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ function show_ass_elements($pl) {
echo '<div class="entryi"><label>Show</label>',
'<ul class="entry inline">', join('', $show_data), '</ul></div>';
}
echo Ht::hidden("forceShow", 1, ["id" => "showforce"]); // search API must override conflicts
echo '<div class="entryi autosave-hidden hidden"><label></label><div class="entry">',
Ht::submit("update", "Save assignments", ["class" => "btn-primary btn big"]), '</div></div>';
echo '</div>';
Expand Down
3 changes: 2 additions & 1 deletion scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6300,7 +6300,8 @@ function search_sort_url(self, href) {
var hrefm = /^([^?#]*(?:search|reviewprefs|manualassign)(?:\.php)?)(\?[^#]*)/.exec(href),
api = hrefm[2], e;
if ((e = document.getElementById("showforce"))) {
api = api.replace(/&forceShow=[^&#;]*/, "") + "&forceShow=" + (e.checked ? 1 : 0);
var v = e.type === "checkbox" ? (e.checked ? 1 : 0) : e.value;
api = api.replace(/&forceShow=[^&#;]*/, "") + "&forceShow=" + v;
}
if (!/[&?]q=/.test(api)) {
api += "&q=";
Expand Down

0 comments on commit 7b2ddab

Please sign in to comment.