LP#1117808: new egFmValueSelector directive
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 23 Dec 2016 06:36:07 +0000 (01:36 -0500)
committerKathy Lussier <klussier@masslnc.org>
Fri, 17 Feb 2017 15:13:36 +0000 (10:13 -0500)
commit150d6c32d475f5eb56a8a3f7ef8eae88a7bedfb1
tree59607096d041d76588b05e66be0a71df8cc07d0d
parentabf20be081e1a4094f515ade4bb39e1ce312cd9f
LP#1117808: new egFmValueSelector directive

This directive supplies a select widget that draws its
values from a table specified by an IDL class code.  It
is meant to be used for tables containing a reasonably
small number of rows (i.e., dozens at most, not hundreds
or thousands).

The following attributes are available:

idl-class      : Code of IDL class to draw from, e.g., "vmp".
ng-model       : Model to bind the current selected value to.
filter         : JSON query filter to apply conditions on the set
                 of rows to be used. (optional)
sticky-setting : Local storage key to persist the last value
                 that was selected by the user. (optional)
ou-setting     : Name of library setting to use to set the default
                 selected value. If sticky-setting is used, any
                 previously-selected value will override the default
                 specified by the OU setting. (optional)

The list of values from the source table displayed in the select
widget are those that meet all of the following conditions:

- primary key is not null
- filter conditions (if supplied)
- logged-in user has PCRUD permissions to view the value

The option value is taken from the column in the source table
specified by the oils_persist:primary IDL attribute, while
the displayed label is taken from the column that has the
reporter:selector="name" IDL attribute.

Example:

<eg-fm-value-selector
  idl-class="vmp"
  ng-model="merge_profile"
  filter="{'preserve_spec':{'=':null}}"
  sticky-setting="eg.cat.z3950.selected_merge_profile"
  ou-setting="cat.default.merge_profile"
></eg-fm-value-selector>

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/share/t_fm_value_selector.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/services/ui.js