Bug 5462: modified intranet scripts to match templates
authorChristopher Hall <chris.hall@catalyst.net.nz>
Mon, 15 Nov 2010 03:06:24 +0000 (16:06 +1300)
committerColin Campbell <colin.campbell@ptfs-europe.com>
Thu, 3 Feb 2011 09:57:24 +0000 (09:57 +0000)
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
admin/auth_subfields_structure.pl
admin/auth_tag_structure.pl
admin/branches.pl
admin/marc_subfields_structure.pl
admin/marctagstructure.pl
admin/systempreferences.pl
reserve/request.pl

index cee3312..432d496 100755 (executable)
@@ -370,8 +370,8 @@ if ($op eq 'add_form') {
                $row_data{row} = $i;
                push(@loop_data, \%row_data);
        }
-       $template->param('use-heading-flags-p' => 1);
-       $template->param('heading-edit-subfields-p' => 1);
+       $template->param('use_heading_flags_p' => 1);
+       $template->param('heading_edit_subfields_p' => 1);
        $template->param(action => "Edit subfields",
                                                        tagfield => $tagfield,
                                                        tagfieldinput => "<input type=\"hidden\" name=\"tagfield\" value=\"$tagfield\" />",
index b6ae347..27c48e9 100755 (executable)
@@ -120,13 +120,13 @@ if ($op eq 'add_form') {
        if ($searchfield) {
                $template->param(action => "Modify tag",
                                                                searchfield => "<input type=\"hidden\" name=\"tagfield\" value=\"$searchfield\" />$searchfield");
-               $template->param('heading-modify-tag-p' => 1);
+               $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('heading-add-tag-p' => 1);
+               $template->param('heading_add_tag_p' => 1);
        }
-       $template->param('use-heading-flags-p' => 1);
+       $template->param('use_heading_flags_p' => 1);
        $template->param(liblibrarian => $data->{'liblibrarian'},
                                                        libopac => $data->{'libopac'},
                                                        repeatable => "".$data->{'repeatable'},
index 758fa32..f4bcf66 100755 (executable)
@@ -76,14 +76,14 @@ $template->param( ($op || 'else') => 1 );
 if ( $op eq 'add' ) {
 
     # If the user has pressed the "add new branch" button.
-    $template->param( 'heading-branches-add-branch-p' => 1 );
+    $template->param( 'heading_branches_add_branch_p' => 1 );
     editbranchform($branchcode,$template);
 
 }
 elsif ( $op eq 'edit' ) {
 
     # if the user has pressed the "edit branch settings" button.
-    $template->param( 'heading-branches-add-branch-p' => 0,
+    $template->param( 'heading_branches_add_branch_p' => 0,
                         'add' => 1, );
     editbranchform($branchcode,$template);
 }
@@ -103,7 +103,7 @@ elsif ( $op eq 'add_validate' ) {
             if ($existing > 0) {
                 $mod_branch = 0;
                 _branch_to_template($params, $template); # preserve most (FIXME) of user's input
-                $template->param( 'heading-branches-add-branch-p' => 1, 'add' => 1, 'ERROR1' => 1 );
+                $template->param( 'heading_branches_add_branch_p' => 1, 'add' => 1, 'ERROR1' => 1 );
             }
         }
         if ($mod_branch) {
@@ -113,7 +113,7 @@ elsif ( $op eq 'add_validate' ) {
                 # copy input parameters back to form
                 # FIXME - doing this doesn't preserve any branch group selections, but good enough for now
                 editbranchform($branchcode,$template);
-                $template->param( 'heading-branches-add-branch-p' => 1, 'add' => 1, "ERROR$error" => 1 );
+                $template->param( 'heading_branches_add_branch_p' => 1, 'add' => 1, "ERROR$error" => 1 );
             } else {
                 $template->param( else => 1);
                 default("MESSAGE2",$template);
@@ -160,7 +160,7 @@ elsif ( $op eq 'delete_confirmed' ) {
 elsif ( $op eq 'editcategory' ) {
 
     # If the user has pressed the "add new category" or "modify" buttons.
-    $template->param( 'heading-branches-edit-category-p' => 1 );
+    $template->param( 'heading_branches_edit_category_p' => 1 );
     editcatform($categorycode,$template);
 }
 elsif ( $op eq 'addcategory_validate' ) {
@@ -221,7 +221,7 @@ sub default {
     my $innertemplate = shift or return;
     $innertemplate->param($message => 1) if $message;
     $innertemplate->param(
-        'heading-branches-p' => 1,
+        'heading_branches_p' => 1,
     );
     branchinfotable("",$innertemplate);
 }
index 372a811..0049376 100755 (executable)
@@ -364,8 +364,8 @@ if ( $op eq 'add_form' ) {
         $row_data{row}    = $j;
         push( @loop_data, \%row_data );
     }
-    $template->param( 'use-heading-flags-p'      => 1 );
-    $template->param( 'heading-edit-subfields-p' => 1 );
+    $template->param( 'use_heading_flags_p'      => 1 );
+    $template->param( 'heading_edit_subfields_p' => 1 );
     $template->param(
         action   => "Edit subfields",
         tagfield => $tagfield,
index a20f77c..92e0d99 100755 (executable)
@@ -118,12 +118,12 @@ if ($op eq 'add_form') {
        if ($searchfield) {
         $template->param(searchfield => $searchfield);
                $template->param(action => "Modify tag");
-               $template->param('heading-modify-tag-p' => 1);
+               $template->param('heading_modify_tag_p' => 1);
        } else {
                $template->param(action => "Add tag");
-               $template->param('heading-add-tag-p' => 1);
+               $template->param('heading_add_tag_p' => 1);
        }
-       $template->param('use-heading-flags-p' => 1);
+       $template->param('use_heading_flags_p' => 1);
        $template->param(liblibrarian => $data->{'liblibrarian'},
                        libopac => $data->{'libopac'},
                        repeatable => CGI::checkbox(-name=>'repeatable',
index 9ff009d..2ed3913 100755 (executable)
@@ -486,30 +486,30 @@ sub GetPrefParams {
     $params->{'prefoptions'} = $data->{'options'};
 
     if ( not defined( $data->{'type'} ) ) {
-        $params->{'type-free'} = 1;
+        $params->{'type_free'} = 1;
         $params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 );
     } elsif ( $data->{'type'} eq 'Upload' ) {
-        $params->{'type-upload'} = 1;
+        $params->{'type_upload'} = 1;
     } elsif ( $data->{'type'} eq 'Choice' ) {
-        $params->{'type-choice'} = 1;
+        $params->{'type_choice'} = 1;
     } elsif ( $data->{'type'} eq 'YesNo' ) {
-        $params->{'type-yesno'} = 1;
+        $params->{'type_yesno'} = 1;
         $data->{'value'}        = C4::Context->boolean_preference( $data->{'variable'} );
         if ( defined( $data->{'value'} ) and $data->{'value'} eq '1' ) {
-            $params->{'value-yes'} = 1;
+            $params->{'value_yes'} = 1;
         } else {
-            $params->{'value-no'} = 1;
+            $params->{'value_no'} = 1;
         }
     } elsif ( $data->{'type'} eq 'Integer' || $data->{'type'} eq 'Float' ) {
-        $params->{'type-free'} = 1;
+        $params->{'type_free'} = 1;
         $params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 ) ? $data->{'options'} : 10;
     } elsif ( $data->{'type'} eq 'Textarea' ) {
-        $params->{'type-textarea'} = 1;
+        $params->{'type_textarea'} = 1;
         $data->{options} =~ /(.*)\|(.*)/;
         $params->{'cols'} = $1;
         $params->{'rows'} = $2;
     } elsif ( $data->{'type'} eq 'Themes' ) {
-        $params->{'type-choice'} = 1;
+        $params->{'type_choice'} = 1;
         my $type = '';
         ( $data->{'variable'} =~ m#opac#i ) ? ( $type = 'opac' ) : ( $type = 'intranet' );
         @options = ();
@@ -527,7 +527,7 @@ sub GetPrefParams {
             $counter++;
         }
     } elsif ( $data->{'type'} eq 'ClassSources' ) {
-        $params->{'type-choice'} = 1;
+        $params->{'type_choice'} = 1;
         my $type = '';
         @options = ();
         my $sources = GetClassSources();
@@ -564,13 +564,13 @@ sub GetPrefParams {
         my $languages_loop = getTranslatedLanguages( $interface, $theme, $lang, $currently_selected_languages );
 
         $params->{'languages_loop'}    = $languages_loop;
-        $params->{'type-langselector'} = 1;
+        $params->{'type_langselector'} = 1;
     } else {
-        $params->{'type-free'} = 1;
+        $params->{'type_free'} = 1;
         $params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 ) ? $data->{'options'} : 30;
     }
 
-    if ( $params->{'type-choice'} || $params->{'type-free'} || $params->{'type-yesno'} ) {
+    if ( $params->{'type_choice'} || $params->{'type_free'} || $params->{'type_yesno'} ) {
         $params->{'oneline'} = 1;
     }
 
index 7e51364..a31b6e2 100755 (executable)
@@ -330,7 +330,7 @@ foreach my $biblionumber (@biblionumbers) {
         foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } )    {
             my $item = $iteminfos_of->{$itemnumber};
             
-            unless (C4::Context->preference('item-level_itypes')) {
+            unless (C4::Context->preference('item_level_itypes')) {
                 $item->{itype} = $biblioitem->{itemtype};
             }