Legend:
- Unmodified
- Added
- Removed
-
types.php
r3 r4 27 27 $Parts = explode('-', $Parameter); 28 28 29 $Output = ($Parts[2] *1).'.'.$MonthList[$Parts[1]*1].'.'.$Parts[0];29 $Output = ($Parts[2] * 1).'.'.$MonthList[$Parts[1] * 1].'.'.$Parts[0]; 30 30 return($Output); 31 31 } … … 64 64 } 65 65 66 function TypePointerViewHtml($Type, $Parameter, $Table, $Id) 67 { 68 $Output = '<a href="?Action=SelectList&Id='.$Type['TypeDefinition'].'&ParentTable='.$Table.'&ParentId='.$Id.'">Seznam</a>'; 66 function TypePointerOneToOneViewHtml($Type, $Parameter, $Table, $Id) 67 { 68 global $Database, $Lists; 69 70 $Output = ''; 71 $Columns = ''; 72 foreach($Lists[$Type['Parameter']]['Items'] as $ListItem) 73 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 74 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, Id'; 75 $DbResult = $Database->select($Type['Parameter'], $Columns, 'Id='.$Parameter); 76 //echo($Database->LastQuery); 77 if($DbResult->num_rows > 0) 78 { 79 $DbRow = $DbResult->fetch_array(); 80 $Output = '<a href="?Action=ViewItem&TableId='.$Type['Parameter'].'&ItemId='.$DbRow['Id'].'">'.$DbRow['Name'].'</a>'; 81 } 82 return($Output); 83 } 84 85 function TypePointerOneToOneEditHtml($Type, $Parameter, $Table, $Id) 86 { 87 global $Database, $Lists; 88 89 $Output = '<select name="%name%">'; 90 $Columns = ''; 91 foreach($Lists[$Type['Parameter']]['Items'] as $ListItem) 92 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 93 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, Id'; 94 $DbResult = $Database->select($Type['Parameter'], $Columns); 95 //echo($Database->LastQuery); 96 while($DbRow = $DbResult->fetch_array()) 97 { 98 if($Parameter == $DbRow['Id']) $Selected = ' selected="1"'; else $Selected = ''; 99 $Output .= '<option value="'.$DbRow['Id'].'"'.$Selected.'>'.$DbRow['Name'].'</option>'; 100 } 101 $Output .= '</select>'; 102 return($Output); 103 } 104 105 function TypePointerOneToManyViewHtml($Type, $Parameter, $Table, $Id) 106 { 107 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$Table.'&ParentColumn='.$Id.'">Seznam</a>'; 108 return($Output); 109 } 110 111 function TypePointerOneToManyEditHtml($Type, $Parameter, $Table, $Id) 112 { 113 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$Table.'&ParentColumn='.$Id.'">Seznam</a>'; 69 114 return($Output); 70 115 } … … 122 167 ), 123 168 ), 124 'ListItemPointer' => array( 125 'Type' => 'Pointer', 126 'TypeDefinition' => 'ListItem', 127 'ViewHtml' => 'TypePointerViewHtml', 128 'EditHtml' => 'TypePointerViewHtml', 129 'DatabaseType' => 'INT', 130 'InitValue' => '0', 131 'ParseFunction' => '', 132 ), 133 'SubjectConnectState' => array( 134 'Type' => 'Enumeration', 135 'TypeDefinition' => array('Zájemce o připojení', 'Připojen', 'Trvale odpojen'), 169 'PointerOneToOne' => array( 170 'Type' => '', 171 'ViewHtml' => 'TypePointerOneToOneViewHtml', 172 'EditHtml' => 'TypePointerOneToOneEditHtml', 173 'DatabaseType' => 'INT', 174 'InitValue' => '0', 175 'ParseFunction' => '', 176 ), 177 'PointerOneToMany' => array( 178 'Type' => '', 179 'ViewHtml' => 'TypePointerOneToManyViewHtml', 180 'EditHtml' => 'TypePointerOneToManyEditHtml', 181 'DatabaseType' => 'INT', 182 'InitValue' => '0', 183 'ParseFunction' => '', 184 ), 185 'PointerManyToMany' => array( 186 'Type' => '', 187 'ViewHtml' => 'TypePointerManyToManyViewHtml', 188 'EditHtml' => 'TypePointerManyToManyEditHtml', 189 'DatabaseType' => 'INT', 190 'InitValue' => '0', 191 'ParseFunction' => '', 192 ), 193 'MemberState' => array( 194 'Type' => 'Enumeration', 195 'TypeDefinition' => array('Neznámý stav', 'Zájemce o připojení', 'Připojen', 'Trvale odpojen'), 196 'ViewHtml' => 'TypeEnumerationViewHtml', 197 'EditHtml' => 'TypeEnumerationEditHtml', 198 'DatabaseType' => 'INT', 199 'InitValue' => 0, 200 'ParseFunction' => '', 201 ), 202 'HostType' => array( 203 'Type' => 'Enumeration', 204 'TypeDefinition' => array('Nezařazeno', 'Osobní počítač', 'VoIP zařízení', 'IPTV zařízení', 'Směrovač', 'Server', 'Tiskárna/skener/kopírka', 'Jiné'), 205 'ViewHtml' => 'TypeEnumerationViewHtml', 206 'EditHtml' => 'TypeEnumerationEditHtml', 207 'DatabaseType' => 'INT', 208 'InitValue' => 0, 209 'ParseFunction' => '', 210 ), 211 'InterfaceType' => array( 212 'Type' => 'Enumeration', 213 'TypeDefinition' => array('Jiný', 'Ethernet 10 Mbit/s', 'Ethernet 100 Mbit/s', 'Ethernet 1 Gbit/s', 'Wifi 2,4 GHz 802.11b 11 Mbit/s', 'Wifi 2,4 GHz 802.11g 54 Mbit/s', 'Wifi 5 GHz 802.11a 54 Mbit/s', 'Optika 100 Mbit/s', 'Optika 1 Gbit/s'), 214 'ViewHtml' => 'TypeEnumerationViewHtml', 215 'EditHtml' => 'TypeEnumerationEditHtml', 216 'DatabaseType' => 'INT', 217 'InitValue' => 0, 218 'ParseFunction' => '', 219 ), 220 'AssetState' => array( 221 'Type' => 'Enumeration', 222 'TypeDefinition' => array('Neznámý', 'Na skladě', 'Používáno', 'V reklamaci', 'Vyřazeno'), 223 'ViewHtml' => 'TypeEnumerationViewHtml', 224 'EditHtml' => 'TypeEnumerationEditHtml', 225 'DatabaseType' => 'INT', 226 'InitValue' => 0, 227 'ParseFunction' => '', 228 ), 229 'MemberReportType' => array( 230 'Type' => 'Enumeration', 231 'TypeDefinition' => array('Jiné', 'Hlášení závady', 'Požadavek na změnu', 'Poznámka správce'), 232 'ViewHtml' => 'TypeEnumerationViewHtml', 233 'EditHtml' => 'TypeEnumerationEditHtml', 234 'DatabaseType' => 'INT', 235 'InitValue' => 0, 236 'ParseFunction' => '', 237 ), 238 'BankAccountType' => array( 239 'Type' => 'Enumeration', 240 'TypeDefinition' => array('Neurčeno', 'Běžný účet', 'Spořící účet'), 136 241 'ViewHtml' => 'TypeEnumerationViewHtml', 137 242 'EditHtml' => 'TypeEnumerationEditHtml',
Note:
See TracChangeset
for help on using the changeset viewer.