1 if (!dojo._hasResource["openils.URLVerify.Sessions"]) {
2 dojo.require("dojo.string");
3 dojo.require("openils.Util");
4 dojo.require("openils.URLVerify.Verify");
6 dojo.requireLocalization("openils.URLVerify", "URLVerify");
8 dojo._hasResource["openils.URLVerify.Sessions"] = true;
9 dojo.provide("openils.URLVerify.Sessions");
11 dojo.declare("openils.URLVerify.Sessions", null, {});
13 /* Take care that we add nothing to the global namespace.
14 * This is not an OO module so much as a container for
15 * functions needed by a specific interface. */
18 var module = openils.URLVerify.Sessions;
20 dojo.i18n.getLocalization("openils.URLVerify", "URLVerify");
22 module.setup = function(grid, org_selector) {
25 module.setup_org_selector_for_grid(org_selector);
28 module.setup_org_selector_for_grid = function(org_selector) {
29 function filter_grid_by_selected_org() {
31 "owning_lib": org_selector.attr("value")
33 module.grid.refresh();
36 new openils.User().buildPermOrgSelector(
37 "URL_VERIFY", org_selector, null,
40 org_selector, "onChange", filter_grid_by_selected_org
42 filter_grid_by_selected_org();
47 module.format_id = function(str) {
51 return "<a href='select_urls?session_id=" + str + "' title='" +
52 localeStrings.REREVIEW + "'>" + str +
53 "</a> <a href='create_session?clone=" + str + "' title='" +
54 localeStrings.CLONE_SESSION + "'>" +
55 localeStrings.CLONE_SESSION + "</a>";
58 module.format_attempts = function(list) {
59 if (!dojo.isArray(list)) return "";
65 return "<a title='" + localeStrings.REVIEW_ATTEMPT +
66 "' href='review_attempt?attempt_id=" + id + "'>" +