From 0f976aabddc6e50fe1e47aee0dc447f7608721d3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 19 Apr 2016 14:52:21 +0000 Subject: [PATCH] Bug 12461 [QA Followup] - Changes based on suggestions --- Koha/Patron.pm | 1 + .../intranet-tmpl/prog/en/includes/permissions.inc | 4 + .../intranet-tmpl/prog/en/includes/tools-menu.inc | 3 + .../prog/en/modules/clubs/clubs-add-modify.tt | 34 +-- .../intranet-tmpl/prog/en/modules/clubs/clubs.tt | 280 +++++++++++---------- .../prog/en/modules/clubs/templates-add-modify.tt | 51 ++-- .../opac-tmpl/bootstrap/en/modules/clubs/enroll.tt | 2 +- 7 files changed, 193 insertions(+), 182 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 55e5ced..77a4d56 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -23,6 +23,7 @@ use Carp; use Koha::Database; use Koha::Patron::Images; +use Koha::Club::Enrollments; use base qw(Koha::Object); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 4a262b9..d5f1754 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -19,6 +19,7 @@ [%- CASE 'coursereserves' -%]Course reserves [%- CASE 'plugins' -%]Koha plugins [%- CASE 'lists' -%]Lists + [%- CASE 'clubs' -%]Clubs [%- END -%] [%- END -%] @@ -100,5 +101,8 @@ [%- CASE 'report' -%]Use report plugins [%- CASE 'tool' -%]Use tool plugins [%- CASE 'delete_public_lists' -%]Delete public lists + [%- CASE 'edit_clubs' -%]Create and edit clubs + [%- CASE 'edit_templates' -%]Create and edit club templates + [%- CASE 'enroll' -%]Enroll patrons in clubs [%- END -%] [%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc index 4ef2a8e..7c499a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -26,6 +26,9 @@ [% IF ( CAN_user_tools_manage_patron_lists ) %]
  • Patron lists
  • [% END %] + [% IF (CAN_user_clubs) %] +
  • Patron clubs
  • + [% END %] [% IF ( CAN_user_tools_moderate_comments ) %]
  • Comments
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt index ee4adb0..634daf9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt @@ -6,22 +6,6 @@ Koha › Tools › Patron clubs › Club [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] - - - @@ -33,12 +17,16 @@ function CheckForm() {
    [% IF stored %]
    -

    Your club was [% IF stored == 'updated' %] updated [% ELSE %] saved [% END %]

    + [% IF stored == 'updated' %] +

    Your club was updated

    + [% ELSE %] +

    Your club was created

    + [% END %] Return to patron clubs
    [% END %] -
    + @@ -55,7 +43,8 @@ function CheckForm() {
    1. - + + Required
    2. @@ -132,9 +121,10 @@ function CheckForm() { - - - Cancel +
      + + Cancel +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt index 8c5472f..fd30102 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt @@ -24,7 +24,7 @@ }); function ConfirmDeleteTemplate( id, name, a ) { - if ( confirm( _("Are you sure you want to delete the club template") + name + "?" ) ) { + if ( confirm( _("Are you sure you want to delete the club template %s?" ).format(name) ) ) { $.ajax({ type: "POST", url: '/cgi-bin/koha/svc/club/template/delete', @@ -42,7 +42,7 @@ } function ConfirmDeleteClub( id, name, a ) { - if ( confirm( _("Are you sure you want to delete the club ") + name + "?" ) ) { + if ( confirm( _("Are you sure you want to delete the club %s?" ).format(name) ) ) { $.ajax({ type: "POST", url: '/cgi-bin/koha/svc/club/delete', @@ -68,139 +68,163 @@ [% INCLUDE 'cat-search.inc' %] -
    -
    -

    Patron clubs

    +
    +
    +
    +
    +

    Patron clubs

    +

    Club templates

    -

    Club templates

    + [% IF CAN_user_clubs_edit_templates %] + + [% END %] - [% IF CAN_user_clubs_edit_templates %] - - [% END %] - - - - - - - - - - - - - - - - [% FOREACH t IN club_templates %] - - - - - - - -
    NameDescriptionPublic enrollmentEmail requiredLibrary  
    [% t.name %][% t.description %] - [% IF t.is_enrollable_from_opac %] - Yes - [% ELSE %] - No - [% END %] - - [% IF t.is_email_required %] - Yes - [% ELSE %] - No - [% END %] - [% Branches.GetName( t.branchcode ) %] - [% IF CAN_user_clubs_edit_templates %] - - Edit - + + + + + + + + + + + + + + + [% IF club_templates %] + [% FOREACH t IN club_templates %] + + + + + + + + + [% END %] - - - + [% ELSE %] + + + + [% END %] + +
    NameDescriptionPublic enrollmentEmail requiredLibrary  
    [% t.name %][% t.description %] + [% IF t.is_enrollable_from_opac %] + Yes + [% ELSE %] + No + [% END %] + + [% IF t.is_email_required %] + Yes + [% ELSE %] + No + [% END %] + [% Branches.GetName( t.branchcode ) %] + [% IF CAN_user_clubs_edit_templates %] + + Edit + + [% END %] + + [% IF CAN_user_clubs_edit_templates %] + + Delete + + [% END %] +
    - [% IF CAN_user_clubs_edit_templates %] - - Delete - - [% END %] -
    + No club templates defined. +
    + +

    Clubs

    + + [% IF CAN_user_clubs_edit_clubs %] +
    +
    + + +
    +
    [% END %] -
    - -

    Clubs

    - - [% IF CAN_user_clubs_edit_clubs %] -
    -
    - -
    - [% END %] - - - - - - - - - - - - - - - - - [% FOREACH c IN clubs %] - - - - - - - - - - - [% END %] - -
    NameTemplateDescriptionPublic enrollmentEmail requiredLibrary  
    [% c.name %][% c.club_template.name %][% c.description %] - [% IF c.club_template.is_enrollable_from_opac %] - Yes - [% ELSE %] - No - [% END %] - - [% IF c.club_template.is_email_required %] - Yes - [% ELSE %] - No - [% END %] - [% Branches.GetName( c.branchcode ) %] - [% IF CAN_user_clubs_edit_clubs %] - - Edit - - [% END %] - - [% IF CAN_user_clubs_edit_clubs %] - - Delete - - [% END %] -
    +
    +
    + [% INCLUDE 'tools-menu.inc' %] +
    [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt index d51ae51..4423c15 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt @@ -4,22 +4,6 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Patron clubs › Club template [% INCLUDE 'doc-head-close.inc' %] - - - @@ -36,7 +20,7 @@ function CheckForm() {
    [% END %] -
    +
    @@ -52,7 +36,8 @@ function CheckForm() {
    1. - + + Required
    2. @@ -98,7 +83,7 @@ function CheckForm() {

    Club fields:

    - These fields will be used in the creation of clubs based on this template +

    These fields will be used in the creation of clubs based on this template

    [% FOREACH f IN club_template.club_template_fields %]
      @@ -136,12 +121,14 @@ function CheckForm() {
    [% END %]
    - - Add new field - +

    Enrollment fields:

    - These fields will be used when enrolling a patron in a club based on this template +

    These fields will be used when enrolling a patron in a club based on this template

    [% FOREACH f IN club_template.club_template_enrollment_fields %]
      @@ -179,17 +166,19 @@ function CheckForm() {
    [% END %]
    - - Add new field - +
    - - - - - Cancel +
    + + + Cancel +
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt index c621dd1..27dd048 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt @@ -28,7 +28,7 @@ [% END %]
  • - Enroll + Enroll Cancel
  • -- 2.1.4