Changeset 647 for trunk/Common


Ignore:
Timestamp:
Mar 25, 2014, 7:09:47 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Podpora pro virtuální tabulky.
  • Přidáno: Roční přehledy roků a subjektů.
  • Přidáno: Evidence zaměstnanců a mezd v nabídce v IS.
Location:
trunk/Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Form/Form.php

    r639 r647  
    162162    }
    163163    $Columns = implode(',', $Columns);
    164     $DbResult = $this->Database->query('SELECT '.$Columns.' FROM `'.$this->Definition['Table'].'` AS `T` WHERE `T`.`Id`='.$Id);
     164    if(array_key_exists('SQL', $this->Definition))
     165      $SourceTable = '('.$this->Definition['SQL'].') AS `TX`';
     166      else $SourceTable = '`'.$this->Definition['Table'].'` AS `TX`';
     167    $DbResult = $this->Database->query('SELECT '.$Columns.' FROM '.$SourceTable.' WHERE `TX`.`Id`='.$Id);
    165168    $DbRow = $DbResult->fetch_array();
    166169    foreach($this->Definition['Items'] as $Index => $Item)
  • trunk/Common/Form/Types/OneToMany.php

    r639 r647  
    8080      $Output = '`'.$Item['Name'].'`, (SELECT '.$Type['Parameters']['Name'].''.
    8181        ' AS `Name` FROM '.$Table.' WHERE `'.
    82         $Type['Parameters']['Id'].'`=`'.$Item['Name'].'`) AS `'.$Item['Name'].'_Filter`';
     82        $Type['Parameters']['Id'].'`=`TX`.`'.$Item['Name'].'`) AS `'.$Item['Name'].'_Filter`';
    8383    //} else $Output = '`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`';
    8484    return($Output);
  • trunk/Common/Setup/Updates.php

    r646 r647  
    612612}
    613613
     614function UpdateTo647($Manager)
     615{
     616        $Manager->Execute('ALTER TABLE `EmployeeSalary` ADD FOREIGN KEY ( `Employee` ) REFERENCES `Employee` (
     617`Id`
     618) ON DELETE RESTRICT ON UPDATE RESTRICT ;');
     619  $Manager->Execute('ALTER TABLE `EmployeeSalary` ADD `Contract` INT NOT NULL ,
     620ADD INDEX ( `Contract` ) ;');
     621 $Manager->Execute('ALTER TABLE `EmployeeSalary` ADD FOREIGN KEY ( `Contract` ) REFERENCES `Contract` (
     622`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;');
     623  $Manager->Execute("INSERT INTO `Action` (
     624`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` ,
     625`Enable`) VALUES (NULL , '', 'Zaměstnanci', '1', '/is/?t=Employee&a=list', NULL , NULL , NULL , '1'
     626);");
     627  $ActionId = $Manager->Database->insert_id;
     628  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     629    "VALUES (NULL , 'Zaměstnanci', '2', '".$ActionId."', '1');");
     630  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     631    "VALUES (NULL , 'Roční výkazy', '2', NULL, '1');");
     632  $MenuId = $Manager->Database->insert_id;
     633  $Manager->Execute("INSERT INTO `Action` (
     634`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` ,
     635`Enable`) VALUES (NULL , '', 'Roční přehled', '1', '/is/?t=FinanceYearReport&a=list', NULL , NULL , NULL , '1'
     636);");
     637  $ActionId = $Manager->Database->insert_id;
     638  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     639    "VALUES (NULL , 'Roční přehled', '".$MenuId."', '".$ActionId."', '1');");
     640  $Manager->Execute("INSERT INTO `Action` (
     641`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` ,
     642`Enable`) VALUES (NULL , '', 'Výkaz subjektů', '1', '/is/?t=SubjectReport&a=list', NULL , NULL , NULL , '1'
     643);");
     644  $ActionId = $Manager->Database->insert_id;
     645  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     646    "VALUES (NULL , 'Výkaz subjektů', '".$MenuId."', '".$ActionId."', '1');");
     647}
     648
    614649
    615650class Updates
     
    651686      633 => array('Revision' => 645, 'Function' => 'UpdateTo645'),
    652687      645 => array('Revision' => 646, 'Function' => 'UpdateTo646'),
     688      646 => array('Revision' => 647, 'Function' => 'UpdateTo647'),
    653689    ));
    654690  }
Note: See TracChangeset for help on using the changeset viewer.