Changeset 31
- Timestamp:
- Dec 16, 2008, 1:47:05 PM (16 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
base.php
r30 r31 10 10 { 11 11 global $Database, $Config; 12 13 echo($Column.','.$ColumnValue.' '); 12 14 13 15 if(!CheckPermission('Read', $List['Id'])) … … 22 24 foreach($List['Items'] as $Item) 23 25 { 24 if( $Item['VisibleInList'] == 1)26 if(($Item['VisibleInList'] == 1) and ($Item['Name'] != $Column)) 25 27 $Output .= '<th><a href="?OrderColumn='.$Item['Name'].'">'.$Item['TextBefore'].'</a></th>'; 26 28 } … … 71 73 foreach($List['Items'] as $Index => $Item) 72 74 { 73 if( $Item['VisibleInList'] == 1)75 if(($Item['VisibleInList'] == 1) and ($Item['Name'] != $Column)) 74 76 { 75 77 $ItemDefinition = array('Name' => $Index, 'Value' => $DbRow[$Index], 'SourceTable' => $List['Id'], 'SourceItemId' => $DbRow[$List['IdName']], 'Type' => $Item['Type']); -
docs/features.txt
r29 r31 14 14 Unimplemented/planned: 15 15 16 * Full back and forward button history navigation 16 17 * Custom templates 17 18 * Time history, versioning … … 29 30 * Automatic backup and restore 30 31 * Consistency/integrity check 32 * Form definition items manual ordering -
types/PointerOneToOne.php
r30 r31 23 23 { 24 24 //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'])); 26 26 $DbRow = $DbResult->fetch_assoc(); 27 27 $DefinitionItem = array('Name' => $Index, 'Type' => $Item['Type'], 'Caption' => $Item['TextBefore'], 'Value' => $DbRow[$Index], 'SourceTable' => $List['Id'], 'SourceItemId' => 0); … … 32 32 } 33 33 $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'])); 37 37 //echo($Database->LastQuery); 38 38 if($DbResult->num_rows > 0) … … 51 51 foreach($List['Items'] as $ListItem) 52 52 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)); 55 55 //echo($Database->LastQuery); 56 56 if($DbResult->num_rows > 0) … … 69 69 70 70 $Type = GetTypeDefinition($Item['Type']); 71 $List = GetListDefinition($Type['Parameters'][0]); 71 72 $TargetTable = $Type['Parameters'][0]; 72 73 $TargetName = $this->GetTablePointerName($Type, $Item); 73 $Output = '<a href="?Action=ViewItem&Table='.$TargetTable.'&Item='.$TargetName[ 'Id'].'">'.$TargetName['Name'].'</a>';74 $Output = '<a href="?Action=ViewItem&Table='.$TargetTable.'&Item='.$TargetName[$List['IdName']].'">'.$TargetName['Name'].'</a>'; 74 75 return($Output); 75 76 } … … 80 81 81 82 $Type = $Types[$Item['Type']]; 83 $List = GetListDefinition($Type['Parameters'][0]); 82 84 $Output = '<select name="'.$Item['Name'].'">'; 83 85 $TargetNameList = $this->GetTablePointerNameList($Type, $Item); … … 85 87 foreach($TargetNameList as $TargetName) 86 88 { 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>'; 89 91 } 90 92 $Output .= '</select>';
Note:
See TracChangeset
for help on using the changeset viewer.