4.6.6 bug fixes
This commit is contained in:
parent
e305e8ca07
commit
a1a21aa1ee
8 changed files with 2173 additions and 1091 deletions
|
|
@ -1,5 +1,5 @@
|
|||
package WebGUI;
|
||||
our $VERSION = "4.6.5";
|
||||
our $VERSION = "4.6.6";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black LLC.
|
||||
|
|
|
|||
|
|
@ -74,8 +74,10 @@ sub _createThumbnail {
|
|||
WebGUI::ErrorHandler::warn("Couldn't read image for thumnail creation: ".$error) if $error;
|
||||
($x, $y) = $image->Get('width','height');
|
||||
$n = $_[1] || $session{setting}{thumbnailSize};
|
||||
$r = $x>$y ? $x / $n : $y / $n;
|
||||
$image->Scale(width=>($x/$r),height=>($y/$r));
|
||||
if ($x > $n || $y > $n) {
|
||||
$r = $x>$y ? $x / $n : $y / $n;
|
||||
$image->Scale(width=>($x/$r),height=>($y/$r));
|
||||
}
|
||||
if (isIn($_[0]->getType, qw(tif tiff bmp))) {
|
||||
$error = $image->Write($_[0]->{_node}->getPath.'/thumb-'.$_[0]->getFilename.'.png');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -77,20 +77,21 @@ sub fatalError {
|
|||
print '<br>'.$session{setting}{companyName};
|
||||
print '<br>'.$session{setting}{companyEmail};
|
||||
print '<br>'.$session{setting}{companyURL};
|
||||
} else {
|
||||
print '<h3>Session Variables</h3><table bgcolor="#ffffff" style="color: #000000; font-size: 10pt; font-family: helvetica;">';
|
||||
while (my ($section, $hash) = each %session) {
|
||||
while (my ($key, $value) = each %$hash) {
|
||||
if (ref $value eq 'ARRAY') {
|
||||
$value = '['.join(', ',@$value).']';
|
||||
} elsif (ref $value eq 'HASH') {
|
||||
$value = '{'.join(', ',map {"$_ => $value->{$_}"} keys %$value).'}';
|
||||
}
|
||||
print '<tr><td align="right"><b>'.$section.'.'.$key.':</b></td><td>'.$value.'</td>';
|
||||
}
|
||||
print '<tr height=10><td> </td><td> </td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
print '<h3>Session Variables</h3><table bgcolor="#ffffff" style="color: #000000; font-size: 10pt; font-family: helvetica;">';
|
||||
while (my ($section, $hash) = each %session) {
|
||||
while (my ($key, $value) = each %$hash) {
|
||||
if (ref $value eq 'ARRAY') {
|
||||
$value = '['.join(', ',@$value).']';
|
||||
} elsif (ref $value eq 'HASH') {
|
||||
$value = '{'.join(', ',map {"$_ => $value->{$_}"} keys %$value).'}';
|
||||
}
|
||||
print '<tr><td align="right"><b>'.$section.'.'.$key.':</b></td><td>'.$value.'</td>';
|
||||
}
|
||||
print '<tr height=10><td> </td><td> </td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -214,46 +214,43 @@ sub www_listHelpMessages {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_listInternationalMessages {
|
||||
my ($output, $sth, $new, $key, $p, %data, %newList, %list, $i, $missing, @row, @split);
|
||||
tie %data, 'Tie::CPHash';
|
||||
tie %list, 'Tie::IxHash';
|
||||
tie %newList, 'Tie::IxHash';
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%data = WebGUI::SQL->quickHash("select language from language where languageId=".$session{form}{lid});
|
||||
%data = WebGUI::SQL->quickHash("select language from language where languageId=".$session{form}{lid});
|
||||
$missing = '<b>'.WebGUI::International::get(596).'</b>';
|
||||
$output = '<h1>'.WebGUI::International::get(595).' ('.$data{language}.')</h1>';
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=".$session{form}{lid});
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=".$session{form}{lid}." order by namespace");
|
||||
while (%data = $sth->hash) {
|
||||
$list{$data{internationalId}."-".$data{namespace}} = $data{message};
|
||||
$list{$data{namespace}."-".$data{internationalId}} = "<em>[$data{namespace}]</em> - ".$data{message};
|
||||
}
|
||||
$sth->finish;
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=1");
|
||||
while (%data = $sth->hash) {
|
||||
unless ($list{$data{internationalId}."-".$data{namespace}}) {
|
||||
$list{"missing-".$data{internationalId}."-".$data{namespace}} = $missing;
|
||||
}
|
||||
unless ($list{$data{namespace}."-".$data{internationalId}}) {
|
||||
$list{"missing-".$data{namespace}."-".$data{internationalId}} = "<em>[$data{namespace}]</em> - ".$missing;
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
foreach $key (sort {$b cmp $a} keys %list) {
|
||||
$newList{$key}=$list{$key};
|
||||
}
|
||||
foreach $key (keys %newList) {
|
||||
@split = split(/-/,$key);
|
||||
if ($split[0] eq "missing") {
|
||||
$split[0] = $split[1];
|
||||
$split[1] = $split[2];
|
||||
$new = 1;
|
||||
} else {
|
||||
$new = 0;
|
||||
}
|
||||
$row[$i] = editIcon('op=editInternationalMessage&lid='.$session{form}{lid}.'&iid='.$split[0].'&namespace='.$split[1]
|
||||
.'&pn='.$session{form}{pn}.'&missing='.$new)
|
||||
.' '.$newList{$key}."<br>";
|
||||
$i++;
|
||||
}
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=listInternationalMessages&lid='.$session{form}{lid}),\@row,100);
|
||||
foreach $key (sort {$b cmp $a} keys %list) {
|
||||
$newList{$key}=$list{$key};
|
||||
}
|
||||
foreach $key (keys %newList) {
|
||||
@split = reverse(split(/-/,$key));
|
||||
if ($split[3] eq "missing") {
|
||||
$new = 1;
|
||||
} else {
|
||||
$new = 0;
|
||||
}
|
||||
$row[$i] = editIcon('op=editInternationalMessage&lid='.$session{form}{lid}.'&iid='.$split[0].'&namespace='.$split[1]
|
||||
.'&pn='.$session{form}{pn}.'&missing='.$new)
|
||||
.' '.$newList{$key}."<br>"; # add real message here
|
||||
$i++;
|
||||
}
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=listInternationalMessages&lid='.$session{form}{lid}),\@row,100);
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
return _submenu($output);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,11 @@ sub www_view {
|
|||
$output .= $_[0]->description;
|
||||
$output .= WebGUI::International::get(17,$namespace)." ".$query."<p>" if ($_[0]->get("debugMode"));
|
||||
if ($dsn =~ /\DBI\:\w+\:\w+/) {
|
||||
$dbh = DBI->connect($dsn,$_[0]->get("username"),$_[0]->get("identifier"));
|
||||
eval{$dbh = DBI->connect($dsn,$_[0]->get("username"),$_[0]->get("identifier"))};
|
||||
if ($@) {
|
||||
WebGUI::ErrorHandler::warn("SQL Report [".$_[0]->get("wobjectId")."] ".$@);
|
||||
undef $dbh;
|
||||
}
|
||||
} else {
|
||||
$output .= WebGUI::International::get(9,$namespace).'<p>' if ($_[0]->get("debugMode"));
|
||||
WebGUI::ErrorHandler::warn("SQLReport [".$_[0]->get("wobjectId")."] The DSN specified is of an improper format.");
|
||||
|
|
@ -196,7 +200,7 @@ sub www_view {
|
|||
$dbh->disconnect();
|
||||
} else {
|
||||
$output .= WebGUI::International::get(12,$namespace).'<p>' if ($_[0]->get("debugMode"));
|
||||
WebGUI::ErrorHandler::warn("SQLReport [".$_[0]->get("wobjectId")."] Could not connect to remote database.");
|
||||
WebGUI::ErrorHandler::warn("SQLReport [".$_[0]->get("wobjectId")."] Could not connect to database.");
|
||||
}
|
||||
return $_[0]->processMacros($output);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue