Changeset 31


Ignore:
Timestamp:
Dec 16, 2008, 1:47:05 PM (16 years ago)
Author:
george
Message:
  • Upraveno: Nezobrazovat vybraný sloupec v podseznamech.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • base.php

    r30 r31  
    1010{
    1111  global $Database, $Config;
     12 
     13  echo($Column.','.$ColumnValue.' ');
    1214
    1315  if(!CheckPermission('Read', $List['Id']))
     
    2224  foreach($List['Items'] as $Item)
    2325  {
    24     if($Item['VisibleInList'] == 1)
     26    if(($Item['VisibleInList'] == 1) and ($Item['Name'] != $Column))
    2527      $Output .= '<th><a href="?OrderColumn='.$Item['Name'].'">'.$Item['TextBefore'].'</a></th>';
    2628  }
     
    7173    foreach($List['Items'] as $Index => $Item)
    7274    {
    73       if($Item['VisibleInList'] == 1)
     75      if(($Item['VisibleInList'] == 1) and ($Item['Name'] != $Column))
    7476      {
    7577        $ItemDefinition = array('Name' => $Index, 'Value' => $DbRow[$Index], 'SourceTable' => $List['Id'], 'SourceItemId' => $DbRow[$List['IdName']], 'Type' => $Item['Type']);
  • docs/features.txt

    r29 r31  
    1414Unimplemented/planned:
    1515
     16* Full back and forward button history navigation
    1617* Custom templates
    1718* Time history, versioning
     
    2930* Automatic backup and restore
    3031* Consistency/integrity check
     32* Form definition items manual ordering
  • types/PointerOneToOne.php

    r30 r31  
    2323        {
    2424          //print_r($Type);
    25           $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $List['TableName'], 'Condition' => 'Id='.$Item['Value']));
     25          $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $List['TableName'], 'Condition' => $List['IdName'].'='.$Item['Value']));
    2626          $DbRow = $DbResult->fetch_assoc();
    2727          $DefinitionItem = array('Name' => $Index, 'Type' => $Item['Type'], 'Caption' => $Item['TextBefore'], 'Value' => $DbRow[$Index], 'SourceTable' => $List['Id'], 'SourceItemId' => 0);
     
    3232    }
    3333    $Columns = substr($Columns, 0, -1);
    34     if($Columns == '') $Columns = 'Id AS Name, Id';
    35       else $Columns = 'CONCAT('.$Columns.') AS Name, Id';
    36     $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $TargetTable, 'Columns' => $Columns, 'Condition' => 'Id='.$Item['Value']));
     34    if($Columns == '') $Columns = '`'.$List['IdName'].'` AS `Name`, `'.$List['IdName'].'`';
     35      else $Columns = 'CONCAT('.$Columns.') AS `Name`, `'.$List['IdName'].'`';
     36    $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $TargetTable, 'Columns' => $Columns, 'Condition' => $List['IdName'].'='.$Item['Value']));
    3737    //echo($Database->LastQuery);
    3838    if($DbResult->num_rows > 0)
     
    5151    foreach($List['Items'] as $ListItem)
    5252      if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",';
    53     $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, Id';
    54     $DbResult = $Database->query('SELECT '.$Columns.' FROM `'.$TargetTable.'`');
     53    $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, `'.$List['IdName'].'`';
     54    $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $TargetTable, 'Columns' => $Columns));
    5555    //echo($Database->LastQuery);
    5656    if($DbResult->num_rows > 0)
     
    6969
    7070    $Type = GetTypeDefinition($Item['Type']);
     71    $List = GetListDefinition($Type['Parameters'][0]);
    7172    $TargetTable = $Type['Parameters'][0];
    7273    $TargetName = $this->GetTablePointerName($Type, $Item);
    73     $Output = '<a href="?Action=ViewItem&amp;Table='.$TargetTable.'&amp;Item='.$TargetName['Id'].'">'.$TargetName['Name'].'</a>';
     74    $Output = '<a href="?Action=ViewItem&amp;Table='.$TargetTable.'&amp;Item='.$TargetName[$List['IdName']].'">'.$TargetName['Name'].'</a>';
    7475    return($Output);
    7576  }
     
    8081
    8182    $Type = $Types[$Item['Type']];
     83    $List = GetListDefinition($Type['Parameters'][0]);
    8284    $Output = '<select name="'.$Item['Name'].'">';
    8385    $TargetNameList = $this->GetTablePointerNameList($Type, $Item);
     
    8587    foreach($TargetNameList as $TargetName)
    8688    {
    87       if($Item['Value'] == $TargetName['Id']) $Selected = ' selected="1"'; else $Selected = '';
    88       $Output .= '<option value="'.$TargetName['Id'].'"'.$Selected.'>'.$TargetName['Name'].'</option>';
     89      if($Item['Value'] == $TargetName[$List['IdName']]) $Selected = ' selected="1"'; else $Selected = '';
     90      $Output .= '<option value="'.$TargetName[$List['IdName']].'"'.$Selected.'>'.$TargetName['Name'].'</option>';
    8991    }
    9092    $Output .= '</select>';
Note: See TracChangeset for help on using the changeset viewer.