From 4055f7e377535f1d7952da7aeafa8da1b83720c2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 20 Apr 2022 12:53:27 +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. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- .../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 | 477 +++++++++--------- 4 files changed, 285 insertions(+), 271 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 3e06728f5c..cb7198a532 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -3038,6 +3038,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 7e6520749c..22dac4b769 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 4d86f0c914..121bf26613 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 06a484060b..893d60bf2d 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,184 +91,192 @@ [% 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 %] [% bibliosubtitle | 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 %] [% bibliosubtitle | 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 %] + +
        +
        +
        +
      -