Bugzilla – Attachment 17404 Details for
Bug 9924
Simplify and rename patron card creator error message include
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9924 - Simplify and rename patron card creator error message include
Bug-9924---Simplify-and-rename-patron-card-creator.patch (text/plain), 12.24 KB, created by
Kyle M Hall (khall)
on 2013-04-12 16:22:55 UTC
(
hide
)
Description:
Bug 9924 - Simplify and rename patron card creator error message include
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-04-12 16:22:55 UTC
Size:
12.24 KB
patch
obsolete
>From 2b893a1f4dad59c7a0937a01279cacbe7d441d24 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 25 Mar 2013 12:22:33 -0400 >Subject: [PATCH] Bug 9924 - Simplify and rename patron card creator error message include > >The patron card creator error message include uses a non-standard method >for displaying error messages, and is poorly-named. > >This patch converts the method of displaying error messages for various >patron card creator options to the standard one ('<div class="dialog >alert">') and renames the include file to make it clear that it relates >only to patron card creator operations. > >To test, perform various operations: > >- Go to 'manage images' and try to upload a file which exceeds the > 500KBfile size limit >- Go to the edit batch page and manually append an error code to the > URL: /cgi-bin/koha/patroncards/edit-batch.pl?op=new&error=403 >- Go to one of the manage pages and manually append an error code to the > URL: > /cgi-bin/koha/patroncards/manage.pl?card_element=profile&error=201 > >Correct display of an error message indicates that the include file is >being found. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/includes/error-messages.inc | 108 -------------------- > .../prog/en/includes/patroncards-errors.inc | 35 +++++++ > .../prog/en/modules/patroncards/edit-batch.tt | 3 +- > .../prog/en/modules/patroncards/image-manage.tt | 2 +- > .../prog/en/modules/patroncards/manage.tt | 2 +- > 5 files changed, 39 insertions(+), 111 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/error-messages.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/error-messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/error-messages.inc >deleted file mode 100644 >index fe71f26..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/error-messages.inc >+++ /dev/null >@@ -1,108 +0,0 @@ >-[% IF ( error ) %] >-<script type='text/javascript'> >-// Gratuitiously copied from http://dhtmlpopups.webarticles.org/basics.php >-// Determine how much the visitor had scrolled >- >-var scrolledX, scrolledY; >-if( self.pageYOffset ) { >- scrolledX = self.pageXOffset; >- scrolledY = self.pageYOffset; >-} else if( document.documentElement && document.documentElement.scrollTop ) { >- scrolledX = document.documentElement.scrollLeft; >- scrolledY = document.documentElement.scrollTop; >-} else if( document.body ) { >- scrolledX = document.body.scrollLeft; >- scrolledY = document.body.scrollTop; >-} >- >-// Determine the coordinates of the center of the page >- >-var centerX, centerY; >-if( self.innerHeight ) { >- centerX = self.innerWidth; >- centerY = self.innerHeight; >-} else if( document.documentElement && document.documentElement.clientHeight ) { >- centerX = document.documentElement.clientWidth; >- centerY = document.documentElement.clientHeight; >-} else if( document.body ) { >- centerX = document.body.clientWidth; >- centerY = document.body.clientHeight; >-} >- >-function myPopupRelocate() { >- var scrolledX, scrolledY; >- if( self.pageYOffset ) { >- scrolledX = self.pageXOffset; >- scrolledY = self.pageYOffset; >- } else if( document.documentElement && document.documentElement.scrollTop ) { >- scrolledX = document.documentElement.scrollLeft; >- scrolledY = document.documentElement.scrollTop; >- } else if( document.body ) { >- scrolledX = document.body.scrollLeft; >- scrolledY = document.body.scrollTop; >- } >- >- var centerX, centerY; >- if( self.innerHeight ) { >- centerX = self.innerWidth; >- centerY = self.innerHeight; >- } else if( document.documentElement && document.documentElement.clientHeight ) { >- centerX = document.documentElement.clientWidth; >- centerY = document.documentElement.clientHeight; >- } else if( document.body ) { >- centerX = document.body.clientWidth; >- centerY = document.body.clientHeight; >- } >- >- var leftOffset = scrolledX + (centerX - 250) / 2; >- var topOffset = scrolledY + (centerY - 200) / 2; >- >- document.getElementById("mypopup").style.top = topOffset + "px"; >- document.getElementById("mypopup").style.left = leftOffset + "px"; >-} >- >-window.onload=function(){ >- myPopupRelocate(); >- document.getElementById("mypopup").style.display = "block"; >- document.body.onscroll = myPopupRelocate; >- window.onscroll = myPopupRelocate; >-} >-</script> >-<div id='mypopup' name='mypopup' style='position: absolute; width: 400px; height: 131px; display: none; background: #FFC url(/intranet-tmpl/prog/img/alert-bg.gif) repeat-x left 0; border: 1px solid #bcbcbc; right: 0px; top: 500px'> >- <span id="message" style="position: absolute; top: 5px; left: 5px;"> >- <strong style="color: #900;">WARNING:</strong> >- [% IF ( 101 ) %] >- The database returned an error while [% IF ( card_element ) %]saving [% card_element %] [% element_id %][% ELSE %]attempting a save operation[% END %]. Please have your system administrator check the error log for details. >- [% ELSIF ( 102 ) %] >- The database returned an error while [% IF ( card_element ) %]deleting [% card_element %] [% element_id %][% ELSIF ( image_ids ) %][% image_ids %][% ELSE %]attempting a delete operation[% END %]. Please have your system administrator check the error log for details. >- [% ELSIF ( 201 ) %] >- An unsupported operation was attempted[% IF ( element_id ) %] on [% card_element %] [% element_id %][% END %]. Please have your system administrator check the error log for details. >- [% ELSIF ( 202 ) %] >- An error has occurred. Please ask your system administrator to check the error log for more details. >- [% ELSIF ( 203 ) %] >- A non-existent or invalid library code was supplied. Please <a href="/cgi-bin/koha/circ/selectbranchprinter.pl">verify</a> that you have a library selected. >- [% ELSIF ( 301 ) %] >- An error has occurred while attempting to upload the image file. Please ask you system administrator to check the error log for more details. >- [% ELSIF ( 302 ) %] >- Image exceeds 500KB. Please resize and import again. >- [% ELSIF ( 303 ) %] >- The database image quota currently only allows a maximum of [% image_limit %] images to be stored at any one time. Please delete one or more images to free up quota space. >- [% ELSIF ( 401 ) %] >- An error has occurred and the item(s) was not added to batch [% batch_id %]. Please have your system administrator check the error log for details. >- [% ELSIF ( 402 ) %] >- The item(s) was not added because the library is not set. Please set your library before adding items to a batch. >- [% ELSIF ( 403 ) %] >- An error has occurred and the item(s) was not removed from batch [% batch_id %]. Please have your system administrator check the error log for details. >- [% ELSIF ( 404 ) %] >- An error has occurred and batch [% batch_id %] was not deleted. Please have your system administrator check the error log for details. >- [% ELSIF ( 405 ) %] >- An error has occurred and batch [% batch_id %] not fully de-duplicated. >- [% ELSE %] >- [% END %] >- </span> >- <span id="close" style="position: absolute; top: 100px; left: 175px;"> >- <input type='submit' value='Close' onClick='document.getElementById("mypopup").style.display = "none"'> >- </span> >-</div> >-[% END %] >- >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc >new file mode 100644 >index 0000000..e7a4c7e >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc >@@ -0,0 +1,35 @@ >+[% IF ( error ) %] >+<div class="dialog alert"> >+ <p> >+ <strong>WARNING:</strong> >+ [% IF ( 101 ) %] >+ The database returned an error while [% IF ( card_element ) %]saving [% card_element %] [% element_id %][% ELSE %]attempting a save operation[% END %]. Please have your system administrator check the error log for details. >+ [% ELSIF ( 102 ) %] >+ The database returned an error while [% IF ( card_element ) %]deleting [% card_element %] [% element_id %][% ELSIF ( image_ids ) %][% image_ids %][% ELSE %]attempting a delete operation[% END %]. Please have your system administrator check the error log for details. >+ [% ELSIF ( 201 ) %] >+ An unsupported operation was attempted[% IF ( element_id ) %] on [% card_element %] [% element_id %][% END %]. Please have your system administrator check the error log for details. >+ [% ELSIF ( 202 ) %] >+ An error has occurred. Please ask your system administrator to check the error log for more details. >+ [% ELSIF ( 203 ) %] >+ A non-existent or invalid library code was supplied. Please <a href="/cgi-bin/koha/circ/selectbranchprinter.pl">verify</a> that you have a library selected. >+ [% ELSIF ( 301 ) %] >+ An error has occurred while attempting to upload the image file. Please ask you system administrator to check the error log for more details. >+ [% ELSIF ( 302 ) %] >+ Image exceeds 500KB. Please resize and import again. >+ [% ELSIF ( 303 ) %] >+ The database image quota currently only allows a maximum of [% image_limit %] images to be stored at any one time. Please delete one or more images to free up quota space. >+ [% ELSIF ( 401 ) %] >+ An error has occurred and the item(s) was not added to batch [% batch_id %]. Please have your system administrator check the error log for details. >+ [% ELSIF ( 402 ) %] >+ The item(s) was not added because the library is not set. Please set your library before adding items to a batch. >+ [% ELSIF ( 403 ) %] >+ An error has occurred and the item(s) was not removed from batch [% batch_id %]. Please have your system administrator check the error log for details. >+ [% ELSIF ( 404 ) %] >+ An error has occurred and batch [% batch_id %] was not deleted. Please have your system administrator check the error log for details. >+ [% ELSIF ( 405 ) %] >+ An error has occurred and batch [% batch_id %] not fully de-duplicated. >+ [% ELSE %] >+ [% END %] >+ </p> >+</div> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >index f8c18c5..8c9a314 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >@@ -152,7 +152,8 @@ > </div> > > >- [% INCLUDE 'error-messages.inc' %] >+ [% INCLUDE 'patroncards-batches-toolbar.inc' %] >+ [% INCLUDE 'patroncards-errors.inc' %] > <div class="yui-g"> > <div class="yui-u first" id="manage-patroncard-batches"> > <div class="hint">Current library: [% LoginBranchname %]</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt >index 66f1725..9c8f944 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt >@@ -56,7 +56,7 @@ > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >- [% INCLUDE 'error-messages.inc' %] >+ [% INCLUDE 'patroncards-errors.inc' %] > <div class="yui-g"> > <div class="yui-u first"> > <h1>Upload Images</h1> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt >index 0f85229..a0ac1f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt >@@ -108,7 +108,7 @@ > <div id="yui-main"> > <div class="yui-b"> > [% INCLUDE 'patroncards-toolbar.inc' %] >- [% INCLUDE 'error-messages.inc' %] >+ [% INCLUDE 'patroncards-errors.inc' %] > <div class="yui-gc"> > <div class="yui-u first" id="manage-patroncards-layouts"> > <div class="hint">Current library: [% LoginBranchname %]</div> >-- >1.7.2.5
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 9924
:
16859
|
17404
|
20542
|
20590
|
20874
|
20875