Bugzilla – Attachment 49639 Details for
Bug 16092
Fix error dialog and use Font Awesome Icons when deleting branch group
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16092: Fix error dialog and introduce the Font Awesome icons when delete a branch category
Bug-16092-Fix-error-dialog-and-introduce-the-Font-.patch (text/plain), 6.05 KB, created by
Héctor Eduardo Castro Avalos
on 2016-03-29 15:01:57 UTC
(
hide
)
Description:
Bug 16092: Fix error dialog and introduce the Font Awesome icons when delete a branch category
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-03-29 15:01:57 UTC
Size:
6.05 KB
patch
obsolete
>From 19ab8d6519133ff3aa120747c596979bc2879503 Mon Sep 17 00:00:00 2001 >From: Hector Castro <hector.hecaxmmx@gmail.com> >Date: Thu, 17 Mar 2016 10:42:10 -0600 >Subject: [PATCH] Bug 16092: Fix error dialog and introduce the Font Awesome > icons when delete a branch category >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Also change admin/branch.pl type => 'error' to type => 'alert' to fit >with wiki <https://wiki.koha-community.org/wiki/Interface_patterns#Errors_and_messages> > >To test: >1) Apply on top 16047 and 16091 >1) Go to Admin -> Libraries and groups >2) Try to delete a library with patrons and bib items >3) See the error message in yellow >4) Try to delete a branch category/group without any library attached > to it >5) Apply patch and repeat steps 1 to 4. Notice about the changes >6) Test buttons Yes, delete and No, do not delete and verify that they > work as expected > >Signed-off-by: Marc Véron <veron@veron.ch> > >NOTE: Patch rebased and reword title according with QA comment 4 >--- > admin/branches.pl | 16 ++++++++-------- > .../intranet-tmpl/prog/en/modules/admin/branches.tt | 12 +++++++----- > 2 files changed, 15 insertions(+), 13 deletions(-) > >diff --git a/admin/branches.pl b/admin/branches.pl >index c2ec087..6031f2f 100755 >--- a/admin/branches.pl >+++ b/admin/branches.pl >@@ -93,7 +93,7 @@ if ( $op eq 'add_form' ) { > > eval { $library->store; }; > if ($@) { >- push @messages, { type => 'error', code => 'error_on_update' }; >+ push @messages, { type => 'alert', code => 'error_on_update' }; > } else { > push @messages, { type => 'message', code => 'success_on_update' }; > } >@@ -107,7 +107,7 @@ if ( $op eq 'add_form' ) { > eval { $library->store; }; > $library->add_to_categories( \@categories ); > if ($@) { >- push @messages, { type => 'error', code => 'error_on_insert' }; >+ push @messages, { type => 'alert', code => 'error_on_insert' }; > } else { > push @messages, { type => 'message', code => 'success_on_insert' }; > } >@@ -126,7 +126,7 @@ if ( $op eq 'add_form' ) { > > if ( $items_count or $patrons_count ) { > push @messages, >- { type => 'error', >+ { type => 'alert', > code => 'cannot_delete_library', > data => { > items_count => $items_count, >@@ -147,7 +147,7 @@ if ( $op eq 'add_form' ) { > my $deleted = eval { $library->delete; }; > > if ( $@ or not $deleted ) { >- push @messages, { type => 'error', code => 'error_on_delete' }; >+ push @messages, { type => 'alert', code => 'error_on_delete' }; > } else { > push @messages, { type => 'message', code => 'success_on_delete' }; > } >@@ -173,7 +173,7 @@ if ( $op eq 'add_form' ) { > $category->show_in_pulldown( $input->param('show_in_pulldown') eq 'on' ); > eval { $category->store; }; > if ($@) { >- push @messages, { type => 'error', code => 'error_on_update_category' }; >+ push @messages, { type => 'alert', code => 'error_on_update_category' }; > } else { > push @messages, { type => 'message', code => 'success_on_update_category' }; > } >@@ -186,7 +186,7 @@ if ( $op eq 'add_form' ) { > $category->show_in_pulldown( $input->param('show_in_pulldown') eq 'on' ); > eval { $category->store; }; > if ($@) { >- push @messages, { type => 'error', code => 'error_on_insert_category' }; >+ push @messages, { type => 'alert', code => 'error_on_insert_category' }; > } else { > push @messages, { type => 'message', code => 'success_on_insert_category' }; > } >@@ -196,7 +196,7 @@ if ( $op eq 'add_form' ) { > my $category = Koha::LibraryCategories->find($categorycode); > if ( my $libraries_count = $category->libraries->count ) { > push @messages, >- { type => 'error', >+ { type => 'alert', > code => 'cannot_delete_category', > data => { libraries_count => $libraries_count, }, > }; >@@ -209,7 +209,7 @@ if ( $op eq 'add_form' ) { > my $deleted = eval { $category->delete; }; > > if ( $@ or not $deleted ) { >- push @messages, { type => 'error', code => 'error_on_delete_category' }; >+ push @messages, { type => 'alert', code => 'error_on_delete_category' }; > } else { > push @messages, { type => 'message', code => 'success_on_delete_category' }; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >index aceec04..47da934 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >@@ -79,7 +79,7 @@ tinyMCE.init({ > <div id="yui-main"> > <div class="yui-b"> > >-[% FOR m IN messages %] >+[% FOREACH m IN messages %] > <div class="dialog [% m.type %]"> > [% SWITCH m.code %] > [% CASE 'error_on_update' %] >@@ -381,13 +381,15 @@ tinyMCE.init({ > [% END %] > > [% IF op == 'delete_confirm_category' %] >- <div class="dialog message"> >- Are you sure you want to delete the group '[% category.codedescription %]' ([% category.categorycode %])? >+ <div class="dialog alert"> >+ <h3>Are you sure you want to delete the group '[% category.codedescription %]' ([% category.categorycode %])?</h3> > <form action="/cgi-bin/koha/admin/branches.pl" method="post"> > <input type="hidden" name="op" value="delete_confirmed_category" /> > <input type="hidden" name="categorycode" value="[% category.categorycode |html %]" /> >- <input type="submit" value="Delete" /> >- <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a> >+ <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button> >+ </form> >+ <form action="/cgi-bin/koha/admin/branches.pl" method="get"> >+ <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button> > </form> > </div> > [% END %] >-- >1.7.10.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 16092
:
49280
|
49281
|
49639
|
49640
|
49733