Stat cats can now have a sip_field and sip_format.
sip_field is the field identifier code, sip_format is one of the following:
1 - Null/Empty, places stat cat value in as-is
2 - A plain string, placed in value as-is when stat cat has value
3 - A plain string with a %s, 1 and 2 combined, where the stat cat value replaces the %s
4 - A regular expression surrounded by | characters (ex, |([0-9]*) -|):
If the regular expression does not match the value, nothing
If the regular expression matches and has a capture group, the captured group
If the regular expression matches and does not have a capture group, the entire match
The | was used because it would otherwise be stripped from the final result anyway.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
<field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
<field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
<field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
+ <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
+ <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
<field reporter:label="Required" name="required" reporter:datatype="bool"/>
</fields>
<links>
<link field="owner" reltype="has_a" key="id" map="" class="aou"/>
+ <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
<link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
</links>
</class>
<link field="usr" reltype="has_a" key="id" map="" class="au"/>
</links>
</class>
+ <class id="actscsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_sip_fields" oils_persist:tablename="actor.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
+ <fields oils_persist:primary="field">
+ <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
+ <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
+ <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
+ </fields>
+ <links/>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
+ <retrieve />
+ <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
+ <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
+ </actions>
+ </permacrud>
+ </class>
<class id="actsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat" oils_persist:tablename="actor.stat_cat" reporter:label="User Statistical Category">
<fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
<field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
<field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
<field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
+ <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
+ <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
</fields>
<links>
<link field="owner" reltype="has_a" key="id" map="" class="aou"/>
+ <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
<link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<link field="owner" reltype="has_a" key="id" map="" class="aou"/>
</links>
</class>
-
+ <class id="ascsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_sip_fields" oils_persist:tablename="asset.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
+ <fields oils_persist:primary="field">
+ <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
+ <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
+ <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
+ </fields>
+ <links/>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
+ <retrieve />
+ <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
+ <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
+ </actions>
+ </permacrud>
+ </class>
<class id="ahrcc" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="action::hold_request_cancel_cause" oils_persist:tablename="action.hold_request_cancel_cause" oils_persist:restrict_primary="100" reporter:label="Hold Request Cancel Cause">
<fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
<field reporter:label="Cause ID" name="id" reporter:datatype="id" />
__PACKAGE__->table( 'actor_stat_cat' );
__PACKAGE__->columns( Primary => qw/id/ );
-__PACKAGE__->columns( Essential => qw/owner name opac_visible usr_summary/ );
+__PACKAGE__->columns( Essential => qw/owner name opac_visible usr_summary sip_field sip_format/ );
#-------------------------------------------------------------------------------
package actor::stat_cat_entry;
__PACKAGE__->table( 'asset_stat_cat' );
__PACKAGE__->columns( Primary => qw/id/ );
-__PACKAGE__->columns( Essential => qw/owner name opac_visible required/ );
+__PACKAGE__->columns( Essential => qw/owner name opac_visible sip_field sip_format required/ );
#-------------------------------------------------------------------------------
package asset::stat_cat_entry;
{
flesh => 3,
flesh_fields => {
- acp => [ 'circ_lib', 'call_number', 'status' ],
+ acp => [ 'circ_lib', 'call_number', 'status', 'stat_cat_entry_copy_maps' ],
acn => [ 'owning_lib', 'record' ],
+ ascecm => [ 'stat_cat', 'stat_cat_entry' ],
}
}
]
return 0;
}
+sub extra_fields {
+ my( $self ) = @_;
+ my $extra_fields = {};
+ my $c = $self->{copy};
+ foreach my $stat_cat_entry (@{$c->stat_cat_entry_copy_maps}) {
+ my $stat_cat = $stat_cat_entry->stat_cat;
+ next unless ($stat_cat->sip_field);
+ my $value = $stat_cat_entry->stat_cat_entry->value;
+ if(defined $stat_cat->sip_format && length($stat_cat->sip_format) > 0) { # Has a format string?
+ if($stat_cat->sip_format =~ /^\|(.*)\|$/) { # Regex match?
+ if($value =~ /($1)/) { # If we have a match
+ if(defined $2) { # Check to see if they embedded a capture group
+ $value = $2; # If so, use it
+ }
+ else { # No embedded capture group?
+ $value = $1; # Use our outer one
+ }
+ }
+ else { # No match?
+ $value = ''; # Empty string. Will be checked for below.
+ }
+ }
+ else { # Not a regex match - Try sprintf match (looking for a %s, if any)
+ $value = sprintf($stat_cat->sip_format, $value);
+ }
+ }
+ next unless length($value) > 0; # No value = no export
+ $value =~ s/\|//g; # Remove all lingering pipe chars for sane output purposes
+ $extra_fields->{ $stat_cat->sip_field } = [] unless (defined $extra_fields->{$stat_cat->sip_field});
+ push(@{$extra_fields->{ $stat_cat->sip_field}}, $value);
+ }
+ return $extra_fields;
+}
+
1;
__END__
"billing_address",
"mailing_address",
'profile',
+ "stat_cat_entries",
+ ],
+ actscecm => [
+ "stat_cat",
],
}
};
return $name;
}
+sub extra_fields {
+ my( $self ) = @_;
+ my $extra_fields = {};
+ my $u = $self->{user};
+ foreach my $stat_cat_entry (@{$u->stat_cat_entries}) {
+ my $stat_cat = $stat_cat_entry->stat_cat;
+ next unless ($stat_cat->sip_field);
+ my $value = $stat_cat_entry->stat_cat_entry;
+ if(defined $stat_cat->sip_format && length($stat_cat->sip_format) > 0) { # Has a format string?
+ if($stat_cat->sip_format =~ /^\|(.*)\|$/) { # Regex match?
+ if($value =~ /($1)/) { # If we have a match
+ if(defined $2) { # Check to see if they embedded a capture group
+ $value = $2; # If so, use it
+ }
+ else { # No embedded capture group?
+ $value = $1; # Use our outer one
+ }
+ }
+ else { # No match?
+ $value = ''; # Empty string. Will be checked for below.
+ }
+ }
+ else { # Not a regex match - Try sprintf match (looking for a %s, if any)
+ $value = sprintf($stat_cat->sip_format, $value);
+ }
+ }
+ next unless length($value) > 0; # No value = no export
+ $value =~ s/\|//g; # Remove all lingering pipe chars for sane output purposes
+ $extra_fields->{ $stat_cat->sip_field } = [] unless (defined $extra_fields->{$stat_cat->sip_field});
+ push(@{$extra_fields->{ $stat_cat->sip_field}}, $value);
+ }
+ return $extra_fields;
+}
1;
CREATE INDEX actor_usr_setting_usr_idx ON actor.usr_setting (usr);
+CREATE TABLE actor.stat_cat_sip_fields (
+ field CHAR(2) PRIMARY KEY,
+ name TEXT NOT NULL,
+ one_only BOOL NOT NULL DEFAULT FALSE
+);
+COMMENT ON TABLE actor.stat_cat_sip_fields IS $$
+Actor Statistical Category SIP Fields
+
+Contains the list of valid SIP Field identifiers for
+Statistical Categories.
+$$;
CREATE TABLE actor.stat_cat (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
opac_visible BOOL NOT NULL DEFAULT FALSE,
usr_summary BOOL NOT NULL DEFAULT FALSE,
+ sip_field CHAR(2) REFERENCES actor.stat_cat_sip_fields(field) ON UPDATE CASCADE ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
+ sip_format TEXT,
CONSTRAINT sc_once_per_owner UNIQUE (owner,name)
);
COMMENT ON TABLE actor.stat_cat IS $$
CREATE INDEX actor_stat_cat_entry_usr_idx ON actor.stat_cat_entry_usr_map (target_usr);
+CREATE FUNCTION actor.stat_cat_check() RETURNS trigger AS $func$
+DECLARE
+ sipfield actor.stat_cat_sip_fields%ROWTYPE;
+ use_count INT;
+BEGIN
+ IF NEW.sip_field IS NOT NULL THEN
+ SELECT INTO sipfield * FROM actor.stat_cat_sip_fields WHERE field = NEW.sip_field;
+ IF sipfield.one_only THEN
+ SELECT INTO use_count count(id) FROM actor.stat_cat WHERE sip_field = NEW.sip_field AND id != NEW.id;
+ IF use_count > 0 THEN
+ RAISE EXCEPTION 'Sip field cannot be used twice';
+ END IF;
+ END IF;
+ END IF;
+ RETURN NEW;
+END;
+$func$ LANGUAGE PLPGSQL;
+
+CREATE TRIGGER actor_stat_cat_sip_update_trigger
+ BEFORE INSERT OR UPDATE ON actor.stat_cat FOR EACH ROW
+ EXECUTE PROCEDURE actor.stat_cat_check();
+
CREATE TABLE actor.card (
id SERIAL PRIMARY KEY,
usr INT NOT NULL REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED,
BEFORE UPDATE ON asset.copy
FOR EACH ROW EXECUTE PROCEDURE asset.acp_status_changed();
+CREATE TABLE asset.stat_cat_sip_fields (
+ field CHAR(2) PRIMARY KEY,
+ name TEXT NOT NULL,
+ one_only BOOL NOT NULL DEFAULT FALSE
+);
+COMMENT ON TABLE asset.stat_cat_sip_fields IS $$
+Asset Statistical Category SIP Fields
+
+Contains the list of valid SIP Field identifiers for
+Statistical Categories.
+$$;
+
CREATE TABLE asset.stat_cat_entry_transparency_map (
id BIGSERIAL PRIMARY KEY,
stat_cat INT NOT NULL, -- needs ON DELETE CASCADE
opac_visible BOOL NOT NULL DEFAULT FALSE,
name TEXT NOT NULL,
required BOOL NOT NULL DEFAULT FALSE,
+ sip_field CHAR(2) REFERENCES asset.stat_cat_sip_fields(field) ON UPDATE CASCADE ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
+ sip_format TEXT,
CONSTRAINT sc_once_per_owner UNIQUE (owner,name)
);
);
CREATE INDEX scecm_owning_copy_idx ON asset.stat_cat_entry_copy_map(owning_copy);
+CREATE FUNCTION asset.stat_cat_check() RETURNS trigger AS $func$
+DECLARE
+ sipfield asset.stat_cat_sip_fields%ROWTYPE;
+ use_count INT;
+BEGIN
+ IF NEW.sip_field IS NOT NULL THEN
+ SELECT INTO sipfield * FROM asset.stat_cat_sip_fields WHERE field = NEW.sip_field;
+ IF sipfield.one_only THEN
+ SELECT INTO use_count count(id) FROM asset.stat_cat WHERE sip_field = NEW.sip_field AND id != NEW.id;
+ IF use_count > 0 THEN
+ RAISE EXCEPTION 'Sip field cannot be used twice';
+ END IF;
+ END IF;
+ END IF;
+ RETURN NEW;
+END;
+$func$ LANGUAGE PLPGSQL;
+
+CREATE TRIGGER asset_stat_cat_sip_update_trigger
+ BEFORE INSERT OR UPDATE ON asset.stat_cat FOR EACH ROW
+ EXECUTE PROCEDURE asset.stat_cat_check();
+
CREATE TABLE asset.copy_note (
id BIGSERIAL PRIMARY KEY,
owning_copy BIGINT NOT NULL,
<!ENTITY staff.main.menu.admin.server_admin.conify.config_circ_weights "Circulation Matchpoint Weights">
<!ENTITY staff.main.menu.admin.server_admin.conify.config_hold_weights "Hold Matchpoint Weights">
<!ENTITY staff.main.menu.admin.server_admin.conify.config_weight_assoc "Weights Association">
+<!ENTITY staff.main.menu.admin.server_admin.conify.config_actor_sip_fields "Actor Stat Cat Sip Fields">
+<!ENTITY staff.main.menu.admin.server_admin.conify.config_asset_sip_fields "Asset Stat Cat Sip Fields">
<!ENTITY staff.main.menu.admin.server_admin.conify.global_flag.label "Global Flags">
<!ENTITY staff.main.menu.admin.server_admin.acq.label "Acquisitions">
<!ENTITY staff.server.admin.stat_cat.copy_stat_cats "Copy Statistical Categories">
<!ENTITY staff.server.admin.stat_cat.patron_stat_cats "Patron Statistical Categories">
<!ENTITY staff.server.admin.stat_cat.info_prompt "* To edit or view information about an entry, click on the entry in the drop-down menu">
+<!ENTITY staff.server.admin.stat_cat.sip_field_warning "** Some sip fields may only be valid on one stat cat. Entries using them may not save.">
<!ENTITY staff.server.admin.stat_cat.none_defined "No statistical categories are defined">
<!ENTITY staff.server.admin.stat_cat.name.label "Statistical Category Name">
<!ENTITY staff.server.admin.stat_cat.owning_library.label "Owning Library">
<!ENTITY staff.server.admin.stat_cat.new_entry_name "Enter the value of the new entry: ">
<!ENTITY staff.server.admin.stat_cat.new_entry_create "Create new entry">
<!ENTITY staff.server.admin.stat_cat.update_success "Update succeeded">
+<!ENTITY staff.server.admin.stat_cat.sip_field "SIP Field: ">
+<!ENTITY staff.server.admin.stat_cat.sip_field.none "No SIP Export">
+<!ENTITY staff.server.admin.stat_cat.sip_format "SIP Format: ">
+<!ENTITY staff.server.admin.stat_cat.sip_field.label "SIP Field">
+<!ENTITY staff.server.admin.stat_cat.sip_format.label "SIP Format">
+<!ENTITY staff.server.admin.stat_cat.sip_field.none.label "No SIP">
<!ENTITY staff.server.admin.upload_xacts.title "Upload Offline Transactions">
<!ENTITY staff.server.admin.upload_xacts.header "Uploading transactions...">
<!ENTITY staff.server.admin.upload_xacts.upload "Upload">
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Actor Stat Cat Sip Fields' %]
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Actor Stat Cat Sip Fields</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='actorSipFieldsGrid.showCreateDialog()'>New Sip Field</button>
+ <button dojoType='dijit.form.Button' onClick='actorSipFieldsGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+ </div>
+ <div>
+ <table jsId="actorSipFieldsGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['field', 'name', 'one_only']"
+ query="{field: '*'}"
+ fmClass='actscsf'
+ defaultCellWidth='15'
+ editOnEnter='true'/>
+</div>
+
+<script type="text/javascript">
+ dojo.require('openils.Util');
+ dojo.require('openils.widget.AutoGrid');
+ openils.Util.addOnLoad( function() { actorSipFieldsGrid.loadAll(); } );
+</script>
+[% END %]
+
+
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Asset Stat Cat Sip Fields' %]
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Asset Stat Cat Sip Fields</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='assetSipFieldsGrid.showCreateDialog()'>New Sip Field</button>
+ <button dojoType='dijit.form.Button' onClick='assetSipFieldsGrid.deleteSelected()'>Delete Selected</button>
+ </div>
+ </div>
+ <div>
+ <table jsId="assetSipFieldsGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['field', 'name', 'one_only']"
+ query="{field: '*'}"
+ fmClass='ascsf'
+ defaultCellWidth='15'
+ editOnEnter='true'/>
+</div>
+
+<script type="text/javascript">
+ dojo.require('openils.Util');
+ dojo.require('openils.widget.AutoGrid');
+ openils.Util.addOnLoad( function() { assetSipFieldsGrid.loadAll(); } );
+</script>
+[% END %]
+
+
['oncommand'],
function(event) { open_eg_web_page('conify/global/config/weight_assoc', null, event); }
],
+ 'cmd_server_admin_config_actor_sip_fields' : [
+ ['oncommand'],
+ function(event) { open_eg_web_page('conify/global/config/actor_sip_fields', null, event); }
+ ],
+ 'cmd_server_admin_config_asset_sip_fields' : [
+ ['oncommand'],
+ function(event) { open_eg_web_page('conify/global/config/asset_sip_fields', null, event); }
+ ],
'cmd_local_admin_external_text_editor' : [
['oncommand'],
function() {
<command id="cmd_server_admin_config_weight_assoc"
perm="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT"
/>
+ <command id="cmd_server_admin_config_actor_sip_fields"
+ perm="CREATE_PATRON_STAT_CAT"
+ />
+ <command id="cmd_server_admin_config_asset_sip_fields"
+ perm="CREATE_COPY_STAT_CAT"
+ />
<command id="cmd_hotkeys_toggle" />
<command id="cmd_hotkeys_set" />
<menuitem label="&staff.main.menu.admin.server_admin.conify.config_circ_weights;" command="cmd_server_admin_config_circ_weights"/>
<menuitem label="&staff.main.menu.admin.server_admin.conify.config_hold_weights;" command="cmd_server_admin_config_hold_weights"/>
<menuitem label="&staff.main.menu.admin.server_admin.conify.config_weight_assoc;" command="cmd_server_admin_config_weight_assoc"/>
+ <menuitem label="&staff.main.menu.admin.server_admin.conify.config_actor_sip_fields;" command="cmd_server_admin_config_actor_sip_fields"/>
+ <menuitem label="&staff.main.menu.admin.server_admin.conify.config_asset_sip_fields;" command="cmd_server_admin_config_asset_sip_fields"/>
<menu id="main.menu.admin.server.acq" label="&staff.main.menu.admin.server_admin.acq.label;" accesskey="&staff.main.menu.admin.server_admin.acq.accesskey;">
<menupopup id="main.menu.admin.server.acq.popup">
<menuitem label="&staff.main.menu.admin.server_admin.acq.fund.label;" accesskey="&staff.main.menu.admin.server_admin.acq.fund.accesskey;" command="cmd_server_admin_acq_fund" />
var SC_FETCH_ALL = 'open-ils.circ:open-ils.circ.stat_cat.TYPE.retrieve.all';
+var SC_FETCH_SF = 'open-ils.pcrud:open-ils.pcrud.search.PCRUD.atomic';
var SC_CREATE = 'open-ils.circ:open-ils.circ.stat_cat.TYPE.create';
var SC_UPDATE = 'open-ils.circ:open-ils.circ.stat_cat.TYPE.update';
var SC_DELETE = 'open-ils.circ:open-ils.circ.stat_cat.TYPE.delete';
PERMS[ACTOR] = {};
PERMS[ASSET] = {};
+var PCRUD_CLASS = {};
+PCRUD_CLASS[ACTOR] = 'actscsf';
+PCRUD_CLASS[ASSET] = 'ascsf';
+
+scSFCache = {};
+
var currentlyVisible;
var opacVisible = false;
var cgi;
}, 20 );
}
+function scPopSipFields( selector, type ) {
+ while(selector.lastChild.value != '') selector.removeChild(selector.lastChild);
+ if(!scSFCache[type]) {
+ var req = new Request(
+ SC_FETCH_SF.replace(/PCRUD/, PCRUD_CLASS[type]) , session, { 'field' : { '!=' : null } } );
+ req.send(true);
+ scSFCache[type] = req.result();
+ }
+ for(var f in scSFCache[type]) {
+ var option = document.createElement('option');
+ option.value = scSFCache[type][f].field();
+ option.appendChild(text(scSFCache[type][f].name() + ' (' + scSFCache[type][f].field() + ')' + (isTrue(scSFCache[type][f].one_only()) ? '**' : '')));
+ selector.appendChild(option);
+ }
+}
function scGo() {
var show = cgi.param('show');
else
unHideMe($n(row, 'sc_opac_invisible'));
+ if(cat.sip_field().length != 2)
+ unHideMe($n(row, 'sc_sip_field_none'));
+ else {
+ $n(row, 'sc_sip_field_value').appendChild( text( cat.sip_field() ) );
+ unHideMe($n(row, 'sc_sip_field_value'));
+ }
+
+ $n(row, 'sc_sip_format_td').appendChild( text( cat.sip_format() ) );
+
+
if(type == ACTOR) {
if(isTrue(cat.usr_summary()))
unHideMe($n(row, 'sc_usr_summary_on'));
hideMe($('required_td2'));
unHideMe($('usr_summary_td1'));
unHideMe($('usr_summary_td2'));
+ unHideMe($('sip_tr'));
break;
case ASSET:
hideMe($('usr_summary_td1'));
hideMe($('usr_summary_td2'));
+ hideMe($('sip_tr'));
unHideMe($('required_td1'));
unHideMe($('required_td2'));
break;
libSel.disabled = false;
}
buildMergedOrgSel(libSel, org_list, 0, 'shortname');
+ scPopSipFields($('sc_sip_field'),type);
}
cat = new asc();
cat.required( required );
}
+ var field = getSelectorVal($('sc_sip_field'));
+ if(field.length == 2) cat.sip_field(field);
+ else cat.sip_field(null);
+ cat.sip_format($('sc_sip_format').value);
cat.opac_visible(visible);
cat.name(name);
if(r.nextSibling) { tbody.insertBefore( row, r.nextSibling ); }
else{ tbody.appendChild(row); }
+ scPopSipFields($n(row, 'sc_edit_sip_field'), type);
$n(row, 'sc_edit_name').value = cat.name();
+ setSelector($n(row, 'sc_edit_sip_field'), cat.sip_field());
+ $n(row, 'sc_edit_sip_format').value = cat.sip_format();
if(type == ACTOR) {
var cb = $n(row, 'sc_edit_usr_summary');
var usr_summary = $n(row, 'sc_edit_usr_summary').checked;
var required = $n(row, 'sc_edit_required').checked;
+ var sip_field = getSelectorVal( $n(row, 'sc_edit_sip_field') );
cat.name( name );
cat.owner( newlib );
cat.entries(null);
cat.opac_visible(0);
+ if(sip_field.length == 2) cat.sip_field( sip_field );
+ else cat.sip_field(null);
+ cat.sip_format($n(row, 'sc_edit_sip_format').value);
if( visible ) cat.opac_visible(1);
switch(type) {
case ACTOR:
<span>&staff.server.admin.stat_cat.off;</span>
<input type='radio' name='usr_summary' checked='checked'> </input>
</td>
-
+ </tr>
+ <tr>
+ <td>&staff.server.admin.stat_cat.sip_field;</td>
+ <td>
+ <select name='sip_field' id='sc_sip_field'>
+ <option value=''>&staff.server.admin.stat_cat.sip_field.none;</option>
+ </select>
+ </td>
+ <td>&staff.server.admin.stat_cat.sip_format;</td>
+ <td><input type='text' name='sip_format' id='sc_sip_format' /></td>
</tr>
<tr>
<td colspan='4'>
<br/>
<div>&staff.server.admin.stat_cat.info_prompt;</div>
+ <div>&staff.server.admin.stat_cat.sip_field_warning;</div>
<br/>
<div style='padding: 20px;' id='sc_none' class='hide_me'><b>&staff.server.admin.stat_cat.none_defined;</b></div>
<td>&staff.server.admin.stat_cat.opac_visibility.label;</td>
<td id='sc_required_label'>&staff.server.admin.stat_cat.required.label;</td>
<td id='sc_usr_summary_label'>&staff.server.admin.stat_cat.usr_summary.label;</td>
+ <td>&staff.server.admin.stat_cat.sip_field.label;</td>
+ <td>&staff.server.admin.stat_cat.sip_format.label;</td>
<td>&staff.server.admin.stat_cat.entries.label;</td>
<td>&staff.server.admin.stat_cat.add_entry;</td>
<td>&staff.server.admin.stat_cat.edit;</td>
<span class='hide_me' name='sc_usr_summary'>&staff.server.admin.stat_cat.off;</span>
</td>
<td>
+ <span class='hide_me' name='sc_sip_field_none'>&staff.server.admin.stat_cat.sip_field.none.label;</span>
+ <span class='hide_me' name='sc_sip_field_value' />
+ </td>
+ <td name='sc_sip_format_td'/>
+ <td>
<select class='selector' name='sc_entries_selector'>
<option>&staff.server.admin.stat_cat.none;</option>
</select>
<td name='sc_edit_usr_summary_td'>
<input type='checkbox' name='sc_edit_usr_summary'/>
</td>
+ <td>
+ <select name='sc_edit_sip_field'>
+ <option value=''>&staff.server.admin.stat_cat.sip_field.none;</option>
+ </select>
+ </td>
+ <td name='sc_edit_sip_format_td'>
+ <input type='text' name='sc_edit_sip_format'/>
+ </td>
<td colspan='4'>
<span class='padded'>
<input type='submit' value='&staff.server.admin.stat_cat.edit_submit;' name='sc_edit_submit'/>