Bugzilla – Attachment 20966 Details for
Bug 5031
CSV export profile form doesn't indicate that profile marcfields are required
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5031: CSV profiles: content fields are required
Bug-5031-CSV-profiles-content-fields-are-required.patch (text/plain), 6.54 KB, created by
Jonathan Druart
on 2013-09-10 15:22:49 UTC
(
hide
)
Description:
Bug 5031: CSV profiles: content fields are required
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-09-10 15:22:49 UTC
Size:
6.54 KB
patch
obsolete
>From ca4ebe66136cb9deaab4f9f8c509a381dec980c5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 10 Sep 2013 17:19:10 +0200 >Subject: [PATCH] Bug 5031: CSV profiles: content fields are required > >Some fields are required on editing/adding csv profiles. > >Test plan: >- 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 | 23 ++++++++++++++------ > 1 file changed, 16 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >index 9c58751..0d068aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >+++ b/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) { > <fieldset class="rows"> > <ol> > <li><label for="profile_name" class="required">Profile name: </label> >- <input type="text" id="profile_name" name="profile_name" /></li> >+ <input type="text" id="profile_name" name="profile_name" required="required" /></li> > > <li> > <label for="profile_type" class="required">Profile type: </label> >@@ -143,14 +152,14 @@ function reloadPage(p) { > </select></li> > > >- <li class="marc_specific"><label for="new_profile_marc_content">Profile MARC fields: </label> >+ <li class="marc_specific"><label for="new_profile_marc_content" class="required">Profile MARC fields: </label> > <textarea cols="50" rows="2" name="profile_marc_content" id="new_profile_marc_content"></textarea> > <p>You have to define which fields or subfields you want to export, separated by pipes.</p> > <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field number with an header, followed by the equal sign.</p> > <p>Example: Personal name=200|Entry element=210$a|300|009</p> > </li> > <li class="sql_specific"> >- <label for="new_profile_sql_content">Profile SQL fields: </label> >+ <label for="new_profile_sql_content" class="required">Profile SQL fields: </label> > <textarea cols="50" rows="2" name="profile_sql_content" id="new_profile_sql_content"></textarea> > <p>You have to define which fields you want to export, separated by pipes.</p> > <p>You can also use your own headers (instead of the ones from Koha) by prefixing the field name with an header, followed by the equal sign.</p> >@@ -170,7 +179,7 @@ function reloadPage(p) { > <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="post"> > <fieldset class="rows"> > <ol> >- <li><label for="modify_profile_name">Profile name: </label> >+ <li><label for="modify_profile_name" class="required">Profile name: </label> > <select id="modify_profile_name" name="profile_name" onchange="javascript:reloadPage(this)"> > <option value="0">-- Choose One --</option> > [% FOREACH existing_profile IN existing_profiles %] >@@ -183,7 +192,7 @@ function reloadPage(p) { > </select></li> > > <li> >- <label for="modify_profile_type">Profile type: </label> >+ <label for="modify_profile_type" class="required">Profile type: </label> > <select id="modify_profile_type" name="profile_type"> > <option value="marc">MARC</option> > [% IF selected_profile_type == "sql" %] >@@ -343,11 +352,11 @@ function reloadPage(p) { > [% END %] > </select></li> > >- <li class="marc_specific"><label for="modify_profile_marc_content">Profile MARC fields: </label> >+ <li class="marc_specific"><label for="modify_profile_marc_content" class="required">Profile MARC fields: </label> > <textarea cols="50" rows="2" name="profile_marc_content" id="modify_profile_marc_content">[% selected_profile_content %]</textarea></li> > > <li class="sql_specific"> >- <label for="modify_profile_sql_content">Profile SQL fields: </label> >+ <label for="modify_profile_sql_content" class="required">Profile SQL fields: </label> > <textarea cols="50" rows="2" name="profile_sql_content" id="modify_profile_sql_content">[% selected_profile_content %]</textarea> > </li> > >-- >1.7.10.4
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 5031
:
20966
|
21303
|
21304
|
23257
|
23258