This causes JSPac to ignore them and TPac to sort them above a divider.
Also fixes an issue where excessive escaping was being done on values. This
would break some values in the value map selectors.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
<field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
<field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
<field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
+ <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
</fields>
<links>
<link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
value TEXT NOT NULL,
description TEXT,
opac_visible BOOL NOT NULL DEFAULT TRUE, -- For TPac selectors
- search_label TEXT
+ search_label TEXT,
+ is_simple BOOL NOT NULL DEFAULT FALSE
);
CREATE VIEW config.language_map AS SELECT code, value FROM config.coded_value_map WHERE ctype = 'item_lang';
ALTER TABLE config.coded_value_map
ADD COLUMN opac_visible BOOL NOT NULL DEFAULT TRUE,
- ADD COLUMN search_label TEXT;
+ ADD COLUMN search_label TEXT,
+ ADD COLUMN is_simple BOOL NOT NULL DEFAULT FALSE;
[% END;
# turn the list of objects into a list of hashes to
# leverage TT's array.sort('<hashkey>') behavior
+simple_sorter = [];
sorter = [];
-FOR o IN all_values;
- sorter.push({code => o.code, value => (o.search_label ? o.search_label : o.value)});
+FOR o IN all_values;
+ IF o.is_simple == 't';
+ simple_sorter.push({code => o.code, value => (o.search_label ? o.search_label : o.value)});
+ ELSE;
+ sorter.push({code => o.code, value => (o.search_label ? o.search_label : o.value)});
+ END;
END;
+FOR o IN simple_sorter.sort('value') %]
+ <option value='[% o.code | html | replace("'","'") %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : '' %]>[% o.value | html %]</option>
+[% END;
+IF simple_sorter.size && sorter.size %]
+ <option disabled='true'>-----</option>
+[% END;
FOR o IN sorter.sort('value') %]
- <option value='[% o.code | uri %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : '' %]>[% o.value | html %]</option>
+ <option value='[% o.code | html | replace("'","'") %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : '' %]>[% o.value | html %]</option>
[% END -%]
</select>
var ctypes = ["bib_level", "item_form", "item_type", "audience", "lit_form"];
- var req = new Request('open-ils.fielder:open-ils.fielder.ccvm.atomic', {"cache":1,"query":{"ctype":ctypes, "opac_visible":"t"}});
+ var req = new Request('open-ils.fielder:open-ils.fielder.ccvm.atomic', {"cache":1,"query":{"ctype":ctypes, "opac_visible":"t", "is_simple":"f"}});
req.callback(advDrawBibExtras);
req.request.ctypes = ctypes;
req.send();