Changeset 730
- Timestamp:
- Jan 13, 2015, 12:18:19 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/System.php
r729 r730 210 210 echo($Output); 211 211 } else echo('Command "'.$argv[1].'" not supported.'."\n"); 212 } 213 //print_r($argv); 212 } else echo('No command was given as parameter'."\n"); 214 213 } 215 214 -
trunk/Application/Version.php
r729 r730 1 1 <?php 2 2 3 $Revision = 7 29; // Subversion revision4 $DatabaseRevision = 7 29; // SQL structure revision5 $ReleaseTime = strtotime('2015-01-1 1');3 $Revision = 730; // Subversion revision 4 $DatabaseRevision = 730; // SQL structure revision 5 $ReleaseTime = strtotime('2015-01-12'); -
trunk/Common/Setup/Updates.php
r729 r730 1207 1207 1208 1208 $Manager->Execute('INSERT INTO `Module` (`Id`, `Name`, `Title`) VALUES (NULL, "Plánovač", "Scheduler");'); 1209 } 1210 1211 function UpdateTo730($Manager) 1212 { 1213 $Manager->Execute('CREATE TABLE IF NOT EXISTS `SchedulerAction` ( 1214 `Id` int(11) NOT NULL AUTO_INCREMENT, 1215 `Name` varchar(255) NOT NULL, 1216 `Class` varchar(255) NOT NULL 1217 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 1218 $Manager->Execute('ALTER TABLE `SchedulerAction` ADD PRIMARY KEY (`Id`);'); 1219 1220 $Manager->Execute('ALTER TABLE `Scheduler` CHANGE `Class` `Action` INT(11) NOT NULL;'); 1221 $Manager->Execute("ALTER TABLE `Scheduler` ADD INDEX ( `Action` ) "); 1222 $Manager->Execute('ALTER TABLE `Scheduler` ADD CONSTRAINT `Schedule_ibfk_2` FOREIGN KEY (`Action`) REFERENCES `SchedulerAction` (`Id`);'); 1223 $Manager->Execute('INSERT INTO `SchedulerAction` (`Id`, `Name`, `Class`) VALUES (NULL, "Import bankovních účtů", "ScheduleBankImport");'); 1209 1224 } 1210 1225 … … 1271 1286 725 => array('Revision' => 726, 'Function' => 'UpdateTo726'), 1272 1287 726 => array('Revision' => 729, 'Function' => 'UpdateTo729'), 1288 729 => array('Revision' => 730, 'Function' => 'UpdateTo730'), 1273 1289 )); 1274 1290 } -
trunk/Modules/FinanceBankAPI/FinanceBankAPI.php
r729 r730 88 88 { 89 89 $Output = ''; 90 $DbResult = $this->Database->select('FinanceBankAccount', 'Id', '( AutoImport=1) AND ((TimeEnd IS NULL) OR (TimeEnd> NOW()))');90 $DbResult = $this->Database->select('FinanceBankAccount', 'Id', '(`AutoImport`=1) AND ((`TimeEnd` IS NULL) OR (`TimeEnd` > NOW()))'); 91 91 while($DbRow = $DbResult->fetch_assoc()) 92 92 { 93 echo($DbRow['Comment']."\n"); 93 94 $Page = new PageImportAPI($this->System); 94 95 $Output .= $Page->Show(); -
trunk/Modules/Scheduler/Scheduler.php
r729 r730 24 24 'Enabled' => array('Type' => 'Boolean', 'Caption' => 'Povoleno', 'Default' => '0'), 25 25 'ScheduledTime' => array('Type' => 'DateTime', 'Caption' => 'Plánovaný čas', 'Default' => ''), 26 ' Class' => array('Type' => 'String', 'Caption' => 'Vykonat třídu', 'Default' => ''),26 'Action' => array('Type' => 'TSchedulerAction', 'Caption' => 'Akce', 'Default' => ''), 27 27 'Period' => array('Type' => 'Integer', 'Caption' => 'Opakovat po', 'Default' => '', 'Null' => true, 'Suffix' => 'sekund'), 28 28 'Log' => array('Type' => 'Text', 'Caption' => 'Poslední záznam', 'Default' => '', 'ReadOnly' => true), 29 29 'LastExecutedTime' => array('Type' => 'DateTime', 'Caption' => 'Čas posledního spuštění', 'Default' => '', 'ReadOnly' => true), 30 30 ), 31 )); 32 $this->System->FormManager->RegisterClass('SchedulerAction', array( 33 'Title' => 'Akce plánovače', 34 'Table' => 'SchedulerAction', 35 'DefaultSortColumn' => 'Name', 36 'ReadOnly' => true, 37 'Items' => array( 38 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => '', 'ReadOnly' => true), 39 'Class' => array('Type' => 'String', 'Caption' => 'Vykonat třídu', 'Default' => '', 'ReadOnly' => true), 40 ), 41 )); 42 $this->System->FormManager->RegisterFormType('TSchedulerAction', array( 43 'Type' => 'Reference', 44 'Table' => 'SchedulerAction', 45 'Id' => 'Id', 46 'Name' => 'Name', 47 'Filter' => '1', 31 48 )); 32 49 $this->System->RegisterCommandLine('run-scheduler', array('ModuleScheduler', 'Run')); … … 45 62 while(true) 46 63 { 47 $DbResult = $this->Database->select('Scheduler', '*', '(Enabled=1) AND (ScheduledTime < NOW())'); 64 $DbResult = $this->Database->query('SELECT `Scheduler`.*, `SchedulerAction`.`Class` AS `Class` FROM `Scheduler` '. 65 'LEFT JOIN `SchedulerAction` ON `SchedulerAction`.`Id` = `Scheduler`.`Action` '. 66 'WHERE (`Scheduler`.`Enabled`=1) AND (`Scheduler`.`ScheduledTime` > `Scheduler`.`LastExecutedTime`)'); 48 67 while($DbRow = $DbResult->fetch_assoc()) 49 68 { … … 60 79 array('ScheduledTime' => TimeToMysqlDateTime((MysqlDateTimeToTime($DbRow['ScheduledTime']) + $DbRow['Period'])))); 61 80 } 81 echo('.'); 62 82 sleep(1); 63 83 }
Note:
See TracChangeset
for help on using the changeset viewer.