[open-ils-commits] [GIT] Evergreen ILS branch master updated. fc5f7714c978fd7a5b5c4ce77d6a993e10dd6ccf
Evergreen Git
git at git.evergreen-ils.org
Sun Apr 8 21:33:32 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via fc5f7714c978fd7a5b5c4ce77d6a993e10dd6ccf (commit)
via 96d0855b26b1ff40af895755dbb04a6762a473fd (commit)
via 17f66a91636d1164199fc215e30b4771c451b5a9 (commit)
via 3caf5a7f4e279219557d93ae231b228e844b5951 (commit)
from 4643f3613ad57ad4cdcf99a9bf17faf4c63870af (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fc5f7714c978fd7a5b5c4ce77d6a993e10dd6ccf
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Sun Apr 8 21:32:25 2012 -0400
Stamp tpac value maps upgrade script
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index e32fda3..c6cdb04 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -87,7 +87,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0702', :eg_version); -- berick/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0703', :eg_version); -- tsbere
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0703.tpac_value_maps.sql b/Open-ILS/src/sql/Pg/upgrade/0703.tpac_value_maps.sql
new file mode 100644
index 0000000..ca10969
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0703.tpac_value_maps.sql
@@ -0,0 +1,12 @@
+-- Evergreen DB patch 0703.tpac_value_maps.sql
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0703', :eg_version);
+
+ALTER TABLE config.coded_value_map
+ ADD COLUMN opac_visible BOOL NOT NULL DEFAULT TRUE,
+ ADD COLUMN search_label TEXT,
+ ADD COLUMN is_simple BOOL NOT NULL DEFAULT FALSE;
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql
deleted file mode 100644
index 6172f5e..0000000
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-ALTER TABLE config.coded_value_map
- ADD COLUMN opac_visible BOOL NOT NULL DEFAULT TRUE,
- ADD COLUMN search_label TEXT,
- ADD COLUMN is_simple BOOL NOT NULL DEFAULT FALSE;
commit 96d0855b26b1ff40af895755dbb04a6762a473fd
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Thu Apr 5 15:39:40 2012 -0400
Add "Simple" flag for selectors
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 at mvlc.org>
Signed-off-by: Ben Shum <bshum at biblio.org>
diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index c66eeaa..375f93f 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -790,6 +790,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
<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"/>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index af24ba4..e32fda3 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -743,7 +743,8 @@ CREATE TABLE config.coded_value_map (
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';
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql
index 4e409ec..6172f5e 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql
@@ -1,3 +1,4 @@
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;
diff --git a/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2 b/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2
index acb464e..18bb4a4 100644
--- a/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2
+++ b/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2
@@ -23,12 +23,23 @@
[% 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>
diff --git a/Open-ILS/web/opac/skin/default/js/adv_global.js b/Open-ILS/web/opac/skin/default/js/adv_global.js
index de29876..daf3e67 100644
--- a/Open-ILS/web/opac/skin/default/js/adv_global.js
+++ b/Open-ILS/web/opac/skin/default/js/adv_global.js
@@ -16,7 +16,7 @@ function advgInit() {
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();
commit 17f66a91636d1164199fc215e30b4771c451b5a9
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Thu Mar 29 16:39:10 2012 -0400
Add i18n tag to coded value map value/description
Because the seed data assumes they are translated, so tell the IDL.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Ben Shum <bshum at biblio.org>
diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 0da0727..c66eeaa 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -786,8 +786,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
<field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
<field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link" oils_obj:required="true"/>
<field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
- <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
- <field reporter:label="Description" name="description" reporter:datatype="text"/>
+ <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
+ <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"/>
</fields>
commit 3caf5a7f4e279219557d93ae231b228e844b5951
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Thu Mar 29 15:37:07 2012 -0400
Coded Value Maps Opac Visible/Search Labels
Add two new fields to Coded Value Maps:
1 - Opac Visible, for "does this show up in opac limiter boxes"
2 - Search Label, for "what does this get called for those boxes"
Intended use cases include:
Re-labeling MARC fields without changing the base MARC information, say
because you don't expect patrons to understand "Projected Medium".
Hiding things that don't apply, say the vast majority of language limiters,
without needing to delete rows.
I also hooked it up in JSPac, because it was easy to do so.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Ben Shum <bshum at biblio.org>
diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 10b5837..0da0727 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -788,6 +788,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
<field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
<field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
<field reporter:label="Description" name="description" reporter:datatype="text"/>
+ <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"/>
</fields>
<links>
<link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
index 3fd9983..6031eac 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -70,12 +70,18 @@ sub init_ro_object_cache {
# search for objects of class $hint where field=value
$cache{search}{$hint} = {};
$ro_object_subs->{$search_key} = sub {
- my ($field, $val) = @_;
+ my ($field, $val, $filterfield, $filterval) = @_;
my $method = "search_$eclass";
+ my $cacheval = $val;
+ my $search_obj = {$field => $val};
+ if($filterfield) {
+ $search_obj->{$filterfield} = $filterval;
+ $cacheval .= ':' . $filterfield . ':' . $filterval;
+ }
$cache{search}{$hint}{$field} = {} unless $cache{search}{$hint}{$field};
- $cache{search}{$hint}{$field}{$val} = $e->$method({$field => $val})
- unless $cache{search}{$hint}{$field}{$val};
- return $cache{search}{$hint}{$field}{$val};
+ $cache{search}{$hint}{$field}{$cacheval} = $e->$method($search_obj)
+ unless $cache{search}{$hint}{$field}{$cacheval};
+ return $cache{search}{$hint}{$field}{$cacheval};
};
}
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 734f3a9..af24ba4 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -737,11 +737,13 @@ CREATE TABLE config.record_attr_index_norm_map (
);
CREATE TABLE config.coded_value_map (
- id SERIAL PRIMARY KEY,
- ctype TEXT NOT NULL REFERENCES config.record_attr_definition (name) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
- code TEXT NOT NULL,
- value TEXT NOT NULL,
- description TEXT
+ id SERIAL PRIMARY KEY,
+ ctype TEXT NOT NULL REFERENCES config.record_attr_definition (name) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ code TEXT NOT NULL,
+ value TEXT NOT NULL,
+ description TEXT,
+ opac_visible BOOL NOT NULL DEFAULT TRUE, -- For TPac selectors
+ search_label TEXT
);
CREATE VIEW config.language_map AS SELECT code, value FROM config.coded_value_map WHERE ctype = 'item_lang';
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql
new file mode 100644
index 0000000..4e409ec
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.tpac_value_maps.sql
@@ -0,0 +1,3 @@
+ALTER TABLE config.coded_value_map
+ ADD COLUMN opac_visible BOOL NOT NULL DEFAULT TRUE,
+ ADD COLUMN search_label TEXT;
diff --git a/Open-ILS/src/templates/conify/global/config/coded_value_map.tt2 b/Open-ILS/src/templates/conify/global/config/coded_value_map.tt2
index b49804f..7354368 100644
--- a/Open-ILS/src/templates/conify/global/config/coded_value_map.tt2
+++ b/Open-ILS/src/templates/conify/global/config/coded_value_map.tt2
@@ -17,7 +17,7 @@
<table jsId="ccvmGrid"
autoHeight='true'
dojoType="openils.widget.AutoGrid"
- fieldOrder="['ctype', 'code', 'value', 'description']"
+ fieldOrder="['ctype', 'code', 'value', 'description', 'opac_visible', 'search_label']"
query="{code: '*'}"
defaultCellWidth='"25%"'
fmClass='ccvm'
diff --git a/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2 b/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2
index 0016b7a..acb464e 100644
--- a/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2
+++ b/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2
@@ -7,7 +7,7 @@
all_values = [];
attr_class = '';
FOR attr_class IN attr;
- all_values = ctx.search_ccvm('ctype', attr_class);
+ all_values = ctx.search_ccvm('ctype', attr_class, 'opac_visible', 't');
IF all_values.size > 0; LAST; END;
END;
name = name || "fi:" _ attr_class;
@@ -25,7 +25,7 @@
# leverage TT's array.sort('<hashkey>') behavior
sorter = [];
FOR o IN all_values;
- sorter.push({code => o.code, value => o.value});
+ sorter.push({code => o.code, value => (o.search_label ? o.search_label : o.value)});
END;
FOR o IN sorter.sort('value') %]
<option value='[% o.code | uri %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : '' %]>[% o.value | html %]</option>
diff --git a/Open-ILS/web/opac/skin/default/js/adv_global.js b/Open-ILS/web/opac/skin/default/js/adv_global.js
index 7422e90..de29876 100644
--- a/Open-ILS/web/opac/skin/default/js/adv_global.js
+++ b/Open-ILS/web/opac/skin/default/js/adv_global.js
@@ -16,7 +16,7 @@ function advgInit() {
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}});
+ var req = new Request('open-ils.fielder:open-ils.fielder.ccvm.atomic', {"cache":1,"query":{"ctype":ctypes, "opac_visible":"t"}});
req.callback(advDrawBibExtras);
req.request.ctypes = ctypes;
req.send();
@@ -156,13 +156,13 @@ function advDrawBibExtras(r) {
var ctypeData = dojo.filter(data, function(item) { return item.ctype == ctype } );
ctypeData = ctypeData.sort(
function(a,b) { /* sort alphabetically */
- return (a.value < b.value) ? -1 : 1;
+ return ((a.search_label ? a.search_label : a.value) < (b.search_label ? b.search_label : b.value)) ? -1 : 1;
}
);
dojo.forEach(ctypeData,
function(thing) {
- var opt = insertSelectorVal(sel, -1, thing.value, thing.code);
- opt.setAttribute('title', thing.value);
+ var opt = insertSelectorVal(sel, -1, (thing.search_label ? thing.search_label : thing.value), thing.code);
+ opt.setAttribute('title', (thing.search_label ? thing.search_label : thing.value));
}
);
}
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/examples/fm_IDL.xml | 7 +++++--
.../perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm | 14 ++++++++++----
Open-ILS/src/sql/Pg/002.schema.config.sql | 15 +++++++++------
.../src/sql/Pg/upgrade/0703.tpac_value_maps.sql | 12 ++++++++++++
.../conify/global/config/coded_value_map.tt2 | 2 +-
.../templates/opac/parts/coded_value_selector.tt2 | 19 +++++++++++++++----
Open-ILS/web/opac/skin/default/js/adv_global.js | 8 ++++----
7 files changed, 56 insertions(+), 21 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0703.tpac_value_maps.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list