Changeset 660
- Timestamp:
- May 31, 2014, 12:08:52 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r659 r660 1 1 <?php 2 2 3 $Revision = 6 59; // Subversion revision3 $Revision = 660; // Subversion revision 4 4 $DatabaseRevision = 657; // SQL structure revision 5 $ReleaseTime = strtotime('2014-05-2 5');5 $ReleaseTime = strtotime('2014-05-29'); -
trunk/Common/Form/Types/TimeDiff.php
r659 r660 7 7 function OnView($Item) 8 8 { 9 $Output = sprintf('%02d', floor($Item['Value'] / 3600 % 24)).':'. 10 sprintf('%02d', floor($Item['Value'] / 60 % 60)).':'. 11 sprintf('%02d', floor($Item['Value'] % 60)); 12 $Days = floor($Item['Value'] / (60 * 60 * 24)); 13 if($Days > 0) $Output = $Days.' dnů '.$Output; 9 if($Item['Value'] == null) $Output = ''; 10 else { 11 $Output = sprintf('%02d', floor($Item['Value'] / 3600 % 24)).':'. 12 sprintf('%02d', floor($Item['Value'] / 60 % 60)).':'. 13 sprintf('%02d', floor($Item['Value'] % 60)); 14 $Days = floor($Item['Value'] / (60 * 60 * 24)); 15 if($Days > 0) $Output = $Days.' dnů '.$Output; 16 } 14 17 return($Output); 15 18 } -
trunk/Modules/Finance/Finance.php
r652 r660 293 293 return($Output); 294 294 } 295 295 296 296 function GetVATByType($TypeId) 297 297 { … … 345 345 'Table' => 'FinanceOperation', 346 346 'DefaultSortColumn' => 'Time', 347 'DefaultSortOrder' => 1, 347 348 'Items' => array( 348 349 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), … … 367 368 'Table' => 'FinanceInvoice', 368 369 'DefaultSortColumn' => 'Time', 370 'DefaultSortOrder' => 1, 369 371 'Items' => array( 370 372 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), … … 378 380 'Generate' => array('Type' => 'Boolean', 'Caption' => 'Generovat', 'Default' => ''), 379 381 'PeriodFrom' => array('Type' => 'Date', 'Caption' => 'Období od', 'Default' => '', 'Null' => true), 380 'PeriodTo' => array('Type' => 'Date', 'Caption' => 'Období do', 'Default' => '', 'Null' => true), 382 'PeriodTo' => array('Type' => 'Date', 'Caption' => 'Období do', 'Default' => '', 'Null' => true), 381 383 'Items' => array('Type' => 'TFinanceInvoiceItemListInvoice', 'Caption' => 'Položky', 'Default' => ''), 382 384 'OperationRel' => array('Type' => 'TFinanceInvoiceOperationRelListInvoice', 'Caption' => 'Platba', 'Default' => ''), 383 'OperationRelCount' => array('Type' => 'Integer', 'Caption' => 'Plateb', 385 'OperationRelCount' => array('Type' => 'Integer', 'Caption' => 'Plateb', 384 386 'ReadOnly' => true, 'SQL' => '(SELECT COUNT(`FinanceInvoiceOperationRel`.`Id`) FROM `FinanceInvoiceOperationRel` '. 385 387 'WHERE `FinanceInvoiceOperationRel`.`Invoice`=#Id)'), … … 396 398 'Quantity' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'), 397 399 'VAT' => array('Type' => 'Integer', 'Caption' => 'Daň', 'Default' => '21', 'Suffix' => '%'), 398 'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč', 400 'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč', 399 401 'ReadOnly' => true, 'SQL' => '`Price` * `Quantity`'), 400 402 ), -
trunk/Modules/IS/IS.php
r654 r660 400 400 if(!array_key_exists('DefaultSortColumn', $FormClass)) 401 401 $FormClass['DefaultSortColumn'] = 'Id'; 402 $Order = GetOrderTableHeader($TableColumns, $FormClass['DefaultSortColumn'], 0); 402 if(!array_key_exists('DefaultSortOrder', $FormClass)) 403 $FormClass['DefaultSortOrder'] = 0; 404 $Order = GetOrderTableHeader($TableColumns, $FormClass['DefaultSortColumn'], $FormClass['DefaultSortOrder']); 403 405 $Output .= $Order['Output']; 404 406 -
trunk/Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php
r659 r660 30 30 'Title' => 'Změny stavu rozhraní', 31 31 'Table' => 'NetworkInterfaceUpDown', 32 'DefaultSortColumn' => 'Time', 33 'DefaultSortOrder' => 1, 32 34 'Items' => array( 33 35 'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => '', 'ReadOnly' => true), -
trunk/Modules/News/News.php
r614 r660 3 3 include_once(dirname(__FILE__).'/NewsPage.php'); 4 4 5 function CategoryItemCompare($Item1, $Item2) 5 function CategoryItemCompare($Item1, $Item2) 6 6 { 7 7 if ($Item1['Index'] == $Item2['Index']) return(0); … … 25 25 $this->SupportedModules = array('Search'); 26 26 } 27 27 28 28 function DoInstall() 29 29 { … … 32 32 function DoUnInstall() 33 33 { 34 } 35 34 } 35 36 36 function DoStart() 37 37 { … … 40 40 'Title' => 'Aktualita', 41 41 'Table' => 'News', 42 'DefaultSortColumn' => 'Date', 43 'DefaultSortOrder' => 1, 42 44 'Items' => array( 43 45 'Category' => array('Type' => 'TNewsCategory', 'Caption' => 'Kategorie', 'Default' => 0), … … 67 69 { 68 70 $this->System->ModuleManager->Modules['Search']->RegisterSearch('Novinky', 'News', array('Title', 'Content')); 69 } 70 } 71 71 } 72 } 73 72 74 function ShowNews($Category, $ItemCount, $DaysAgo) 73 75 { … … 76 78 $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$Category); 77 79 $Row = $DbResult->fetch_array(); 78 $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption']; 80 $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption']; 79 81 $Output .= '<div class="Action"><a href="aktuality/?category='.$Category.'">Zobrazit</a>'; 80 82 if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category)) … … 100 102 101 103 if($Row['Enclosure'] != '') 102 { 104 { 103 105 $Output .= '<br />Přílohy: '; 104 106 $Enclosures = explode(';', $Row['Enclosure']); 105 107 foreach($Enclosures as $Enclosure) 106 108 { 107 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 109 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 108 110 $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 109 111 } 110 112 } 111 113 $Output .= '</div></td></tr>'; 112 $Index = $Index + 1; 114 $Index = $Index + 1; 113 115 $FontSize = $FontSize - 1; 114 116 } … … 127 129 while($NewsCategory = $DbResult->fetch_array()) 128 130 { 129 $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 131 $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 130 132 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo'], 'Group' => $NewsCategory['Group']); 131 133 $I++; … … 166 168 $Output .= '<td style="vertical-align: top; width: '.round(100 / $ColumnCount).'%;">'; 167 169 foreach($this->NewsSetting as $SettingItem) 168 if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column)) 170 if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column)) 169 171 $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']); 170 172 $Output .= '</td>'; … … 175 177 $Output .= '</div>'; 176 178 return($Output); 177 } 179 } 178 180 179 181 function ShowCustomizeMenu() … … 188 190 $NewsCategory = $DbResult->fetch_array(); 189 191 $Output .= '<tr><td>'.$NewsCategory['Caption'].'</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex'.$I.'" value="'.$SettingItem['Index'].'" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled'.$I.'"'; 190 if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"'; 192 if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"'; 191 193 $Output .= ' /></td>'. 192 194 '<td align="center"><input type="text" size="2" name="NewsCategoryCount'.$I.'" value="'.$SettingItem['ItemCount'].'" />'. … … 224 226 setcookie('NewsSetting', $_COOKIE['NewsSetting'], time() + 60 * 60 * 24 * 365); 225 227 } 226 228 227 229 function ModifyContent($Content) 228 230 { 229 231 $Result = ''; 230 232 231 233 // Make HTML link from URL 232 234 $I = 0; … … 251 253 $Result .= $Content; 252 254 return($Result); 253 } 255 } 254 256 } -
trunk/Modules/Task/Task.php
r586 r660 13 13 $this->Dependencies = array('User'); 14 14 } 15 15 16 16 function DoStart() 17 17 { … … 19 19 'Title' => 'Úkoly', 20 20 'Table' => 'Task', 21 'DefaultSortColumn' => 'Name', 21 'DefaultSortColumn' => 'TimeCreate', 22 'DefaultSortOrder' => 1, 22 23 'Items' => array( 23 24 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => '', 'Required' => true), … … 28 29 'Priority' => array('Type' => 'TPriority', 'Caption' => 'Důležitost', 'Default' => 1), 29 30 'Conclusion' => array('Type' => 'Text', 'Caption' => 'Vyhodnocení', 'Default' => ''), 30 'Public' => array('Type' => 'Boolean', 'Caption' => 'Veřejné', 'Default' => '0'), 31 'Public' => array('Type' => 'Boolean', 'Caption' => 'Veřejné', 'Default' => '0'), 31 32 'Progress' => array('Type' => 'Integer', 'Caption' => 'Průběh', 'Default' => '0', 'Suffix' => '%'), 32 33 'Group' => array('Type' => 'TTaskGroup', 'Caption' => 'Kategorie', 'Default' => '', 'Null' => true), … … 59 60 ), 60 61 )); 61 62 } 62 63 } 63 64 } -
trunk/Modules/TimeMeasure/Measurement/System.php
r548 r660 24 24 25 25 function Ping($Host = 'nix.cz') 26 { 26 { 27 $Row = array(); 27 28 exec('ping '.$Host.' -c 1 -W 1|grep time=', $Row); 28 29 // W - timeout in seconds … … 55 56 $LastCpuUsage = unserialize(file_get_contents($CpuStateFileName)); 56 57 //$cpuIDLEprev, $cpuSYSTprev, $cpuUSERprev; 57 58 58 59 // get processor usage seconds for pct stats ### 59 60 $File = fopen('/proc/stat', 'r'); … … 69 70 $CpuUsageDiffTotal = (($CpuUsageDiff['User'] + $CpuUsageDiff['System']) + $CpuUsageDiff['Idle']); 70 71 if ($CpuUsageDiffTotal > 0) 71 { 72 { 72 73 $CpuUsagePercent['User'] = ($CpuUsageDiff['User'] / $CpuUsageDiffTotal) * 100; 73 74 $CpuUsagePercent['System'] = ($CpuUsageDiff['System'] / $CpuUsageDiffTotal) * 100; … … 93 94 array_shift($Output); // Skip header 94 95 foreach($Output as $Item) 95 { 96 { 96 97 while(strpos($Item, ' ') !== false) $Item = str_replace(' ', ' ', $Item); // Rrmove multiple spaces 97 98 $Item = explode(':', $Item); … … 108 109 $NetworkState[$Interface]['DownAverage'] = 0; 109 110 $NetworkState[$Interface]['UpAverage'] = 0; 110 } 111 } 111 112 if($NetworkState[$Interface]['DownAverage'] < 0) $NetworkState[$Interface]['DownAverage'] = 0; 112 113 if($NetworkState[$Interface]['UpAverage'] < 0) $NetworkState[$Interface]['UpAverage'] = 0; … … 121 122 return($NetworkState['Interface']['DownAverage']); 122 123 } 123 124 124 125 function NetworkSpeedUpload($Interface) 125 126 {
Note:
See TracChangeset
for help on using the changeset viewer.