Changeset 665


Ignore:
Timestamp:
Jul 6, 2014, 10:15:07 PM (10 years ago)
Author:
chronos
Message:
  • Opraveno: Nebylo monžé filtrovat výpisy v ISu u položek OneToMany.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/IS/IS.php

    r664 r665  
    339339          array('Name' => $ItemIndex, 'Type' => $FormItem['Type']));
    340340        if(array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != ''))
    341           $UserFilter .= ' AND ('.$FilterName.' LIKE "%'.$_POST['Filter'.$ItemIndex].'%")';
    342       }
    343     }
    344     if(($Filter == '') and ($UserFilter != '')) $Filter = '1 '.$UserFilter;
    345     if($Filter != '') $Filter = ' WHERE '.$Filter;
     341        {
     342          if($UserFilter != '') $UserFilter .= ' AND ';
     343          $UserFilter .= '('.$FilterName.' LIKE "%'.$_POST['Filter'.$ItemIndex].'%")';
     344        }
     345      }
     346    }
     347    if($UserFilter != '')
     348    {
     349      if($Filter != '') $Filter = ' AND';
     350      $Filter .= ' '.$UserFilter;
     351    }
     352    if($Filter != '') $Filter = ' HAVING '.$Filter;
    346353
    347354    foreach($FormClass['Items'] as $ItemIndex => $FormItem)
     
    386393    if($Filter != '')
    387394    {
    388       $Query = 'SELECT COUNT(*) FROM '.$SourceTable.' '.$Filter;
     395      $Query = 'SELECT COUNT(*) FROM (SELECT '.$Columns.' FROM '.$SourceTable.' '.$Filter.') AS `TS`';
    389396      $DbResult = $this->Database->query($Query);
    390397      $DbRow = $DbResult->fetch_row();
Note: See TracChangeset for help on using the changeset viewer.