Changeset 689


Ignore:
Timestamp:
Sep 7, 2014, 6:15:54 PM (10 years ago)
Author:
chronos
Message:
  • Opraveno: Zobrazení stavu placení u Subjektů v ISu.
  • Přidáno: Výchozí řazení u fronty emailů podle času.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Setup/Updates.php

    r688 r689  
    889889        // Convert monthly plus payment for consumption to regular service
    890890  $DbResult = $Manager->Execute('SELECT `MonthlyPlus`, `Member` FROM `MemberPayment` WHERE `MonthlyPlus` > 0');
    891   while($DbResult->num_rows > 0)
     891  while($DbRow = $DbResult->fetch_assoc)
    892892  {
    893         $DbRow = $DbResult->fetch_assoc();
    894893    $Manager->Execute("INSERT INTO `Service` (`Id` ,`Name` ,`Category` ,`Price` ,`VAT`) ".
    895894      "VALUES (NULL , 'Spotřeba energie', 3, -".$DbRow['MonthlyPlus'].", 2);");
  • trunk/Modules/EmailQueue/EmailQueue.php

    r593 r689  
    66  var $ShortTitle = 'Fronta pošty';
    77  var $ParentClass = 'PagePortal';
    8  
     8
    99  function Show()
    1010  {
     
    1212    $Output = $this->SystemMessage('Zpracování fronty emailů', 'Nové emaily byly odeslány').$Output;
    1313    return($Output);
    14   } 
     14  }
    1515}
    16  
     16
    1717class ModuleEmailQueue extends AppModule
    1818{
     
    3737
    3838  function DoStart()
    39   {   
     39  {
    4040    $this->System->RegisterPage('fronta-posty', 'PageEmailQueueProcess');
    4141    $this->System->FormManager->RegisterClass('Email', array(
     
    5252        'Title' => 'Fronta e-mailů',
    5353        'Table' => 'EmailQueue',
     54                'DefaultSortColumn' => 'Time',
     55                'DefaultSortOrder' => 1,
    5456        'Items' => array(
    5557            'Time' => array('Type' => 'DateTime', 'Caption' => 'Vytvořeno'),
     
    6567            array('Caption' => 'Odeslat nové', 'URL' => '/fronta-posty/'),
    6668        ),
    67     ));   
     69    ));
    6870  }
    6971
     
    7476  function AddItem($To, $Subject, $Content, $From, $AttachmentFileId = '')
    7577  {
    76     $Values = array('To' => $To, 
    77       'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()', 
     78    $Values = array('To' => $To,
     79      'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()',
    7880      'From' => $From);
    7981    if($AttachmentFileId != '') $Values['AttachmentFile'] = $AttachmentFileId;
    8082    $this->Database->insert('EmailQueue', $Values);
    8183  }
    82  
     84
    8385  function Process()
    8486  {
     
    8688    $DbResult = $this->Database->select('EmailQueue', '*', 'Archive=0');
    8789    while($DbRow = $DbResult->fetch_assoc())
    88     {     
     90    {
    8991      $Mail = new Mail();
    9092      $Mail->AddToCombined($DbRow['To']);
     
    103105      $this->System->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']);
    104106      $Output .= 'To: '.$DbRow['To'].'  Subject: '.$DbRow['Subject'].'<br />';
    105     }   
     107    }
    106108    return($Output);
    107109  }
  • trunk/Modules/News/ImportObecHovezi.php

    r635 r689  
    1515
    1616$doc = new DOMDocument();
    17 $doc->load($SourceURL);
    18 foreach($doc->getElementsByTagName('item') as $node) 
     17@$doc->load($SourceURL);
     18foreach($doc->getElementsByTagName('item') as $node)
    1919{
    2020  $Title = $node->getElementsByTagName('title')->item(0)->nodeValue;
    2121  $Description = $node->getElementsByTagName('description')->item(0)->nodeValue;
    22   $Link = $node->getElementsByTagName('link')->item(0)->nodeValue; 
     22  $Link = $node->getElementsByTagName('link')->item(0)->nodeValue;
    2323  $Date = $node->getElementsByTagName('pubDate')->item(0)->nodeValue;
    24  
     24
    2525  $Description = strip_tags($Description);
    2626  $Description = str_replace("\r", '', $Description);
     
    2929  //  $Date = substr($Date, $CommaPos + 1);
    3030  $Date = TimeToMysqlDateTime(strtotime($Date));
    31  
    32  
     31
     32
    3333  $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).'")');
    3434  //echo($System->Database->LastQuery);
     
    5252  $Description = substr($Content, strpos($Content, $DescriptionSeparator) + strlen($DescriptionSeparator));
    5353  $Description = trim(substr($Description, 0, strpos($Description, '</')));
    54  
     54
    5555  $Content = substr($Content, strpos($Content, $StartLink) + strlen($StartLink));
    5656  $Link = substr($Content, 0, strpos($Content, '<'));
     
    6262  //echo('Description: '.$Description.'<br>');
    6363  //echo('Link: '.$Link.'<br><hr>');
    64  
     64
    6565  $Link = $System->Database->real_escape_string($Link);
    6666  $Title = $System->Database->real_escape_string($Title);
    6767  $Description = strip_cdata($Description);
    6868  $Description = strip_tags($Description);
    69  
     69
    7070  $Description = str_replace("\n", '<br>', $Description);
    7171  $Description = str_replace("\r", '', $Description);
    7272  $Description = $System->Database->real_escape_string($Description);
    73  
     73
    7474  $DbResult = $System->Database->select('News', 'Id', '(`Title`="'.$Title.'") AND (`Category`='.$Category.') AND (`Content` = "'.$Description.'") AND (`Link` = "'.$Link.'")');
    7575  //echo($System->Database->LastQuery);
     
    7979    echo($System->Database->insert_id.',');
    8080  }
    81 } 
     81}
    8282*/
  • trunk/Modules/Subject/Subject.php

    r678 r689  
    3636        'Invoices' => array('Type' => 'TFinanceInvoiceListSubject', 'Caption' => 'Faktury', 'Default' => ''),
    3737        '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)'),
    4141      ),
    4242    ));
Note: See TracChangeset for help on using the changeset viewer.