From 9e79da0a39c1b29171715b7bfcd8807763755b50 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 | 288 +++++++++++---------- .../prog/en/modules/clubs/templates-add-modify.tt | 51 ++-- .../opac-tmpl/bootstrap/en/modules/clubs/enroll.tt | 2 +- 7 files changed, 199 insertions(+), 184 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 168c8cb..1c53612 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -35,6 +35,7 @@ use Koha::Patron::HouseboundRole; use Koha::Patron::Images; use Koha::Patrons; use Koha::Virtualshelves; +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 bcff76b..7c6275a 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' -%]Patron clubs [%- END -%] [%- END -%] @@ -103,5 +104,8 @@ [%- CASE 'delete_public_lists' -%]Delete public lists [%- CASE 'upload_general_files' -%]Upload any file [%- CASE 'upload_manage' -%]Manage uploaded files (Useless without upload_general_files) + [%- 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 a4bf84a..0b9c9f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -23,6 +23,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 c5e7276..4bc5134 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..34fb75b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt @@ -11,20 +11,24 @@ //<"#filter_c">tr<"bottom pager"ip>', "aoColumnDefs": [ - { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, + { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, ] } )); cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, { + "sPaginationType": "four_button", + "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', "aoColumnDefs": [ - { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, + { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, ] } )); }); 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 +46,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 +72,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 2c7fa73..967c76e 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 7f9cf13..559abd8 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