Ignore:
Timestamp:
Oct 21, 2015, 11:05:08 PM (9 years ago)
Author:
chronos
Message:
  • Added: New module Notify for sending periodic system notification for monitoring various states to user.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Setup/Updates.php

    r748 r754  
    15171517  }
    15181518}
     1519
     1520function UpdateTo752($Manager)
     1521{
     1522  $Manager->Database->query('INSERT INTO `SchedulerAction` (`Id`, `Name`, `Class`) '.
     1523    'VALUES (NULL, "Kontrola změn stavů", "SchedulerNotifyCheck");');
     1524
     1525  $this->Database->query('
     1526  CREATE TABLE IF NOT EXISTS `NotifyUser` (
     1527  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1528  `User` int(11) NOT NULL,
     1529  `Contact` int(11) NOT NULL,
     1530  `Period` int(11) NOT NULL,
     1531  PRIMARY KEY (`Id`),
     1532  KEY `User` (`User`),
     1533  KEY `Contact` (`Contact`)
     1534    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;');
     1535  $this->Database->query('ALTER TABLE `NotifyUser`
     1536ADD CONSTRAINT `NotifyUser_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`),
     1537ADD CONSTRAINT `NotifyUser_ibfk_2` FOREIGN KEY (`Contact`) REFERENCES `Contact` (`Id`);');
     1538
     1539  $this->Database->query('CREATE TABLE IF NOT EXISTS `NotifyCategory` (
     1540      `Id` int(11) NOT NULL AUTO_INCREMENT,
     1541      `Name` varchar(255) NOT NULL,
     1542      `SysName` varchar(255) NOT NULL,
     1543      PRIMARY KEY (`Id`)
     1544    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;');
     1545
     1546  $this->Database->query("INSERT INTO `NotifyCategory` (`Id`, `Name`, `SysName`) VALUES
     1547    (1, 'Dostupnost zařízení (ping)', 'NetworkReachability'),
     1548    (2, 'Dostupnost URL', 'URL'),
     1549    (3, 'Minimální úroveň signálu', 'WirelessSignal'),
     1550    (4, 'Dostupnost síťového portu', 'NetworkPort'),
     1551    (5, 'Minimální odezva', 'NetworkLatency'),
     1552    (6, 'Minimální propustnost', 'NetworkBandwidth');");
     1553}
     1554
    15191555
    15201556class Updates
     
    15901626      742 => array('Revision' => 747, 'Function' => 'UpdateTo747'),
    15911627      747 => array('Revision' => 748, 'Function' => 'UpdateTo748'),
     1628      748 => array('Revision' => 752, 'Function' => 'UpdateTo752'),
    15921629    ));
    15931630  }
Note: See TracChangeset for help on using the changeset viewer.