Changeset 657 for trunk/Common


Ignore:
Timestamp:
May 25, 2014, 8:29:03 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Záznam změn online stavu dostupnosti rozhraní do tabulky.
Location:
trunk/Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/AppModule.php

    r613 r657  
    335335  function LoadModulesFromDir($Directory)
    336336  {
    337     $List = scandir($Directory);
     337        $List = scandir($Directory);     
    338338    foreach($List as $Item)
    339339    {
     
    349349  function LoadModules()
    350350  {
    351     if(method_exists($this->OnLoadModules[0], $this->OnLoadModules[1]))
     351        if(method_exists($this->OnLoadModules[0], $this->OnLoadModules[1]))
    352352      $this->OnLoadModules();
    353353    else $this->LoadModulesFromDir(dirname(__FILE__).'/../Modules');
  • trunk/Common/Setup/Updates.php

    r656 r657  
    706706}
    707707
     708function UpdateTo657($Manager)
     709{
     710        $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkInterfaceUpDown` (
     711  `Id` int(11) NOT NULL AUTO_INCREMENT,
     712  `Time` datetime NOT NULL,
     713  `Interface` int(11) NOT NULL,
     714  `State` int(11) NOT NULL,
     715  PRIMARY KEY (`Id`),
     716  KEY `Interface` (`Interface`)
     717) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;');
     718  $Manager->Execute('ALTER TABLE `NetworkInterfaceUpDown`
     719    ADD CONSTRAINT `NetworkInterfaceUpDown_ibfk_1` FOREIGN KEY (`Interface`) REFERENCES `NetworkInterface` (`Id`);');
     720  $Manager->Execute("INSERT INTO `Action` (
     721`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` ,
     722`Enable`) VALUES (NULL , '', 'Změny stavu rozhraní', '1', '/is/?t=NetworkInterfaceUpDown&a=list', NULL , NULL , NULL , '1'
     723);");
     724  $ActionId = $Manager->Database->insert_id;
     725  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     726    "VALUES (NULL , 'Změny stavu rozhraní', 4, '".$ActionId."', '1');");
     727}
     728
    708729class Updates
    709730{
     
    745766      645 => array('Revision' => 646, 'Function' => 'UpdateTo646'),
    746767      646 => array('Revision' => 647, 'Function' => 'UpdateTo647'),
     768      647 => array('Revision' => 657, 'Function' => 'UpdateTo657'),
    747769    ));
    748770  }
Note: See TracChangeset for help on using the changeset viewer.