From: Chris Sharp Date: Mon, 2 Nov 2020 18:04:01 +0000 (-0500) Subject: LP#1277194: Optionally hide organizational units from staff client X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=91878d03877ed8011883382cdf6bb96f9d79b8e0;p=working%2FEvergreen.git LP#1277194: Optionally hide organizational units from staff client Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index a312c105ef..b7d75d1964 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -7018,6 +7018,7 @@ SELECT usr, + diff --git a/Open-ILS/src/eg2/src/app/core/org.service.ts b/Open-ILS/src/eg2/src/app/core/org.service.ts index 456f93f6f9..60bbf39263 100644 --- a/Open-ILS/src/eg2/src/app/core/org.service.ts +++ b/Open-ILS/src/eg2/src/app/core/org.service.ts @@ -13,6 +13,7 @@ interface OrgFilter { canHaveUsers?: boolean; canHaveVolumes?: boolean; opacVisible?: boolean; + staffVisible?: boolean; inList?: number[]; notInList?: number[]; } @@ -79,6 +80,10 @@ export class OrgService { if (ov && !this.opacVisible(org)) { return; } if (ov === false && this.opacVisible(org)) { return; } + const sv = filter.staffVisible; + if (sv && !this.staffVisible(org)) { return; } + if (sv === false && this.staffVisible(org)) { return; } + if (filter.inList && !filter.inList.includes(org.id())) { return; } @@ -134,6 +139,10 @@ export class OrgService { return this.get(nodeOrId).opac_visible() === 't'; } + staffVisible(nodeOrId): boolean { + return this.get(nodeOrId).staff_visible() === 't'; + } + // list of org_unit objects or IDs for me + descendants descendants(nodeOrId: OrgNodeOrId, asId?: boolean): any[] { const node = this.get(nodeOrId); diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html index 294d62c2bf..d0249eefd1 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html @@ -48,7 +48,7 @@ [record]="currentOrg().isnew() ? currentOrg() : null" [recordId]="currentOrg().isnew() ? null : currentOrg().id()" [showDelete]="!orgHasChildren()" - fieldOrder="parent_ou,ou_type,name,shortname,phone,email,opac_visible,fiscal_calendar" + fieldOrder="parent_ou,ou_type,name,shortname,phone,email,opac_visible,staff_visible,fiscal_calendar" hiddenFields="id,billing_address,mailing_address,holds_address,ill_address"> table( 'actor_org_unit' ); __PACKAGE__->columns( Primary => qw/id/); __PACKAGE__->columns( Essential => qw/parent_ou ou_type mailing_address billing_address - ill_address holds_address shortname name email phone opac_visible fiscal_calendar/); + ill_address holds_address shortname name email phone opac_visible staff_visible + fiscal_calendar/); #------------------------------------------------------------------------------- package actor::org_unit::hours_of_operation; diff --git a/Open-ILS/src/sql/Pg/005.schema.actors.sql b/Open-ILS/src/sql/Pg/005.schema.actors.sql index 33ae6282a1..4145bab877 100644 --- a/Open-ILS/src/sql/Pg/005.schema.actors.sql +++ b/Open-ILS/src/sql/Pg/005.schema.actors.sql @@ -348,6 +348,7 @@ CREATE TABLE actor.org_unit ( email TEXT, phone TEXT, opac_visible BOOL NOT NULL DEFAULT TRUE, + staff_visible BOOL NOT NULL DEFAULT TRUE, fiscal_calendar INT NOT NULL DEFAULT 1 -- foreign key constraint to be added later ); CREATE INDEX actor_org_unit_parent_ou_idx ON actor.org_unit (parent_ou); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1277194_add_staff_visible_aou_column.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1277194_add_staff_visible_aou_column.sql new file mode 100644 index 0000000000..dacaa1bb53 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1277194_add_staff_visible_aou_column.sql @@ -0,0 +1,8 @@ +BEGIN; + +-- check whether patch can be applied +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +ALTER TABLE actor.org_unit ADD COLUMN staff_visible BOOLEAN NOT NULL DEFAULT TRUE; + +COMMIT;