Changeset 505
- Timestamp:
- Apr 1, 2013, 12:29:37 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 deleted
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r501 r505 22 22 include_once(dirname(__FILE__).'/Page.php'); 23 23 include_once(dirname(__FILE__).'/Form/Form.php'); 24 include_once(dirname(__FILE__).'/File.php');25 24 include_once(dirname(__FILE__).'/../aktuality/news.php'); 26 25 include_once(dirname(__FILE__).'/../finance/bills.php'); … … 30 29 31 30 // Application modules 31 include_once(dirname(__FILE__).'/../Modules/File/File.php'); 32 32 include_once(dirname(__FILE__).'/../Modules/Meteostation/Meteostation.php'); 33 33 include_once(dirname(__FILE__).'/../Modules/Portal/Portal.php'); … … 42 42 include_once(dirname(__FILE__).'/../Modules/Finance/Finance.php'); 43 43 include_once(dirname(__FILE__).'/../Modules/FinanceBankAPI/FinanceBankAPI.php'); 44 include_once(dirname(__FILE__).'/../Modules/NetworkShare/NetworkShare.php'); 44 45 45 46 class System extends Module … … 52 53 var $ModuleManager; 53 54 var $PathItems; 54 var $FilesDir;55 55 56 56 function __construct() … … 60 60 $this->Pages = array(); 61 61 $this->ModuleManager = new AppModuleManager(); 62 $this->FilesDir = '';63 62 $this->Database = new Database(); 64 63 $this->FormManager = new FormManager($this->Database); … … 175 174 $System = new System(); 176 175 $System->Config = $Config; 177 $System->FilesDir = dirname(__FILE__).'/../'.$Config['Web']['UploadFileFolder'].'/';178 176 $System->Database->Connect($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']); 179 177 $System->Database->Prefix = $Config['Database']['Prefix']; … … 203 201 204 202 // Register new modules 203 $System->ModuleManager->RegisterModule(new ModuleFile($System)); 205 204 $System->ModuleManager->RegisterModule(new ModuleMeteostation($System)); 206 205 $System->ModuleManager->RegisterModule(new ModulePortal($System)); … … 215 214 $System->ModuleManager->RegisterModule(new ModuleFinance($System)); 216 215 $System->ModuleManager->RegisterModule(new ModuleFinanceBankAPI($System)); 216 $System->ModuleManager->RegisterModule(new ModuleNetworkShare($System)); 217 217 $System->ModuleManager->StartAll(); 218 218 } -
trunk/Common/Update.php
r501 r505 176 176 { 177 177 $Output .= '<h3>Aktualizace</h3>'; 178 $ this->UpdateManager->Update();178 $Output .= $this->UpdateManager->Update(); 179 179 $Output .= $this->ControlPanel(); 180 180 } else … … 183 183 $Output .= '<h3>Instalace</h3>'; 184 184 $this->UpdateManager->Install(); 185 $ this->UpdateManager->Update();185 $Output .= $this->UpdateManager->Update(); 186 186 $Output .= $this->ControlPanel(); 187 187 } else -
trunk/Common/Version.php
r503 r505 1 1 <?php 2 2 3 $Revision = 50 3; // Subversion revision4 $DatabaseRevision = 50 2;5 $ReleaseTime = '2013-03- 10';3 $Revision = 505; // Subversion revision 4 $DatabaseRevision = 505; 5 $ReleaseTime = '2013-03-31'; 6 6 7 7 ?> -
trunk/Modules/Finance/Finance.php
r500 r505 11 11 $this->License = 'GNU/GPLv3'; 12 12 $this->Description = 'Base module for finance management'; 13 $this->Dependencies = array( );13 $this->Dependencies = array('File'); 14 14 } 15 15 -
trunk/Modules/FinanceBankAPI/FioDemo.php
r500 r505 4 4 5 5 $Fio = new FioAPI(); 6 $Fio->Token = ' ';6 $Fio->Token = 'YEEd9LlZ5SJ5VcxFcdbAwCji6UTtxve2ns5sClfCbii8Taq63uP7JNsa7OeN1Oum'; 7 7 $Records = $Fio->Import(time() - 3600 * 24 * 31 * 2, time()); 8 8 //print_r($Records); -
trunk/Modules/FinanceBankAPI/ImportFio.php
r502 r505 27 27 if($Record['Type'] == GPC_TYPE_ITEM) 28 28 { 29 $this->Database->insert('FinanceBankImport', array('Time' => $Record['DueDate'],30 31 32 33 29 $this->Database->insert('FinanceBankImport', array('Time' => TimeToMysqlDate($Record['DueDate']), 30 'BankAccount' => $this->BankAccount, 'Value' => $Record['Value'], 31 'SpecificSymbol' => $Record['SpecificSymbol'], 'VariableSymbol' => $Record['VariableSymbol'], 32 'ConstantSymbol' => $Record['ConstantSymbol'], 'Currency' => $this->Currency, 33 )); 34 34 echo('<td>'.$Record['OffsetAccount'].'</td>'); 35 35 echo('<td>'.$Record['BankCode'].'</td>'); -
trunk/Modules/NetworkShare/browse.php
r129 r505 48 48 //$Vlozit = ''; 49 49 // Nacti parent ID 50 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM itemsLIMIT 0,1');50 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM NetworkShareItem LIMIT 0,1'); 51 51 //echo(DB_NumRows()); 52 52 $Row = $DbResult->fetch_array(); … … 99 99 $Nazev = substr($Nazev,0,strrpos($Nazev,'.')); 100 100 } else $Ext = ''; 101 //$Vlozit .= "INSERT INTO items(name,size,date,ext,parent,type,host) ".101 //$Vlozit .= "INSERT INTO NetworkShareItem (name,size,date,ext,parent,type,host) ". 102 102 //"VALUES ('$Nazev','$Velikost',NOW(),'$Ext','$Parent','$Type','$HostID'); "; 103 103 104 $Database->insert(' items', array(104 $Database->insert('NetworkShareItem', array( 105 105 'name' => $Nazev, 106 106 'size' => $Velikost, … … 126 126 127 127 // Aktualizuj velikost 128 //DB_Query("SELECT SUM(size) FROM itemsWHERE (parent=".$Parent.")");128 //DB_Query("SELECT SUM(size) FROM NetworkShareItem WHERE (parent=".$Parent.")"); 129 129 //$Row = DB_Row(); 130 $Database->update(' items', 'id='.$Parent, array('size' => $VelikostSlozky));130 $Database->update('NetworkShareItem', 'id='.$Parent, array('size' => $VelikostSlozky)); 131 131 //closedir($Dir); 132 132 return($VelikostSlozky); … … 134 134 135 135 // Proskenuj jednotlive sdileni 136 $Database->query('DELETE FROM itemsWHERE host='.$HostID); // Smaz predchozi polozky136 $Database->query('DELETE FROM NetworkShareItem WHERE host='.$HostID); // Smaz predchozi polozky 137 137 138 138 // Zapis nazev pocitace 139 $Database->insert(' items',array(139 $Database->insert('NetworkShareItem',array( 140 140 'name' => $Host, 141 141 'size' => 0, … … 148 148 149 149 // Nacti Parent ID 150 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM itemsLIMIT 0,1');150 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM NetworkShareItem LIMIT 0,1'); 151 151 $Row = $DbResult->fetch_array(); 152 152 $Parent = $Row[0]; … … 170 170 { 171 171 // Přidej poloľku sdílení do datanáze 172 $Database->insert(' items',array(172 $Database->insert('NetworkShareItem',array( 173 173 'name' => $Share, 174 174 'size' => 0, … … 196 196 197 197 // Aktualizuj velikost dat pocitace 198 $DbResult = $Database->query("SELECT SUM(size) FROM itemsWHERE parent=".$Parent);199 $Row = $DbResult->fetch_array(); 200 $Database->update(' items','id='.$Parent,array('size' => $Row[0]));198 $DbResult = $Database->query("SELECT SUM(size) FROM NetworkShareItem WHERE parent=".$Parent); 199 $Row = $DbResult->fetch_array(); 200 $Database->update('NetworkShareItem','id='.$Parent,array('size' => $Row[0])); 201 201 202 202 // Zaktivuj strom … … 207 207 $NewID = $Row['id']; 208 208 $Database->select_db('share'); 209 $Database->query("DELETE FROM itemsWHERE host=".$NewID);210 $Database->update(' items','host='.$HostID,array('host' => $NewID));209 $Database->query("DELETE FROM NetworkShareItem WHERE host=".$NewID); 210 $Database->update('NetworkShareItem','host='.$HostID,array('host' => $NewID)); 211 211 echo("OK\n"); 212 212 … … 219 219 220 220 $Database->select_db('share'); 221 $DbResult = $Database->query("SELECT SUM(size) FROM itemsWHERE ((parent=1) AND (host IN (".substr($Vyber,0,-1).')))');222 $Row = $DbResult->fetch_array(); 223 $Database->update(' items','id=1',array('size' => $Row[0]));221 $DbResult = $Database->query("SELECT SUM(size) FROM NetworkShareItem WHERE ((parent=1) AND (host IN (".substr($Vyber,0,-1).')))'); 222 $Row = $DbResult->fetch_array(); 223 $Database->update('NetworkShareItem','id=1',array('size' => $Row[0])); 224 224 225 225 // Zapiš chyby do databáze 226 226 echo("Chyby sdílení...\n"); 227 $Database->delete(' errors', 'host="'.$Host.'"');227 $Database->delete('NetworkShareError', 'host="'.$Host.'"'); 228 228 if(is_dir($TempDir.'errors')) 229 229 { … … 244 244 { 245 245 $Row = substr($ShareFull.'/'.substr($Row, 39), 0, -1); 246 $Database->insert(' errors', array('host' => $Host, 'message' => $Row));246 $Database->insert('NetworkShareError', array('host' => $Host, 'message' => $Row)); 247 247 echo($Row."\n"); 248 248 } -
trunk/Modules/NetworkShare/online.php
r438 r505 1 1 <?php 2 3 include_once('../Common/Global.php'); 4 2 include('../global.php'); 5 3 //$Database->select_db('share'); 6 4 echo("\n====================== Kontrola online pocitacu ============================\n\n"); -
trunk/Modules/NetworkShare/playlist.php
r438 r505 1 1 <?php 2 3 include_once('../Common/Global.php'); 4 5 // Omezení na online/offline uľivatele 2 include('../global.php'); 3 // Omezení na online/offline uµivatele 6 4 7 5 $DbResult = $Database->query('SELECT id FROM hosts WHERE online=1 AND block=0 AND user>0'); … … 15 13 $Database->select_db('share'); 16 14 17 // Maximální vno ření15 // Maximální vnoøení 18 16 $MaxNesting = 20; 19 17 20 // Najde cestu ke ke řenu18 // Najde cestu ke keøenu 21 19 function PlnaCesta($Row) 22 20 { -
trunk/Modules/NetworkShare/update.php
r40 r505 1 1 <?php 2 include('../style.php');3 2 4 3 //$Perioda = 3600*3; // prochazet po tech hodinach … … 9 8 $Hosts = array(); 10 9 $StartTime = GetMicrotime(); 11 $DbResult = $Database->query("SELECT * FROM hosts WHERE online=1 AND (block=0 OR name='centrala') AND (name!='GATE') AND user>0");10 $DbResult = $Database->query("SELECT * FROM NetworkDevice WHERE Online=1 AND (Block=0 OR Name='centrala') AND (Name!='GATE') AND User>0"); 12 11 while($Row = $DbResult->fetch_array()) 13 12 { … … 19 18 if($Dnes != $Row['last_share_check']) 20 19 { 21 echo("Kontroluji ".$Row[' name']."...\n");22 passthru('env browse_host='.$Row[' name'].' browse_id='.$HostID.' php -q -c php.ini -f browse.php');20 echo("Kontroluji ".$Row['Name']."...\n"); 21 passthru('env browse_host='.$Row['Name'].' browse_id='.$HostID.' php -q -c php.ini -f browse.php'); 23 22 } 24 else echo("Vynechavam ".$Row[' name']."...\n");23 else echo("Vynechavam ".$Row['Name']."...\n"); 25 24 // Aktualizuj datum prochazeni 26 $Database->update(' hosts',"name='".$Row['name']."'",array('last_share_check' => $Dnes));25 $Database->update('Hosts', "name='".$Row['name']."'",array('last_share_check' => $Dnes)); 27 26 } 28 27 $Rozdil = GetMicrotime()-$StartTime+10; 29 28 30 29 // Oprav a zoptimalizuj tabulku 31 $Database->select_db('share');30 //$Database->select_db('share'); 32 31 echo('Opravuji tabulku...'); 33 $Database->query('REPAIR TABLE items');32 $Database->query('REPAIR TABLE NetworkShareItem'); 34 33 echo("\nOptimalizuji tabulku..."); 35 $Database->query('OPTIMIZE TABLE items');34 $Database->query('OPTIMIZE TABLE NetworkShareItem'); 36 35 37 36 echo("\nDoba procháení ".date("H:i:s",$Rozdil-3600)."\n\n"); -
trunk/admin/Updates.php
r503 r505 56 56 $Manager->Execute("INSERT INTO `ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`) ". 57 57 "VALUES (NULL , 'Sítové služby', '1', 'NetworkConfiguration', '');"); 58 $Manager->Execute("INSERT INTO ` centrala`.`ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`) ".58 $Manager->Execute("INSERT INTO `ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`) ". 59 59 "VALUES (NULL , 'Fronta e-mailů', '23', 'EmailQueue', '');"); 60 60 $Manager->Execute("CREATE TABLE IF NOT EXISTS `FinanceVAT` ( … … 154 154 "VALUES (NULL , 'Banka', '2', '', '');"); 155 155 $Id = $Manager->Database->insert_id; 156 $Manager->Execute("UPDATE `ISMenuItem` SET `Parent` = '".$Id."' WHERE `ISMenuItem`.`Id` =10; ". 157 "UPDATE `ISMenuItem` SET `Parent` = '".$Id."' WHERE `ISMenuItem`.`Id` =48;". 158 "UPDATE `ISMenuItem` SET `Parent` = '".$Id."' WHERE `ISMenuItem`.`Id` =50;"); 156 $Manager->Execute("UPDATE `ISMenuItem` SET `Parent` = '".$Id."' WHERE `ISMenuItem`.`Id` =''Bankovní účty'; ". 157 "UPDATE `ISMenuItem` SET `Parent` = '".$Id."' WHERE `ISMenuItem`.`Id` ='Import z účtu';". 158 "UPDATE `ISMenuItem` SET `Parent` = '".$Id."' WHERE `ISMenuItem`.`Name` ='Banky';"); 159 } 160 161 function UpdateTo505($Manager) 162 { 163 $Manager->Execute("UPDATE `ISMenuItem` SET `Name` = 'Služby', `Table` = 'Service' WHERE `ISMenuItem`.`Name` ='Tarify';"); 164 $Manager->Execute("INSERT INTO `ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`) ". 165 "VALUES (NULL , 'Kategorie služeb', '2', 'ServiceCategory', '');"); 166 $Manager->Execute("CREATE TABLE IF NOT EXISTS `NetworkShareItem` ( 167 `Id` int(11) NOT NULL AUTO_INCREMENT, 168 `Name` varchar(255) NOT NULL DEFAULT '', 169 `Parent` int(11) NOT NULL DEFAULT '0', 170 `Host` int(11) NOT NULL DEFAULT '0', 171 `Size` bigint(20) NOT NULL DEFAULT '0', 172 `Ext` varchar(64) NOT NULL DEFAULT '', 173 `Date` date NOT NULL DEFAULT '0000-00-00', 174 `Type` int(11) NOT NULL DEFAULT '0', 175 PRIMARY KEY (`Id`), 176 KEY `Parent` (`Parent`), 177 KEY `Search` (`Name`,`Size`), 178 KEY `Name` (`Name`) 179 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 180 $Manager->Execute("CREATE TABLE IF NOT EXISTS `NetworkShareError` ( 181 `Id` int(11) NOT NULL AUTO_INCREMENT, 182 `Host` varchar(16) NOT NULL DEFAULT '', 183 `Message` varchar(255) NOT NULL DEFAULT '', 184 PRIMARY KEY (`Id`) 185 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 186 159 187 } 160 188 … … 168 196 499 => array('Revision' => 500, 'Function' => 'UpdateTo500'), 169 197 500 => array('Revision' => 502, 'Function' => 'UpdateTo502'), 198 502 => array('Revision' => 505, 'Function' => 'UpdateTo505'), 170 199 ); 171 200 -
trunk/finance/manage.php
r501 r505 617 617 $Bill->System = &$this->System; 618 618 $Bill->InvoiceId = $Row['Id']; 619 $FullFileName = $this->System-> FilesDir.$FileName;619 $FullFileName = $this->System->Modules['File']->FilesDir.$FileName; 620 620 $Bill->SaveToFile($FullFileName); 621 621 $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName)));
Note:
See TracChangeset
for help on using the changeset viewer.