Changeset 914 for trunk


Ignore:
Timestamp:
Sep 22, 2021, 10:34:30 PM (3 years ago)
Author:
chronos
Message:
  • Added: Made IS dashboard numbers as links with filters.
Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r911 r914  
    11<?php
    22
    3 $Revision = 911; // Subversion revision
     3$Revision = 914; // Subversion revision
    44$DatabaseRevision = 911; // SQL structure revision
    5 $ReleaseTime = strtotime('2021-07-31');
     5$ReleaseTime = strtotime('2021-09-22');
  • trunk/Common/Form/Form.php

    r897 r914  
    452452      if (!$this->Database->TableExists($Class['Table'])) continue;
    453453
    454       echo($Class['Table'].'<br>');
     454      echo($Class['Table'].'<br/>');
    455455      $Module = 1;
    456456      $DbResult = $this->Database->select('Model', 'Id', 'Name="'.$Class['Table'].'"');
     
    503503        }
    504504      }
    505       echo('<br>');
     505      echo('<br/>');
    506506    }
    507507  }
  • trunk/Modules/Customer/Customer.php

    r912 r914  
    249249    $DbResult = $this->Database->select('Member', 'COUNT(*)', '1');
    250250    $DbRow = $DbResult->fetch_row();
    251     $Output = 'Zákazníků: registrovaných:'.$DbRow['0'];
    252 
    253     $DbResult = $this->Database->select('Member', 'COUNT(*)', '`Blocked`=0 AND `BillingPeriod`<>1');
     251    $Output = 'Zákazníků: registrovaných: <a href="'.$this->System->Link('/is/?a=list&amp;t=Member').'">'.$DbRow['0'].'</a>';
     252
     253    $DbResult = $this->Database->select('Member', 'COUNT(*)', '(`Blocked`=0) AND (`BillingPeriod`<>1)');
    254254    $DbRow = $DbResult->fetch_row();
    255     $Output .= ' platících:'.$DbRow['0'].'<br/>';
     255    $Output .= ' aktivních: <a href="'.$this->System->Link('/is/?a=list&t=Member&amp;filter=1&amp;FilterBlocked=0&amp;FilterBillingPeriod=Nikdy&amp;FilterOpBillingPeriod=notequal').'">'.$DbRow['0'].'</a>';
     256
     257    $DbResult = $this->Database->select('Member', 'COUNT(*)', '(`Blocked`=0) AND (`BillingPeriod`<>1) AND '.
     258      '((SELECT SUM(Service.Price) FROM ServiceCustomerRel LEFT JOIN Service ON Service.Id=ServiceCustomerRel.Service WHERE ServiceCustomerRel.Customer=Member.Id) <> 0)');
     259    $DbRow = $DbResult->fetch_row();
     260    $Output .= ' platících: <a href="'.$this->System->Link('/is/?a=list&t=Member&amp;filter=1&amp;FilterBlocked=0&amp;FilterBillingPeriod=Nikdy&amp;FilterOpBillingPeriod=notequal').'">'.$DbRow['0'].'</a><br/>';
    256261
    257262    return $Output;
  • trunk/Modules/FinanceBankAPI/FinanceBankAPI.php

    r901 r914  
    8686    $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', '`FinanceOperation` IS NULL');
    8787    $DbRow = $DbResult->fetch_row();
    88     $Output = 'Nezpárovaných plateb: '.$DbRow['0'].'<br/>';
     88    $Output = 'Nezpárovaných plateb: <a href="'.$this->System->Link('/is/?a=list&amp;t=FinanceBankImport&amp;filter=1&amp;FilterFinanceOperation=1&amp;FilterOpFinanceOperation=isnull').'">'.$DbRow['0'].'</a><br/>';
    8989    return $Output;
    9090  }
  • trunk/Modules/IS/IS.php

    r912 r914  
    549549  }
    550550
     551  function GetParam(string $Name, string $Default): string
     552  {
     553    $Result = $Default;
     554    if (array_key_exists($Name, $_POST) and ($_POST[$Name] != ''))
     555    {
     556      $Result = $_POST[$Name];
     557    }
     558    if (array_key_exists($Name, $_GET) and ($_GET[$Name] != ''))
     559    {
     560      $Result = $_GET[$Name];
     561    }
     562    return $Result;
     563  }
     564
    551565  function ShowTable(string $Table, string $Filter = '', string $Title = '', string $RowActions = '', string $ExcludeColumn = ''): string
    552566  {
     
    604618        $FilterName = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnFilterName',
    605619          array('Name' => $ItemIndex, 'Type' => $FormItem['Type']));
    606         if (array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != ''))
     620
     621        $SqlOperator = array(
     622          'like' => 'LIKE',
     623          'notlike' => 'NOT LIKE',
     624          'equal' => '=',
     625          'notequal' => '!=',
     626          'less' => '<',
     627          'lessorequal' => '<=',
     628          'greater' => '>',
     629          'greaterorequal' => '>=',
     630          'isnull' => 'IS NULL',
     631          'isnotnull' => 'IS NOT NULL',
     632        );
     633        $Operator = $this->GetParam('FilterOp'.$ItemIndex, 'like');
     634        if (array_key_exists($Operator, $SqlOperator))
     635        {
     636          $OperatorSql = $SqlOperator[$Operator];
     637        } else $OperatorSql = $SqlOperator['like'];
     638
     639        $FilterValue = $this->GetParam('Filter'.$ItemIndex, '');
     640        if ($FilterValue != '')
    607641        {
    608642          if ($UserFilter != '') $UserFilter .= ' AND ';
    609           $UserFilter .= '('.$FilterName.' LIKE "%'.$_POST['Filter'.$ItemIndex].'%")';
     643          $UserFilter .= '('.$FilterName.' '.$OperatorSql;
     644          if (($Operator == 'like') or ($Operator == 'notlike')) $UserFilter .= ' "%'.$FilterValue.'%")';
     645            else if (($Operator == 'isnull') or ($Operator == 'isnotnull')) $UserFilter .= ')';
     646            else $UserFilter .= ' "'.$FilterValue.'")';
    610647        }
    611648      }
    612649    }
     650    echo($UserFilter);
    613651    if ($UserFilter != '')
    614652    {
  • trunk/Modules/Network/Network.php

    r912 r914  
    829829    $DbResult = $this->Database->select('NetworkDevice', 'COUNT(*)', '1');
    830830    $DbRow = $DbResult->fetch_row();
    831     $Output .= 'Síťových zařízení: registrovaných:'.$DbRow['0'];
     831    $Output .= 'Síťových zařízení: registrovaných: <a href="'.$this->System->Link('/is/?a=list&amp;t=NetworkDevice').'">'.$DbRow['0'].'</a>';
    832832
    833833    $DbResult = $this->Database->select('NetworkDevice', 'COUNT(*)', '`Used`=1');
    834834    $DbRow = $DbResult->fetch_row();
    835     $Output .= ' použitých:'.$DbRow['0'].'<br>';
     835    $Output .= ' použitých: <a href="'.$this->System->Link('/is/?a=list&amp;t=NetworkDevice&amp;filter=1&amp;FilterUsed=1').'">'.$DbRow['0'].'</a><br/>';
    836836
    837837    $DbResult = $this->Database->select('NetworkInterface', 'COUNT(*)', '1');
    838838    $DbRow = $DbResult->fetch_row();
    839     $Output .= 'Síťových rozhraní: '.$DbRow['0'].'<br>';
     839    $Output .= 'Síťových rozhraní: registrovaných: <a href="'.$this->System->Link('/is/?a=list&amp;t=NetworkDevice').'">'.$DbRow['0'].'</a>';
     840
     841    $DbResult = $this->Database->select('NetworkInterface', 'COUNT(*)', '`Enabled`=1');
     842    $DbRow = $DbResult->fetch_row();
     843    $Output .= ' použitých: <a href="'.$this->System->Link('/is/?a=list&amp;t=NetworkInterface&amp;filter=1&amp;FilterEnabled=1').'">'.$DbRow['0'].'</a><br/>';
    840844
    841845    $DbResult = $this->Database->select('NetworkSubnet', 'COUNT(*)', '1');
    842846    $DbRow = $DbResult->fetch_row();
    843     $Output .= 'Síťových podsítí: '.$DbRow['0'].'<br/>';
     847    $Output .= 'Síťových podsítí: <a href="'.$this->System->Link('/is/?a=list&amp;t=NetworkSubnet').'">'.$DbRow['0'].'</a><br/>';
    844848    return $Output;
    845849  }
  • trunk/Modules/Subject/Subject.php

    r901 r914  
    145145    $DbResult = $this->Database->select('Subject', 'COUNT(*)', '1');
    146146    $DbRow = $DbResult->fetch_row();
    147     $Output = 'Subjektů: '.$DbRow['0'].'<br/>';
     147    $Output = 'Subjektů: <a href="'.$this->System->Link('/is/?a=list&amp;t=Subject').'">'.$DbRow['0'].'</a><br/>';
    148148    return $Output;
    149149  }
  • trunk/Modules/Task/Task.php

    r899 r914  
    9898    $DbResult = $this->Database->select('Task', 'COUNT(*)', '`Progress` < 100');
    9999    $DbRow = $DbResult->fetch_row();
    100     $Output = 'Nedokončených úkolů: '.$DbRow['0'].'<br/>';
     100    $Output = 'Nedokončených úkolů: <a href="'.$this->System->Link('/is/?a=list&amp;t=Task&amp;filter=1&amp;FilterProgress=100&amp;FilterOpProgress=less').'">'.$DbRow['0'].'</a><br/>';
    101101    return $Output;
    102102  }
  • trunk/Modules/User/User.php

    r900 r914  
    198198    $DbResult = $this->Database->select('User', 'COUNT(*)', '1');
    199199    $DbRow = $DbResult->fetch_row();
    200     $Output = 'Uživatelů: '.$DbRow['0'].'<br/>';
     200    $Output = 'Uživatelů: <a href="'.$this->System->Link('/is/?a=list&amp;t=User&amp;filter=1').'">'.$DbRow['0'].'</a><br/>';
    201201    return $Output;
    202202  }
Note: See TracChangeset for help on using the changeset viewer.