Changeset 29 for lists


Ignore:
Timestamp:
Dec 9, 2008, 1:24:32 PM (16 years ago)
Author:
george
Message:
  • Upraveno: Hledání položek v seznamu dle zadaného filtru.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lists/SystemListItem.php

    r28 r29  
    33class ListSystemListItem
    44{
    5   function RebuildOrder()
     5  function RebuildOrder($List)
    66  {
    77    global $Database;
    88
    9     $Database->query('UPDATE SystemListItem AS Table1 SET Sequence = (SELECT COUNT(*) FROM (SELECT * FROM SystemListItem) AS Table2 WHERE ((Table2.Sequence < Table1.Sequence) OR ((Table1.Sequence = Table2.Sequence) AND (Table2.Id < Table1.Id))))');
     9    $Database->query('SET @I = 0;');
     10    $Database->query('UPDATE `SystemListItem` SET `Sequence` = (@I := @I + 1) WHERE `List`='.$List.' ORDER BY `Sequence`;');
    1011  }
    1112
     
    1516
    1617    //print_r($Parameters);
    17     $DbResult = $Database->query('SELECT DbDataType FROM SystemType WHERE Id='.$Parameters['Type']);
     18    $DbResult = $Database->query('SELECT `DbDataType` FROM `SystemType` WHERE Id='.$Parameters['Type']);
    1819    //echo($Database->LastQuery);
    1920    $DbRow = $DbResult->fetch_assoc();
    20     $DbResult = $Database->query('SELECT TableName FROM SystemList WHERE Id='.$Parameters[$Parameters['Column']]);
     21    $DbResult = $Database->query('SELECT `TableName` FROM `SystemList` WHERE Id='.$Parameters[$Parameters['Column']]);
    2122    //echo($Database->LastQuery);
    2223    $DbRow2 = $DbResult->fetch_assoc();
     
    2425    //echo($Database->LastQuery);
    2526
    26     $this->RebuildOrder();
     27    $this->RebuildOrder($Parameters['List']);
    2728  }
    2829
    2930  function OnEdit($Parameters)
    3031  {
    31     $this->RebuildOrder();
     32    $this->RebuildOrder($Parameters['List']);
    3233  }
    3334
    3435  function OnDelete($Parameters)
    3536  {
    36     $this->RebuildOrder();
     37    $this->RebuildOrder($Parameters['List']);
    3738  }
    3839}
Note: See TracChangeset for help on using the changeset viewer.