Changeset 719 for trunk/Modules/IS/IS.php
- Timestamp:
- Jan 2, 2015, 11:16:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/IS/IS.php
r711 r719 26 26 $this->System->FormManager->ShowRelation = true; 27 27 28 // a - action 28 29 if(array_key_exists('a', $_GET)) $Action = $_GET['a']; 29 30 else $Action = ''; 31 // t - table 30 32 if(array_key_exists('t', $_GET)) $Table = $_GET['t']; 31 33 else $Table = ''; 34 // i - index of item 32 35 if(array_key_exists('i', $_GET)) $ItemId = $_GET['i']; 33 36 else $ItemId = 0; 37 // fc - preset colum 38 if(array_key_exists('fn', $_GET)) $FilterName = $_GET['fn']; 39 else $FilterName = ''; 40 if(array_key_exists('fv', $_GET)) $FilterValue = $_GET['fv']; 41 else $FilterValue = ''; 34 42 if(array_key_exists('menutype', $_COOKIE)) $MenuType = $_COOKIE['menutype']; 35 43 else $MenuType = 0; … … 37 45 setcookie('menutype', $MenuType, time() + 60 * 60 * 24 * 365); 38 46 39 if($Action == 'list') $Content = $this->ShowList($Table); 47 if($Action == 'list') { 48 if($FilterName == '') $Content = $this->ShowList($Table); 49 else $Content = $this->ShowList($Table, '', '', $FilterName, $FilterValue); 50 } 40 51 else if($Action == 'select') $Content = $this->ShowSelect($Table); 41 52 else if($Action == 'mapselect') $Content = $this->ShowMapSelect($Table); … … 70 81 { 71 82 $Output = '<strong>Nástěnka:</strong><br/>'; 72 $DbResult = $this->Database->select('Task', 'COUNT(*)', ' Progress< 100');83 $DbResult = $this->Database->select('Task', 'COUNT(*)', '`Progress` < 100'); 73 84 $DbRow = $DbResult->fetch_row(); 74 85 $Output .= 'Nedokončených úkolů: '.$DbRow['0'].'<br/>'; 86 75 87 $DbResult = $this->Database->select('Member', 'COUNT(*)', '1'); 76 88 $DbRow = $DbResult->fetch_row(); 77 89 $Output .= 'Zákazníků: '.$DbRow['0'].'<br/>'; 90 78 91 $DbResult = $this->Database->select('Subject', 'COUNT(*)', '1'); 79 92 $DbRow = $DbResult->fetch_row(); 80 93 $Output .= 'Subjektů: '.$DbRow['0'].'<br/>'; 94 81 95 $DbResult = $this->Database->select('User', 'COUNT(*)', '1'); 82 96 $DbRow = $DbResult->fetch_row(); 83 97 $Output .= 'Uživatelů: '.$DbRow['0'].'<br/>'; 98 84 99 $DbResult = $this->Database->select('NetworkDevice', 'COUNT(*)', '1'); 85 100 $DbRow = $DbResult->fetch_row(); 86 101 $Output .= 'Registrovaných zařízení: '.$DbRow['0'].'<br/>'; 87 $DbResult = $this->Database->select('FinanceOperation', 'SUM(Value)', '1'); 102 103 $DbResult = $this->Database->select('FinanceOperation', 'SUM(`Value` * `Direction`)', '1'); 88 104 $DbRow = $DbResult->fetch_row(); 89 105 $Output .= 'Stav placení: '.$DbRow['0'].'<br/>'; 90 $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', 'FinanceOperation IS NULL'); 106 107 $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', '`FinanceOperation` IS NULL'); 91 108 $DbRow = $DbResult->fetch_row(); 92 109 $Output .= 'Nezpárovaných plateb: '.$DbRow['0'].'<br/>'; … … 397 414 else $SourceTable = '`'.$FormClass['Table'].'` AS `TX`'; 398 415 416 // Build form type filter 417 $TypeFilter = ''; 418 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 419 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 420 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and 421 ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne'))) 422 if(array_key_exists('Filter', $FormItem) and ($FormItem['Filter'] == true)) 423 { 424 if($TypeFilter != '') $TypeFilter .= ' AND '; 425 $TypeFilter .= '('.$ItemIndex.' = "'.$FormItem['Default'].'")'; 426 } 427 if($TypeFilter != '') 428 { 429 if($Filter != '') $Filter = ' AND'; 430 $Filter .= ' '.$TypeFilter; 431 } 432 399 433 // Build user filter 400 434 $UserFilter = ''; … … 403 437 { 404 438 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 439 if(!array_key_exists('Hidden', $FormItem) or ($FormItem['Hidden'] == false)) 405 440 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 406 441 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and … … 435 470 if($Filter != '') $Filter = ' HAVING '.$Filter; 436 471 437 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 472 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 438 473 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 439 474 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and … … 441 476 { 442 477 if($ExcludeColumn != $ItemIndex) 478 if(!array_key_exists('Hidden', $FormItem) or ($FormItem['Hidden'] == false)) 443 479 $TableColumns[] = array('Name' => $ItemIndex, 'Title' => $FormItem['Caption']); 444 480 $UseType = $UseType = $FormItem['Type']; … … 499 535 $Output .= '<tr><form action="?a='.$_GET['a'].'&t='.$Table.'&filter=1'.$Addition.'" method="post">'; 500 536 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 537 if(!array_key_exists('Hidden', $FormItem) or ($FormItem['Hidden'] == false)) 501 538 if((!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 502 539 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and … … 520 557 $Output .= '<tr>'; 521 558 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 559 if(!array_key_exists('Hidden', $FormItem) or ($FormItem['Hidden'] == false)) 522 560 if((!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 523 561 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and
Note:
See TracChangeset
for help on using the changeset viewer.