From 4189114b0be6d83e56116e2024142ab7229a85e0 Mon Sep 17 00:00:00 2001 From: Denis Maier Date: Thu, 16 Nov 2023 09:50:45 +0100 Subject: [PATCH] Mehrere Bestellcodes korrekt verarbeiten (#22) * handle multiple order codes * bump version * change copyright year --- CHANGES.md | 3 +++ README.md | 2 +- .../scripts/zoteroswisscoveryubbernlocations.js | 15 ++++++++------- install.rdf | 2 +- makefile | 2 +- update.rdf | 6 +++--- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f5b4524..2098220 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/README.md b/README.md index be263c0..9be0218 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/chrome/content/scripts/zoteroswisscoveryubbernlocations.js b/chrome/content/scripts/zoteroswisscoveryubbernlocations.js index b0f71f7..d0e53cf 100644 --- a/chrome/content/scripts/zoteroswisscoveryubbernlocations.js +++ b/chrome/content/scripts/zoteroswisscoveryubbernlocations.js @@ -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) { @@ -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 @@ -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(); diff --git a/install.rdf b/install.rdf index dd4d8df..2ef390f 100644 --- a/install.rdf +++ b/install.rdf @@ -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" diff --git a/makefile b/makefile index 233c94f..1ab37a9 100644 --- a/makefile +++ b/makefile @@ -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 \ No newline at end of file diff --git a/update.rdf b/update.rdf index 563245f..b2a4ba6 100644 --- a/update.rdf +++ b/update.rdf @@ -5,13 +5,13 @@ - 0.2.8 + 0.2.9 zotero@chnm.gmu.edu 5.0 6.* - https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.8/zotero-swisscovery-ubbern-locations-0.2.8.xpi + https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.9/zotero-swisscovery-ubbern-locations-0.2.9.xpi @@ -19,7 +19,7 @@ juris-m@juris-m.github.io 5.0 6.* - https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.8/zotero-swisscovery-ubbern-locations-0.2.8.xpi + https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/v0.2.9/zotero-swisscovery-ubbern-locations-0.2.9.xpi