View | Details | Raw Unified | Return to bug 5453
Collapse All | Expand All

(-)a/cataloguing/addbiblio.pl (-1 / +4 lines)
Lines 920-926 if ( $op eq "addbiblio" ) { Link Here
920
    my @params = $input->param();
920
    my @params = $input->param();
921
    $record = TransformHtmlToMarc( \@params , $input );
921
    $record = TransformHtmlToMarc( \@params , $input );
922
    # check for a duplicate
922
    # check for a duplicate
923
    my ($duplicatebiblionumber,$duplicatetitle) = FindDuplicate($record) if (!$is_a_modif);
923
    my ( $duplicatebiblionumber, $duplicatetitle );
924
    if ( !$is_a_modif ) {
925
        ( $duplicatebiblionumber, $duplicatetitle ) = FindDuplicate($record);
926
    }
924
    my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
927
    my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
925
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
928
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
926
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
929
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
(-)a/reports/issues_avg_stats.pl (-8 / +27 lines)
Lines 554-561 sub calculate { Link Here
554
    # and the number matches the number of columns
554
    # and the number matches the number of columns
555
        my $colcount=0;
555
        my $colcount=0;
556
        foreach my $col ( @loopcol ) {
556
        foreach my $col ( @loopcol ) {
557
            my $value =$table{$row}->{(($col->{coltitle} eq "NULL")or ($col->{coltitle} eq ""))?"zzEMPTY":$col->{coltitle}} / $wgttable{$row}->{(($col->{coltitle} eq "NULL")or ($col->{coltitle} eq ""))?"zzEMPTY":$col->{coltitle}} if ($table{$row}->{(($col->{coltitle} eq "NULL")or ($col->{coltitle} eq ""))?"zzEMPTY":$col->{coltitle}});
557
            my $value;
558
558
            if ($table{$row}->{
559
                    (        ( $col->{coltitle} eq 'NULL' )
560
                          or ( $col->{coltitle} eq q{} )
561
                      ) ? 'zzEMPTY' : $col->{coltitle}
562
                }
563
              ) {
564
                $value = $table{$row}->{
565
                    (        ( $col->{coltitle} eq 'NULL' )
566
                          or ( $col->{coltitle} eq q{} )
567
                      ) ? 'zzEMPTY' : $col->{coltitle}
568
                  } / $wgttable{$row}->{
569
                    (        ( $col->{coltitle} eq 'NULL' )
570
                          or ( $col->{coltitle} eq q{} )
571
                      ) ? 'zzEMPTY' : $col->{coltitle}
572
                  };
573
            }
559
            $table{$row}->{(($col->{coltitle} eq "NULL")or ($col->{coltitle} eq ""))?"zzEMPTY":$col->{coltitle}} = $value;
574
            $table{$row}->{(($col->{coltitle} eq "NULL")or ($col->{coltitle} eq ""))?"zzEMPTY":$col->{coltitle}} = $value;
560
            $table{$row}->{totalrow}+=$value;
575
            $table{$row}->{totalrow}+=$value;
561
            #warn "row : $row col:$col  $cnttable{$row}->{(($col->{coltitle} eq \"NULL\")or ($col->{coltitle} eq \"\"))?\"zzEMPTY\":$col->{coltitle}}";
576
            #warn "row : $row col:$col  $cnttable{$row}->{(($col->{coltitle} eq \"NULL\")or ($col->{coltitle} eq \"\"))?\"zzEMPTY\":$col->{coltitle}}";
Lines 563-574 sub calculate { Link Here
563
            push @loopcell, {value => ($value)?sprintf("%.2f",$value):0  } ;
578
            push @loopcell, {value => ($value)?sprintf("%.2f",$value):0  } ;
564
        }
579
        }
565
        #warn "row : $row colcount:$colcount";
580
        #warn "row : $row colcount:$colcount";
566
        my $total = $table{$row}->{totalrow}/$colcount if ($colcount>0);
581
        my $total;
567
        push @looprow,{ 'rowtitle' => ($row eq "zzEMPTY")?"NULL":$row,
582
        if ( $colcount > 0 ) {
568
                        'loopcell' => \@loopcell,
583
            $total = $table{$row}->{totalrow} / $colcount;
569
                        'hilighted' => ($hilighted >0),
584
        }
570
                        'totalrow' => ($total)?sprintf("%.2f",$total):0
585
        push @looprow,
571
                    };
586
          { 'rowtitle' => ( $row eq "zzEMPTY" ) ? "NULL" : $row,
587
            'loopcell' => \@loopcell,
588
            'hilighted' => ( $hilighted > 0 ),
589
            'totalrow'  => ($total) ? sprintf( "%.2f", $total ) : 0
590
          };
572
        $hilighted = -$hilighted;
591
        $hilighted = -$hilighted;
573
    }
592
    }
574
# 	
593
# 	
(-)a/suggestion/suggestion.pl (-3 / +9 lines)
Lines 288-297 my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patron Link Here
288
$template->param(patron_reason_loop=>$patron_reason_loop);
288
$template->param(patron_reason_loop=>$patron_reason_loop);
289
289
290
#Budgets management
290
#Budgets management
291
my $searchbudgets={ budget_branchcode=>$branchfilter} if $branchfilter;
291
my $budgets = [];
292
my $budgets = GetBudgets($searchbudgets);
292
if ($branchfilter) {
293
    my $searchbudgets = { budget_branchcode => $branchfilter };
294
    $budgets = GetBudgets($searchbudgets);
295
} else {
296
    $budgets = GetBudgets(undef);
297
}
293
298
294
foreach my $budget (@$budgets){
299
foreach my $budget ( @{$budgets} ) {
300
## Please see file perltidy.ERR
295
    $budget->{'selected'}=1 if ($$suggestion_ref{'budgetid'} && $budget->{'budget_id'} eq $$suggestion_ref{'budgetid'})
301
    $budget->{'selected'}=1 if ($$suggestion_ref{'budgetid'} && $budget->{'budget_id'} eq $$suggestion_ref{'budgetid'})
296
};
302
};
297
303
(-)a/tools/export.pl (-8 / +9 lines)
Lines 184-199 else { Link Here
184
       push @itemtypesloop, \%row;
184
       push @itemtypesloop, \%row;
185
    }
185
    }
