fixed: Thingy: edit operation sql error and default thing property hidden

This commit is contained in:
Yung Han Khoe 2008-08-19 23:52:00 +00:00
parent c6e9d322a8
commit 2fe2eaf9e2
3 changed files with 23 additions and 9 deletions

View file

@ -21,6 +21,8 @@
- fixed: Tree Navigation menu shows level numbers
- fixed: loginBox macro no longer can return user to "logout" page, logging them out
- fixed: Template Assets broken
- fixed: edit operation sql error, Thingy (Yung Han Khoe)
- fixed: Thingy: default thing property hidden (Yung Han Khoe)
7.5.20
- fixed: DataForm acknowledgement screen shows incorrect value for Date/Time fields

View file

@ -585,7 +585,7 @@ sub getEditForm {
my $things = $self->session->db->buildHashRef('select thingId, label from Thingy_things where assetId = ?',[$self->get("assetId")]);
unless (scalar(keys(%{$things}))) {
if (scalar(keys(%{$things}))) {
$tabform->getTab("display")->selectBox(
-name=>"defaultThingId",
-value=>$self->get("defaultThingId"),
@ -2419,13 +2419,19 @@ sequenceNumber');
});
}
}
$query = "select thingDataId, ";
$query .= join(", ",map {$dbh->quote_identifier('field_'.$_->{fieldId})} @displayInSearchFields);
$query .= " from ".$dbh->quote_identifier("Thingy_".$thingId);
$query .= " where ".join(" and ",@constraints) if (scalar(@constraints) > 0);
if ($orderBy){
$query .= " order by ".$dbh->quote_identifier("field_".$orderBy);
if (scalar(@displayInSearchFields)){
$query = "select thingDataId, ";
$query .= join(", ",map {$dbh->quote_identifier('field_'.$_->{fieldId})} @displayInSearchFields);
$query .= " from ".$dbh->quote_identifier("Thingy_".$thingId);
$query .= " where ".join(" and ",@constraints) if (scalar(@constraints) > 0);
if ($orderBy){
$query .= " order by ".$dbh->quote_identifier("field_".$orderBy);
}
}
else{
$self->session->errorHandler->warn("The default Thing has no fields selected to display in the search.");
return undef;
}
# store query in cache for thirty minutes

View file

@ -210,6 +210,7 @@ function initAddFieldDialog() {
// Add table row to fields on search tab
var search_fields_table = new YAHOO.util.Element('search_fields_table');
var search_fields_table_rows = search_fields_table.getElementsByTagName("tr");
var search_tr = document.createElement('tr');
search_tr.id = "search_tr_"+listItemId;
search_fields_table.appendChild(search_tr);
@ -229,7 +230,12 @@ function initAddFieldDialog() {
var searchIn_td = document.createElement('td');
searchIn_td.id = "search_searchIn_"+listItemId;
searchIn_td.className = 'tableData';
searchIn_td.innerHTML = "<input type='checkbox' name='searchIn_"+listItemId+"' value='1' />";
// only the first field should be checked by default
if (search_fields_table_rows.length == 2){
searchIn_td.innerHTML = "<input type='checkbox' name='searchIn_"+listItemId+"' value='1' checked='checked' />";
}else{
searchIn_td.innerHTML = "<input type='checkbox' name='searchIn_"+listItemId+"' value='1' />";
}
search_tr.appendChild(searchIn_td);
var sortBy_td = document.createElement('td');