Changeset 447 for trunk/Common/Forms.php
- Timestamp:
- Oct 16, 2012, 8:26:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Forms.php
r445 r447 71 71 { 72 72 if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default']; 73 if(array_key_exists($Item['Type'], $FormTypes)) 74 { 75 if(!array_key_exists($Item['Type'], $System->Type->TypeDefinitionList)) 76 $System->Type->RegisterType($Item['Type'], '', 77 $FormTypes[$Item['Type']]); 78 if($FormTypes[$Item['Type']]['Type'] == 'Reference') 79 $UseType = 'OneToMany'; 80 else if($FormTypes[$Item['Type']]['Type'] == 'Enumeration') 81 $UseType = 'Enumeration'; 82 } else $UseType = $Item['Type']; 83 $Edit = ''.$System->Type->ExecuteTypeEvent($UseType, 'OnEdit', 84 array('Value' => $this->Values[$Index], 'Name' => $Index, 85 'Type' => $Item['Type'])).''; 73 $Parameters = array('Value' => $this->Values[$Index], 'Name' => $Index, 74 'Type' => $Item['Type']); 75 if(array_key_exists('Null', $Item)) $Parameters['Null'] = $Item['Null']; 76 else unset($Parameters['Null']); 77 78 if(array_key_exists($Item['Type'], $FormTypes)) 79 { 80 if(!array_key_exists($Item['Type'], $System->Type->TypeDefinitionList)) 81 $System->Type->RegisterType($Item['Type'], '', 82 $FormTypes[$Item['Type']]); 83 if($FormTypes[$Item['Type']]['Type'] == 'Reference') 84 { 85 $UseType = 'OneToMany'; 86 } else if($FormTypes[$Item['Type']]['Type'] == 'Enumeration') 87 $UseType = 'Enumeration'; 88 } else $UseType = $Item['Type']; 89 $Edit = ''.$System->Type->ExecuteTypeEvent($UseType, 'OnEdit', $Parameters).''; 86 90 87 91 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); … … 131 135 { 132 136 if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default']; 133 if(array_key_exists($Item['Type'], $FormTypes)) 134 { 135 if(!array_key_exists($Item['Type'], $System->Type->TypeDefinitionList)) 136 $System->Type->RegisterType($Item['Type'], '', 137 $FormTypes[$Item['Type']]); 138 if($FormTypes[$Item['Type']]['Type'] == 'Reference') 139 $UseType = 'OneToMany'; 140 else if($FormTypes[$Item['Type']]['Type'] == 'Enumeration') 141 $UseType = 'Enumeration'; 142 } else $UseType = $Item['Type']; 143 $Values[$Index] = ''.$System->Type->ExecuteTypeEvent($UseType, 'OnSaveDb', 144 array('Value' => $this->Values[$Index], 'Name' => $Index, 145 'Type' => $Item['Type'])).''; 137 $Parameters = array('Value' => $this->Values[$Index], 'Name' => $Index, 138 'Type' => $Item['Type']); 139 140 if(array_key_exists($Item['Type'], $FormTypes)) 141 { 142 if(!array_key_exists($Item['Type'], $System->Type->TypeDefinitionList)) 143 $System->Type->RegisterType($Item['Type'], '', 144 $FormTypes[$Item['Type']]); 145 if($FormTypes[$Item['Type']]['Type'] == 'Reference') 146 { 147 $UseType = 'OneToMany'; 148 } 149 else if($FormTypes[$Item['Type']]['Type'] == 'Enumeration') 150 $UseType = 'Enumeration'; 151 } else $UseType = $Item['Type']; 152 $Values[$Index] = ''.$System->Type->ExecuteTypeEvent($UseType, 'OnSaveDb', $Parameters).''; 146 153 147 154 //echo($DbRow[$Index].'='.$this->Values[$Index].'<br/>'); … … 152 159 $DbResult = $Database->insert($this->Definition['Table'], $Values); 153 160 } else 154 $DbResult = $Database->update($this->Definition['Table'], 'Id='.$Id, $Values);161 $DbResult = $Database->update($this->Definition['Table'], 'Id='.$Id, $Values); 155 162 //echo($Database->LastQuery); 156 163 }
Note:
See TracChangeset
for help on using the changeset viewer.