Switching from building 'edit' link in the script to building it in the template...
[koha-ffzg.git] / admin / marctagstructure.pl
index 495901f..e3021b1 100755 (executable)
@@ -124,11 +124,10 @@ if ($op eq 'add_form') {
 
        if ($searchfield) {
                $template->param(action => "Modify tag",
-                                                               searchfield => "<input type=\"hidden\" name=\"tagfield\" value=\"$searchfield\" />$searchfield");
+                                                               searchfield => $searchfield);
                $template->param('heading-modify-tag-p' => 1);
        } else {
-               $template->param(action => "Add tag",
-                                                               searchfield => "<input type=\"text\" name=\"tagfield\" size=\"5\" maxlength=\"3\" />");
+               $template->param(action => "Add tag");
                $template->param('heading-add-tag-p' => 1);
        }
        $template->param('use-heading-flags-p' => 1);
@@ -161,7 +160,7 @@ if ($op eq 'add_form') {
                                                        );
        }
        $sth->finish;
-       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=marctagstructure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode\"></html>";
+       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode\"></html>";
        exit;
                                                                                                        # END $OP eq ADD_VALIDATE
 ################## DELETE_CONFIRM ##################################
@@ -224,9 +223,6 @@ if ($op eq 'add_form') {
                $row_data{repeatable} = $results->[$i]{'repeatable'};
                $row_data{mandatory} = $results->[$i]{'mandatory'};
                $row_data{authorised_value} = $results->[$i]{'authorised_value'};
-               $row_data{subfield_link} ="marc_subfields_structure.pl?tagfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
-               $row_data{edit} = "$script_name?op=add_form&amp;searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
-               $row_data{delete} = "$script_name?op=delete_confirm&amp;searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
                $row_data{bgcolor} = $toggle;
                push(@loop_data, \%row_data);
        }
@@ -286,11 +282,11 @@ sub duplicate_framework {
                $sth_insert->execute($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value,$newframeworkcode);
        }
 
-       $sth = $dbh->prepare("select frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder,seealso from marc_subfield_structure where frameworkcode=?");
+       $sth = $dbh->prepare("select frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso from marc_subfield_structure where frameworkcode=?");
        $sth->execute($oldframeworkcode);
-       $sth_insert = $dbh->prepare("insert into marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder,seealso) values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
+       $sth_insert = $dbh->prepare("insert into marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso) values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
        while ( my ($frameworkcode, $tagfield, $tagsubfield, $liblibrarian, $libopac, $repeatable, $mandatory, $kohafield, $tab, $authorised_value, $thesaurus_category, $value_builder, $seealso) = $sth->fetchrow) {
-               $sth_insert->execute($newframeworkcode, $tagfield, $tagsubfield, $liblibrarian, $libopac, $repeatable, $mandatory, $kohafield, $tab, $authorised_value, $thesaurus_category, $value_builder, $seealso);
+           $sth_insert->execute($newframeworkcode, $tagfield, $tagsubfield, $liblibrarian, $libopac, $repeatable, $mandatory, $kohafield, $tab, $authorised_value, $thesaurus_category, $value_builder, $seealso);
        }
 }