Guest User

Untitled

a guest
Jul 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. if (scalar(@displayInSearchFields)){
  2. $query = "select thingDataId, ";
  3. if ($thingProperties->{exportMetaData}){
  4. $query .= "dateCreated, createdById, updatedById, updatedByName, lastUpdated, ipAddress, ";
  5. }
  6. $query .= join(", ",map {$dbh->quote_identifier('field_'.$_->{fieldId})} @displayInSearchFields);
  7. $query .= " from ".$dbh->quote_identifier("Thingy_".$thingId);
  8. if($session->form->process('func') eq 'search'){
  9. # Don't add constraints when the search screen is displayed as an 'after save' option.
  10. $query .= " where ".join(" and ",@constraints) if (scalar(@constraints) > 0);
  11. }
  12. if ($orderBy){
  13. $query .= " order by ".$dbh->quote_identifier("field_".$orderBy);
  14. }
  15. }
  16. else{
  17. $self->session->errorHandler->warn("The default Thing has no fields selected to display in the search.");
  18. $noFields = 1;
  19. }
Add Comment
Please, Sign In to add comment