Changeset 26
- Timestamp:
- Dec 4, 2008, 12:31:09 PM (16 years ago)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
base.php
r24 r26 217 217 $System->Modules['DatabaseList']->EditItem($List['ItemId'], $Form->Values, $Id); 218 218 $NewId = $Database->insert_id; 219 $System->Modules['Log']->Add($List['I d'], $NewId, $LogActionType['Edit']);219 $System->Modules['Log']->Add($List['ItemId'], $NewId, $LogActionType['Edit']); 220 220 $Output = 'Změny uloženy.'; 221 221 $Output .= ShowViewItem($List, $Id); … … 302 302 $NewItemId = $System->Modules['DatabaseList']->AddItem($List['ItemId'], $Form->Values); 303 303 $NewId = $Database->insert_id; 304 $System->Modules['Log']->Add($List['I d'], $NewId, $LogActionType['Add']);304 $System->Modules['Log']->Add($List['ItemId'], $NewId, $LogActionType['Add']); 305 305 $Output = 'Položka přidána'; 306 306 $Output .= ShowViewItem($List, $NewItemId); … … 346 346 } 347 347 $Output .= ' <a href="?Action=ShowHistory&Table='.$List['ItemId'].'&Item='.$DbRow['ItemId'].'">Historie</a>'; 348 $Output .= ' <a href="?Action=DeleteItem&Table='.$List['ItemId'].'&Item='.$DbRow['ItemId'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>'; 348 349 $Output .= '<div class="line"></div>'; 349 350 foreach($List['Items'] as $Index => $Item) … … 365 366 366 367 if(!CheckPermission('Write', $List['ItemId'])) return(SystemMessage('Řízení přístupu', 'Nemáte dostatečná oprávnění')); 367 $System->Modules['Log']->Add($List['I d'], $Id, $LogActionType['Delete']);368 $System->Modules['Log']->Add($List['ItemId'], $Id, $LogActionType['Delete']); 368 369 $System->Modules['DatabaseList']->DeleteItem($List['ItemId'], $Id); 369 370 $Output = 'Položka smazána.'; -
lists/SystemList.php
r23 r26 17 17 PRIMARY KEY (`Id`) 18 18 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;'); 19 $Database->query('ALTER TABLE `'.$Parameters['TableName'].'` ADD INDEX ( `ItemId` );'); 19 20 //echo($Database->LastQuery); 20 21 } -
lists/SystemListItem.php
r23 r26 3 3 class ListSystemListItem 4 4 { 5 function RebuildOrder() 6 { 7 global $Database; 8 9 $Database->query('UPDATE SystemListItem AS Table1 SET Sequence = (SELECT COUNT(*) FROM (SELECT * FROM SystemListItem) AS Table2 WHERE (Table1.ItemId = Table2.ItemId) AND ((Table2.Sequence < Table1.Sequence) OR ((Table1.Sequence = Table2.Sequence) AND (Table2.Id < Table1.Id))))'); 10 } 11 5 12 function OnAdd($Parameters) 6 13 { … … 16 23 $Database->query('ALTER TABLE `'.$DbRow2['TableName'].'` ADD `'.$Parameters['Name'].'` '.$DbRow['DbDataType'].' NOT NULL ;'); 17 24 //echo($Database->LastQuery); 25 26 $this->RebuildOrder(); 27 } 28 29 function OnEdit($Parameters) 30 { 31 $this->RebuildOrder(); 32 } 33 34 function OnDelete($Parameters) 35 { 36 $this->RebuildOrder(); 18 37 } 19 38 } -
types/PointerOneToOne.php
r24 r26 11 11 $List = GetListDefinition($Type['Parameters'][0]); 12 12 $TargetTable = $List['TableName']; 13 foreach($List['Items'] as $ListItem) 14 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 13 foreach($List['Items'] as $Index => $ListItem) 14 { 15 //echo('ListItem'); 16 //print_r($ListItem); 17 $Type = GetTypeDefinition($ListItem['Type']); 18 if($ListItem['VisibleInPointer'] == 1) 19 { 20 if($Type['ParentType'] == TypePointerOneToOneId) 21 { 22 //print_r($Type); 23 $DbResult = $Database->select($List['TableName'], '*', 'ItemId='.$Item['Value'].' ORDER BY Id DESC LIMIT 1'); 24 $DbRow = $DbResult->fetch_assoc(); 25 $DefinitionItem = array('Name' => $Index, 'Type' => $Item['Type'], 'Caption' => $Item['TextBefore'], 'Value' => $DbRow[$Index], 'SourceTable' => $List['ItemId'], 'SourceItemId' => 0); 26 $SubTarget = $this->GetTablePointerName($Type, $DefinitionItem); 27 $Columns .= '"'.$SubTarget['Name'].' ",'; 28 } else $Columns .= '`'.$ListItem['Name'].'`," ",'; 29 } 30 } 15 31 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, ItemId, Id'; 16 32 $DbResult = $Database->select($TargetTable, $Columns, 'ItemId='.$Item['Value'].' AND (DeletionTime IS NULL) ORDER BY Id DESC LIMIT 1'); 17 //echo($Database->LastQuery);33 echo($Database->LastQuery); 18 34 if($DbResult->num_rows > 0) 19 35 { … … 36 52 if($DbResult->num_rows > 0) 37 53 { 54 38 55 $Result = array(array('Name' => 'Žádný', 'Id' => 0, 'ItemId' => 0)); 39 56 while($DbRow = $DbResult->fetch_assoc()) -
types/include.php
r24 r26 16 16 include('types/File/File.php'); 17 17 include('types/GPS.php'); 18 include('types/IPv4Address.php'); 18 19 19 20 define("TypeIntegerId", 1);
Note:
See TracChangeset
for help on using the changeset viewer.