Skip to content

Commit

Permalink
Mehrere Bestellcodes korrekt verarbeiten (#22)
Browse files Browse the repository at this point in the history
* handle multiple order codes

* bump version

* change copyright year
  • Loading branch information
denismaier authored Nov 16, 2023
1 parent 49b64d8 commit 4189114
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Änderungen

## 0.2.9
- Mehrere Bestellcode-Tags korrekt im Feld Band speichern

## 0.2.8
- Kompatibilitätsupdate für Zotero 6.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Das Addon befindet sich in einem frühen Entwicklungsstadium. Bisher sind nur di

## License

Copyright (C) 2019--2022 Denis Maier
Copyright (C) 2019--2023 Denis Maier

Distributed under the GPLv3 License.
15 changes: 8 additions & 7 deletions chrome/content/scripts/zoteroswisscoveryubbernlocations.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ Zotero.swisscoveryubbernlocations.orderNoteFromTags = async function () {
tags = item.getTags();
// initialize vars
let ddcs = [];
let orderCode = "";
let orderCodes = [];
let budgetCode = "";
// iterate over tags
for (let tag of tags) {
Expand All @@ -494,7 +494,8 @@ Zotero.swisscoveryubbernlocations.orderNoteFromTags = async function () {
}
else if (tag.tag.startsWith("BC")) {
// tag is an orderCode
orderCode = tag.tag.substring(3);
orderCodeText = tag.tag.substring(3);
orderCodes.push(orderCodeText);
}
else if (tag.tag.startsWith("ETAT")) {
// tag is an budgetCode
Expand All @@ -503,11 +504,11 @@ Zotero.swisscoveryubbernlocations.orderNoteFromTags = async function () {
}
// construct orderNote
let orderNote = [];
orderNote.push(budgetCode)
orderNote.push(ddcs.join(', '))
orderNote.push(orderCode)
orderNote = orderNote.filter(Boolean)
orderNote = orderNote.join(' // ')
orderNote.push(budgetCode);
orderNote.push(ddcs.join(', '));
orderNote.push(orderCodes.join(', ')); // maybe better use a semicolon?
orderNote = orderNote.filter(Boolean);
orderNote = orderNote.join(' // ');
// update volume field and save item
item.setField('volume', orderNote);
await item.saveTx();
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RDF:about="urn:mozilla:install-manifest"
em:id="zoteroswisscoveryubbernlocations@ubbe.org"
em:name="Zotero Swisscovery UB Bern Locations"
em:version="0.2.8"
em:version="0.2.9"
em:type="2"
em:creator="Denis Maier"
em:description="Zotero/Jurism-Plugin zur Bestandsabfrage im Swisscovery UB Bern"
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile

VERSION = 0.2.8
VERSION = 0.2.9

build:
7z a -tzip -r zotero-swisscovery-ubbern-locations-$(VERSION).xpi chrome/* defaults/* chrome.manifest install.rdf options.xul
6 changes: 3 additions & 3 deletions update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.2.8</em:version>
<em:version>0.2.9</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>zotero@chnm.gmu.edu</em:id>
<em:minVersion>5.0</em:minVersion>
<em:maxVersion>6.*</em:maxVersion>
<em:updateLink>https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.8/zotero-swisscovery-ubbern-locations-0.2.8.xpi</em:updateLink>
<em:updateLink>https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.9/zotero-swisscovery-ubbern-locations-0.2.9.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>
<em:targetApplication>
<rdf:Description>
<em:id>juris-m@juris-m.github.io</em:id>
<em:minVersion>5.0</em:minVersion>
<em:maxVersion>6.*</em:maxVersion>
<em:updateLink>https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.8/zotero-swisscovery-ubbern-locations-0.2.8.xpi</em:updateLink>
<em:updateLink>https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.9/zotero-swisscovery-ubbern-locations-0.2.9.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>
</rdf:Description>
Expand Down

0 comments on commit 4189114

Please sign in to comment.