From 1ad188f9d67c729ff7119f5ede8e06cf3133a750 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. Signed-off-by: Katrin Fischer Passes all tests and QA script. You now see a useful error message, when no departments have been defined. Else you are taken to the correct form. Signed-off-by: Galen Charlton --- .../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 42dc1c45ab..b4ab8ea552 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 authorized values found! Please create one or more authorized 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 authorized values found! + [% IF ( CAN_user_parameters ) %] + Please create one or more authorized values with the category DEPARTMENT. + [% ELSE %] + An administrator must create one or more authorized values with the category DEPARTMENT. + [% END %] +

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