Changeset 26 for lists


Ignore:
Timestamp:
Dec 4, 2008, 12:31:09 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Logování správných id položek.
  • Upraveno: Částečně zprovozněno vícestupňové zobrazení odkazů.
Location:
lists
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lists/SystemList.php

    r23 r26  
    1717    PRIMARY KEY  (`Id`)
    1818    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     19    $Database->query('ALTER TABLE `'.$Parameters['TableName'].'` ADD INDEX ( `ItemId` );');
    1920    //echo($Database->LastQuery);
    2021  }
  • lists/SystemListItem.php

    r23 r26  
    33class ListSystemListItem
    44{
     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
    512  function OnAdd($Parameters)
    613  {
     
    1623    $Database->query('ALTER TABLE `'.$DbRow2['TableName'].'` ADD `'.$Parameters['Name'].'` '.$DbRow['DbDataType'].' NOT NULL ;');
    1724    //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();
    1837  }
    1938}
Note: See TracChangeset for help on using the changeset viewer.