From: Dobrica Pavlinusic Date: Fri, 28 Jan 2011 13:57:11 +0000 (+0100) Subject: use unit all over X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=commitdiff_plain;h=1f12f5ba25530a04f3a5e7b86c3ac88d9526fe1d;hp=d1bfa4d92bec24954f2e7877f6531644bb84e8f3 use unit all over --- diff --git a/lib/BackupPC/CGI/BurnMedia.pm b/lib/BackupPC/CGI/BurnMedia.pm index bf4dfaf..7fce5df 100644 --- a/lib/BackupPC/CGI/BurnMedia.pm +++ b/lib/BackupPC/CGI/BurnMedia.pm @@ -67,8 +67,11 @@ EOF } if ($total_size > ($Conf{ArchiveMediaSize} * $parts)) { - $cont .= eval( q{ ${h2(Error)}}); - $cont .= "Selected backups size " . sprintf("%1.2f", $total_size / 1024) ." Kb exceed max archive size " . sprintf("%1.2f", $Conf{ArchiveMediaSize} / 1024) ." Kb."; + $cont .= eval(' ${h2(Error)} '); + $cont .= join(' ' + , "Selected backups size", unit($total_size) + , "exceed medium size ", unit($Conf{ArchiveMediaSize}) + ); } elsif ($total_size == 0) { $cont .= eval( q{ ${h2(Error)}}); $cont .= "No backups selected."; @@ -130,7 +133,7 @@ EOF Archived following backups: } . join(", ", @selected_backup_ids) . q{
with total size of - } . sprintf("%1.2f Mb", $total_size / 1024 / 1024) + } . unit($total_size) . q{ to media } . $dvd_nr . q{ with following message: @@ -141,6 +144,11 @@ EOF } } + $cont .= join(' ' + , "ArchiveMediaSize:", unit($Conf{ArchiveMediaSize}) + , "ArchiveChunkSize:", unit($Conf{ArchiveChunkSize}) + ); + Header($Lang->{Burn_media}, "", 1, "", $cont); Trailer(); diff --git a/lib/BackupPC/Search.pm b/lib/BackupPC/Search.pm index 888a853..f2dac44 100644 --- a/lib/BackupPC/Search.pm +++ b/lib/BackupPC/Search.pm @@ -458,8 +458,6 @@ print STDERR "## sort=". ($param->{'sort'} || 'no sort param') . " burn sql orde ($row->{volumes}, $row->{inc_size_calc}) = getVolumes($row->{id}); } - $row->{size} = sprintf("%0.2f", $row->{size} / 1024 / 1024); - # do some cluster calculation (approximate) $row->{inc_size} = int(( ($row->{inc_size} + 1023 ) / 2 ) * 2); $row->{inc_size_calc} ||= $row->{inc_size}; @@ -832,8 +830,8 @@ EOF3 } . sort_header($param, 'Date', 'date', 'center') . sort_header($param, 'Age/days', 'age', 'center') . - sort_header($param, 'Size/Mb', 'size', 'center') . - sort_header($param, 'gzip size/Kb', 'incsize', 'center') . + sort_header($param, 'Size', 'size', 'center') . + sort_header($param, 'gzip size', 'incsize', 'center') . qq{ medias }; @@ -871,8 +869,8 @@ EOF3 '' . $backup->{'type'} . '' . '' . epoch_to_iso( $backup->{'date'} ) . '' . '' . $backup->{'age'} . '' . - '' . $backup->{'size'} . '' . - '' . sprintf("%0.1f", $backup->{'inc_size'} / 1024 ) . + '' . unit($backup->{'size'}) . '' . + '' . unit($backup->{'inc_size'}) . '' . '' . '' . '' . ( qq{media} x $backup->{volumes} ) . '' .