186
    my @branchloop;
186
    my @branchloop;
187
	for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
187
    for my $thisbranch (
188
        my $selected = 1 if $thisbranch eq $branch;
188
        sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} }
189
        my %row = (
189
        keys %{$branches}
190
            value => $thisbranch,
190
      ) {
191
            selected => $selected,
191
        push @branchloop,
192
          { value      => $thisbranch,
193
            selected   => $thisbranch eq $branch,
192
            branchname => $branches->{$thisbranch}->{'branchname'},
194
            branchname => $branches->{$thisbranch}->{'branchname'},
193
       );
195
          };
194
       push @branchloop, \%row;
195
    }
196
    }
196
    
197
197
    $template->param(
198
    $template->param(
198
        branchloop   => \@branchloop,
199
        branchloop   => \@branchloop,
199
        itemtypeloop => \@itemtypesloop,
200
        itemtypeloop => \@itemtypesloop,
(-)a/tools/holidays.pl (-9 / +11 lines)
Lines 65-82 if ( $onlymine ) { Link Here
65
    $branch = C4::Context->userenv->{'branch'};
65
    $branch = C4::Context->userenv->{'branch'};
66
}
66
}
67
my $branchname = GetBranchName($branch);
67
my $branchname = GetBranchName($branch);
68
my $branches = GetBranches($onlymine);
68
my $branches   = GetBranches($onlymine);
69
my @branchloop;
69
my @branchloop;
70
for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
70
for my $thisbranch (
71
    my $selected = 1 if $thisbranch eq $branch;
71
    sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} }
72
    my %row =(value => $thisbranch,
72
    keys %{$branches} ) {
73
                selected => $selected,
73
    push @branchloop,
74
                branchname => $branches->{$thisbranch}->{'branchname'},
74
      { value      => $thisbranch,
75
            );
75
        selected   => $thisbranch eq $branch,
76
    push @branchloop, \%row;
76
        branchname => $branches->{$thisbranch}->{'branchname'},
77
      };
77
}
78
}
79
78
# branches calculated - put branch codes in a single string so they can be passed in a form
80
# branches calculated - put branch codes in a single string so they can be passed in a form
79
my $branchcodes = join("|", keys %$branches);
81
my $branchcodes = join '|', keys %{$branches};
80
82
81
# Get all the holidays
83
# Get all the holidays
82
84
(-)a/tools/picture-upload.pl (-4 / +9 lines)
Lines 78-84 my ( $total, $handled, @counts, $tempfile, $tfh ); Link Here
78
if ( ($op eq 'Upload') && $uploadfile ) {       # Case is important in these operational values as the template must use case to be visually pleasing!
78
if ( ($op eq 'Upload') && $uploadfile ) {       # Case is important in these operational values as the template must use case to be visually pleasing!
79
    my $dirname = File::Temp::tempdir( CLEANUP => 1);
79
    my $dirname = File::Temp::tempdir( CLEANUP => 1);
80
    $debug and warn "dirname = $dirname";
80
    $debug and warn "dirname = $dirname";
81
    my $filesuffix = $1 if $uploadfilename =~ m/(\..+)$/i;
81
    my $filesuffix;
82
    if ( $uploadfilename =~ m/(\..+)$/i ) {
83
        my $filesuffix = $1;
84
    }
82
    ( $tfh, $tempfile ) = File::Temp::tempfile( SUFFIX => $filesuffix, UNLINK => 1 );
85
    ( $tfh, $tempfile ) = File::Temp::tempfile( SUFFIX => $filesuffix, UNLINK => 1 );
83
    $debug and warn "tempfile = $tempfile";
86
    $debug and warn "tempfile = $tempfile";
84
    my ( @directories, $errors );
87
    my ( @directories, $errors );
Lines 254-261 sub handle_file { Link Here
254
					undef $srcimage;    # This object can get big...
257
					undef $srcimage;    # This object can get big...
255
				}
258
				}
256
				$debug and warn "Image is of mimetype $mimetype";
259
				$debug and warn "Image is of mimetype $mimetype";
257
				my $dberror = PutPatronImage($cardnumber,$mimetype, $imgfile) if $mimetype;
260
                my $dberror;
258
				if ( !$dberror && $mimetype ) { # Errors from here on are fatal only to the import of a particular image, so don't bail, just note the error and keep going
261
                if ($mimetype) {
262
                    $dberror = PutPatronImage( $cardnumber, $mimetype, $imgfile );
263
                }
264
                if ( !$dberror && $mimetype ) { # Errors from here on are fatal only to the import of a particular image, so don't bail, just note the error and keep going
259
					$count{count}++;
265
					$count{count}++;
260
					push @{ $count{filenames} }, { source => $filename, cardnumber => $cardnumber };
266
					push @{ $count{filenames} }, { source => $filename, cardnumber => $cardnumber };
261
				} elsif ( $dberror ) {
267
				} elsif ( $dberror ) {
262
- 

Return to bug 5453