Changeset 721


Ignore:
Timestamp:
Jan 3, 2015, 7:34:55 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Form class ItemActions changed to define URL using #RowId instead of addition of &i=number.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r720 r721  
    11<?php
    22
    3 $Revision = 720; // Subversion revision
     3$Revision = 721; // Subversion revision
    44$DatabaseRevision = 720; // SQL structure revision
    5 $ReleaseTime = strtotime('2015-01-02');
     5$ReleaseTime = strtotime('2015-01-03');
  • trunk/Modules/Customer/Customer.php

    r719 r721  
    3636        'Consumption' => array('Type' => 'TCustomerStockSerialNumber', 'Caption' => 'Spotřeba zařízení', 'Default' => ''),
    3737      ),
     38        'ItemActions' => array(
     39        array('Caption' => 'Klientská sekce', 'URL' => '/finance/platby/?i=#RowId'),
     40      ),
    3841    ));   
    3942    $this->System->FormManager->RegisterClass('MemberPayment', array(
  • trunk/Modules/File/File.php

    r708 r721  
    130130      ),
    131131      'ItemActions' => array(
    132         array('Caption' => 'Stáhnout', 'URL' => '/file'),
     132        array('Caption' => 'Stáhnout', 'URL' => '/file?i=#RowId'),
    133133      ),
    134134    ));
  • trunk/Modules/Finance/Finance.php

    r720 r721  
    454454      ),
    455455      'ItemActions' => array(
    456         array('Caption' => 'Import plateb z banky', 'URL' => '/finance/import-api/'),
    457         array('Caption' => 'Import plateb ze souboru', 'URL' => '/finance/import-soubor/'),
     456        array('Caption' => 'Import plateb z banky', 'URL' => '/finance/import-api/?i=#RowId'),
     457        array('Caption' => 'Import plateb ze souboru', 'URL' => '/finance/import-soubor/?i=#RowId'),
    458458      ),
    459459    ));
  • trunk/Modules/Finance/UserState.php

    r720 r721  
    7070    $this->System->Modules['Finance']->LoadTariffs(1);
    7171
    72     if(array_key_exists('Subject', $_GET))
     72    // Determine which customer should be displayed
     73    if(array_key_exists('i', $_GET))
    7374    {
    7475      if(!$this->System->User->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
    75       $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id='.$_GET['Subject']);
    76       if($DbResult->num_rows > 0)
    77         $Subject = $DbResult->fetch_assoc();
    78       else return($this->SystemMessage('Chyba', 'Subjekt nenalezen'));
     76      $CustomerId = $_GET['i'];
    7977    } else
    8078    {
     
    8583      {
    8684        $CustomerUserRel = $DbResult->fetch_assoc();
    87         $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id='.$CustomerUserRel['Customer'].')');
    88         $Subject = $DbResult->fetch_assoc();
     85        $CustomerId = $CustomerUserRel['Customer'];
    8986      } else return($this->SystemMessage('Chyba', 'Nejste zákazníkem'));
    9087    }
    91 
    92     if(!array_key_exists('show', $_GET)) $_GET['show'] = '';
    93     $DbResult = $this->Database->query('SELECT Member.* '.
    94       'FROM Member LEFT JOIN MemberPayment ON MemberPayment.Member=Member.Id WHERE Member.Subject='.$Subject['Id']);
    95     if($DbResult->num_rows == 0)
     88       
     89    // Load customer info
     90    $DbResult = $this->Database->query('SELECT * FROM Member WHERE Id='.$CustomerId);
     91    if($DbResult->num_rows == 1)
    9692    {
    97       return($this->SystemMessage('Položka nenalezena', 'Zákazník nenalezen'));
    98     }
    99     $Member = $DbResult->fetch_assoc();
    100     $Output = '<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td valign="top">';
     93        $Customer = $DbResult->fetch_assoc();     
     94    } else return($this->SystemMessage('Položka nenalezena', 'Zákazník nenalezen'));
     95   
     96   
     97    // Load subject info
     98    $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id='.$Customer['Subject']);
     99    if($DbResult->num_rows == 1)
     100    {   
     101      $Subject = $DbResult->fetch_assoc();     
     102    } else return($this->SystemMessage('Položka nenalezena', 'Subjekt nenalezen'));
     103   
     104   
     105    $Output = '<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td valign="top">';       
    101106
    102107    // Account state
     
    131136    $DbResult = $this->Database->query('SELECT Service.Name, Service.Price FROM ServiceCustomerRel '.
    132137      'LEFT JOIN Service ON Service.Id=ServiceCustomerRel.Service '.
    133       'WHERE (ServiceCustomerRel.Customer='.$Member['Id'].') AND (ServiceCustomerRel.Action IS NULL)');
     138      'WHERE (ServiceCustomerRel.Customer='.$Customer['Id'].') AND (ServiceCustomerRel.Action IS NULL)');
    134139    while($DbRow = $DbResult->fetch_assoc())
    135140    {
    136           $Output .= '<tr><td>'.$DbRow['Name'].'</td><td>'.$DbRow['Price'].'</td></tr>';
     141            $Output .= '<tr><td>'.$DbRow['Name'].'</td><td>'.$DbRow['Price'].'</td></tr>';
    137142      $Total += $DbRow['Price'];
    138143    }
  • trunk/Modules/IS/IS.php

    r719 r721  
    377377      foreach($FormClass['ItemActions'] as $Action)
    378378      {
    379         $URL = $this->System->Link($Action['URL']);
    380         if(strpos($URL, '?') === false) $URL .= '?';
    381         else if((substr($URL, -5, 5) !== '&amp;') and (substr($URL, -1, 1) !== '?')) $URL .= '&amp;';
    382         $URL .= 'i='.$Id;
     379        $URL = str_replace('#RowId', $Id, $this->System->Link($Action['URL']));
    383380        $Actions[] = $this->ShowAction($Action['Caption'], $URL,
    384381          $this->System->Link('/images/action.png'));
     
    643640      {
    644641        $URL = $this->System->Link($Action['URL']);
    645         if(strpos($URL, '?') === false) $URL .= '?';
    646         else if((substr($URL, -5, 5) !== '&amp;') and (substr($URL, -1, 1) !== '?')) $URL .= '&amp;';
    647         $URL .= 'i=#RowId';
    648642        $RowActions .= '<a href="'.$URL.'"><img alt="'.$Action['Caption'].'" title="'.$Action['Caption'].'" src="'.
    649643          $this->System->Link('/images/action.png').'"/></a>';
  • trunk/Modules/Map/Map.php

    r712 r721  
    221221      ),
    222222      'ItemActions' => array(
    223         array('Caption' => 'Ukázat na mapě', 'URL' => '/map/show-position'),
     223        array('Caption' => 'Ukázat na mapě', 'URL' => '/map/show-position?i=#RowId'),
    224224      ),
    225225    ));
  • trunk/Modules/NetworkConfig/NetworkConfig.php

    r644 r721  
    3737      ),
    3838      'ItemActions' => array(
    39         array('Caption' => 'Záznam', 'URL' => '/is/?a=view&t=NetworkConfigurationLog'),
     39        array('Caption' => 'Záznam', 'URL' => '/is/?a=view&t=NetworkConfigurationLog&i=#RowId'),
    4040      ),
    4141    ));
Note: See TracChangeset for help on using the changeset viewer.