From 1f01b7f91200350c3ca2ecd05f8511f1ef943e03 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 3 May 2010 21:24:34 +0000 Subject: bug 1642 fixed: if no category exists, prevent from selecting an existing category (before form submission). git-svn-id: http://piwigo.org/svn/trunk@6057 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/photos_add_direct.tpl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'admin') diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl index f5a8c7f53..ffa5e2415 100644 --- a/admin/themes/default/template/photos_add_direct.tpl +++ b/admin/themes/default/template/photos_add_direct.tpl @@ -49,6 +49,12 @@ jQuery(document).ready(function(){ } + if ($("select[name=category] option").length == 0) { + $('input[name=category_type][value=existing]').attr('disabled', true); + $('input[name=category_type]').attr('checked', false); + $('input[name=category_type][value=new]').attr('checked', true); + } + $("input[name=category_type]").click(function () { $("[id^=category_type_]").hide(); $("#category_type_"+$(this).attr("value")).show(); -- cgit v1.2.3