@rero/rero-ils-ui
Version:
User interface for RERO integrated library system (RERO ILS).
2 lines (1 loc) • 6.47 kB
JavaScript
import{a as S}from"./chunk-GQ5FIRIY.js";import{d as u,i as p}from"./chunk-4MYHQLZQ.js";import{V as d,oa as v}from"./chunk-WKOKZ3JO.js";import{a as o,da as l,ia as h}from"./chunk-3WD6XLXL.js";var q=(()=>{class r{constructor(){this.httpClient=h(p),this.translateService=h(S),this.httpOptions={headers:new u({"Content-Type":"application/json"})}}getPermission(t,s){let i=s==null?`/api/permissions/${t}`:`/api/permissions/${t}/${s}`;return this.httpClient.get(i,this.httpOptions)}getRolesManagementPermissions(){return this.httpClient.get("api/patrons/roles_management_permissions",this.httpOptions)}generateTooltipMessage(t,s){let i=new v(new d(this.translateService.getCurrentLang())),e=[];if(t){if("links"in t){let n=this.pluralLinksMessages();Object.keys(t.links).forEach(a=>{let c=a in n?i.transform(t.links[a],n[a],this.translateService.getCurrentLang()):`${t.links[a][a]} ${a}`;e.push("- "+c)})}if("others"in t){let n=this.othersMessages();Object.keys(t.others).forEach(a=>{let c=a in n?n[a]:a;e.push("- "+c)})}}if(e.length>0)switch(s){case"delete":e.unshift(e.length===1?this.translateService.instant("You cannot delete the record for the following reason:"):this.translateService.instant("You cannot delete the record for the following reasons:"));break;case"request":e.unshift(e.length===1?this.translateService.instant("You cannot request the record for the following reason:"):this.translateService.instant("You cannot request the record for the following reasons:"));break;default:e.unshift(e.length===1?this.translateService.instant("You cannot operate the record for the following reason:"):this.translateService.instant("You cannot operate the record for the following reasons:"))}return e.join("<br>")}membership(t,s,i,e=!0){if(e&&t!==s){let n={update:{can:!1},delete:{can:!1,reasons:{others:{record_not_in_current_library:""}}}};i=o(o({},i),n)}return i}pluralLinksMessages(){return{acq_order_lines:{"=1":this.translateService.instant("1 acquisition order line attached."),other:this.translateService.instant("# acquisition order lines attached.")},acq_orders:{"=1":this.translateService.instant("1 acquisition order attached."),other:this.translateService.instant("# acquisition orders attached.")},acq_receipt_lines:{"=1":this.translateService.instant("1 acquisition receipt line attached."),other:this.translateService.instant("# acquisition receipts lines attached.")},acq_receipts:{"=1":this.translateService.instant("1 acquisition receipt attached."),other:this.translateService.instant("# acquisition receipts attached.")},acq_accounts:{"=1":this.translateService.instant("1 acquisition account attached."),other:this.translateService.instant("# acquisition accounts attached.")},budgets:{"=1":this.translateService.instant("1 budget attached."),other:this.translateService.instant("# budgets attached.")},circ_policies:{"=1":this.translateService.instant("1 circulation policy attached."),other:this.translateService.instant("# circulation policies attached.")},collections:{"=1":this.translateService.instant("1 exhibition/course attached."),other:this.translateService.instant("# exhibitions/courses attached.")},documents:{"=1":this.translateService.instant("1 document attached."),other:this.translateService.instant("# documents attached.")},fees:{"=1":this.translateService.instant("1 fee attached."),other:this.translateService.instant("# fees attached.")},files:{"=1":this.translateService.instant("1 file repository attached."),other:this.translateService.instant("# file repositories attached.")},holdings:{"=1":this.translateService.instant("1 holding attached."),other:this.translateService.instant("# holdings attached.")},item_types:{"=1":this.translateService.instant("1 item type attached."),other:this.translateService.instant("# item types attached.")},items:{"=1":this.translateService.instant("1 item attached."),other:this.translateService.instant("# items attached.")},items_with_loans_or_fees:{"=1":this.translateService.instant("1 item with active loans/fees attached."),other:this.translateService.instant("# items with active loans/fees attached.")},libraries:{"=1":this.translateService.instant("1 library attached."),other:this.translateService.instant("# libraries attached.")},loans:{"=1":this.translateService.instant("1 loan attached."),other:this.translateService.instant("# loans attached.")},locations:{"=1":this.translateService.instant("1 location attached."),other:this.translateService.instant("# locations attached.")},organisations:{"=1":this.translateService.instant("1 organisation attached."),other:this.translateService.instant("# organisations attached.")},patron_types:{"=1":this.translateService.instant("1 patron type attached."),other:this.translateService.instant("# patron types attached.")},patrons:{"=1":this.translateService.instant("1 patron attached."),other:this.translateService.instant("# patrons attached.")},reports:{"=1":this.translateService.instant("1 report attached."),other:this.translateService.instant("# reports attached.")},rolled_over:{other:this.translateService.instant("Fiscal year closed")},stats_cfg:{"=1":this.translateService.instant("1 statistics configuration attached."),other:this.translateService.instant("# statistics configurations attached.")},templates:{"=1":this.translateService.instant("1 template attached."),other:this.translateService.instant("# templates attached.")},transactions:{"=1":this.translateService.instant("1 transaction attached."),other:this.translateService.instant("# transactions attached.")}}}othersMessages(){return{is_default:this.translateService.instant("The record is set as the default one."),has_settings:this.translateService.instant("The record contains settings."),harvested:this.translateService.instant("The record has been harvested."),regular_issue_cannot_be_deleted:this.translateService.instant("A regular issue cannot be deleted."),record_not_in_current_library:this.translateService.instant("The record does not belong to the current library."),order_fully_received:this.translateService.instant("The order is fully received."),order_already_sent:this.translateService.instant("Order already sent."),order_has_active_status:this.translateService.instant("Order has an active status."),order_not_in_reception:this.translateService.instant("Order not in reception.")}}static{this.\u0275fac=function(s){return new(s||r)}}static{this.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{q as a};