Changeset 948 for trunk/Common/Form
- Timestamp:
- Apr 10, 2023, 7:44:01 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Form.php
r941 r948 82 82 { 83 83 $Item = $this->Definition['Items'][$Index]; 84 $UseType = $this->GetItemType($Item); 84 $UseType = $this->GetItemType($Item); 85 85 86 86 $Result = $this->FormManager->Type->ExecuteTypeEvent($UseType, $Event, … … 175 175 176 176 function GetItemType($Item): string 177 { 177 { 178 178 if (array_key_exists($Item['Type'], $this->FormManager->FormTypes)) 179 179 { … … 186 186 $UseType = 'Enumeration'; 187 187 } else $UseType = $Item['Type']; 188 188 189 189 return $UseType; 190 190 } … … 197 197 (array_key_exists($Item['Type'], $this->FormManager->FormTypes) and 198 198 ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne'))) 199 { 199 { 200 200 $UseType = $this->GetItemType($Item); 201 201 if (!array_key_exists('SQL', $Item)) $Item['SQL'] = ''; … … 217 217 ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne'))) 218 218 { 219 $UseType = $this->GetItemType($Item); 219 $UseType = $this->GetItemType($Item); 220 220 $this->Values[$Index] = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'OnLoadDb', 221 221 array('Value' => $DbRow[$Index], 'Name' => $Index, … … 256 256 257 257 foreach ($this->Definition['Items'] as $Index => $Item) 258 { 258 { 259 259 if (!array_key_exists('ReadOnly', $Item)) $Item['ReadOnly'] = false; 260 260 if ($Item['ReadOnly'] == false) … … 268 268 array('Value' => $this->Values[$Index], 'Name' => $Index, 269 269 'Type' => $Item['Type'], 'Values' => $this->Values, 270 'Filter' => $this->Values[$Index]))) 271 { 270 'Filter' => $this->Values[$Index]))) 271 { 272 272 $Result = false; 273 273 break; 274 274 } 275 } 275 } 276 276 } 277 277 … … 309 309 } else 310 310 { 311 if (isset($Item['Default'])) 311 if (isset($Item['Default'])) 312 312 { 313 313 if (isset($Item['Null']) and ($Item['Null'] == true)) … … 339 339 else $Parameters['Null'] = false; 340 340 if (!$this->FormManager->Type->ExecuteTypeEvent($UseType, 'Validate', 341 $Parameters)) 341 $Parameters)) 342 342 { 343 343 $this->ValuesValidate[$Index] = true; … … 345 345 } 346 346 } 347 } 347 } 348 348 if ($Valid == false) throw new Exception('not validated'); 349 349 return $Valid;
Note:
See TracChangeset
for help on using the changeset viewer.