From 8dddf0a60dc17c4d76e71af31aace6079868dfdc Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 1 Apr 2022 15:50:32 +0000 Subject: [PATCH] Bug 30436: Convert article requests tabs to Bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch converts the jQuery tabs on the article requests page to Bootstrap. To test you should have the "ArticleRequests" system preference enabled. If necessary, create some article requests and mark some "Pending," some "Processing," and leave some new. - Apply the patch and go to Circulation -> Article requests. - The page should show three tabs: New, Pending, and Processing. - The tabs should look correct and work correctly. - The DataTables under each tab should work correctly. Signed-off-by: Séverine QUEUNE Signed-off-by: Tomas Cohen Arazi Signed-off-by: Fridolin Somers --- .../prog/en/modules/circ/article-requests.tt | 659 +++++++++--------- 1 file changed, 330 insertions(+), 329 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt index efbd50d203..1c559b5330 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt @@ -170,343 +170,344 @@
-
    -
  • - + - -
    -
    - Select all | Clear all - [% PROCESS actions menuid='article-menu-requested' id_arg=0 pull_right='' aria_menu='table_controls' %] +
    +
    +
    + Select all | Clear all + [% PROCESS actions menuid='article-menu-requested' id_arg=0 pull_right='' aria_menu='table_controls' %] +
    + + + + + + + + + + + + + + + + + + + + + + + [% FOREACH ar IN article_requests_requested %] + + + + + + + + + + + + + + + + + + [% END %] + +
    + TitleRequested articleCollectionItem typeCall numberStatusCopy numberEnumerationBarcodeFormatURLsPatronDateActions
    +

    + + [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] + +

    + +

    +

    [% ar.biblionumber | html %]
    +
    [% ar.biblio.author | html %]
    +
    + [% ar.biblio.biblioitem.publishercode | html %] + + [% IF ar.biblio.biblioitem.publicationyear %] + [% ar.biblio.biblioitem.publicationyear | html %] + [% ELSIF ar.biblio.copyrightdate %] + [% ar.biblio.copyrightdate | html %] + [% END %] + + [% IF ar.biblio.biblioitem.pages %] + : [% ar.biblio.biblioitem.pages | html %] + [% END %] + + [% r.biblio.biblioitem.size | html %] + + [% IF ar.biblio.biblioitem.isbn %] + ISBN: [% ar.biblio.biblioitem.isbn | html %] + [% END %] +
    +

    +
    + [% IF ar.toc_request %]

    Include TOC

    [% END %] + [% IF ar.title %]

    Title: [% ar.title | html %]

    [% END %] + [% IF ar.author %]

    Author: [% ar.author | html %]

    [% END %] + [% IF ar.volume %]

    Volume: [% ar.volume | html %]

    [% END %] + [% IF ar.issue %]

    Issue: [% ar.issue | html %]

    [% END %] + [% IF ar.date %]

    Date: [% ar.date | html %]

    [% END %] + [% IF ar.pages %]

    Pages: [% ar.pages | html %]

    [% END %] + [% IF ar.chapters %]

    Chapters: [% ar.chapters | html %]

    [% END %] + [% IF ar.patron_notes %]

    Patron notes: [% ar.patron_notes | html %]

    [% END %] +
    [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %][% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %] + [% IF ar.item.location %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %] + [% END %] + + [% ar.item.itemcallnumber | html %] + [% PROCESS 'item_status' myitem = ar.item IF ar.item %][% ar.item.copynumber | html %][% ar.item.enumchron | html %][% ar.item.barcode | html %][% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %][% IF ar.format == 'SCAN' %][% IF ar.urls %]Yes[% ELSE %]No[% END%][% END %] +

    + + [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) + +

    + +

    [% ar.borrower.phone | html %]

    +
    [% ar.created_on | $KohaDates %] + [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %] +
    - - - - - - - - - - - - - - - - - - - - - - [% FOREACH ar IN article_requests_requested %] - - - - - - - - - - - - - - - - +
    +
    + Select all | Clear all + [% PROCESS actions menuid='article-menu-pending' id_arg=0 pull_right='' aria_menu='table_controls' %] +
    + +
    - TitleRequested articleCollectionItem typeCall numberStatusCopy numberEnumerationBarcodeFormatURLsPatronDateActions
    -

    - - [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] - -

    - -

    -

    [% ar.biblionumber | html %]
    -
    [% ar.biblio.author | html %]
    -
    - [% ar.biblio.biblioitem.publishercode | html %] - - [% IF ar.biblio.biblioitem.publicationyear %] - [% ar.biblio.biblioitem.publicationyear | html %] - [% ELSIF ar.biblio.copyrightdate %] - [% ar.biblio.copyrightdate | html %] - [% END %] - - [% IF ar.biblio.biblioitem.pages %] - : [% ar.biblio.biblioitem.pages | html %] - [% END %] - - [% r.biblio.biblioitem.size | html %] - - [% IF ar.biblio.biblioitem.isbn %] - ISBN: [% ar.biblio.biblioitem.isbn | html %] - [% END %] -
    -

    -
    - [% IF ar.toc_request %]

    Include TOC

    [% END %] - [% IF ar.title %]

    Title: [% ar.title | html %]

    [% END %] - [% IF ar.author %]

    Author: [% ar.author | html %]

    [% END %] - [% IF ar.volume %]

    Volume: [% ar.volume | html %]

    [% END %] - [% IF ar.issue %]

    Issue: [% ar.issue | html %]

    [% END %] - [% IF ar.date %]

    Date: [% ar.date | html %]

    [% END %] - [% IF ar.pages %]

    Pages: [% ar.pages | html %]

    [% END %] - [% IF ar.chapters %]

    Chapters: [% ar.chapters | html %]

    [% END %] - [% IF ar.patron_notes %]

    Patron notes: [% ar.patron_notes | html %]

    [% END %] -
    [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %][% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %] - [% IF ar.item.location %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %] - [% END %] - - [% ar.item.itemcallnumber | html %] - [% PROCESS 'item_status' myitem = ar.item IF ar.item %][% ar.item.copynumber | html %][% ar.item.enumchron | html %][% ar.item.barcode | html %][% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %][% IF ar.format == 'SCAN' %][% IF ar.urls %]Yes[% ELSE %]No[% END%][% END %] -

    - - [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) - -

    - -

    [% ar.borrower.phone | html %]

    -
    [% ar.created_on | $KohaDates %] - [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %] -
    + + + + + + + + + + + + + + + + - [% END %] - -
    + TitleRequested articleCollectionItem typeCall numberStatusCopy numberEnumerationBarcodeFormatURLsPatronDateActions
    -
    - -
    -
    - Select all | Clear all - [% PROCESS actions menuid='article-menu-pending' id_arg=0 pull_right='' aria_menu='table_controls' %] + + + + [% FOREACH ar IN article_requests_pending %] + + + +

    + + [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] + +

    + +

    +

    [% ar.biblionumber | html %]
    +
    [% ar.biblio.author | html %]
    +
    + [% ar.biblio.biblioitem.publishercode | html %] + + [% IF ar.biblio.biblioitem.publicationyear %] + [% ar.biblio.biblioitem.publicationyear | html %] + [% ELSIF ar.biblio.copyrightdate %] + [% ar.biblio.copyrightdate | html %] + [% END %] + + [% IF ar.biblio.biblioitem.pages %] + : [% ar.biblio.biblioitem.pages | html %] + [% END %] + + [% r.biblio.biblioitem.size | html %] + + [% IF ar.biblio.biblioitem.isbn %] + ISBN: [% ar.biblio.biblioitem.isbn | html %] + [% END %] +
    +

    + + + [% IF ar.toc_request %]

    Include TOC

    [% END %] + [% IF ar.title %]

    Title: [% ar.title | html %]

    [% END %] + [% IF ar.author %]

    Author: [% ar.author | html %]

    [% END %] + [% IF ar.volume %]

    Volume: [% ar.volume | html %]

    [% END %] + [% IF ar.issue %]

    Issue: [% ar.issue | html %]

    [% END %] + [% IF ar.date %]

    Date: [% ar.date | html %]

    [% END %] + [% IF ar.pages %]

    Pages: [% ar.pages | html %]

    [% END %] + [% IF ar.chapters %]

    Chapters: [% ar.chapters | html %]

    [% END %] + [% IF ar.patron_notes %]

    Patron notes: [% ar.patron_notes | html %]

    [% END %] + + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %] + [% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %] + + [% IF ar.item.location %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %] + [% END %] + + [% ar.item.itemcallnumber | html %] + + [% PROCESS 'item_status' myitem = ar.item IF ar.item %] + [% ar.item.copynumber | html %] + [% ar.item.enumchron | html %] + [% ar.item.barcode | html %] + [% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %] + [% IF ar.format == 'SCAN' %][% IF ar.urls %]Yes[% ELSE %]No[% END%][% END %] + +

    + + [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) + +

    + +

    [% ar.borrower.phone | html %]

    + + [% ar.created_on | $KohaDates %] + + [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id format=ar.format pull_right='pull-right' aria_menu='ar-actions' %] + + + [% END %] + +
    - - - - - - - - - - - - - - - - - - - - - - [% FOREACH ar IN article_requests_pending %] - - - - - - - - - - - - - - - - +
    +
    + Select all | Clear all + [% PROCESS actions menuid='article-menu-processing' id_arg=0 pull_right='' aria_menu='table_controls' %] +
    +
    - TitleRequested articleCollectionItem typeCall numberStatusCopy numberEnumerationBarcodeFormatURLsPatronDateActions
    -

    - - [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] - -

    - -

    -

    [% ar.biblionumber | html %]
    -
    [% ar.biblio.author | html %]
    -
    - [% ar.biblio.biblioitem.publishercode | html %] - - [% IF ar.biblio.biblioitem.publicationyear %] - [% ar.biblio.biblioitem.publicationyear | html %] - [% ELSIF ar.biblio.copyrightdate %] - [% ar.biblio.copyrightdate | html %] - [% END %] - - [% IF ar.biblio.biblioitem.pages %] - : [% ar.biblio.biblioitem.pages | html %] - [% END %] - - [% r.biblio.biblioitem.size | html %] - - [% IF ar.biblio.biblioitem.isbn %] - ISBN: [% ar.biblio.biblioitem.isbn | html %] - [% END %] -
    -

    -
    - [% IF ar.toc_request %]

    Include TOC

    [% END %] - [% IF ar.title %]

    Title: [% ar.title | html %]

    [% END %] - [% IF ar.author %]

    Author: [% ar.author | html %]

    [% END %] - [% IF ar.volume %]

    Volume: [% ar.volume | html %]

    [% END %] - [% IF ar.issue %]

    Issue: [% ar.issue | html %]

    [% END %] - [% IF ar.date %]

    Date: [% ar.date | html %]

    [% END %] - [% IF ar.pages %]

    Pages: [% ar.pages | html %]

    [% END %] - [% IF ar.chapters %]

    Chapters: [% ar.chapters | html %]

    [% END %] - [% IF ar.patron_notes %]

    Patron notes: [% ar.patron_notes | html %]

    [% END %] -
    [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %][% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %] - [% IF ar.item.location %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %] - [% END %] - - [% ar.item.itemcallnumber | html %] - [% PROCESS 'item_status' myitem = ar.item IF ar.item %][% ar.item.copynumber | html %][% ar.item.enumchron | html %][% ar.item.barcode | html %][% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %][% IF ar.format == 'SCAN' %][% IF ar.urls %]Yes[% ELSE %]No[% END%][% END %] -

    - - [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) - -

    - -

    [% ar.borrower.phone | html %]

    -
    [% ar.created_on | $KohaDates %] - [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id format=ar.format pull_right='pull-right' aria_menu='ar-actions' %] -
    + + + + + + + + + + + + + + + + - [% END %] - -
    + TitleRequested articleCollectionItem typeCall numberStatusCopy numberEnumerationBarcodeFormatURLsPatronDateActions
    -
    - -
    -
    - Select all | Clear all - [% PROCESS actions menuid='article-menu-processing' id_arg=0 pull_right='' aria_menu='table_controls' %] + + + + [% FOREACH ar IN article_requests_processing %] + + + +

    + [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link = 1%] +

    + +

    +

    [% ar.biblionumber | html %]
    +
    [% ar.biblio.author | html %]
    +
    + [% ar.biblio.biblioitem.publishercode | html %] + + [% IF ar.biblio.biblioitem.publicationyear %] + [% ar.biblio.biblioitem.publicationyear | html %] + [% ELSIF ar.biblio.copyrightdate %] + [% ar.biblio.copyrightdate | html %] + [% END %] + + [% IF ar.biblio.biblioitem.pages %] + : [% ar.biblio.biblioitem.pages | html %] + [% END %] + + [% r.biblio.biblioitem.size | html %] + + [% IF ar.biblio.biblioitem.isbn %] + ISBN: [% ar.biblio.biblioitem.isbn | html %] + [% END %] +
    +

    + + + [% IF ar.toc_request %]

    Include TOC

    [% END %] + [% IF ar.title %]

    Title: [% ar.title | html %]

    [% END %] + [% IF ar.author %]

    Author: [% ar.author | html %]

    [% END %] + [% IF ar.volume %]

    Volume: [% ar.volume | html %]

    [% END %] + [% IF ar.issue %]

    Issue: [% ar.issue | html %]

    [% END %] + [% IF ar.date %]

    Date: [% ar.date | html %]

    [% END %] + [% IF ar.pages %]

    Pages: [% ar.pages | html %]

    [% END %] + [% IF ar.chapters %]

    Chapters: [% ar.chapters | html %]

    [% END %] + [% IF ar.patron_notes %]

    Patron notes: [% ar.patron_notes | html %]

    [% END %] + + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %] + [% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %] + + [% IF ar.item.location %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %] + [% END %] + + [% ar.item.itemcallnumber | html %] + + [% PROCESS 'item_status' myitem = ar.item IF ar.item %] + [% ar.item.copynumber | html %] + [% ar.item.enumchron | html %] + [% ar.item.barcode | html %] + [% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %] + [% IF ar.format == 'SCAN' %][% IF ar.urls %]Yes[% ELSE %]No[% END%][% END %] + +

    + + [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) + +

    + +

    [% ar.borrower.phone | html %]

    + + [% ar.created_on | $KohaDates %] + + [% PROCESS actions menuid="table_" _ ar.id id_arg=ar.id format=ar.format pull_right='pull-right' aria_menu='ar-actions' %] + + + [% END %] + +
    - - - - - - - - - - - - - - - - - - - - - - [% FOREACH ar IN article_requests_processing %] - - - - - - - - - - - - - - - - - - [% END %] - -
    - TitleRequested articleCollectionItem typeCall numberStatusCopy numberEnumerationBarcodeFormatURLsPatronDateActions
    -

    - [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link = 1%] -

    - -

    -

    [% ar.biblionumber | html %]
    -
    [% ar.biblio.author | html %]
    -
    - [% ar.biblio.biblioitem.publishercode | html %] - - [% IF ar.biblio.biblioitem.publicationyear %] - [% ar.biblio.biblioitem.publicationyear | html %] - [% ELSIF ar.biblio.copyrightdate %] - [% ar.biblio.copyrightdate | html %] - [% END %] - - [% IF ar.biblio.biblioitem.pages %] - : [% ar.biblio.biblioitem.pages | html %] - [% END %] - - [% r.biblio.biblioitem.size | html %] - - [% IF ar.biblio.biblioitem.isbn %] - ISBN: [% ar.biblio.biblioitem.isbn | html %] - [% END %] -
    -

    -
    - [% IF ar.toc_request %]

    Include TOC

    [% END %] - [% IF ar.title %]

    Title: [% ar.title | html %]

    [% END %] - [% IF ar.author %]

    Author: [% ar.author | html %]

    [% END %] - [% IF ar.volume %]

    Volume: [% ar.volume | html %]

    [% END %] - [% IF ar.issue %]

    Issue: [% ar.issue | html %]

    [% END %] - [% IF ar.date %]

    Date: [% ar.date | html %]

    [% END %] - [% IF ar.pages %]

    Pages: [% ar.pages | html %]

    [% END %] - [% IF ar.chapters %]

    Chapters: [% ar.chapters | html %]

    [% END %] - [% IF ar.patron_notes %]

    Patron notes: [% ar.patron_notes | html %]

    [% END %] -
    [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %][% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %] - [% IF ar.item.location %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %] - [% END %] - - [% ar.item.itemcallnumber | html %] - [% PROCESS 'item_status' myitem = ar.item IF ar.item %][% ar.item.copynumber | html %][% ar.item.enumchron | html %][% ar.item.barcode | html %][% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %][% IF ar.format == 'SCAN' %][% IF ar.urls %]Yes[% ELSE %]No[% END%][% END %] -

    - - [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) - -

    - -

    [% ar.borrower.phone | html %]

    -
    [% ar.created_on | $KohaDates %] - [% PROCESS actions menuid="table_" _ ar.id id_arg=ar.id format=ar.format pull_right='pull-right' aria_menu='ar-actions' %] -
    -
    +

@@ -520,18 +521,18 @@ var active_tab = "#article-requests-requested"; var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable; $(document).ready(function() { - $('#article-request-tabs').tabs({ - activate: function( activate_event, activate_ui ) { - active_tab = activate_ui.newPanel.selector; - if( active_tab == '#article-requests-requested' ) - active_datatable = requested_datatable; - else if( active_tab == '#article-requests-pending' ) - active_datatable = pending_datatable; - else active_datatable = processing_datatable; - activateBatchActions( active_tab ); - }, - }); + $("#article-request-tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) { + active_tab = e.target.hash; + if( active_tab == "#article-requests-requested" ){ + active_datatable = requested_datatable; + } else if( active_tab == "#article-requests-pending" ){ + active_datatable = pending_datatable; + } else { + active_datatable = processing_datatable; + } + activateBatchActions( active_tab ); + }); $( "input:checkbox, #article-request-tabs" ).on("change", function(){ activateBatchActions( active_tab ); -- 2.39.5