Bug 17173: Quick jump to subfield edition form

There are too many clicks to jump to the edit form of a specific
subfield.

This patch adds a hidden feature (i.e. will not be polished or
documented).

When searching for a tag field from a marc framework structure, it's not
possible to search for a tag subfield to jump directly to the subfield
edition form.

Test plan:
On /admin/marctagstructure.pl?frameworkcode=FRAMEWORKCODE
Search for a subfield (952$d)
you will be redirected to the subfield edition form

There is no check if the subfield does not exist.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-08-23 18:50:20 +01:00 committed by Kyle M Hall
parent 1e17c92905
commit 430a641482

View file

@ -285,6 +285,12 @@ if ($op eq 'add_form') {
$template->param(select_display => "True",
loop => \@loop_data);
} else {
# Hidden feature: If search was field$subfield, redirect to the subfield edit form
my ( $tagfield, $tagsubfield ) = split /\$/, $searchfield;
if ( $tagsubfield ) {
print $input->redirect('/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&tagfield='.$tagfield.'&frameworkcode='.$frameworkcode.'#sub'.$tagsubfield.'field');
exit;
}
#here, normal old style : display every tags
my ($count,$results)=StringSearch($searchfield,$frameworkcode);
$cnt = $count;