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ů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • types/PointerOneToOne.php

    r24 r26  
    1111    $List = GetListDefinition($Type['Parameters'][0]);
    1212    $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    }
    1531    $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, ItemId, Id';
    1632    $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);
    1834    if($DbResult->num_rows > 0)
    1935    {
     
    3652    if($DbResult->num_rows > 0)
    3753    {
     54
    3855      $Result = array(array('Name' => 'Žádný', 'Id' => 0, 'ItemId' => 0));
    3956      while($DbRow = $DbResult->fetch_assoc())
Note: See TracChangeset for help on using the changeset viewer.