Changeset 483 for trunk


Ignore:
Timestamp:
Feb 7, 2013, 11:01:56 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: OneToMany vazba ve formulářích nyní využívá rozšířenou definici tabulky pomocí pole 'View'.
  • Přidáno: Zobrazení síťových propojení ve správě dat.
Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Types/OneToMany.php

    r448 r483  
    1010    if($Item['Value'] != '')
    1111    {
     12      if(array_key_exists('View', $Type['Parameters'])) $Table = $Type['Parameters']['View'];
     13        else $Table = $Type['Parameters']['Table'];
    1214      $DbResult = $this->System->Database->query('SELECT '.$Type['Parameters']['Name'].
    13         ' AS `Name` FROM `'.$Type['Parameters']['Table'].'` WHERE `'.
     15        ' AS `Name` FROM '.$Table.' WHERE `'.
    1416        $Type['Parameters']['Id'].'`='.$Item['Value']);
    1517      $DbRow = $DbResult->fetch_assoc();
     
    3133      $Output .= '<option value=""'.$Selected.'></option>';
    3234    }
    33     $DbResult = $this->System->Database->query('SELECT '.$Type['Parameters']['Name'].' AS `Name`,'.$Type['Parameters']['Id'].' AS `Id` FROM `'.$Type['Parameters']['Table'].'`'.$Where.' ORDER BY `Name`');
     35    if(array_key_exists('View', $Type['Parameters'])) $Table = $Type['Parameters']['View'];
     36      else $Table = $Type['Parameters']['Table'];
     37    $DbResult = $this->System->Database->query('SELECT '.$Type['Parameters']['Name'].' AS `Name`,'.$Type['Parameters']['Id'].' AS `Id` FROM '.$Table.''.$Where.' ORDER BY `Name`');
    3438    while($DbRow = $DbResult->fetch_assoc())
    3539    {
  • trunk/form_classes.php

    r482 r483  
    1616
    1717$FormClasses = array(   
     18  'NetworkLink' => array(
     19    'Title' => 'Síťové propojení',
     20    'Table' => 'NetworkLink',
     21    'Items' => array(
     22      'Type' => array('Type' => 'Integer', 'Caption' => 'Typ', 'Default' => '1'),
     23      'Interface1' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 1', 'Default' => ''),
     24      'Interface2' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 2', 'Default' => ''),
     25    ),
     26  ),
    1827  'PermissionUserAssignment' => array(
    1928    'Title' => 'Oprávnění uživatelů',
     
    421430      'Online' => array('Type' => 'Boolean', 'Caption' => 'Běží', 'Default' => '0', 'ReadOnly' => true),
    422431      'LastOnline' => array('Type' => 'DateTime', 'Caption' => 'Naposledy běželo', 'Default' => '', 'ReadOnly' => true),
     432      'Links1' => array('Type' => 'TNetworkLinkListInterface1', 'Caption' => 'Propojení 1', 'Default' => ''),
     433      'Links2' => array('Type' => 'TNetworkLinkListInterface2', 'Caption' => 'Propojení 2', 'Default' => ''),
    423434    ),
    424435  ),
     
    767778    'Type' => 'Reference',
    768779    'Table' => 'NetworkInterface',
    769     'Id' => 'Id',
    770     'Name' => 'Name',
     780    'View' => '(SELECT NetworkInterface.*, CONCAT(NetworkDevice.Name, "-", NetworkInterface.Name) AS DeviceName FROM NetworkInterface '.
     781      'LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device) AS T',     
     782    'Id' => 'Id',
     783    'Name' => 'DeviceName',
    771784    'Filter' => '1',
    772785  ),
     
    10211034    'Id' => 'Id',
    10221035    'Ref' => 'Category',
     1036    'Filter' => '1',
     1037  ),
     1038  'TNetworkLinkListInterface1' => array(
     1039    'Type' => 'ManyToOne',
     1040    'Table' => 'NetworkLink',
     1041    'Id' => 'Id',
     1042    'Ref' => 'Interface1',
     1043    'Filter' => '1',
     1044  ),
     1045  'TNetworkLinkListInterface2' => array(
     1046    'Type' => 'ManyToOne',
     1047    'Table' => 'NetworkLink',
     1048    'Id' => 'Id',
     1049    'Ref' => 'Interface2',
    10231050    'Filter' => '1',
    10241051  ),
Note: See TracChangeset for help on using the changeset viewer.