From d69ba6d4722fe2be8cee6cb0aa8855b2e4bf93c6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 5 Jun 2013 08:36:51 -0400 Subject: [PATCH] Bug 10409 - Do not show course entry form if no departments are found The course reserves entry form should not be shown if there are no DEPARTMENT authorized values, since this prevents the form from being submitted. This patch replaces the form with an error message when no DEPARTMENT authorized values are found. Also corrected: - Corrected grid structure for more standard display - Converted labels with no corresponding inputs to - Closed unclosed tags - Corrected incorrect capitalization This patch contains whitespace changes, so please ignore whitespace when examining changes. To test, delete any DEPARTMENT authorized values, if present. Create a new course in Course Reserves. You should see a warning that no DEPARTMENT values were found. If you are logged in with the correct permission, the warning should contain a link to the correct authorized value page. If you do no, the warning should refer the problem to an administrator. After creating one or more DEPARTMENT values, the form should display and submit correctly. Signed-off-by: Jared Camins-Esakov After this patch has been applied, I get an error message and no form if I don't have any DEPARTMENTs defined, which makes sense given that the form can't be submitted without a DEPARTMENT. --- .../prog/en/modules/course_reserves/course.tt | 343 ++++++++++---------- 1 file changed, 175 insertions(+), 168 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt index 85817ed..8e6a60d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt @@ -2,71 +2,75 @@ Koha › Course reserves › [% IF course_name %] Edit [% course_name %] [% ELSE %] New course [% END %] [% INCLUDE 'doc-head-close.inc' %] - - - + + -//]]> - +[% END %] @@ -77,128 +81,131 @@ function RemoveInstructor( cardnumber ) { -
-
-
-
-
-
-
- [% IF course_id %][% END %] -
- [% IF course_id %] Edit [% ELSE %] Create [% END %] course -
    -
  1. - - [% IF departments %] - +[% IF ( departments ) %] + +
    +
    + + [% IF course_id %][% END %] +
    + [% IF course_id %] Edit [% ELSE %] Create [% END %] course +
      +
    1. + + +
    2. + +
    3. + + +
    4. + +
    5. + + +
    6. + +
    7. + + +
    8. + +
    9. + [% IF terms %] + + -
    10. - -
    11. - - -
    12. - -
    13. - - -
    14. - -
    15. - - [% IF terms %] - - [% ELSE %] - No TERM authorised values found! Please create one or more authorised values with the category TERM. - [% END %] -
    16. - -
    17. - - -
      -
      - [% FOREACH i IN instructors %] -
      - [% i.surname %], [% i.firstname %] ( Remove ) - -
      - [% END %] -
      - -
      - -
      - - -
      -
      -
    18. - - -
    19. - -
    20. - - -
    21. - -
    22. - - -
    23. - -
    24. - - [% IF enabled == 'no' %] - - [% ELSE %] - - [% END %] -
    25. -
    + [% END %] + + [% ELSE %] + Term: + No TERM authorised values found! Please create one or more authorised values with the category TERM. + [% END %] +
  2. + +
  3. + Instructors: + +
    +
    + [% FOREACH i IN instructors %] +
    + [% i.surname %], [% i.firstname %] ( Remove ) + +
    + [% END %] +
    -
    - - - Cancel +
    + + +
    - -
-
-
+
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + [% IF enabled == 'no' %] + + [% ELSE %] + + [% END %] +
  • + + + +
    + + + Cancel +
    +
    -
    + +[% ELSE %] + +
    +

    + No DEPARTMENT authorised values found! + [% IF ( CAN_user_parameters ) %] + Please create one or more authorised values with the category DEPARTMENT. + [% ELSE %] + An administrator must create one or more authorised values with the category DEPARTMENT. + [% END %] +

    +[% END %] [% INCLUDE 'intranet-bottom.inc' %] -- 1.7.9.5