- Timestamp:
- May 12, 2009, 11:30:51 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base.php
r36 r38 51 51 if(array_key_exists('OrderColumn', $_GET)) 52 52 { 53 if( $_SESSION['OrderTable'] != $List['Id']) // Different table => set ascending order53 if(array_key_exists('OrderTable', $_SESSION) and ($_SESSION['OrderTable'] != $List['Id'])) // Different table => set ascending order 54 54 $_SESSION['OrderDirection'] = 0; 55 55 $_SESSION['OrderColumn'] = $_GET['OrderColumn']; … … 222 222 if($Type['BaseType'] != 'PointerOneToMany') 223 223 { 224 $DefinitionItems[] = array('Name' => $Index, 'Caption' => $Item['TextBefore'].$Required, 'Value' => $DbRow[$Index], 'SourceTable' => $List['Id'], 'SourceItemId' => $DbRow[$List['IdName']], 'Type' => $Item['Type']); 225 } 224 if($Item['Editable'] == 1) 225 { 226 $DefinitionItems[] = array('Name' => $Index, 'Caption' => $Item['TextBefore'], 'Value' => $DbRow[$Index], 'SourceTable' => $List['Id'], 'SourceItemId' => $DbRow[$List['IdName']], 'Type' => $Item['Type']); 227 } else $DefinitionItems[] = array('Name' => $Index, 'Type' => TypeHiddenId, 'Caption' => '', 'Value' => $DbRow[$Index]); 228 } 226 229 } 227 230 } … … 239 242 $Output = 'Změny uloženy.'; 240 243 $Output .= ShowViewItem($List, $Id); 241 $Form->Values['Column'] = $_POST['Column']; 244 if(array_key_exists('Column', $_POST)) $Form->Values['Column'] = $_POST['Column']; 245 else $Form->Values['Column'] = ''; 242 246 $Form->Values['Id'] = $Id; 243 247 $Form->Values['ListTableName'] = $List['TableName']; … … 279 283 ); 280 284 $Form->OnSubmit = '?Action=AddItemFinish'; 281 $Output .= $Form->ShowEditForm().$AfterTableOutput;285 $Output = $Form->ShowEditForm().$AfterTableOutput; 282 286 if(($Column != '') and ($ColumnValue != 0)) 283 287 { … … 297 301 $DefinitionItems = array(); 298 302 $AfterTableOutput = ''; 303 if(array_key_exists('Column', $_GET)) $Column = $_GET['Column']; else $Column = ''; 299 304 foreach($List['Items'] as $Item) 300 305 { … … 401 406 $DefinitionItems = array(); 402 407 $AfterTableOutput = ''; 408 if(array_key_exists('Column', $_GET)) $Column = $_GET['Column']; else $Column = ''; 403 409 foreach($List['Items'] as $Item) 404 410 { … … 425 431 ); 426 432 $Form->OnSubmit = '?Action=Search'; 427 $Output .= $Form->ShowEditForm();433 $Output = $Form->ShowEditForm(); 428 434 return($Output); 429 435 } … … 436 442 $DefinitionItems = array(); 437 443 $AfterTableOutput = ''; 444 if(array_key_exists('Column', $_GET)) $Column = $_GET['Column']; else $Column = ''; 438 445 foreach($List['Items'] as $Item) 439 446 { … … 649 656 $ListObject = $ListDefinition['Class']; 650 657 if(is_callable(array($ListObject, $Event))) return($ListObject->$Event($Parameters)); 651 else return($ListDefinition['TableName'].'->'.$Event.'('.$ List.')');652 } else return($ListDefinition['TableName'].'->'.$Event.'('.$ List.')');658 else return($ListDefinition['TableName'].'->'.$Event.'('.$Table.')'); 659 } else return($ListDefinition['TableName'].'->'.$Event.'('.$Table.')'); 653 660 } 654 661 -
trunk/database_list.php
r35 r38 9 9 $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId); 10 10 $DbRow = $DbResult->fetch_assoc(); 11 $TableName = $DbRow['TableName'];12 11 13 $this->Database->insert(array('Table' => $ TableName), $Values);12 $this->Database->insert(array('Table' => $DbRow['TableName'], 'Database' => $DbRow['Database']), $Values); 14 13 return($this->Database->insert_id); 15 14 } … … 19 18 $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId); 20 19 $DbRow = $DbResult->fetch_assoc(); 21 $TableName = $DbRow['TableName']; 22 $this->Database->delete(array('Table' => $TableName, 'Condition' => 'Id='.$ItemId), array('DeletionTime' => 'NOW()')); 20 $this->Database->delete(array('Table' => $DbRow['TableName'], 'Database' => $DbRow['Database'], 'Condition' => 'Id='.$ItemId), array('DeletionTime' => 'NOW()')); 23 21 } 24 22 … … 27 25 $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId); 28 26 $DbRow = $DbResult->fetch_assoc(); 29 $TableName = $DbRow['TableName'];30 27 $this->DeleteItem($TableId, $ItemId); 31 28 $Values['Id'] = $ItemId; 32 $this->Database->replace(array('Table' => $ TableName), $Values);29 $this->Database->replace(array('Table' => $DbRow['TableName'], 'Database' => $DbRow['Database']), $Values); 33 30 } 34 31 } -
trunk/types/include.php
r36 r38 18 18 include('types/GPS.php'); 19 19 include('types/IPv4Address.php'); 20 include('types/Color.php'); 21 include('types/Text.php'); 20 22 21 23 define('TypeIntegerId', 1); … … 29 31 define('TypeHiddenId', 20); 30 32 define('TypePointerToUserId', 37); 33 define('TypeColorId', 66); 31 34 32 35 ?>
Note:
See TracChangeset
for help on using the changeset viewer.