Bug 19678: Clicking Cancel when adding New Course to course reserves shows message...
authorClaire Gravely <claire.gravely@bsz-bw.de>
Wed, 22 Nov 2017 13:54:11 +0000 (13:54 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 20 Dec 2017 16:26:46 +0000 (13:26 -0300)
Clicking on the cancel link when adding a new course to course reserves
displays the message 'Invalid Course!'. It would be better if it
redirected back to the main Course Reserves page.

This patch redirects the user back to the main course reserves page.

To Test:

1. Go to Course Reserves

2. Click '+ New Course'

3. Cancel the process

4. You are shown 'Invalid Course!'

5. Apply patch and repeat steps 1-3

6. You are redirected back to the main course reserves page

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt

index 78dad2c..b2ada82 100644 (file)
                 <fieldset class="action">
                     <input type="submit" value="Save" class="submit" />
 
-                    <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course_id %]" class="cancel">Cancel</a>
+                    [% IF course_id %]
+                        <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course_id %]" class="cancel">Cancel</a>
+                    [% ELSE %]
+                        <a href="/cgi-bin/koha/course_reserves/course-reserves.pl" class="cancel">Cancel</a>
+                    [% END %]
                 </fieldset>
             </form>
         </div>