From 37d5a0cb44d3d37bde91ef6d05e7af694acbee16 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 19 Jul 2023 11:23:58 +0000 Subject: [PATCH] Bug 34197: Group and label vendor contact settings This patch changes the layout of vendor contact settings, both in the entry form and in the detail view. Now acquisitions-specific contact settings and serials-specific contact settings are grouped together and labeled as such. The patch also corrects some markup to make the display more consistent. JS handling of some labels has been removed because the structure change eliminated the need for a "for" attribute. The patch also makes a minor unrelated change to the display of discount percentages to ensure that a blank value doesn't display. To test, apply the patch and go to Acquisitions -> New vendor. - In the vendor entry form, in the "Contacts" section, you should see two groups of checkboxes, "Acquisitions options" and "Serials options." Confirm that the labels can be clicked to check checkboxes. - Test the process of adding another contact and confirm that the additional entry fields work correctly. - Confirm that the "Primary acquisitions contact" and "Primary serials contact" checkboxes act like radio buttons between the two contacts: Checking the box under one contact should uncheck the same box under the other contact. - Confirm that all your data is saved correctly. - Test the page during the edit process as well. - View your updated vendor and confirm that the detail view looks correct. Signed-off-by: Caroline Cyr La Rose Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/acqui/supplier.tt | 232 +++++++++++------- 1 file changed, 141 insertions(+), 91 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index 9141921d55..8903160adf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -20,73 +20,126 @@
  • -
  • - [% IF contact.acqprimary %] - - [% ELSE %] - - [% END %] - -
  • - [% IF contact.serialsprimary %] - - [% ELSE %] - - [% END %] - -
  • - [% IF contact.orderacquisition %] - - [% ELSE %] - - [% END %] - -
  • - [% IF contact.claimacquisition %] - - [% ELSE %] - - [% END %] - -
  • - [% IF contact.claimissues %] - - [% ELSE %] - - [% END %] - -
  • + +
    +
    +
    + Acquisitions options +
      +
    1. + +
    2. +
    3. + +
    4. +
    5. + +
    6. +
    +
    +
    +
    +
    + Serials options +
      +
    1. + +
    2. +
    3. + +
    4. +
    +
    +
    +
    + [% IF contact.id %]
  • [% END %] [% END %] [% BLOCK show_contact %]

    [% contact.name | html %]

    -

    Position: [% contact.position | html %]

    -

    Phone: [% contact.phone | html %]

    -

    Alternative phone: [% contact.altphone | html %]

    -

    Fax: [% contact.fax | html %]

    - [% IF ( contact.email ) %] -

    Email: [% contact.email | html %]

    - [% END %] - [% IF ( contact.notes ) %] -

    Notes: [% contact.notes | html %]

    - [% END %] - [% IF ( contact.acqprimary ) %] -

    Primary acquisitions contact

    - [% END %] - [% IF ( contact.serialsprimary ) %] -

    Primary serials contact

    - [% END %] - [% IF ( contact.orderacquisition ) %] -

    Receives orders

    - [% END %] - [% IF ( contact.claimacquisition ) %] -

    Receives claims for late orders

    - [% END %] - [% IF ( contact.claimissues ) %] -

    Receives claims for late issues

    - [% END %] +
      +
    1. Position: [% contact.position | html %]
    2. +
    3. Phone: [% contact.phone | html %]
    4. +
    5. Alternative phone: [% contact.altphone | html %]
    6. +
    7. Fax: [% contact.fax | html %]
    8. + [% IF ( contact.email ) %] +
    9. Email: [% contact.email | html %]
    10. + [% END %] + [% IF ( contact.notes ) %] +
    11. Notes: [% contact.notes | html %]
    12. + [% END %] + [% IF ( contact.acqprimary || contact.orderacquisition || contact.claimacquisition ) %] +
    13. + Acquisitions options: +
        + [% IF ( contact.acqprimary ) %] +
      1. Primary acquisitions contact
      2. + [% END %] + [% IF ( contact.orderacquisition ) %] +
      3. Receives orders
      4. + [% END %] + [% IF ( contact.claimacquisition ) %] +
      5. Receives claims for late orders
      6. + [% END %] +
      +
    14. + [% END %] + [% IF ( contact.serialsprimary || contact.claimissues ) %] +
    15. + Serials options: +
        + [% IF ( contact.serialsprimary ) %] +
      1. Primary serials contact
      2. + [% END %] + [% IF ( contact.claimissues ) %] +
      3. Receives claims for late issues
      4. + [% END %] +
      +
    16. + [% END %] +
    [% END %] [% SET footerjs = 1 %] @@ -310,50 +363,50 @@ div.rows { padding: 1rem; }

    Vendor details

    -

    +

  • Type: [% IF (type) %][% AuthorisedValues.GetByCode( 'VENDOR_TYPE', type ) | html %][% END %] -

    -

    Company name: [% name | html %]

    -

    Postal address: [% postal | html %]

    -

    Physical address: [% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]

    -

    Phone: [% phone | html %]

    -

    Fax: [% fax | html %]

    +
  • +
  • Company name: [% name | html %]
  • +
  • Postal address: [% postal | html %]
  • +
  • Physical address: [% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]
  • +
  • Phone: [% phone | html %]
  • +
  • Fax: [% fax | html %]
  • [% IF ( url ) %] -

    Website: [% url | html %]

    +
  • Website: [% url | html %]
  • [% END %] [% IF ( accountnumber ) %] -

    Account number: [% accountnumber | html %]

    +
  • Account number: [% accountnumber | html %]
  • [% END %] [% IF vendor.aliases.count %] -

    +

  • Aliases:
      [% FOR alias IN vendor.aliases %]
    • [% alias.alias | html %]
    • [% END %]
    -

    +
  • [% END %]

    Ordering information

    -

    Vendor is: [% IF ( active ) %]Active[% ELSE %]Inactive[% END %]

    -

    List prices are: [% listprice | html %]

    -

    Invoice prices are: [% invoiceprice | html %]

    +
  • Vendor is: [% IF ( active ) %]Active[% ELSE %]Inactive[% END %]
  • +
  • List prices are: [% listprice | html %]
  • +
  • Invoice prices are: [% invoiceprice | html %]
  • [% IF ( tax_rate ) %] -

    Tax number registered: [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]

    -

    List item price includes tax: [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]

    -

    Invoice item price includes tax: [% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]

    +
  • Tax number registered: [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]
  • +
  • List item price includes tax: [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]
  • +
  • Invoice item price includes tax: [% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]
  • [% END %] -

    Discount: [% discount | format("%.1f") %] %

    -

    Tax rate: [% ( tax_rate || 0 ) * 100 | html %] %

    +
  • Discount: [% ( discount || 0 ) | format("%.1f" ) %] %
  • +
  • Tax rate: [% ( tax_rate || 0 ) * 100 | html %] %
  • [% IF deliverytime.defined %] -

    Delivery time: [% deliverytime | html %] days

    +
  • Delivery time: [% deliverytime | html %] days
  • [% END %] [% IF ( notes ) %] -

    Notes: [% notes | html %]

    +
  • Notes: [% notes | html %]
  • [% END %]
    @@ -364,22 +417,22 @@ div.rows { padding: 1rem; } [% FOR i IN vendor.interfaces %]

    [% i.name | html %]

    [% IF i.type %] -

    Type: [% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]

    +
  • Type: [% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]
  • [% END %] [% IF i.uri %] -

    URI: [% i.uri | html %]

    +
  • URI: [% i.uri | html %]
  • [% END %] [% IF i.login %] -

    Login: [% i.login | html %]

    +
  • Login: [% i.login | html %]
  • [% END %] [% IF i.password %] -

    Password: Show

    +
  • Password: Show
  • [% END %] [% IF i.account_email %] -

    Account email: [% i.account_email | html %]

    +
  • Account email: [% i.account_email | html %]
  • [% END %] [% IF i.notes %] -

    Notes: [% i.notes | html %]

    +
  • Notes: [% i.notes | html %]
  • [% END %] [% END %]
    @@ -476,9 +529,6 @@ div.rows { padding: 1rem; } $('input, textarea', new_contact).each(function () { $(this).attr('id', $(this).attr('id') + '_' + timestamp); }); - $('label', new_contact).each(function () { - $(this).attr('for', $(this).attr('for') + '_' + timestamp); - }); $(new_contact).insertBefore(this); if ($('.supplier-contact').length === 2) { // First contact $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) { -- 2.39.5