diff --git a/css/00-central-package.css b/css/00-central-package.css index 779ff44..3f7dcce 100644 --- a/css/00-central-package.css +++ b/css/00-central-package.css @@ -120,6 +120,9 @@ /*445 Details*/ +/*446 Export options*/ + + /*449 Other*/ @@ -957,11 +960,27 @@ button.switch-to-simple.zero-margin.button-with-icon.md-button.md-primoExplore-t /*Resource type filter bar*/ +prm-resource-type-filter-bar button.md-button.md-primoExplore-theme.md-ink-ripple { + + border-radius: 3px; + border-style: solid; + border-width: 1px; + border-color: #00000000; + margin: 5px 6px 5px 0; +} + prm-resource-type-filter-bar button.md-button.md-primoExplore-theme.md-ink-ripple:hover { + + border-style: solid; + border-width: 1px; font-weight: 500; cursor: pointer; } +prm-resource-type-filter-bar button.md-button.md-primoExplore-theme.md-ink-ripple:hover span { + box-shadow: none; +} + /*220 Frames*/ /*Genialy requests guide*/ @@ -1202,6 +1221,55 @@ div[data-facet-value="institution-5501"] { display: none !important; } +/*Open Knowledge Maps*/ + +.eth-okm-link { + height: auto !important; + line-height: normal !important; + margin-bottom: 5px; +} + +.eth-okm-link a { + padding-top: 3px; + padding-bottom: 3px; + overflow: visible; + white-space: normal; + display: flex; + margin-right: 40px; + text-align: left; + align-items: center; +} + +.eth-okm-link a span { + color: #3a3a3a; + line-height: 1.2em; + border-radius: 3px; + padding: 3px 0.25em; +} + +.eth-okm-link strong:hover a span, +.eth-okm-link strong:focus a span { + color: #fff; + background-color: #3a3a3a; +} + +.eth-okm-link a img { + width: 20px; + height: 20px; + vertical-align: middle; + margin-right: 5px; +} + +/*Hide the "Open Knowledge Maps" link fully (facet group and okm link)*/ +.okm-full { + display: block; +} + +/*Hide the "Open Knowledge Maps" link in the facet group*/ +eth-okm-link-component { + display: block; +} + /*390 Other*/ @@ -1591,7 +1659,7 @@ prm-alma-other-units>button>div>h3, order: 7 !important; } -[aria-label="Send to"] { +[aria-label="Export Options"] { order: 8 !important; } @@ -1642,7 +1710,7 @@ prm-alma-other-units>button>div>h3, order: 7 !important; } -[aria-label="Senden an"] { +[aria-label="Exportoptionen"] { order: 8 !important; } @@ -1693,7 +1761,7 @@ prm-alma-other-units>button>div>h3, order: 7 !important; } -[aria-label="Envoyer vers"] { +[aria-label="Exporter"] { order: 8 !important; } @@ -1744,7 +1812,7 @@ prm-alma-other-units>button>div>h3, order: 7 !important; } -[aria-label="Invia a"] { +[aria-label="Esportare"] { order: 8 !important; } @@ -2298,6 +2366,114 @@ md-list.md-primoExplore-theme.icnLblOtherUnitsE { margin-top: -5px; } +/*446 Export options*/ + +/*Send email form*/ + +.send-email-info-box { + width: 60%; + border: 1px solid black; + border-radius: 5px; + padding: 18px 26px; + margin-bottom: 20px; + text-align: justify; +} + +@media (min-width: 600px) and (max-width: 959px) { + .send-email-info-box { + width: 80%; + } +} + +@media (max-width: 599px) { + .send-email-info-box { + width: 100%; + } +} + +label[translate="email.to"], +label[translate="email.note"] { + color: #848484 !important; +} + +/*Citation export**/ + +.slsp-citation-select-radio .md-container { + position: absolute; + top: 50%; + transform: translateY(-50%); + box-sizing: border-box; + display: inline-block; + width: 20px; + height: 20px; + cursor: pointer; + left: 0; + right: auto; +} + +.slsp-citation-select-radio .md-container:before { + box-sizing: border-box; + background-color: transparent; + border-radius: 50%; + content: ""; + position: absolute; + display: block; + height: auto; + left: 0; + top: 0; + right: 0; + bottom: 0; + transition: all .5s; + width: auto; +} + +.slsp-citation-select-radio .md-on, +.slsp-citation-select-radio .md-off { + box-sizing: border-box; + position: absolute; + top: 0; + left: 0; + width: 20px; + height: 20px; + border-radius: 50%; +} + +.slsp-citation-select-radio .md-off { + border-color: rgba(0, 0, 0, .57); +} + +.slsp-citation-select-radio .md-off { + border-style: solid; + border-width: 2px; + transition: border-color .28s ease; +} + +.slsp-citation-select-radio>span { + display: inline-block; + margin-left: 20px; + vertical-align: middle; +} + +.slsp-citation-select-radio:hover:not([disabled]), +.slsp-citation-select-radio:focus:not([disabled]) { + color: unset !important; + background-color: unset !important; +} + +.slsp-citation-select-radio .md-on { + transition: transform .28s ease; + transform: scale(0); +} + +.slsp-citation-select-radio.md-active .md-on { + transform: scale(.5); +} + +.slsp-citation-select-radio.md-active .md-on { + background-color: #4E4A99 !important; + /* add to custom css - background of the primary color*/ +} + /*449 Other*/ @@ -3494,7 +3670,8 @@ prm-resource-type-filter-bar prm-icon { color: #fff !important; } -button.switch-to-advanced.zero-margin.button-with-icon.md-button.md-primoExplore-theme.md-ink-ripple { +button.switch-to-advanced.zero-margin.button-with-icon.md-button.md-primoExplore-theme.md-ink-ripple, +prm-resource-type-filter-bar button.md-button.md-primoExplore-theme.md-ink-ripple:hover { border-color: #fff !important; } diff --git a/js/main.js b/js/main.js index 23c6196..24e6a11 100644 --- a/js/main.js +++ b/js/main.js @@ -3,10 +3,13 @@ import { hsgHowovpAfterModule } from './modules/alma-howovp-after/hsg-howovp-aft import { hsgHtgiSvcAfterModule } from './modules/alma-htgi-svc-after/hsg-htgi-svc-after.module' import { hsgAlertMessageModule } from './modules/hsg-alert-message/hsg-alert-message.module' import { hsgExceptionHandlerModule } from './modules/hsg-exception-handler/hsg-exception-handler.module' -import { hsgAlmaOtherMembersAfterModule } from './modules/prm-alma-other-members-after/hsg-alma-other-members-after.module' import { hsgHomeModule } from './modules/hsg-home/hsg-home.module' +import { hsgAlmaOtherMembersAfterModule } from './modules/prm-alma-other-members-after/hsg-alma-other-members-after.module' +import { hsgAlmaOtherUnitsAfterModule } from './modules/prm-alma-other-units-after/hsg-alma-other-units-after.module' +import { hsgAlmaViewerAfterModule } from './modules/prm-alma-viewer-after/hsg-alma-viewer-after.module' import { hsgAlmaViewitAfterModule } from './modules/prm-alma-viewit-after/hsg-alma-viewit-after.module' import { hsgAlmaViewitItemsAfterModule } from './modules/prm-alma-viewit-items-after/hsg-alma-viewit-items-after.module' +import { hsgCitationAfterModule } from './modules/prm-citation-after/hsg-citation-after.module' import { hsgFinesAfterModule } from './modules/prm-fines-after/hsg-fines-after.module' import { hsgFullViewAfterModule } from './modules/prm-full-view-after/hsg-full-view-after.module' import { hsgGalleryItemAfterModule } from './modules/prm-gallery-item-after/hsg-gallery-item-after.module' @@ -18,11 +21,13 @@ import { hsgLocationItemsAfterModule } from './modules/prm-location-items-after/ import { hsgLocationsAfterModule } from './modules/prm-locations-after/hsg-locations-after.module' import { hsgLoginAfterModule } from './modules/prm-login-after/hsg-login-after.module' import { hsgOfferDetailsTileAfterModule } from './modules/prm-offer-details-tile-after/hsg-offer-details-tile-after.module' +import { hsgOpacAfterModule } from './modules/prm-opac-after/hsg-opac-after.module' import { hsgPersonalInfoAfterModule } from './modules/prm-personal-info-after/hsg-personal-info-after.module' import { hsgRequestAfterModule } from './modules/prm-request-after/hsg-request-after.module' import { hsgRequestsAfterModule } from './modules/prm-requests-after/hsg-requests-after.module' import { hsgSearchBarAfterModule } from './modules/prm-search-bar-after/hsg-search-bar-after.module' import { hsgSearchResultAvailabilityLineAfterModule } from './modules/prm-search-result-availability-line-after/hsg-search-result-availabilty-line-after.module' +import { hsgSendEmailAfterModule } from './modules/prm-send-email-after/hsg-send-email-after.module' import { hsgServiceButtonAfterModule } from './modules/prm-service-button-after/hsg-service-button-after.module' import { hsgServiceDetailsAfterModule } from './modules/prm-service-details-after/hsg-service-details-after.module' import { hsgServiceNgrsAfterModule } from './modules/prm-service-ngrs-after/hsg-service-ngrs-after.module' @@ -32,10 +37,8 @@ import { hsgStandAloneLoginAfterModule } from './modules/prm-stand-alone-login-a import { hsgTabsAndScopesSelectorAfterModule } from './modules/prm-tabs-and-scopes-selector-after/hsg-tabs-and-scopes-selector-after.module' import { hsgUnionCatalogLoginAfterModule } from './modules/prm-union-catalog-login-after/hsg-union-catalog-login-after.module' import { hsgUserAreaExpandableAfterModule } from './modules/prm-user-area-expandable-after/hsg-user-ara-expandable-after.module' -import { hsgAlmaOtherUnitsAfterModule } from './modules/prm-alma-other-units-after/hsg-alma-other-units-after.module' import { slspHttpInterceptPickupInformation } from './modules/slsp-http-intercept-pickup-information/slsp-http-intercept-pickup-information.module' import { slspHttpInterceptRequestsModule } from './modules/slsp-http-intercept-requests/slsp-http-intercept-requests.module' -import { hsgAlmaViewerAfterModule } from './modules/prm-alma-viewer-after/hsg-alma-viewer-after.module' let app = angular.module('viewCustom', ['angularLoad']) @@ -48,6 +51,7 @@ app.requires.push(hsgAlmaOtherMembersAfterModule.name) app.requires.push(hsgAlmaViewerAfterModule.name) app.requires.push(hsgAlmaViewitAfterModule.name) app.requires.push(hsgAlmaViewitItemsAfterModule.name) +app.requires.push(hsgCitationAfterModule.name) app.requires.push(hsgFinesAfterModule.name) app.requires.push(hsgFullViewAfterModule.name) app.requires.push(hsgGalleryItemAfterModule.name) @@ -59,11 +63,13 @@ app.requires.push(hsgLocationItemsAfterModule.name) app.requires.push(hsgLocationsAfterModule.name) app.requires.push(hsgLoginAfterModule.name) app.requires.push(hsgOfferDetailsTileAfterModule.name) +app.requires.push(hsgOpacAfterModule.name) app.requires.push(hsgPersonalInfoAfterModule.name) app.requires.push(hsgRequestAfterModule.name) app.requires.push(hsgRequestsAfterModule.name) app.requires.push(hsgSearchBarAfterModule.name) app.requires.push(hsgSearchResultAvailabilityLineAfterModule.name) +app.requires.push(hsgSendEmailAfterModule.name) app.requires.push(hsgServiceButtonAfterModule.name) app.requires.push(hsgServiceDetailsAfterModule.name) app.requires.push(hsgServiceNgrsAfterModule.name) diff --git a/js/modules/prm-citation-after/hsg-citation-after.module.js b/js/modules/prm-citation-after/hsg-citation-after.module.js new file mode 100644 index 0000000..6500438 --- /dev/null +++ b/js/modules/prm-citation-after/hsg-citation-after.module.js @@ -0,0 +1,11 @@ +import { slspCitationSelectModule } from './slsp-citation-select/slsp-citation-select.module' + +export const hsgCitationAfterModule = angular + .module('hsgCitationAfterModule', []) + .component('prmCitationAfter', { + bindings: { parentCtrl: '<' }, + template: ` + ` + }) + +hsgCitationAfterModule.requires.push(slspCitationSelectModule.name) diff --git a/js/modules/prm-citation-after/slsp-citation-select/slsp-citation-select.controller.js b/js/modules/prm-citation-after/slsp-citation-select/slsp-citation-select.controller.js new file mode 100644 index 0000000..1eaa17f --- /dev/null +++ b/js/modules/prm-citation-after/slsp-citation-select/slsp-citation-select.controller.js @@ -0,0 +1,24 @@ +export class slspCitationSelectController { + + constructor($scope, $timeout, $compile) { + this.$scope = $scope + this.$timeout = $timeout + this.$compile = $compile + } + + $onInit() { + this.$timeout(() => { + this.parentCtrl = this.afterCtrl.parentCtrl + + let citationSelectRadio = '
' + + let citationSelectList = document.querySelectorAll('prm-citation ul li button') + + angular.forEach(citationSelectList, (citationSelect) => { + angular.element(citationSelect).append(this.$compile(citationSelectRadio)(this.$scope)).addClass('slsp-citation-select-radio') + }) + }, 0) + } +} + +slspCitationSelectController.$inject = ['$scope', '$timeout', '$compile'] diff --git a/js/modules/prm-citation-after/slsp-citation-select/slsp-citation-select.module.js b/js/modules/prm-citation-after/slsp-citation-select/slsp-citation-select.module.js new file mode 100644 index 0000000..33f0f03 --- /dev/null +++ b/js/modules/prm-citation-after/slsp-citation-select/slsp-citation-select.module.js @@ -0,0 +1,9 @@ +import { slspCitationSelectController } from './slsp-citation-select.controller' + +export const slspCitationSelectModule = angular + .module('slspCitationSelectModule', []) + .controller('slspCitationSelectController', slspCitationSelectController) + .component('slspCitationSelectComponent', { + bindings: { afterCtrl: '<' }, + controller: 'slspCitationSelectController', + }) diff --git a/js/modules/prm-fines-after/slsp-closed-fines-bar/slsp-closed-fines-bar.controller.js b/js/modules/prm-fines-after/slsp-closed-fines-bar/slsp-closed-fines-bar.controller.js index 86482d2..4a184e2 100644 --- a/js/modules/prm-fines-after/slsp-closed-fines-bar/slsp-closed-fines-bar.controller.js +++ b/js/modules/prm-fines-after/slsp-closed-fines-bar/slsp-closed-fines-bar.controller.js @@ -1,8 +1,7 @@ export class slspClosedFinesBarController { - constructor($scope) { this.$scope = $scope - this.showClosedFines = false // Variable für Anzeige-Status hinzufügen + this.showClosedFines = false } $onInit() { @@ -13,18 +12,28 @@ export class slspClosedFinesBarController { if (this.parentCtrl.finesTypeDropDownSelection === 'closed' || this.parentCtrl.finesTypeDropDownSelection === 'all') { const currentFinesArray = this.parentCtrl.totalNumOfFines if (angular.isArray(currentFinesArray) && currentFinesArray.length > 0) { - let hasClosedFines = false // Variable für geschlossene Fines hinzufügen + let hasClosedFines = false angular.forEach(currentFinesArray, (fine) => { - if (fine.fineType === 'CLOSED') { - hasClosedFines = true // Geschlossene Fines vorhanden + if (fine.fineType === 'CLOSED' && !fine.firstWordRemoved) { + hasClosedFines = true + + //replace the first 2 words in the line right text with the fine data + let fineData = fine.expandedDisplay[0].data + let firstLineRightText = fine.firstLineRight + const words = firstLineRightText.split(/\s+/) + words.splice(0, 2) + words.unshift(fineData) + fine.firstLineRight = words.join(' ') + fine.firstWordRemoved = true + //console.log(fine); } }) - this.showClosedFines = hasClosedFines // Anzeige-Status aktualisieren + this.showClosedFines = hasClosedFines } else { - this.showClosedFines = false // Keine Fines vorhanden + this.showClosedFines = false } } else { - this.showClosedFines = false // Dropdown-Auswahl entspricht nicht 'closed' oder 'all' + this.showClosedFines = false } } } diff --git a/js/modules/prm-location-item-after/hsg-location-item-after.module.js b/js/modules/prm-location-item-after/hsg-location-item-after.module.js index f734249..fc0e7ba 100644 --- a/js/modules/prm-location-item-after/hsg-location-item-after.module.js +++ b/js/modules/prm-location-item-after/hsg-location-item-after.module.js @@ -1,5 +1,6 @@ import { hsgDisplayItemPolicyModule } from './hsg-display-item-policy/hsg-display-item-policy.module' import { slspCugPolicyModule } from './slsp-cug-policy/slsp-cug-policy.module' +import { slspOvpItemReservationModule } from './slsp-ovp-item-reservation/slsp-ovp-item-reservation.module' export const hsgLocationItemAfterModule = angular .module('hsgLocationItemAfterModule', []) @@ -7,9 +8,11 @@ export const hsgLocationItemAfterModule = angular bindings: { parentCtrl: '<' }, template: ` + ` }) hsgLocationItemAfterModule.requires.push(hsgDisplayItemPolicyModule.name) hsgLocationItemAfterModule.requires.push(slspCugPolicyModule.name) +hsgLocationItemAfterModule.requires.push(slspOvpItemReservationModule.name) diff --git a/js/modules/prm-location-item-after/slsp-ovp-item-reservation/slsp-ovp-item-reservation.controller.js b/js/modules/prm-location-item-after/slsp-ovp-item-reservation/slsp-ovp-item-reservation.controller.js new file mode 100644 index 0000000..f13dfde --- /dev/null +++ b/js/modules/prm-location-item-after/slsp-ovp-item-reservation/slsp-ovp-item-reservation.controller.js @@ -0,0 +1,40 @@ + +export class slspOvpItemReservationController { + constructor($scope, $element, $compile) { + this.$scope = $scope + this.$element = $element + this.$compile = $compile + this.itemReservationLabel = '' + } + + $onInit() { + this.parentCtrl = this.afterCtrl.parentCtrl + this.processDoCheck = true + } + + $doCheck() { + let unavailability = this.parentCtrl.currLoc.location.singleUnavailableItemProcessType + + // Hier das DOM-Element der Angular-Komponente abrufen + let currentElement = this.$element[0] + + // Das Elternelement ("md-list-item") der Angular-Komponente abrufen + let prmOpacElement = currentElement.closest('md-list-item') + + // Den Button innerhalb des aktuellen "md-list-item" Teils auswählen + let itemReservationButton = prmOpacElement.querySelector('prm-service-button button span[translate="AlmaItemRequest"]') + + if (!this.processDoCheck && unavailability !== null) { + // Überprüfen, ob das Element gefunden wurde, bevor auf innerHTML zugegriffen wird + if (itemReservationButton && !itemReservationButton.innerHTML.includes('customized.rapido.reservation')) { + // Element mit "itemReservationLabel" ersetzen + let compiledHtml = this.$compile(this.itemReservationLabel)(this.$scope) + angular.element(itemReservationButton).replaceWith(compiledHtml) + } + } + //console.log(this.parentCtrl.currLoc); + this.processDoCheck = false + } +} + +slspOvpItemReservationController.$inject = ['$scope', '$element', '$compile'] diff --git a/js/modules/prm-location-item-after/slsp-ovp-item-reservation/slsp-ovp-item-reservation.module.js b/js/modules/prm-location-item-after/slsp-ovp-item-reservation/slsp-ovp-item-reservation.module.js new file mode 100644 index 0000000..49c5883 --- /dev/null +++ b/js/modules/prm-location-item-after/slsp-ovp-item-reservation/slsp-ovp-item-reservation.module.js @@ -0,0 +1,10 @@ +import { slspOvpItemReservationController } from './slsp-ovp-item-reservation.controller' + + +export const slspOvpItemReservationModule = angular + .module('slspOvpItemReservationModule', []) + .controller('slspOvpItemReservationController', slspOvpItemReservationController) + .component('slspOvpItemReservationComponent', { + bindings: { afterCtrl: '<' }, + controller: 'slspOvpItemReservationController', + }) diff --git a/js/modules/prm-login-after/slsp-login-box/slsp-login-box.controller.js b/js/modules/prm-login-after/slsp-login-box/slsp-login-box.controller.js index 7497ee4..af5d73b 100644 --- a/js/modules/prm-login-after/slsp-login-box/slsp-login-box.controller.js +++ b/js/modules/prm-login-after/slsp-login-box/slsp-login-box.controller.js @@ -1,16 +1,18 @@ export class slspLoginBoxController { - constructor($scope, $compile, $timeout) { + constructor($scope, $compile, $timeout, $rootScope, $window) { this.$scope = $scope this.$compile = $compile this.$timeout = $timeout + this.$rootScope = $rootScope + this.$window = $window } $onInit() { this.$timeout(() => { this.parentCtrl = this.afterCtrl.parentCtrl - let buttonHelp = '' + let buttonHelp = '' let infoLabel = '

' @@ -19,8 +21,18 @@ export class slspLoginBoxController { let authMeth2 = angular.element(document.querySelectorAll(`prm-login div > md-content > md-list > md-list-item:nth-child(2)`)) angular.element(authMeth2).append(this.$compile(infoLabel)(this.$scope)).addClass('authMethAlma') + }, 0) } + + getLanguage() { + let sms = this.$rootScope.$$childHead.$ctrl.userSessionManagerService + if (!sms) { + return 'en' + } else { + return sms.getUserLanguage() || $window.appConfig['primo-view']['attributes-map'].interfaceLanguage + } + } } -slspLoginBoxController.$inject = ['$scope', '$compile', '$timeout'] +slspLoginBoxController.$inject = ['$scope', '$compile', '$timeout', '$rootScope', '$window'] diff --git a/js/modules/prm-login-after/slsp-login-box/slsp-login-box.html b/js/modules/prm-login-after/slsp-login-box/slsp-login-box.html index 41a8e0d..c11a77f 100644 --- a/js/modules/prm-login-after/slsp-login-box/slsp-login-box.html +++ b/js/modules/prm-login-after/slsp-login-box/slsp-login-box.html @@ -1,5 +1,5 @@
- + diff --git a/js/modules/prm-opac-after/hsg-opac-after.module.js b/js/modules/prm-opac-after/hsg-opac-after.module.js new file mode 100644 index 0000000..f5ad568 --- /dev/null +++ b/js/modules/prm-opac-after/hsg-opac-after.module.js @@ -0,0 +1,11 @@ +import { slspOvpReservationModule } from './slsp-ovp-reservation/slsp-ovp-reservation.module' + +export const hsgOpacAfterModule = angular + .module('hsgOpacAfterModule', []) + .component('prmOpacAfter', { + bindings: { parentCtrl: '<' }, + template: `` + }) + + +hsgOpacAfterModule.requires.push(slspOvpReservationModule.name) diff --git a/js/modules/prm-opac-after/slsp-ovp-reservation/slsp-ovp-reservation.controller.js b/js/modules/prm-opac-after/slsp-ovp-reservation/slsp-ovp-reservation.controller.js new file mode 100644 index 0000000..82e2e75 --- /dev/null +++ b/js/modules/prm-opac-after/slsp-ovp-reservation/slsp-ovp-reservation.controller.js @@ -0,0 +1,39 @@ +export class slspOvpReservationController { + constructor($scope, $element, $compile) { + this.$scope = $scope + this.$element = $element + this.$compile = $compile + this.reservationLabel = '' + } + + $onInit() { + this.parentCtrl = this.afterCtrl.parentCtrl + this.processDoCheck = true + } + + $doCheck() { + let unavailability = this.parentCtrl.item.delivery.bestlocation.availabilityStatus + + // Hier das DOM-Element der Angular-Komponente abrufen + let currentElement = this.$element[0] + + // Das Elternelement ("prm-opac") der Angular-Komponente abrufen + let prmOpacElement = currentElement.closest('prm-opac') + + // Den Button innerhalb des aktuellen "prm-opac" Teils auswählen + let reservationButton = prmOpacElement.querySelector('prm-service-button button span[translate="AlmaRequest"], prm-service-button button span[translate="AlmaRequestOther"]') + + if (!this.processDoCheck && unavailability !== "available") { + // Überprüfen, ob das Element gefunden wurde, bevor auf innerHTML zugegriffen wird + if (reservationButton && !reservationButton.innerHTML.includes('customized.rapido.reservation')) { + // Element mit "reservationLabel" ersetzen + let compiledHtml = this.$compile(this.reservationLabel)(this.$scope) + angular.element(reservationButton).replaceWith(compiledHtml) + } + } + //console.log(this.parentCtrl); + this.processDoCheck = false + } +} + +slspOvpReservationController.$inject = ['$scope', '$element', '$compile'] diff --git a/js/modules/prm-opac-after/slsp-ovp-reservation/slsp-ovp-reservation.module.js b/js/modules/prm-opac-after/slsp-ovp-reservation/slsp-ovp-reservation.module.js new file mode 100644 index 0000000..eaf4b2d --- /dev/null +++ b/js/modules/prm-opac-after/slsp-ovp-reservation/slsp-ovp-reservation.module.js @@ -0,0 +1,10 @@ +import { slspOvpReservationController } from './slsp-ovp-reservation.controller' + + +export const slspOvpReservationModule = angular + .module('slspOvpReservationModule', []) + .controller('slspOvpReservationController', slspOvpReservationController) + .component('slspOvpReservationComponent', { + bindings: { afterCtrl: '<' }, + controller: 'slspOvpReservationController', + }) diff --git a/js/modules/prm-send-email-after/hsg-send-email-after.module.js b/js/modules/prm-send-email-after/hsg-send-email-after.module.js new file mode 100644 index 0000000..30e2424 --- /dev/null +++ b/js/modules/prm-send-email-after/hsg-send-email-after.module.js @@ -0,0 +1,10 @@ +import { slspSendEmailInfoModule } from './slsp-send-email-info/slsp-send-email-info.module' + +export const hsgSendEmailAfterModule = angular + .module('hsgSendEmailAfterModule', []) + .component('prmSendEmailAfter', { + bindings: { parentCtrl: '<' }, + template: `` + }) + +hsgSendEmailAfterModule.requires.push(slspSendEmailInfoModule.name) diff --git a/js/modules/prm-send-email-after/slsp-send-email-info/slsp-send-email-info.controller.js b/js/modules/prm-send-email-after/slsp-send-email-info/slsp-send-email-info.controller.js new file mode 100644 index 0000000..e768a98 --- /dev/null +++ b/js/modules/prm-send-email-after/slsp-send-email-info/slsp-send-email-info.controller.js @@ -0,0 +1,21 @@ +export class slspSendEmailInfoController { + + constructor($scope, $compile) { + this.$scope = $scope + this.$compile = $compile + this.sendEmailInfoLabel = '
' + } + + $onInit() { + this.parentCtrl = this.afterCtrl.parentCtrl + + let sendEmailForm = angular.element(document.querySelectorAll(`form[name="emailForm"]`)) + + if (sendEmailForm && !sendEmailForm.html().includes('customized.email.infobox')) { + let compiledHtml = this.$compile(this.sendEmailInfoLabel)(this.$scope) + sendEmailForm.prepend(compiledHtml) + } + } +} + +slspSendEmailInfoController.$inject = ['$scope', '$compile'] diff --git a/js/modules/prm-send-email-after/slsp-send-email-info/slsp-send-email-info.module.js b/js/modules/prm-send-email-after/slsp-send-email-info/slsp-send-email-info.module.js new file mode 100644 index 0000000..92aeffe --- /dev/null +++ b/js/modules/prm-send-email-after/slsp-send-email-info/slsp-send-email-info.module.js @@ -0,0 +1,9 @@ +import { slspSendEmailInfoController } from './slsp-send-email-info.controller' + +export const slspSendEmailInfoModule = angular + .module('slspSendEmailInfoModule', []) + .controller('slspSendEmailInfoController', slspSendEmailInfoController) + .component('slspSendEmailInfoComponent', { + bindings: { afterCtrl: '<' }, + controller: 'slspSendEmailInfoController', + }) diff --git a/js/modules/prm-service-button-after/hsg-service-button-after.module.js b/js/modules/prm-service-button-after/hsg-service-button-after.module.js index 3155aa7..7017b5e 100644 --- a/js/modules/prm-service-button-after/hsg-service-button-after.module.js +++ b/js/modules/prm-service-button-after/hsg-service-button-after.module.js @@ -1,10 +1,15 @@ import { slspDigitizationButtonLabelModule } from './slsp-digitization-button-label/slsp-digitization-button-label.module' +import { slspReservationButtonModule } from './slsp-reservation-button/slsp-reservation-button.module' export const hsgServiceButtonAfterModule = angular .module('hsgServiceButtonAfterModule', []) .component('prmServiceButtonAfter', { bindings: { parentCtrl: '<' }, - template: `` + template: ` + + + ` }) hsgServiceButtonAfterModule.requires.push(slspDigitizationButtonLabelModule.name) +hsgServiceButtonAfterModule.requires.push(slspReservationButtonModule.name) diff --git a/js/modules/prm-service-button-after/slsp-reservation-button/slsp-reservation-button.controller.js b/js/modules/prm-service-button-after/slsp-reservation-button/slsp-reservation-button.controller.js new file mode 100644 index 0000000..aa8ac47 --- /dev/null +++ b/js/modules/prm-service-button-after/slsp-reservation-button/slsp-reservation-button.controller.js @@ -0,0 +1,60 @@ +export class slspReservationButtonController { + + constructor($scope, $compile, $timeout, $rootScope, $window, $element) { + this.$scope = $scope + this.$compile = $compile + this.$timeout = $timeout + this.$rootScope = $rootScope + this.$window = $window + this.$element = $element + this.itemReservationLabel = '' + } + + $onInit() { + this.$timeout(() => { + this.parentCtrl = this.afterCtrl.parentCtrl + + let language = this.getLanguage() + let serviceType = this.parentCtrl.service.type + let statusName = this.parentCtrl.requestParameters.itemstatusname + + // Hier das DOM-Element der Angular-Komponente abrufen + let currentElement = this.$element[0] + + // Das Elternelement ("md-list-item") der Angular-Komponente abrufen + let prmOpacElement = currentElement.closest('md-list-item') + + // Überprüfen, ob prmOpacElement vorhanden ist + if (prmOpacElement) { + // Den Button innerhalb des aktuellen "md-list-item" Teils auswählen + let itemReservationButton = prmOpacElement.querySelector('prm-service-button button span[translate="AlmaItemRequest"]') + + // Check conditions and execute code if necessary + if (serviceType === 'AlmaItemRequest' && + ((language === 'de' && statusName !== 'Exemplar ist vorhanden') || + (language === 'fr' && statusName !== 'Exemplaire en rayon') || + (language === 'it' && statusName !== 'Copia a scaffale') || + (language === 'en' && statusName !== 'Item in place'))) { + + let compiledHtml = this.$compile(this.itemReservationLabel)(this.$scope) + angular.element(itemReservationButton).replaceWith(compiledHtml) + } + } else { + console.warn('md-list-item element not found.') + } + + }, 0) + } + + getLanguage() { + let sms = this.$rootScope.$$childHead.$ctrl.userSessionManagerService + + if (!sms) { + return 'en' + } else { + return sms.getUserLanguage() || $window.appConfig['primo-view']['attributes-map'].interfaceLanguage + } + } +} + +slspReservationButtonController.$inject = ['$scope', '$compile', '$timeout', '$rootScope', '$window', '$element'] diff --git a/js/modules/prm-service-button-after/slsp-reservation-button/slsp-reservation-button.module.js b/js/modules/prm-service-button-after/slsp-reservation-button/slsp-reservation-button.module.js new file mode 100644 index 0000000..34037af --- /dev/null +++ b/js/modules/prm-service-button-after/slsp-reservation-button/slsp-reservation-button.module.js @@ -0,0 +1,9 @@ +import { slspReservationButtonController } from './slsp-reservation-button.controller' + +export const slspReservationButtonModule = angular + .module('slspReservationButtonModule', []) + .controller('slspReservationButtonController', slspReservationButtonController) + .component('slspReservationButtonComponent', { + bindings: { afterCtrl: '<' }, + controller: 'slspReservationButtonController', + })