Changeset 581 for trunk/Common/Form
- Timestamp:
- Oct 14, 2013, 12:26:30 AM (11 years ago)
- Location:
- trunk/Common/Form
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Form.php
r570 r581 136 136 $UseType = 'Enumeration'; 137 137 } else $UseType = $Item['Type']; 138 if(!array_key_exists('SQL', $Item)) $Item['SQL'] = ''; 139 else $Item['SQL'] = str_replace('#Id', $Id, $Item['SQL']); 138 140 $Columns[] = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'OnFilterNameQuery', 139 array('Name' => $Index, 'Type' => $Item['Type'] ));141 array('Name' => $Index, 'Type' => $Item['Type'], 'SQL' => $Item['SQL'])); 140 142 } 141 143 $Columns = implode(',', $Columns); … … 227 229 $this->FormManager->Type->RegisterType($Item['Type'], '', 228 230 $this->FormManager->FormTypes[$Item['Type']]); 229 if($this->FormManager->FormTypes[$Item['Type']]['Type'] == 'Reference') 230 $UseType = 'OneToMany'; 231 else if($this->FormManager->FormTypes[$Item['Type']]['Type'] == 'Enumeration') 231 $CustomType = $this->FormManager->FormTypes[$Item['Type']]['Type']; 232 if($CustomType == 'Reference') 233 $UseType = 'OneToMany'; 234 else if($CustomType == 'Enumeration') 232 235 $UseType = 'Enumeration'; 233 236 } else $UseType = $Item['Type']; -
trunk/Common/Form/Types/Base.php
r548 r581 47 47 function OnFilterName($Item) 48 48 { 49 return('`'.$Item['Name'].'`'); 49 if($Item['SQL'] != '') $SQL = '('.$Item['SQL'].') AS '; 50 else $SQL = ''; 51 return($SQL.'`'.$Item['Name'].'`'); 50 52 } 51 53 52 54 function OnFilterNameQuery($Item) 53 55 { 54 return('`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`'); 56 if($Item['SQL'] != '') 57 $Output = '('.$Item['SQL'].') AS `'.$Item['Name'].'`, ('.$Item['SQL'].') AS `'.$Item['Name'].'_Filter`'; 58 else $Output = '`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`'; 59 return($Output); 55 60 } 56 61 }
Note:
See TracChangeset
for help on using the changeset viewer.