Bug 3150: (follow-up) Improve and fix new notice templates
[srvgit] / admin / auth_tag_structure.pl
index c2b0762..1c952d5 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-#use warnings; FIXME - Bug 2505
+use Modern::Perl;
 use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Koha;
+use C4::Auth qw( get_template_and_user );
 use C4::Context;
-use C4::Output;
+use C4::Output qw( output_html_with_http_headers );
 use C4::Context;
 
 use Koha::Authority::Types;
 
 # retrieve parameters
-my $input = new CGI;
+my $input = CGI->new;
 my $authtypecode         = $input->param('authtypecode')         || '';    # set to select framework
 my $existingauthtypecode = $input->param('existingauthtypecode') || '';    # set when we have to create a new framework (in authtype) by copying an old one (in existingauthtype)
 
@@ -50,9 +48,7 @@ my ($template, $loggedinuser, $cookie)
     = get_template_and_user({template_name => "admin/auth_tag_structure.tt",
                  query => $input,
                  type => "intranet",
-                 authnotrequired => 0,
-                 flagsrequired => {parameters => 'parameters_remaining_permissions'},
-                 debug => 1,
+                 flagsrequired => {parameters => 'manage_marc_frameworks'},
                  });
 
 my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypecode'] } );
@@ -198,9 +194,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}    = "auth_subfields_structure.pl?tagfield=" . $results->[$i]{'tagfield'} . "&amp;authtypecode=" . $authtypecode;
-        $row_data{edit}             = "$script_name?op=add_form&amp;searchfield=" . $results->[$i]{'tagfield'} . "&amp;authtypecode=" . $authtypecode;
-        $row_data{delete}           = "$script_name?op=delete_confirm&amp;searchfield=" . $results->[$i]{'tagfield'} . "&amp;authtypecode=" . $authtypecode;
         push(@loop_data, \%row_data);
     }
     $template->param(loop => \@loop_data,