@@ -, +, @@ --- 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(-) --- a/Koha/Patron.pm +++ a/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); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ a/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 -%] @@ -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 -%] --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ a/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 %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt +++ a/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 +
    --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ a/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' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt +++ a/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 +
    --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt @@ -28,7 +28,7 @@ [% END %]
  • - Enroll + Enroll Cancel
  • --