[open-ils-commits] [GIT] Evergreen ILS branch master updated. a25aa4e66ce4080bac65cd702a1e51542d5bae7e
Evergreen Git
git at git.evergreen-ils.org
Mon Apr 2 12:11:23 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 a25aa4e66ce4080bac65cd702a1e51542d5bae7e (commit)
via 1108cfc0b3978dc0fd80566a2b654edcf6b99d55 (commit)
via 706f1e86f0b9e4b5423b1b355bd30db422316068 (commit)
via dee33cc9da90762dea9b9aa13190c65e80f07577 (commit)
via 1b7c563166d60ddee4a9c507f3eded07bc5e70c0 (commit)
from 37b324f53adb4fb90fe17ada72d44fca1d606e9f (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 a25aa4e66ce4080bac65cd702a1e51542d5bae7e
Author: Mike Rylander <mrylander at gmail.com>
Date: Mon Apr 2 12:17:51 2012 -0400
Stamping upgrade script for "Org unit selective hiding and sorting in tpac library selector"
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 34224b1..734f3a9 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 ('0701', :eg_version); -- sprater/bshum/tsbere
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0702', :eg_version); -- berick/miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql b/Open-ILS/src/sql/Pg/upgrade/0702.schema.org_unit_opac_vis_and_sorting.sql
similarity index 92%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
rename to Open-ILS/src/sql/Pg/upgrade/0702.schema.org_unit_opac_vis_and_sorting.sql
index d387280..0dd500e 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0702.schema.org_unit_opac_vis_and_sorting.sql
@@ -1,6 +1,6 @@
BEGIN;
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0702', :eg_version);
INSERT INTO config.global_flag (name, enabled, label)
VALUES (
commit 1108cfc0b3978dc0fd80566a2b654edcf6b99d55
Author: Bill Erickson <berick at esilibrary.com>
Date: Tue Mar 13 12:17:23 2012 -0400
Org unit sibling display sort order : admin UI
Adds a new menu entry for Local Admin called "Library Sort Order", where
staff can configure via drag-n-drop the sibling display order for org
units in the opac.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/templates/actor/org_unit/sibling_order.tt2 b/Open-ILS/src/templates/actor/org_unit/sibling_order.tt2
new file mode 100644
index 0000000..49050c3
--- /dev/null
+++ b/Open-ILS/src/templates/actor/org_unit/sibling_order.tt2
@@ -0,0 +1,57 @@
+[% WRAPPER base.tt2 %]
+[% ctx.page_title = l('Org Unit Sibling Order') %]
+<link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/js/dojo/dojo/resources/dnd.css'/>
+<style>
+ .dimple_img { padding-right: 5px; }
+ #child-table { margin-left: 15px; margin-top: 10px;}
+ #child-tbody td { padding: 5px 10px 5px 10px; }
+ #child-tbody tr:nth-child(odd) {
+ background-color:#E7A555;
+ border-left: 1px solid #4A4747;
+ border-right: 1px solid #4A4747;
+ }
+ #wrapper { width:100%; margin-top: 15px; }
+ #left-pane { float:left; padding-right: 20px; max-width: 40%; }
+ #right-pane { float:left; padding-left: 10px; max-width: 58%; }
+ #ol { border:2px dashed #4A4747; -moz-border-radius: 10px; padding: 5px; }
+</style>
+
+<h2>[% l('Org Unit Sibling Order') %]</h2>
+<hr/>
+
+<div id='wrapper'>
+ <div id='left-pane'>
+ <div>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+ </div>
+ <table id='child-table'>
+ <tbody id='child-tbody'>
+ <tr id='row-template'>
+ <td name='name'></td>
+ <td>
+ <img class='dimple_img' src="[% ctx.media_prefix %]/images/dimple.png"/>
+ <img class='dimple_img' src="[% ctx.media_prefix %]/images/dimple.png"/>
+ <img class='dimple_img' src="[% ctx.media_prefix %]/images/dimple.png"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div id='right-pane'>
+ <div id='ol'>
+ <ol>
+ <li>[% l('Select the org unit whose children you wish to sort.') %]</li>
+ <li>[% l('Drag the child org units up or down to change the position.') %]</li>
+ <li>[% l('After each drag operation, the changes are automatically saved.') %]</li>
+ <li>[% l('When finished, it will be necessary to restart/reload the web server (Apache) for the changes to take effect.') %]</li>
+ </ol>
+ </div>
+ </div>
+</div>
+
+<script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/actor/org_unit/sibling_order.js'> </script>
+[% END %]
diff --git a/Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js b/Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js
new file mode 100644
index 0000000..c06d98d
--- /dev/null
+++ b/Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js
@@ -0,0 +1,103 @@
+dojo.require("dijit.form.Button");
+dojo.require("dojo.dnd.Source");
+dojo.require("openils.User");
+dojo.require("openils.Util");
+dojo.require("openils.PermaCrud");
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+var user;
+var pcrud;
+var dndSource;
+
+function pageInit() {
+ user = new openils.User();
+ pcrud = new openils.PermaCrud({authtoken : user.authtoken});
+ fieldmapper.aou.slim_ok = false; // we need full orgs for updates
+
+ user.buildPermOrgSelector(
+ ['UPDATE_ORG_UNIT', 'ADMIN_ORG_UNIT'],
+ contextOrgSelector,
+ null,
+ function() {
+ dojo.connect(contextOrgSelector, 'onChange', drawChildren)
+ // set the value to the root of the tree (instead of ws_ou).
+ contextOrgSelector.store.fetch({
+ query : {id : '*'},
+ onComplete : function(list) {
+ contextOrgSelector.attr('value', list[0].id);
+ }
+ });
+ }
+ );
+}
+
+var tbody, rowTmpl;
+function drawChildren() {
+
+ if(!tbody) {
+ tbody = dojo.byId('child-tbody');
+ rowTmpl = tbody.removeChild(dojo.byId('row-template'));
+ dndSource = new dojo.dnd.Source(tbody);
+ dojo.connect(dndSource, 'onDndDrop', updateSiblingOrder);
+ }
+
+ dndSource.selectAll();
+ dndSource.deleteSelectedNodes();
+ dndSource.clearItems();
+
+ var org = fieldmapper.aou.findOrgUnit(contextOrgSelector.attr('value'));
+ if (!org.children()) return;
+
+ // fetch the full child org units
+ org.children(
+ org.children().map(
+ function(c) { return fieldmapper.aou.findOrgUnit(c.id()) }
+ )
+ );
+
+ // sort by sibling order, fall back to name
+ var children = org.children().sort(
+ function(a, b) {
+ if (a.sibling_order() < b.sibling_order()) {
+ return -1;
+ } else if (a.sibling_order() > b.sibling_order()) {
+ return 1;
+ } else if (a.name() < b.name()) {
+ return -1;
+ }
+ return 1;
+ }
+ );
+
+ dojo.forEach(
+ children,
+ function(child) {
+ var row = tbody.appendChild(rowTmpl.cloneNode(true));
+ row.setAttribute('child', child.id());
+ dojo.query('[name=name]', row)[0].innerHTML = child.name();
+ dndSource.insertNodes(false, [row]);
+ }
+ );
+}
+
+function updateSiblingOrder() {
+ var pos = 0;
+ var toUpdate = [];
+ dojo.forEach(
+ dndSource.getAllNodes(),
+ function(node) {
+ childId = node.getAttribute('child');
+ var child = fieldmapper.aou.findOrgUnit(childId);
+ if (child.sibling_order() != pos) {
+ child.sibling_order(pos);
+ toUpdate.push(child);
+ }
+ pos++;
+ }
+ );
+
+ if (toUpdate.length == 0) return;
+ pcrud.update(toUpdate); // run sync to prevent UI changes mid-update
+}
+
+openils.Util.addOnLoad(pageInit);
diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 38b9866..e42c1a1 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -2068,6 +2068,7 @@
<!ENTITY staff.server.admin.index.closed_dates "Closed Dates Editor">
<!ENTITY staff.server.admin.index.copy_locations "Copy Locations Editor">
<!ENTITY staff.server.admin.index.library_settings "Library Settings Editor">
+<!ENTITY staff.server.admin.index.library_sort_order "Library Sort Order">
<!ENTITY staff.server.admin.index.non_cataloged_types "Non-cataloged Types Editor">
<!ENTITY staff.server.admin.index.statistical_categories "Statistical Categories Editor">
<!ENTITY staff.server.admin.index.expired_holds_shelf "Expired Holds Shelf Printable Listing">
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
index 4ca96d8..bc35694 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
@@ -1106,6 +1106,17 @@ main.menu.prototype = {
);
}
],
+ 'cmd_local_admin_lib_sort_order' : [
+ ['oncommand'],
+ function(event) {
+ open_eg_web_page(
+ "/eg/actor/org_unit/sibling_order",
+ "menu.cmd_local_admin_lib_sort_order.tab",
+ event
+ );
+ }
+ ],
+
'cmd_reprint' : [
['oncommand'],
function() {
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
index bd98d4b..67752f5 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
@@ -124,6 +124,7 @@
/>
<command id="cmd_local_admin_copy_locations" />
<command id="cmd_local_admin_lib_settings" />
+ <command id="cmd_local_admin_lib_sort_order" />
<command id="cmd_local_admin_non_cat_types" />
<command id="cmd_local_admin_stat_cats" />
<command id="cmd_local_admin_standing_penalty" />
@@ -505,6 +506,7 @@
<menuitem label="&staff.main.menu.admin.local_admin.conify.grp_penalty_threshold.label;" command="cmd_local_admin_grp_penalty_threshold"/>
<menuitem label="&staff.main.menu.admin.local_admin.hold_matrix_matchpoint.label;" command="cmd_local_admin_hold_matrix_matchpoint"/>
<menuitem label="&staff.server.admin.index.library_settings;" command="cmd_local_admin_lib_settings"/>
+ <menuitem label="&staff.server.admin.index.library_sort_order;" command="cmd_local_admin_lib_sort_order"/>
<menuitem label="&staff.server.admin.index.non_cataloged_types;" command="cmd_local_admin_non_cat_types"/>
<menuitem label="&staff.main.menu.admin.local_admin.conify.action_trigger.label;" command="cmd_local_admin_action_trigger"/>
<menuitem label="&staff.main.menu.admin.local_admin.patrons_due_refunds.label;" accesskey="&staff.main.menu.admin.local_admin.patrons_due_refunds.accesskey;" command="cmd_local_admin_patrons_due_refunds"/>
diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
index 961ad06..4f30313 100644
--- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
+++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
@@ -252,6 +252,7 @@ menu.cmd_booking_resource.tab=Resources
menu.cmd_booking_reservation.tab=Reservations
menu.cmd_booking_reservation_pickup.tab=Reservation Pickup
menu.cmd_booking_reservation_return.tab=Reservation Return
+menu.cmd_local_admin_lib_sort_order.tab=Library Sort Order
menu.cmd_booking_pull_list.tab=Booking Pull List
menu.cmd_booking_capture.tab=Booking Capture
menu.cmd_authority_manage.tab=Manage Authorities
commit 706f1e86f0b9e4b5423b1b355bd30db422316068
Author: Bill Erickson <berick at esilibrary.com>
Date: Tue Mar 13 12:15:33 2012 -0400
Repaired non-slim org unit fetching bug
Fixed an old thinko. When fetching a full org unit object, set the
children org unit array value instead of clobbering the function.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js b/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
index 8a1000c..87582d3 100644
--- a/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
+++ b/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js
@@ -56,7 +56,7 @@ if(!dojo._hasResource["fieldmapper.OrgUtils"]){
if(!(o && o.id)) {
throw new Error("fieldmapper.aou.LoadOrg(): No org unit found with ID " + id);
}
- o.children = fieldmapper.aou.OrgCache[o.id()].children;
+ o.children(slim_o.org.children());
fieldmapper.aou.OrgCache[o.id()] = { loaded : true, org : o };
return o;
};
commit dee33cc9da90762dea9b9aa13190c65e80f07577
Author: Bill Erickson <berick at esilibrary.com>
Date: Mon Mar 12 14:11:47 2012 -0400
Org unit sibling display sort order
Adds a new "sibling_order" column to actor.org_unit which specifies the
order in which an org unit should be sorted as compared to its sibling
org units in org unit trees.
This commit adds the IDL/DB components. It also updates the tpac and
the generic get_org_tree API. (Note, a follow-up commit will be pushed
to remove some deprecated / reduntant org tree retrievals).
Note that the sibling_order values do not have to be unique within each
set of siblings. The org unit name is still used as a tie-breaker sort,
so if the sort order is left unset (i.e. all values are 0), org units
will fall back to name-only sorting.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index c9357ba..8de132d 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -4944,6 +4944,7 @@ SELECT usr,
<field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
</fields>
<links>
<link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
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 f46587f..aa0be42 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -87,7 +87,7 @@ sub init_ro_object_cache {
{ parent_ou => undef},
{ flesh => -1,
flesh_fields => {aou => ['children']},
- order_by => {aou => 'name'}
+ order_by => {aou => 'sibling_order, name'}
}
])->[0];
diff --git a/Open-ILS/src/sql/Pg/005.schema.actors.sql b/Open-ILS/src/sql/Pg/005.schema.actors.sql
index 4f9f39b..2a4429c 100644
--- a/Open-ILS/src/sql/Pg/005.schema.actors.sql
+++ b/Open-ILS/src/sql/Pg/005.schema.actors.sql
@@ -295,7 +295,8 @@ CREATE TABLE actor.org_unit (
email TEXT,
phone TEXT,
opac_visible BOOL NOT NULL DEFAULT TRUE,
- fiscal_calendar INT NOT NULL DEFAULT 1 -- foreign key constraint to be added later
+ fiscal_calendar INT NOT NULL DEFAULT 1, -- foreign key constraint to be added later
+ sibling_order INT NOT NULL DEFAULT 0
);
CREATE INDEX actor_org_unit_parent_ou_idx ON actor.org_unit (parent_ou);
CREATE INDEX actor_org_unit_ou_type_idx ON actor.org_unit (ou_type);
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
index 115613a..d387280 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
@@ -14,11 +14,19 @@ INSERT INTO config.global_flag (name, enabled, label)
)
);
+ALTER TABLE actor.org_unit ADD COLUMN
+ sibling_order INTEGER NOT NULL DEFAULT 0;
+
+ALTER TABLE auditor.actor_org_unit_history ADD COLUMN
+ sibling_order INTEGER NOT NULL DEFAULT 0;
+
COMMIT;
/* UNDO
BEGIN;
DELETE FROM config.global_flag WHERE name = 'opac.org_unit.non_inheritied_visibility';
+ALTER TABLE actor.org_unit DROP COLUMN sibling_order;
+ALTER TABLE auditor.actor_org_unit_history DROP COLUMN sibling_order;
COMMIT;
*/
commit 1b7c563166d60ddee4a9c507f3eded07bc5e70c0
Author: Bill Erickson <berick at esilibrary.com>
Date: Mon Mar 12 12:22:22 2012 -0400
TPac: non-inherited org unit visibility
Adds support for displaying org units that are children of hidden org
units in the tpac org unit selector. A new global flag was added to
control this behavior called "opac.org_unit.non_inheritied_visibility" /
"Org Units Do Not Inherit Visibility".
To avoid confusion / distorted org unit trees, children of hidden org
units are left-padded one less for each hidden parent org unit. For
example, in the stock org tree, if Sys2 is opac_visible=false (and the
global flag is enabled), the tree in the tpac would appear like so:
Cons
- Sys 1
-- BR1
--- SL1
-- BR2
- BR3
- BR4
Similarly, if CONS was also hidden, the whole tree would be shifted left
by 1 pad depth.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 6c97858..4bb8f3b 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -11541,3 +11541,16 @@ INSERT INTO action_trigger.environment (event_def, path)
INSERT INTO actor.toolbar(org,label,layout) VALUES
( 1, 'circ', '["circ_checkout","circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","patron_search","patron_register","toolbarspacer.3","hotkeys_toggle"]' ),
( 1, 'cat', '["circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","create_marc","authority_manage","retrieve_last_record","toolbarspacer.3","hotkeys_toggle"]' );
+
+INSERT INTO config.global_flag (name, enabled, label)
+ VALUES (
+ 'opac.org_unit.non_inheritied_visibility',
+ FALSE,
+ oils_i18n_gettext(
+ 'opac.org_unit.non_inheritied_visibility',
+ 'Org Units Do Not Inherit Visibility',
+ 'cgf',
+ 'label'
+ )
+ );
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
new file mode 100644
index 0000000..115613a
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
@@ -0,0 +1,24 @@
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.global_flag (name, enabled, label)
+ VALUES (
+ 'opac.org_unit.non_inheritied_visibility',
+ FALSE,
+ oils_i18n_gettext(
+ 'opac.org_unit.non_inheritied_visibility',
+ 'Org Units Do Not Inherit Visibility',
+ 'cgf',
+ 'label'
+ )
+ );
+
+COMMIT;
+
+/* UNDO
+BEGIN;
+DELETE FROM config.global_flag WHERE name = 'opac.org_unit.non_inheritied_visibility';
+COMMIT;
+*/
+
diff --git a/Open-ILS/src/templates/opac/parts/org_selector.tt2 b/Open-ILS/src/templates/opac/parts/org_selector.tt2
index fd9c8c0..49775c4 100644
--- a/Open-ILS/src/templates/opac/parts/org_selector.tt2
+++ b/Open-ILS/src/templates/opac/parts/org_selector.tt2
@@ -8,6 +8,8 @@
BLOCK build_org_selector;
node_stack = [{org => org_unit || ctx.aou_tree}];
+ inherited_vis = ctx.get_cgf('opac.org_unit.non_inheritied_visibility').enabled == 'f';
+
IF !name;
name = 'loc';
IF show_loc_groups; name = 'locg'; END;
@@ -30,8 +32,10 @@ BLOCK build_org_selector;
css_class = '';
disabled = '';
selected = '';
+ visible = org_unit.opac_visible == 't';
- NEXT UNLESS ctx.is_staff || org_unit.opac_visible == 't';
+ # org and all children are invisible.
+ NEXT IF !visible AND inherited_vis AND !ctx.is_staff;
IF !loc_grp; # processing an org unit
@@ -57,11 +61,15 @@ BLOCK build_org_selector;
FOR grp IN top_loc_groups;
node_stack.push({org => org_unit, loc_grp => grp});
END;
+
END;
+ # This org unit is not publicly visible (though its children may be).
+ NEXT UNLESS ctx.is_staff OR visible;
+
node_value = ou_id;
- IF loc_grp; node_value = node_value _ ':' _ loc_grp.id; END;
IF loc_grp;
+ node_value = node_value _ ':' _ loc_grp.id;
css_class = 'class="loc_grp"';
ELSE;
css_class = 'class="org_unit"';
@@ -71,20 +79,31 @@ BLOCK build_org_selector;
disabled = 'disabled="disabled"';
ELSIF node_value == value;
selected = 'selected="selected"';
- END %]
+ END;
+
+ pad_depth = org_unit.ou_type.depth;
+
+ # copy loc groups appear as children of the owner (current) org
+ SET pad_depth = pad_depth + 1 IF loc_grp;
+
+ # for each parent org unit that is hidden, decrease the pad depth by one.
+ IF !ctx.is_staff;
+ porg = ctx.get_aou(org_unit.parent_ou);
+ WHILE porg;
+ SET pad_depth = pad_depth - 1 IF porg.opac_visible == 'f';
+ porg = ctx.get_aou(porg.parent_ou);
+ END;
+ END;
+
+ pad_depth = pad_depth * 2;
+ display_name = loc_grp ? loc_grp.name : org_unit.name;
+
+ %]
<option value='[% node_value %]' [% selected %] [% disabled %] [% css_class %]>
- [%
- # loc_grp's are displayed as children of the current org
- depth = org_unit.ou_type.depth;
- IF loc_grp; depth = depth + 1; END;
- pad = depth * 2;
- FOR idx IN [0..pad]; ' '; END;
- loc_grp ? loc_grp.name : org_unit.name | html ;
- %]
+ [% ' ' FOR [0..pad_depth]; display_name | html %]
</option>
- [%
- END;
- %]
+
+ [% END %]
</select>
[% END %]
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/examples/fm_IDL.xml | 1 +
.../perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm | 2 +-
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/005.schema.actors.sql | 3 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 13 +++
.../0702.schema.org_unit_opac_vis_and_sorting.sql | 32 ++++++
.../src/templates/actor/org_unit/sibling_order.tt2 | 57 +++++++++++
Open-ILS/src/templates/opac/parts/org_selector.tt2 | 47 ++++++---
Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js | 2 +-
.../js/ui/default/actor/org_unit/sibling_order.js | 103 ++++++++++++++++++++
Open-ILS/web/opac/locale/en-US/lang.dtd | 1 +
.../xul/staff_client/chrome/content/main/menu.js | 11 ++
.../chrome/content/main/menu_frame_menus.xul | 2 +
.../chrome/locale/en-US/offline.properties | 1 +
14 files changed, 259 insertions(+), 18 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0702.schema.org_unit_opac_vis_and_sorting.sql
create mode 100644 Open-ILS/src/templates/actor/org_unit/sibling_order.tt2
create mode 100644 Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list