[Koha-patches] [PATCH] bug 4929 - add validation to patron administration

Robin Sheat robin at catalyst.net.nz
Wed Jul 7 06:46:28 CEST 2010


Sorry, wrong bug number there - this is actually for this:
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=4942

Op woensdag 07-07-2010 om 16:43 uur [tijdzone +1200], schreef Robin
Sheat:
> This validation requires an enrollment period or a date to be provided
> before the form will save, which will prevent invalid dates getting into
> the system.
> ---
>  .../prog/en/modules/admin/categorie.tmpl           |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl
> index 2c1f022..db66f34 100644
> --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl
> +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl
> @@ -60,16 +60,20 @@
>  			_alertString += _("- upperagelimit is not a number") + "\n";
>  				
>  		}
> +                if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
> +                    ok=1;
> +                    _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
> +                }
>  		if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
>  			document.getElementById('enrolmentmessage').className = "error";
>  			return false;
>  		}
>  		
>  		if (ok) { // if there is a problem
> -			alert(_alertString);
> -             return false;
> -        }
> -        // if all is good
> +		    alert(_alertString);
> +                    return false;
> +                }
> +                // if all is good
>  		ff.submit();
>  	}
>  	//]]>

-- 
Robin Sheat
Catalyst IT Ltd.
✆ +64 4 803 2204
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Dit berichtdeel is digitaal ondertekend
URL: </pipermail/koha-patches/attachments/20100707/cda18798/attachment.pgp>


More information about the Koha-patches mailing list