Changeset 689
- Timestamp:
- Sep 7, 2014, 6:15:54 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Setup/Updates.php
r688 r689 889 889 // Convert monthly plus payment for consumption to regular service 890 890 $DbResult = $Manager->Execute('SELECT `MonthlyPlus`, `Member` FROM `MemberPayment` WHERE `MonthlyPlus` > 0'); 891 while($DbR esult->num_rows > 0)891 while($DbRow = $DbResult->fetch_assoc) 892 892 { 893 $DbRow = $DbResult->fetch_assoc();894 893 $Manager->Execute("INSERT INTO `Service` (`Id` ,`Name` ,`Category` ,`Price` ,`VAT`) ". 895 894 "VALUES (NULL , 'Spotřeba energie', 3, -".$DbRow['MonthlyPlus'].", 2);"); -
trunk/Modules/EmailQueue/EmailQueue.php
r593 r689 6 6 var $ShortTitle = 'Fronta pošty'; 7 7 var $ParentClass = 'PagePortal'; 8 8 9 9 function Show() 10 10 { … … 12 12 $Output = $this->SystemMessage('Zpracování fronty emailů', 'Nové emaily byly odeslány').$Output; 13 13 return($Output); 14 } 14 } 15 15 } 16 16 17 17 class ModuleEmailQueue extends AppModule 18 18 { … … 37 37 38 38 function DoStart() 39 { 39 { 40 40 $this->System->RegisterPage('fronta-posty', 'PageEmailQueueProcess'); 41 41 $this->System->FormManager->RegisterClass('Email', array( … … 52 52 'Title' => 'Fronta e-mailů', 53 53 'Table' => 'EmailQueue', 54 'DefaultSortColumn' => 'Time', 55 'DefaultSortOrder' => 1, 54 56 'Items' => array( 55 57 'Time' => array('Type' => 'DateTime', 'Caption' => 'Vytvořeno'), … … 65 67 array('Caption' => 'Odeslat nové', 'URL' => '/fronta-posty/'), 66 68 ), 67 )); 69 )); 68 70 } 69 71 … … 74 76 function AddItem($To, $Subject, $Content, $From, $AttachmentFileId = '') 75 77 { 76 $Values = array('To' => $To, 77 'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()', 78 $Values = array('To' => $To, 79 'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()', 78 80 'From' => $From); 79 81 if($AttachmentFileId != '') $Values['AttachmentFile'] = $AttachmentFileId; 80 82 $this->Database->insert('EmailQueue', $Values); 81 83 } 82 84 83 85 function Process() 84 86 { … … 86 88 $DbResult = $this->Database->select('EmailQueue', '*', 'Archive=0'); 87 89 while($DbRow = $DbResult->fetch_assoc()) 88 { 90 { 89 91 $Mail = new Mail(); 90 92 $Mail->AddToCombined($DbRow['To']); … … 103 105 $this->System->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']); 104 106 $Output .= 'To: '.$DbRow['To'].' Subject: '.$DbRow['Subject'].'<br />'; 105 } 107 } 106 108 return($Output); 107 109 } -
trunk/Modules/News/ImportObecHovezi.php
r635 r689 15 15 16 16 $doc = new DOMDocument(); 17 $doc->load($SourceURL);18 foreach($doc->getElementsByTagName('item') as $node) 17 @$doc->load($SourceURL); 18 foreach($doc->getElementsByTagName('item') as $node) 19 19 { 20 20 $Title = $node->getElementsByTagName('title')->item(0)->nodeValue; 21 21 $Description = $node->getElementsByTagName('description')->item(0)->nodeValue; 22 $Link = $node->getElementsByTagName('link')->item(0)->nodeValue; 22 $Link = $node->getElementsByTagName('link')->item(0)->nodeValue; 23 23 $Date = $node->getElementsByTagName('pubDate')->item(0)->nodeValue; 24 24 25 25 $Description = strip_tags($Description); 26 26 $Description = str_replace("\r", '', $Description); … … 29 29 // $Date = substr($Date, $CommaPos + 1); 30 30 $Date = TimeToMysqlDateTime(strtotime($Date)); 31 32 31 32 33 33 $DbResult = $System->Database->select('News', 'Id', '(`Title`="'.$System->Database->real_escape_string($Title).'") AND (`Category`='.$Category.') AND (`Content` = "'.$System->Database->real_escape_string($Description).'") AND (`Link` = "'.$System->Database->real_escape_string($Link).'")'); 34 34 //echo($System->Database->LastQuery); … … 52 52 $Description = substr($Content, strpos($Content, $DescriptionSeparator) + strlen($DescriptionSeparator)); 53 53 $Description = trim(substr($Description, 0, strpos($Description, '</'))); 54 54 55 55 $Content = substr($Content, strpos($Content, $StartLink) + strlen($StartLink)); 56 56 $Link = substr($Content, 0, strpos($Content, '<')); … … 62 62 //echo('Description: '.$Description.'<br>'); 63 63 //echo('Link: '.$Link.'<br><hr>'); 64 64 65 65 $Link = $System->Database->real_escape_string($Link); 66 66 $Title = $System->Database->real_escape_string($Title); 67 67 $Description = strip_cdata($Description); 68 68 $Description = strip_tags($Description); 69 69 70 70 $Description = str_replace("\n", '<br>', $Description); 71 71 $Description = str_replace("\r", '', $Description); 72 72 $Description = $System->Database->real_escape_string($Description); 73 73 74 74 $DbResult = $System->Database->select('News', 'Id', '(`Title`="'.$Title.'") AND (`Category`='.$Category.') AND (`Content` = "'.$Description.'") AND (`Link` = "'.$Link.'")'); 75 75 //echo($System->Database->LastQuery); … … 79 79 echo($System->Database->insert_id.','); 80 80 } 81 } 81 } 82 82 */ -
trunk/Modules/Subject/Subject.php
r678 r689 36 36 'Invoices' => array('Type' => 'TFinanceInvoiceListSubject', 'Caption' => 'Faktury', 'Default' => ''), 37 37 'Payment' => array('Type' => 'Float', 'Caption' => 'Placení', 'Default' => '', 38 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => ' (SELECT SUM(`FinanceOperation`.`Value`) FROM `FinanceOperation` '.39 'WHERE `FinanceOperation`.`Subject`=#Id) -(SELECT SUM(`FinanceInvoice`.`Value`) FROM `FinanceInvoice` '.40 'WHERE `FinanceInvoice`.`Subject`=#Id) '),38 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => 'IFNULL((SELECT SUM(`FinanceOperation`.`Value`) FROM `FinanceOperation` '. 39 'WHERE `FinanceOperation`.`Subject`=#Id), 0) - IFNULL((SELECT SUM(`FinanceInvoice`.`Value`) FROM `FinanceInvoice` '. 40 'WHERE `FinanceInvoice`.`Subject`=#Id), 0)'), 41 41 ), 42 42 ));
Note:
See TracChangeset
for help on using the changeset viewer.