Changeset 767
- Timestamp:
- Nov 22, 2015, 12:05:45 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r765 r767 1 1 <?php 2 2 3 $Revision = 76 5; // Subversion revision3 $Revision = 767; // Subversion revision 4 4 $DatabaseRevision = 765; // SQL structure revision 5 $ReleaseTime = strtotime('2015-11- 06');5 $ReleaseTime = strtotime('2015-11-22'); -
trunk/Modules/Notify/Notify.php
r763 r767 35 35 } 36 36 37 function OnlineList($Title, $OnlineNow, $OnlinePrevious )37 function OnlineList($Title, $OnlineNow, $OnlinePrevious, $MinDuration) 38 38 { 39 39 $Time = time(); 40 $MinDuration = 5;41 40 $OnlineText = array('<span style="color:red;">Nedostupný</span>', '<span style="color:green;">Dostupný</span>'); 42 41 $Output = ''; 42 $Condition = 'WHERE (`NetworkInterface`.`Online` = '.$OnlineNow.') AND (`NetworkInterface`.`OnlineNotify` = '.$OnlinePrevious.') '. 43 'AND (`NetworkInterface`.`LastOnline` <= "'.TimeToMysqlDateTime($Time - $MinDuration).'")'; 43 44 $DbResult3 = $this->Database->query('SELECT CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")) AS `Name`, '. 44 45 '`NetworkInterface`.`Online`, `NetworkInterface`.`LastOnline` FROM `NetworkInterface` '. 45 46 'LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` '. 46 'WHERE (`NetworkInterface`.`Online` = '.$OnlineNow.') AND (`NetworkInterface`.`OnlineNotify` = '.$OnlinePrevious.') '. 47 'AND (`NetworkDevice`.`PermanentOnline`=1) AND (`NetworkDevice`.`Used`=1) '. 48 'AND (`NetworkInterface`.`LastOnline` < "'.TimeToMysqlDateTime($Time - $MinDuration).'") ORDER BY `Name` ASC'); 47 $Condition.' AND (`NetworkDevice`.`PermanentOnline`=1) AND (`NetworkDevice`.`Used`=1) '. 48 'ORDER BY `Name` ASC'); 49 49 if($DbResult3->num_rows > 0) { 50 50 $Output .= $Title.'<br/>'; … … 65 65 $Output .= '</table><br/>'."\n"; 66 66 } 67 $this->Database->query('UPDATE `NetworkInterface` SET `OnlineNotify` = `Online` '. 68 $Condition); 67 69 return $Output; 68 70 } … … 83 85 { 84 86 if($Category['SysName'] == 'NetworkReachability') { 85 $List = $this->OnlineList('Nově online', 1, 0 );86 $List .= $this->OnlineList('Nově offline', 0, 1 );87 $List = $this->OnlineList('Nově online', 1, 0, 0); 88 $List .= $this->OnlineList('Nově offline', 0, 1, 5); 87 89 if($List != '') $List .= $this->OnlineList('Stále offline', 0, 0); 88 90 if($List != '') { … … 93 95 } 94 96 } 95 $this->Database->query('UPDATE `NetworkInterface` SET `OnlineNotify` = `Online` '.96 'WHERE `OnlineNotify` != `Online`');97 97 $this->Database->update('NotifyUser', '`Id`='.$User['Id'], array('LastTime' => TimeToMysqlDateTime($Time))); 98 98
Note:
See TracChangeset
for help on using the changeset viewer.