From 2bec9955c21ed8aef1c1d007bcad38993bbb0a8c Mon Sep 17 00:00:00 2001 From: Nicole Engard Date: Sun, 27 Dec 2009 19:30:08 -0500 Subject: [PATCH] bug 4009 & 4010 add required fields Bug 4009: New list w/out title fails silently Fixed so Title is required when adding a list Bug 4010: Purchase Suggestions Should Require Title Fixed text so that it indicates that title is required Added check to make sure Title is filled in For both bugs I added a required style to the CSS --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 34 ++++++++++-------- .../prog/en/modules/opac-shelves.tmpl | 21 +++++++++-- .../prog/en/modules/opac-suggestions.tmpl | 36 ++++++++++++++----- 3 files changed, 65 insertions(+), 26 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 9e302708af..f9a8f594ef 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -19,6 +19,10 @@ body { padding : 0 0 2.5em 0; } +.required { + color : #C00; +} + caption { font-size : 140%; text-align : left; @@ -33,14 +37,14 @@ fieldset { } fieldset.rows { -border-width : 1px; -border-bottom : 1px solid black; -float : left; -font-size : 90%; -clear : left; -margin: .9em 0 0 0; -padding: 0; -width: 100%; + border-width : 1px; + border-bottom : 1px solid black; + float : left; + font-size : 90%; + clear : left; + margin: .9em 0 0 0; + padding: 0; + width: 100%; } fieldset.rows legend { @@ -64,16 +68,16 @@ fieldset.rows fieldset { } fieldset.rows ol { -padding: 1em 1em 0 1em; -list-style-type: none; + padding: 1em 1em 0 1em; + list-style-type: none; } fieldset.rows li { -float : left; -clear : left; -padding-bottom: 1em; -list-style-type: none; -width: 100%; + float : left; + clear : left; + padding-bottom: 1em; + list-style-type: none; + width: 100%; } fieldset.rows.left li { diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 87b78fc68d..6217977b1c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -123,6 +123,23 @@ $(function() { }); }); + function Check(f) { + var _alertString=""; + var alertString2; + + if(f.addshelf.value.length ==0){ + _alertString += _("- You must enter a List Name\n"); + } + + if (_alertString.length==0) { + document.Aform.submit(); + } else { + alertString2 = _("Form not submitted because of the following problem(s)\n"); + alertString2 += "------------------------------------------------------------------------------------\n\n"; + alertString2 += _alertString; + alert(alertString2); + } + } //]]> @@ -475,7 +492,7 @@ $(function() {
  1. - + " size="60" /> @@ -501,7 +518,7 @@ $(function() {
- + Cancel
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl index e03cd3dc01..263e3aeac8 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl @@ -42,6 +42,24 @@ $.tablesorter.addParser({ return false; }); }); + + function Check(f) { + var _alertString=""; + var alertString2; + + if(f.title.value.length ==0){ + _alertString += _("- You must enter a Title\n"); + } + + if (_alertString.length==0) { + document.Aform.submit(); + } else { + alertString2 = _("Form not submitted because of the following problem(s)\n"); + alertString2 += "------------------------------------------------------------------------------------\n\n"; + alertString2 += _alertString; + alert(alertString2); + } + } //]]> @@ -56,18 +74,18 @@ $.tablesorter.addParser({

Enter a new purchase suggestion

-

Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your purchase suggestion

-

No fields are mandatory. Enter whatever information you have. The "Notes" field can be used to provide any additional information.

+

Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion

+

Only the title is required, but the more information you enter the easier it will be for the librarians to find title you're requesting. The "Notes" field can be used to provide any additional information.

    -
  1. +
  2. -
  3. -
  4. +
  5. +
  6. -
  7. -
  8. -
  9. +
  10. +
-
" /> Cancel
+
" /> Cancel
-- 2.39.5