From debd056f1ea776e575ad12e3871b2d7507dd9aef Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 6 Apr 2022 11:29:40 +0000 Subject: [PATCH] Bug 30466: Convert serials pages tabs to Bootstrap This patch modifies three serials templates in order to replace jQueryUI tabs with Bootstrap tabs. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Serials. - Perform a serials search which will return one or more results. - On the search results page you should see an Open and Closed tab. - The tabs should look correct and work correctly. - Confirm that "Select all" and "Clear all" controls work correctly in each tab. - Click one of the search results to view the details for that subscription. - You should see tabs for Information, Planning, Issues, and Summary. You may also see an Acquisition details tab depending on your data. - In the sidebar menu click "Serial collection." - On this page you should see tabs corresponding to each year the serial has been received. - Under each tab the "Select all" and "Clear all" controls should work correctly in the context of that tab. Other controls should apply to all tabs. --- .../prog/css/src/staff-global.scss | 1 + .../en/modules/serials/serials-collection.tt | 17 +- .../prog/en/modules/serials/serials-search.tt | 61 +- .../en/modules/serials/subscription-detail.tt | 735 +++++++++--------- 4 files changed, 414 insertions(+), 400 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index b9d0573dc7..d6bcb4860a 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -3023,6 +3023,7 @@ td { } .toptabs { + margin-top: 5px; .ui-tabs-panel { background: #FFF none; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt index 69575baacc..72c7056ca2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt @@ -137,20 +137,20 @@ [% IF ( years ) %]
-
    - [% FOREACH year IN years %] + - +
    [% FOREACH year IN years %] -
    +
    [% IF ( CAN_user_serials_receive_serials ) %]

    @@ -297,6 +297,7 @@
    [% END %] +
    @@ -342,7 +343,9 @@ } $(document).ready(function() { - $('#subscription_years').tabs(); + if( $("#subscription_years .tab-pane.active").length < 1 ){ + $("#subscription_years a:first").tab("show"); + } $(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, { "aoColumnDefs": [ { "aTargets": [ 0,-1 ], "bSortable": false, "bSearchable": false } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt index 83fd0ed3f1..83ec307815 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt @@ -307,39 +307,41 @@ [% IF ( done_searched ) %] [% IF ( total ) %] -
    -
      +
      + - [% IF mana %] -
      - [% INCLUDE 'mana/mana-subscription-search-result.inc' %] -
      - [% ELSE %] -
      - [% IF openedsubscriptions %] - [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %] - [% ELSE %] -
      -

      Your search returned no open subscriptions.

      -
      - [% END %] -
      -
      - [% IF closedsubscriptions %] - [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %] - [% ELSE %] -
      -

      Your search returned no closed subscriptions.

      -
      - [% END %] -
      - [% END # /IF mana %] +
      + [% IF mana %] +
      + [% INCLUDE 'mana/mana-subscription-search-result.inc' %] +
      + [% ELSE %] +
      + [% IF openedsubscriptions %] + [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %] + [% ELSE %] +
      +

      Your search returned no open subscriptions.

      +
      + [% END %] +
      +
      + [% IF closedsubscriptions %] + [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %] + [% ELSE %] +
      +

      Your search returned no closed subscriptions.

      +
      + [% END %] +
      + [% END # /IF mana %] +
      [% ELSE %]
      @@ -505,7 +507,6 @@ csrlt.fnAddFilters("dt-filter", 750); manarlt.fnAddFilters("dt-filter", 750); - $('#serialstabs').tabs(); $("#reopensub").click(function(){ return confirm(_("Are you sure you want to reopen this subscription?")); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index 4cccfff7db..6f0098ab18 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -91,412 +91,421 @@ [% END %]
      -
        -
      • Information
      • -
      • Planning
      • -
      • Issues
      • -
      • Summary
      • + - -
        -
        -
        -
        -
          -
        1. Subscription ID: [% subscriptionid | html %]
        2. -
        3. Librarian identity: [% librarian | html %]
        4. -
        5. Vendor: [% aqbooksellername | html %]
        6. -
        7. Biblio: [% bibliotitle | html %] ([% bibnum | html %])
        8. - [% IF ( OPACBaseURL ) %] -
        9. - OPAC view: - Open in new window. -
        10. - [% END %] - [% IF ( branchcode ) %] -
        11. Library: [% Branches.GetName( branchcode ) | html %]
        12. - [% END %] - [% IF ( serialsadditems ) %] -
        13. Items: Serial receipt creates an item record.
        14. - [% ELSE %] -
        15. Items: Serial receipt does not create an item record.
        16. - [% END %] -
        17. - Serial number: - [% IF skip_serialseq %] - Serial number is skipped when an irregularity is found. +
          +
          +
          +
          +
          +
            +
          1. Subscription ID: [% subscriptionid | html %]
          2. +
          3. Librarian identity: [% librarian | html %]
          4. +
          5. Vendor: [% aqbooksellername | html %]
          6. +
          7. Biblio: [% bibliotitle | html %] ([% bibnum | html %])
          8. + [% IF ( OPACBaseURL ) %] +
          9. + OPAC view: + Open in new window. +
          10. + [% END %] + [% IF ( branchcode ) %] +
          11. Library: [% Branches.GetName( branchcode ) | html %]
          12. + [% END %] + [% IF ( serialsadditems ) %] +
          13. Items: Serial receipt creates an item record.
          14. [% ELSE %] - Serial number is kept when an irregularity is found. +
          15. Items: Serial receipt does not create an item record.
          16. [% END %] - -
          17. Grace period: [% graceperiod | html %]
          18. -
          -
          -
          -
          -
          -
            - [% IF ( location ) %]
          1. Location: [% location | html %]
          2. [% END %] - [% IF ( callnumber ) %]
          3. Call number: [% callnumber | html %]
          4. [% END %] - [% IF ( staffdisplaycount ) %]
          5. Number of issues to display to staff:[% staffdisplaycount | html %]
          6. [% END %] - [% IF ( opacdisplaycount ) %]
          7. Number of issues to display in OPAC:[% opacdisplaycount | html %]
          8. [% END %] - [% IF ( letter ) %]
          9. - Patron notification: [% letter | html %] - (subscribers) + Serial number: + [% IF skip_serialseq %] + Serial number is skipped when an irregularity is found. + [% ELSE %] + Serial number is kept when an irregularity is found. + [% END %]
          10. - [% END %] - [% IF ( hasRouting ) %]
          11. Routing: yes
          12. [% END %] -
          -
          -
          -
          - - [% IF available_additional_fields.count %] -
          -
          +
        18. Grace period: [% graceperiod | html %]
        19. +
        +
        +
        -

        Additional fields:

          - [% INCLUDE 'additional-fields-display.inc' available=available_additional_fields values=additional_field_values %] + [% IF ( location ) %]
        1. Location: [% location | html %]
        2. [% END %] + [% IF ( callnumber ) %]
        3. Call number: [% callnumber | html %]
        4. [% END %] + [% IF ( staffdisplaycount ) %]
        5. Number of issues to display to staff:[% staffdisplaycount | html %]
        6. [% END %] + [% IF ( opacdisplaycount ) %]
        7. Number of issues to display in OPAC:[% opacdisplaycount | html %]
        8. [% END %] + [% IF ( letter ) %] +
        9. + Patron notification: [% letter | html %] + (subscribers) +
        10. + [% END %] + [% IF ( hasRouting ) %]
        11. Routing: yes
        12. [% END %]
        - [% END %] -
        -
        -
        -
        -
        -
          -
        1. - Beginning date: - [% startdate | html %] -
        2. -
        3. - Frequency: - [% frequency.description | html %] -
        4. -
        5. - Manual history: - [% IF ( manualhistory ) %] - Enabled Edit history - [% ELSE %] - Disabled + [% IF available_additional_fields.count %] +
          +
          +
          +

          Additional fields:

          +
          +
            + [% INCLUDE 'additional-fields-display.inc' available=available_additional_fields values=additional_field_values %] +
          +
          +
          +
          + [% END %] +
        + +
        +
        +
        +
        +
          +
        1. + Beginning date: + [% startdate | html %] +
        2. +
        3. + Frequency: + [% frequency.description | html %] +
        4. +
        5. + Manual history: + [% IF ( manualhistory ) %] + Enabled Edit history + [% ELSE %] + Disabled + [% END %] +
        6. +
        7. + Number pattern: + [% numberpattern.label | html %] +
        8. +
        9. + + + + [% IF (has_X) %] + + [% END %] + [% IF (has_Y) %] + + [% END %] + [% IF (has_Z) %] + + [% END %] + + + + [% IF (has_X) %] + + [% END %] + [% IF (has_Y) %] + + [% END %] + [% IF (has_Z) %] + + [% END %] + +
          Starting with:[% lastvalue1 | html %][% lastvalue2 | html %][% lastvalue3 | html %]
          Rollover:[% numberpattern.whenmorethan1 | html %][% numberpattern.whenmorethan2 | html %][% numberpattern.whenmorethan3 | html %]
          +
        10. + [% IF ( irregular_issues ) %] +
        11. + Irregularity: + [% irregular_issues | html %] issues +
        12. [% END %] - -
        13. - Number pattern: - [% numberpattern.label | html %] -
        14. -
        15. - - - - [% IF (has_X) %] - - [% END %] - [% IF (has_Y) %] - - [% END %] - [% IF (has_Z) %] - - [% END %] - - - - [% IF (has_X) %] - - [% END %] - [% IF (has_Y) %] - - [% END %] - [% IF (has_Z) %] - - [% END %] - -
          Starting with:[% lastvalue1 | html %][% lastvalue2 | html %][% lastvalue3 | html %]
          Rollover:[% numberpattern.whenmorethan1 | html %][% numberpattern.whenmorethan2 | html %][% numberpattern.whenmorethan3 | html %]
          -
        16. - [% IF ( irregular_issues ) %]
        17. - Irregularity: - [% irregular_issues | html %] issues + First arrival: + [% firstacquidate | html %]
        18. - [% END %] -
        19. - First arrival: - [% firstacquidate | html %] -
        20. - [% IF ( numberlength ) %]
        21. - Number of issues: - [% numberlength | html %]
        22. - [% END %] - [% IF ( weeklength ) %]
        23. - Number of weeks: - [% weeklength | html %]
        24. - [% END %] - [% IF ( monthlength ) %]
        25. - Number of months: - [% monthlength | html %]
        26. - [% END %] -
        -
        -
        -
        -
        - - + [% IF ( numberlength ) %]
      • + Number of issues: + [% numberlength | html %]
      • + [% END %] + [% IF ( weeklength ) %]
      • + Number of weeks: + [% weeklength | html %]
      • + [% END %] + [% IF ( monthlength ) %]
      • + Number of months: + [% monthlength | html %]
      • + [% END %] + +
        +
        +
        +
      -
      - - - - - - - - - [% FOREACH serialslis IN serialslist %] +
      Issue numberPlanned datePublished datePublished date (text)Status
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - [% END # /FOREACH serialslist %] -
       XYZ
      Add - [% serialslis.serialseq | html %] + [% add1 | html %] - [% IF serialslis.planneddate %] - [% serialslis.planneddate | html %] - [% ELSE %] - Unknown - [% END %] + [% add2 | html %] - [% IF serialslis.publisheddate %] - [% serialslis.publisheddate | html %] - [% ELSE %] - Unknown - [% END %] + [% add3 | html %]
      once every[% every1 | html %][% every2 | html %][% every3 | html %]
      When more than[% whenmorethan1 | html %] [% IF ( innerloop1 ) %]
      + (is [% innerloop1 | html %])[% END %]
      [% whenmorethan2 | html %] [% IF ( innerloop2 ) %]
      + (is [% innerloop2 | html %])[% END %]
      [% whenmorethan3 | html %] [% IF ( innerloop3 ) %]
      + (is [% innerloop3 | html %])[% END %]
      Set back to[% setto1 | html %][% setto2 | html %][% setto3 | html %]
      - [% serialslis.publisheddatetext | html %] + Inner counter [% innerloop1 | html %][% innerloop2 | html %][% innerloop3 | html %]
      - [% IF ( serialslis.status1 ) %]Expected[% END %] - [% IF ( serialslis.status2 ) %]Arrived[% END %] - [% IF ( serialslis.status3 ) %]Late[% END %] - [% IF ( serialslis.status4 ) %]Missing[% END %] - [% IF ( serialslis.status41 ) %]Missing (never received)[% END %] - [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %] - [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %] - [% IF ( serialslis.status44 ) %]Missing (lost)[% END %] - [% IF ( serialslis.status5 ) %]Not issued[% END %] - [% IF ( serialslis.status6 ) %]Delete[% END %] - [% IF ( serialslis.status7 ) %] - Claimed - [% IF ( serialslis.claimdate ) %] - [% serialslis.claimdate | html %] - [% END %] - [% END %] - [% IF ( serialslis.status8 ) %]Stopped[% END %] + Last value [% lastvalue1 | html %][% lastvalue2 | html %][% lastvalue3 | html %]
      -
      - -
      -
      -
      -
      -
        -
      1. Start date: [% startdate | html %]
      2. -
      3. End date: [% enddate | html %]
      4. -
      5. History start date: [% histstartdate | html %]
      6. -
      7. History end date: [% histenddate | html %]
      8. -
      9. Received issues:[% recievedlist | html | html_line_break %]
      10. -
      11. Missing issues:[% missinglist | html | html_line_break %]
      12. -
      13. Nonpublic note:[% internalnotes | html | html_line_break %]
      14. -
      15. Public note:[% notes | html | html_line_break %]
      16. -
      17. History staff note:[% librariannote | html | html_line_break %]
      18. -
      19. History OPAC note:[% opacnote | html | html_line_break %]
      20. -
      -
      -
      -
      -
      + +
      - [% IF orders_grouped.size %] -
      -

      Acquisition details

      - - - +
      +
      - - Hide already received orders - | Show all orders - | Expand all - | Collapse all - -
      + + + + + + + + [% FOREACH serialslis IN serialslist %] - - - - - - - - - - - - - - - - [% FOR ordernumber IN orders_grouped.keys %] - [% SET parent_tree_id = loop.count %] - [% SET parent_order = orders_grouped.$ordernumber %] - - [%# invoice %] - - [%# ordernumber %] - - - + + + + - [%# internalnote %] - [%# vendornote %] - [%# fund %] - - - + [% END %] + [% IF ( serialslis.status8 ) %]Stopped[% END %] + + + [% END # /FOREACH serialslist %] +
      Issue numberPlanned datePublished datePublished date (text)Status
      InvoiceBasketOrder numberCreation dateReceive dateStatusInternal noteVendor noteFundQuantityOrderedSpent
      - [% IF CAN_user_acquisition_order_manage %] - [% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %]) - [% ELSE %] - [% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %]) - [% END %] - [% parent_order.basket.creationdate | $KohaDates %][% parent_order.datereceived | $KohaDates %] - [% SWITCH parent_order.orderstatus %] - [% CASE 'new' %]New - [% CASE 'ordered' %]Ordered - [% CASE 'partial' %]Partial - [% CASE 'complete' %]Complete - [% CASE 'cancelled' %]Cancelled + + [% serialslis.serialseq | html %] + + [% IF serialslis.planneddate %] + [% serialslis.planneddate | html %] + [% ELSE %] + Unknown + [% END %] + + [% IF serialslis.publisheddate %] + [% serialslis.publisheddate | html %] + [% ELSE %] + Unknown + [% END %] + + [% serialslis.publisheddatetext | html %] + + [% IF ( serialslis.status1 ) %]Expected[% END %] + [% IF ( serialslis.status2 ) %]Arrived[% END %] + [% IF ( serialslis.status3 ) %]Late[% END %] + [% IF ( serialslis.status4 ) %]Missing[% END %] + [% IF ( serialslis.status41 ) %]Missing (never received)[% END %] + [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %] + [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %] + [% IF ( serialslis.status44 ) %]Missing (lost)[% END %] + [% IF ( serialslis.status5 ) %]Not issued[% END %] + [% IF ( serialslis.status6 ) %]Delete[% END %] + [% IF ( serialslis.status7 ) %] + Claimed + [% IF ( serialslis.claimdate ) %] + [% serialslis.claimdate | html %] [% END %] - [% parent_order.quantity | html %][% parent_order.ecost_tax_excluded | $Price %] / [% parent_order.ecost_tax_included | $Price %][% parent_order.unitprice_tax_excluded | $Price %] / [% parent_order.unitprice_tax_included | $Price %]
      +
      + +
      +
      +
      +
      +
        +
      1. Start date: [% startdate | html %]
      2. +
      3. End date: [% enddate | html %]
      4. +
      5. History start date: [% histstartdate | html %]
      6. +
      7. History end date: [% histenddate | html %]
      8. +
      9. Received issues:[% recievedlist | html | html_line_break %]
      10. +
      11. Missing issues:[% missinglist | html | html_line_break %]
      12. +
      13. Nonpublic note:[% internalnotes | html | html_line_break %]
      14. +
      15. Public note:[% notes | html | html_line_break %]
      16. +
      17. History staff note:[% librariannote | html | html_line_break %]
      18. +
      19. History OPAC note:[% opacnote | html | html_line_break %]
      20. +
      +
      +
      +
      +
      + + [% IF orders_grouped.size %] +
      +

      Acquisition details

      + + + + + + + + + + + + + + + + - [% FOR order IN parent_order.orders %] - + + + [% FOR ordernumber IN orders_grouped.keys %] + [% SET parent_tree_id = loop.count %] + [% SET parent_order = orders_grouped.$ordernumber %] + + [%# invoice %] - [%# basket %] - - - - [% SWITCH order.orderstatus %] - [% CASE 'new' %] - - - - + [%# ordernumber %] + + - + [%# internalnote %] + [%# vendornote %] + [%# fund %] + + + - [% END # /FOR order %] - [% END # /FOR ordernumber %] - -
      + + Hide already received orders + | Show all orders + | Expand all + | Collapse all + +
      InvoiceBasketOrder numberCreation dateReceive dateStatusInternal noteVendor noteFundQuantityOrderedSpent
      - [% IF order.invoice %] - [% IF CAN_user_acquisition %] - - [% order.invoice.invoicenumber | html %] + [% IF CAN_user_acquisition_order_manage %] + [% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %]) [% ELSE %] - [% order.invoice.invoicenumber | html %] - [% END %] - [% END %] - [% order.ordernumber | html %][% order.basket.creationdate | $KohaDates%][% order.datereceived | $KohaDates %]New - [% CASE 'ordered' %]Ordered - [% CASE 'partial' %]Partial - [% CASE 'complete' %]Complete - [% CASE 'cancelled' %]Cancelled + [% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %]) [% END %] [% order.order_internalnote | html %][% order.order_vendornote | html %][% order.fund.budget_name | html %][% order.quantity | html %][% parent_order.basket.creationdate | $KohaDates %][% parent_order.datereceived | $KohaDates %] - [% UNLESS order.datereceived %] - [% order.ecost_tax_excluded * order.quantity | $Price %] / [% order.ecost_tax_included * order.quantity | $Price %] - [% END %] - - [% IF order.datereceived %] - [%# FIXME What if unitprice has not been filled? %] - [% order.unitprice_tax_excluded * order.quantity | $Price %] / [% order.unitprice_tax_included * order.quantity | $Price %] + [% SWITCH parent_order.orderstatus %] + [% CASE 'new' %]New + [% CASE 'ordered' %]Ordered + [% CASE 'partial' %]Partial + [% CASE 'complete' %]Complete + [% CASE 'cancelled' %]Cancelled [% END %] [% parent_order.quantity | html %][% parent_order.ecost_tax_excluded | $Price %] / [% parent_order.ecost_tax_included | $Price %][% parent_order.unitprice_tax_excluded | $Price %] / [% parent_order.unitprice_tax_included | $Price %]
      -
      - [% END # IF orders_grouped.size %] + [% FOR order IN parent_order.orders %] + + + [% IF order.invoice %] + [% IF CAN_user_acquisition %] + + [% order.invoice.invoicenumber | html %] + [% ELSE %] + [% order.invoice.invoicenumber | html %] + [% END %] + [% END %] + + [%# basket %] + [% order.ordernumber | html %] + [% order.basket.creationdate | $KohaDates%] + [% order.datereceived | $KohaDates %] + [% SWITCH order.orderstatus %] + [% CASE 'new' %]New + [% CASE 'ordered' %]Ordered + [% CASE 'partial' %]Partial + [% CASE 'complete' %]Complete + [% CASE 'cancelled' %]Cancelled + [% END %] + + [% order.order_internalnote | html %] + [% order.order_vendornote | html %] + [% order.fund.budget_name | html %] + [% order.quantity | html %] + + [% UNLESS order.datereceived %] + [% order.ecost_tax_excluded * order.quantity | $Price %] / [% order.ecost_tax_included * order.quantity | $Price %] + [% END %] + + + [% IF order.datereceived %] + [%# FIXME What if unitprice has not been filled? %] + [% order.unitprice_tax_excluded * order.quantity | $Price %] / [% order.unitprice_tax_included * order.quantity | $Price %] + [% END %] + + + [% END # /FOR order %] + [% END # /FOR ordernumber %] + + +
    + [% END # IF orders_grouped.size %] +
@@ -522,7 +531,7 @@ var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose hemisphere:"),_("Northern"),_("Southern", "Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year")); $(document).ready(function() { - $("#subscription_description").tabs(); + $("#renewsub").click(function(){ popup([% subscriptionid | html %]); return false; -- 2.20.1