small changes
This commit is contained in:
parent
02d24c4e4c
commit
c8139d9333
4 changed files with 17 additions and 6 deletions
|
|
@ -20,6 +20,7 @@ use WebGUI::Session;
|
||||||
use WebGUI::SQL;
|
use WebGUI::SQL;
|
||||||
use WebGUI::Macro;
|
use WebGUI::Macro;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
|
use WebGUI::ErrorHandler;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
|
|
@ -294,7 +295,7 @@ sub getWobjectByCriteria {
|
||||||
if ($wobjectId) {
|
if ($wobjectId) {
|
||||||
$scratchId = "WobjectProxy_" . $wobjectId;
|
$scratchId = "WobjectProxy_" . $wobjectId;
|
||||||
if($session{scratch}{$scratchId}) {
|
if($session{scratch}{$scratchId}) {
|
||||||
return $session{scratch}{$scratchId};
|
return $session{scratch}{$scratchId} unless ($session{var}{adminOn});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -360,7 +361,7 @@ sub getWobjectByCriteria {
|
||||||
|
|
||||||
# No matching wobjects found.
|
# No matching wobjects found.
|
||||||
if (scalar(@wids) == 0) {
|
if (scalar(@wids) == 0) {
|
||||||
return undef;
|
return undef; # fall back to the originally mirrored wobject.
|
||||||
}
|
}
|
||||||
my $wid;
|
my $wid;
|
||||||
# Grab a wid from the results
|
# Grab a wid from the results
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ sub _drawQueryBuilder {
|
||||||
</td>
|
</td>
|
||||||
<td class="qbtd"></td>
|
<td class="qbtd"></td>
|
||||||
<td class="qbtdright">
|
<td class="qbtdright">
|
||||||
<input class="qbselect" type=button value=Add onclick="addCriteria('$fieldLabel', this.form.$opFieldName, this.form.$valFieldName)"></td>
|
<input class="qbButton" type=button value=Add onclick="addCriteria('$fieldLabel', this.form.$opFieldName, this.form.$valFieldName)"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|;
|
|;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,13 @@
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.qbButton {
|
||||||
|
height: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-width: 1px;
|
||||||
|
-moz-border-radius: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.qbText {
|
.qbText {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,17 @@ function addCriteria ( fieldname, opform, valform ) {
|
||||||
var value = getValue(valform);
|
var value = getValue(valform);
|
||||||
var criteria = form.proxyCriteria.value;
|
var criteria = form.proxyCriteria.value;
|
||||||
var conjunction = "";
|
var conjunction = "";
|
||||||
var re = /^\s*$/;
|
if(! /^\s*$/.test(criteria)) {
|
||||||
if(! re.test(criteria)) {
|
|
||||||
conjunction = " " + getValue(form.conjunction) + " ";
|
conjunction = " " + getValue(form.conjunction) + " ";
|
||||||
}
|
}
|
||||||
|
//handle quotes
|
||||||
if(/\s+/.test(fieldname)) {
|
if(/\s+/.test(fieldname)) {
|
||||||
fieldname = '"' + fieldname + '"';
|
fieldname = '"' + fieldname + '"';
|
||||||
}
|
}
|
||||||
var statement = fieldname + " " + operator + " " + '"' + value + '"';
|
if(/^\D+$/.test(value)) {
|
||||||
|
value = '"' + value + '"';
|
||||||
|
}
|
||||||
|
var statement = fieldname + " " + operator + " " + value;
|
||||||
form.proxyCriteria.value = criteria + conjunction + statement;
|
form.proxyCriteria.value = criteria + conjunction + statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue