various bug fixes

This commit is contained in:
JT Smith 2004-07-11 15:53:29 +00:00
parent 83b93e22e8
commit fb5bbc4bb8
4 changed files with 22 additions and 9 deletions

View file

@ -544,10 +544,8 @@ sub fieldType {
my (%hash, $output, $type);
tie %hash, 'Tie::IxHash';
# NOTE: What you are about to see is bad code. Do not attempt this
# without adult supervision. =) It was done this way because a huge
# if/elsif construct executes much more quickly than a bunch of
# unnecessary database hits.
my @types = qw(dateTime time zipcode text textarea HTMLArea url date email phone integer yesNo selectList radioList checkList);
# without adult supervision. =)
my @types = qw(dateTime time float zipcode text textarea HTMLArea url date email phone integer yesNo selectList radioList checkList);
$_[0]->{types} = \@types unless ($_[0]->{types});
foreach $type (@{$_[0]->{types}}) {
if ($type eq "text") {
@ -564,6 +562,8 @@ sub fieldType {
$hash{url} = WebGUI::International::get(478);
} elsif ($type eq "date") {
$hash{date} = WebGUI::International::get(479);
} elsif ($type eq "float") {
$hash{float} = WebGUI::International::get("float");
} elsif ($type eq "email") {
$hash{email} = WebGUI::International::get(480);
} elsif ($type eq "phone") {

View file

@ -964,10 +964,13 @@ The page id of the page you're creating a URL for.
=cut
sub makeUnique {
my ($url, $test, $pageId);
$url = $_[0] || "_1";
$pageId = $_[1] || "new";
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$url' and pageId<>'$pageId'")) {
my $url = $_[0] || "_1";
my $pageId = $_[1] || "new";
my $where = "where urlizedTitle=".quote($url);
unless ($pageId eq "new") {
$where .= " and pageId<>".$pageId;
}
while (my ($test) = WebGUI::SQL->quickArray("select urlizedTitle from page ".$where)) {
if ($url =~ /(.*)(\d+$)/) {
$url = $1.($2+1);
} elsif ($test ne "") {

View file

@ -7134,6 +7134,12 @@ Following a guide like the above will help you get good ranking on search engine
message => q|Ends With|,
lastUpdated => 1089039511,
context => q|A phrase or word ends with this.|
},
'float' => {
message => q|Decimal|,
lastUpdated => 1089039511,
context => q|A label that tells the user that this field uses a floating point number, aka a Decimal number, aka a Real number.|
}
};