Changeset 526
- Timestamp:
- Apr 21, 2013, 10:23:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/System.php
r525 r526 1 1 <?php 2 3 include_once(dirname(__FILE__).'/EmailQueue.php'); 2 4 3 5 class System … … 13 15 var $PathItems; 14 16 var $RootURLFolder; 17 var $EmailQueue; 15 18 16 19 function __construct() … … 21 24 $this->Database = new Database(); 22 25 $this->FormManager = new FormManager($this->Database); 26 $this->EmailQueue = new EmailQueue($this); 23 27 } 24 28 … … 79 83 } 80 84 81 function AddEmailToQueue($To, $Subject, $Content, $From, $AttachmentFileId = '')82 {83 $Values = array('To' => $To,84 'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()',85 'From' => $From);86 if($AttachmentFileId != '') $Values['AttachmentFile'] = $AttachmentFileId;87 $this->Database->insert('EmailQueue', $Values);88 }89 90 function ProcessEmailQueue()91 {92 $Output = '';93 $DbResult = $this->Database->select('EmailQueue', '*', 'Archive=0');94 while($DbRow = $DbResult->fetch_assoc())95 {96 $Mail = new Mail();97 $Mail->AddToCombined($DbRow['To']);98 $Mail->Subject = $DbRow['Subject'];99 $Mail->From = $DbRow['From'];100 $Mail->AddBody(strip_tags($DbRow['Content']), 'text/plain');101 $Mail->AddBody($DbRow['Content'], 'text/html');102 if($DbRow['AttachmentFile'] != '')103 {104 $DbResult2 = $this->Database->select('File', '*', 'Id='.$DbRow['AttachmentFile']);105 while($File = $DbResult2->fetch_assoc())106 $Mail->AttachFile($this->Config['Web']['FileRootFolder'].$File['DrivePath'], $File['MimeType']);107 }108 $Mail->Send();109 $this->Database->update('EmailQueue', 'Id='.$DbRow['Id'], array('Archive' => 1));110 $this->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']);111 $Output .= 'To: '.$DbRow['To'].' Subject: '.$DbRow['Subject'].'<br />';112 }113 return($Output);114 }115 116 85 function HumanDate($Time) 117 86 { -
trunk/Common/Version.php
r524 r526 1 1 <?php 2 2 3 $Revision = 52 4; // Subversion revision4 $DatabaseRevision = 5 17; // SQL structure revision5 $ReleaseTime = '2013-04-2 0';3 $Revision = 526; // Subversion revision 4 $DatabaseRevision = 526; // SQL structure revision 5 $ReleaseTime = '2013-04-21'; 6 6 7 7 ?> -
trunk/Modules/Finance/Manage.php
r524 r526 593 593 594 594 $Content .= '<br />Tento email je generován automaticky. V případě zjištění nesrovnalostí napište zpět.'; 595 $this->System-> AddEmailToQueue($User['Name'].' <'.$User['Email'].'>', $Title, $Content,595 $this->System->EmailQueue->AddItem($User['Name'].' <'.$User['Email'].'>', $Title, $Content, 596 596 $Config['Web']['Admin'].' <'.$Config['Web']['AdminEmail'].'>'); 597 597 $Output = ''; -
trunk/Modules/Network/Administration.php
r525 r526 27 27 $Form = new Form('Email'); 28 28 $Form->LoadValuesFromForm(); 29 $Result = $this->System-> AddEmailToQueue($Form->Values['Address'],29 $Result = $this->System->EmailQueue->AddItem($Form->Values['Address'], 30 30 $Form->Values['Subject'], $Form->Values['Content'], 31 31 $this->System->Config['Web']['Admin'].' <'.$this->System->Config['Web']['AdminEmail'].'>'); … … 34 34 if($_GET['Action'] == 'ProcessEmailQueue') 35 35 { 36 $Output = $this->System-> ProcessEmailQueue();36 $Output = $this->System->EmailQueue->Process(); 37 37 $Output = $this->SystemMessage('Zpracování fronty emailů', 'Nové emaily byly odeslány').$Output; 38 38 } -
trunk/Modules/Portal/Portal.php
r524 r526 8 8 var $ShortTitle = 'Rozcestník'; 9 9 10 function Show Links($HyperlinkGroup)10 function ShowActions($ActionGroup) 11 11 { 12 12 $Output = ''; 13 $DbResult = $this->Database->query('SELECT * FROM `Hyperlink` WHERE (`Group`='.$HyperlinkGroup['Id'].') AND (`Enable` = 1)'); 14 while($HyperLink = $DbResult->fetch_assoc()) 15 { 16 if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png'; 17 if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL']; 18 if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->User->User->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation']))) 19 $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />'; 20 } 21 return($this->Panel($HyperlinkGroup['Name'], $Output)); 13 $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '. 14 'WHERE (`Group`='.$ActionGroup['Id'].') AND (`Enable` = 1)'); 15 while($Action = $DbResult->fetch_assoc()) 16 { 17 if($Action['Icon'] == '') $Action['Icon'] = 'clear.png'; 18 if(substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->System->Link($Action['URL']); 19 if(($Action['PermissionModule'] == '') or (($Action['PermissionModule'] != '') and $this->System->User->User->CheckPermission($Action['PermissionModule'], $Action['PermissionOperation']))) 20 $Output .= '<img alt="'.$Action['Title'].'" src="images/favicons/'.$Action['Icon'].'" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a><br />'; 21 } 22 return($this->Panel($ActionGroup['Name'], $Output)); 22 23 } 23 24 … … 305 306 } 306 307 307 $DbResult = $this->Database->query('SELECT * FROM ` HyperlinkGroup`');308 $DbResult = $this->Database->query('SELECT * FROM `ActionGroup`'); 308 309 while($DbRow = $DbResult->fetch_assoc()) 309 $ HyperlinkGroups[$DbRow['Id']] = $DbRow;310 $ActionGroups[$DbRow['Id']] = $DbRow; 310 311 311 312 // Show pannels … … 322 323 while($Panel = $DbResult2->fetch_assoc()) 323 324 { 324 if($Panel['Module'] == ' HyperlinkGroup') $Output .= $this->ShowLinks($HyperlinkGroups[$Panel['Parameters']]);325 if($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]); 325 326 else if($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList()); 326 327 else if($Panel['Module'] == 'UserOptions') -
trunk/ToDo.txt
r517 r526 24 24 * Ruční filtrování a vyhledávání v tabulkách 25 25 * Předvolené sestavy filtrů, řazení, pořadí sloupců 26 - Zprovoznit obsluhu stránek přes virtuální URL 26 * Inicializace a aktualizace struktury databáze přímo z modulů 27 27 - Udělat fond IP adres, zobrazit jejich užití, umožnit automatické přiřazení volných 28 28 - Vytvořit třídy pro práci s Mikrotik RouterOS API … … 35 35 ====== 36 36 37 - Zprovoznit obsluhu stránek přes virtuální URL 37 38 - IS modul pro obecné datové manipulace s tabulkami 38 39 - Vedení skladu a produktových karet -
trunk/admin/Updates.php
r517 r526 239 239 } 240 240 241 function UpdateTo526($Manager) 242 { 243 $Manager->Execute("ALTER TABLE `Hyperlink` CHANGE `Name` `Title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL"); 244 $Manager->Execute("ALTER TABLE `Hyperlink` ADD `Name` VARCHAR( 255 ) NOT NULL AFTER `Id`"); 245 //$Manager->Execute("ALTER TABLE `Hyperlink` ADD UNIQUE ( `Name` )"); 246 $Manager->Execute("ALTER TABLE `Hyperlink` ADD `Type` INT NOT NULL AFTER `Title` , ADD INDEX ( `Type` )"); 247 $Manager->Execute("RENAME TABLE `Hyperlink` TO `Action` ;"); 248 $Manager->Execute("RENAME TABLE `HyperlinkGroup` TO `ActionGroup` ;"); 249 $Manager->Execute("CREATE TABLE IF NOT EXISTS `ActionType` ( 250 `Id` int(11) NOT NULL AUTO_INCREMENT, 251 `Name` varchar(255) NOT NULL, 252 PRIMARY KEY (`Id`) 253 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; 254 255 INSERT INTO `ActionType` (`Id`, `Name`) VALUES 256 (1, 'Odkaz'), 257 (2, 'Obrázek');"); 258 $Manager->Execute("UPDATE `Action` SET `Type` = 1;"); 259 $Manager->Execute("ALTER TABLE `Action` ADD FOREIGN KEY ( `Type` ) REFERENCES `ActionType` (". 260 "`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 261 $Manager->Execute("UPDATE `Panel` SET `Module` = 'ActionGroup' WHERE `Module` = 'HyperlinkGroup'"); 262 $Manager->Execute("CREATE TABLE IF NOT EXISTS `ActionIcon` ( 263 `Id` int(11) NOT NULL AUTO_INCREMENT, 264 `Name` varchar(255) NOT NULL, 265 PRIMARY KEY (`Id`) 266 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"); 267 $Manager->Execute("INSERT INTO `ActionIcon` (SELECT NULL AS `Id`, `IconFile` AS `Name` FROM `Action` WHERE `IconFile` != '' GROUP BY `IconFile`)"); 268 $Manager->Execute("UPDATE `Action` SET `IconFile` = (SELECT `Id` FROM `ActionIcon` WHERE `ActionIcon`.`Name` = `Action`.`IconFile`) "); 269 $Manager->Execute("ALTER TABLE `Action` CHANGE `IconFile` `Icon` INT NULL "); 270 $Manager->Execute("UPDATE `Action` SET `Icon` = NULL WHERE `Icon` = 0"); 271 $Manager->Execute("ALTER TABLE `Action` ADD INDEX ( `Icon` ) "); 272 $Manager->Execute("ALTER TABLE `Action` ADD FOREIGN KEY ( `Icon` ) REFERENCES `ActionIcon` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 273 $Manager->Execute("INSERT INTO `ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`) ". 274 "VALUES (NULL , 'Akce', '23', 'Action', '');"); 275 } 241 276 242 277 $Updates = array( … … 253 288 507 => array('Revision' => 515, 'Function' => 'UpdateTo515'), 254 289 515 => array('Revision' => 517, 'Function' => 'UpdateTo517'), 290 517 => array('Revision' => 526, 'Function' => 'UpdateTo526'), 255 291 ); 256 292 -
trunk/form_classes.php
r517 r526 19 19 { 20 20 $FormManager->Classes = array( 21 'Action' => array( 22 'Title' => 'Akce', 23 'Table' => 'Action', 24 'Items' => array( 25 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 26 'Title' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 27 'URL' => array('Type' => 'Hyperlink', 'Caption' => 'Odkaz', 'Default' => ''), 28 'Icon' => array('Type' => 'TActionIcon', 'Caption' => 'Ikony', 'Default' => ''), 29 'Type' => array('Type' => 'TActionType', 'Caption' => 'Typ', 'Default' => ''), 30 'Group' => array('Type' => 'TActionGroup', 'Caption' => 'Skupina', 'Default' => ''), 31 'PermissionModule' => array('Type' => 'String', 'Caption' => 'Modul oprávnění', 'Default' => ''), 32 'PermissionOperation' => array('Type' => 'String', 'Caption' => 'Operace oprávnění', 'Default' => ''), 33 'Enable' => array('Type' => 'Boolean', 'Caption' => 'Povolení', 'Default' => ''), 34 ), 35 ), 36 'ActionIcon' => array( 37 'Title' => 'Ikony akcí', 38 'Table' => 'ActionIcon', 39 'Items' => array( 40 'Name' => array('Type' => 'String', 'Caption' => 'Název souboru', 'Default' => ''), 41 ), 42 ), 43 'ActionGroup' => array( 44 'Title' => 'Skupiny akcí', 45 'Table' => 'ActionGroup', 46 'Items' => array( 47 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 48 ), 49 ), 50 'ActionType' => array( 51 'Title' => 'Typy akcí', 52 'Table' => 'ActionType', 53 'Items' => array( 54 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 55 ), 56 ), 21 57 'FinanceBank' => array( 22 58 'Title' => 'Banky', … … 1099 1135 'Filter' => '1', 1100 1136 ), 1137 'TActionIcon' => array( 1138 'Type' => 'Reference', 1139 'Table' => 'ActionIcon', 1140 'Id' => 'Id', 1141 'Name' => 'Name', 1142 'Filter' => '1', 1143 ), 1144 'TActionType' => array( 1145 'Type' => 'Reference', 1146 'Table' => 'ActionType', 1147 'Id' => 'Id', 1148 'Name' => 'Name', 1149 'Filter' => '1', 1150 ), 1151 'TActionGroup' => array( 1152 'Type' => 'Reference', 1153 'Table' => 'ActionGroup', 1154 'Id' => 'Id', 1155 'Name' => 'Name', 1156 'Filter' => '1', 1157 ), 1101 1158 'TDirectory' => array( 1102 1159 'Type' => 'Reference',
Note:
See TracChangeset
for help on using the changeset viewer.