Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (3 years ago)
Author:
chronos
Message:
  • Added: Static types added to almost all classes, methods and function. Supported by PHP 7.4.
  • Fixed: Various found code issues.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/UserState.php

    r874 r887  
    33class PageFinanceUserState extends Page
    44{
    5   var $FullTitle = 'Stav financí účastníka';
    6   var $ShortTitle = 'Stav financí';
    7   var $ParentClass = 'PageUser';
     5  function __construct(System $System)
     6  {
     7    parent::__construct($System);
     8    $this->FullTitle = 'Stav financí účastníka';
     9    $this->ShortTitle = 'Stav financí';
     10    $this->ParentClass = 'PageUser';
     11  }
    812
    913  function ShowFinanceOperation($Subject)
     
    6973  }
    7074
    71   function Show()
     75  function Show(): string
    7276  {
    73     $Finance = &$this->System->Modules['Finance'];
     77    $Finance = &ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance;
    7478    $Finance->LoadMonthParameters(0);
    7579
     
    7781    if (array_key_exists('i', $_GET))
    7882    {
    79       if (!$this->System->User->CheckPermission('Finance', 'Manage')) return 'Nemáte oprávnění';
     83      if (!ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('Finance', 'Manage')) return 'Nemáte oprávnění';
    8084      $CustomerId = $_GET['i'];
    8185    } else
    8286    {
    83       if (!$this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) return 'Nemáte oprávnění';
    84       $UserId = $this->System->User->User['Id'];
     87      if (!ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('Finance', 'DisplaySubjectState')) return 'Nemáte oprávnění';
     88      $UserId = ModuleUser::Cast($this->System->GetModule('User'))->User->User['Id'];
    8589      $DbResult = $this->Database->query('SELECT `Customer` FROM `UserCustomerRel` WHERE `User`='.$UserId.' LIMIT 1');
    8690      if ($DbResult->num_rows > 0)
Note: See TracChangeset for help on using the changeset viewer.