Bugzilla – Attachment 66679 Details for
Bug 19231
No warning of number of attached items when deleting a course
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19231: Add number of attached items to confirm message when deleting course
Bug-19231-Add-number-of-attached-items-to-confirm-.patch (text/plain), 2.68 KB, created by
Aleisha Amohia
on 2017-08-31 22:06:14 UTC
(
hide
)
Description:
Bug 19231: Add number of attached items to confirm message when deleting course
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-08-31 22:06:14 UTC
Size:
2.68 KB
patch
obsolete
>From 3387aa306e7257b17a7deb0388317dbf34cc55fd Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 31 Aug 2017 22:02:05 +0000 >Subject: [PATCH] Bug 19231: Add number of attached items to confirm message > when deleting course > >To test: >1) Ensure UseCourseReserves is enabled >2) Go to Course Reserves and create 3 new courses >3) Add one item to a course, add two items to another course, and add no >items to the third course >4) Delete the course with no items. Confirm the error message shows up. >No need to say how many attached items there are here (because there are >none). >5) Delete the course with one item. Confirm the error message shows and >warns of the one attached item and makes grammatical sense >6) Delete the course with two items. Confirm the error message shows and >shows the correct number of attached items and makes grammatical sense >7) Confirm clicking 'Cancel' and 'OK' does what is expected > >Sponsored-by: Catalyst IT >--- > course_reserves/course-details.pl | 1 + > .../prog/en/modules/course_reserves/course-details.tt | 8 +++++++- > 2 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/course_reserves/course-details.pl b/course_reserves/course-details.pl >index af1eb62..a9ffe2c 100755 >--- a/course_reserves/course-details.pl >+++ b/course_reserves/course-details.pl >@@ -60,6 +60,7 @@ my $course_reserves = GetCourseReserves( > $template->param( > course => $course, > course_reserves => $course_reserves, >+ count => scalar @$course_reserves, > ); > > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index 3e6f8c3..e9f6e7b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -23,7 +23,13 @@ > }); > > $("#delete_course").click(function(){ >- return confirm( _("Are you sure you want to delete this course?") ); >+ [% IF count == 1 %] >+ return confirmDelete(_("Are you sure you want to delete this course? There is [% count %] attached item.") ); >+ [% ELSIF count != 1 && count > 0 %] >+ return confirmDelete(_("Are you sure you want to delete this course? There are [% count %] attached items.") ); >+ [% ELSE %] >+ return confirmDelete(_("Are you sure you want to delete this course?")); >+ [% END %] > }); > $(".disabled").tooltip().on("click", function(e){ > e.preventDefault(); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19231
:
66679
|
67069
|
67071
|
68726
|
68783