ssu-readinglists / readinglists

GNU General Public License v3.0
1 stars 0 forks source link

Need a settings based mechanism for mapping library abbreviations to full library names #60

Closed ostephens closed 11 years ago

ostephens commented 11 years ago

Currently mappings from library abbreviations available from Primo XML to full library names is hardcoded into ~/moodle/local/references/getdata.php; lines 500, 501

This needs to be moved into a setting.

Slightly more complex than a normal setting as could have any number of mappings needed. Options are:

1) Express mappings as a string with some convention as to how to parse the string: e.g. "ABB1" = "Full Name 1";"ABB2" = "Full Name 2" Risk here is errors in string would break code - would need to check that was valid in first place. It might be possible to offset this by having some javascript to present a form that saves to a single field?

2) Have a preset number of possible mappings and assume this is unlikely to be very high (e.g. unlikely to require more than 10 mappings) Could clog up page with empty settings that are there 'just in case'. Conversely may find some circumstances where need more than maximum number

3) Store mappings in a db table?

(1) seems most practical. Also easy to do a first pass and then add in better UI via javascript if time allows

ostephens commented 11 years ago

Setting now available. Use format: "ABB1":"Full name 1","ABB2":"Fullname 2"

i.e. Abbreviation in inverted commas, colon, Full name in inverted commas Separate each Abbrevation/Fullname pair by a comma

If this is not set, or not formatted correctly then the abbreviation will be used in the location information when the reference is added to RefWorks