@@ -, +, @@ required - add a new csv profile (tools/csv-profiles.pl) without any value. - save => error on empty fields. - fill the "marc" content, select type="sql", fill the csv name input. - save => error on sql content field. - fill the sql content - save => the csv profile is saved. - retry for the edit form. --- .../prog/en/modules/tools/csv-profiles.tt | 27 +++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt @@ -15,21 +15,30 @@ function reloadPage(p) { $("#profile_type").change(function(){ if ( $(this).find("option:selected").val() == "marc" ) { $("#csvnew li.marc_specific").show(); + $("#new_profile_marc_content").attr("required", "required"); $("#csvnew li.sql_specific").hide(); + $("#new_profile_sql_content").removeAttr("required"); } else { $("#csvnew li.marc_specific").hide(); + $("#new_profile_marc_content").removeAttr("required"); $("#csvnew li.sql_specific").show(); + $("#new_profile_sql_content").attr("required", "required"); } }); $("#modify_profile_type").change(function(){ if ( $(this).find("option:selected").val() == "marc" ) { $("#csvedit li.marc_specific").show(); + $("#modify_profile_marc_content").attr("required", "required"); $("#csvedit li.sql_specific").hide(); + $("#modify_profile_sql_content").removeAttr("required"); } else { $("#csvedit li.marc_specific").hide(); + $("#modify_profile_marc_content").removeAttr("required"); $("#csvedit li.sql_specific").show(); + $("#modify_profile_sql_content").attr("required", "required"); } }); + $("#profile_type").change(); $("#modify_profile_type").change(); }); //]]> @@ -79,7 +88,7 @@ function reloadPage(p) {