tbrehm
2013-07-31 615a0a96618fa99e7e452523145d6c0f238d4473
interface/lib/classes/listform.inc.php
@@ -180,9 +180,10 @@
        if(@is_array($this->listDef['item'])) { 
            foreach($this->listDef['item'] as $i) {
                $field = $i['field'];
            $table = $i['table'];
                // if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and";
              if(isset($_SESSION['search'][$list_name][$search_prefix.$field]) && $_SESSION['search'][$list_name][$search_prefix.$field] != ''){
                    $sql_where .= " $field ".$i['op']." '".$app->db->quote($i['prefix'].$_SESSION['search'][$list_name][$search_prefix.$field].$i['suffix'])."' and";
                    $sql_where .= " ".($table != ''? $table.'.' : $this->listDef['table'].'.')."$field ".$i['op']." '".$app->db->quote($i['prefix'].$_SESSION['search'][$list_name][$search_prefix.$field].$i['suffix'])."' and";
                }
            }
        }
@@ -216,7 +217,7 @@
        if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0;
        $sql_von = $app->functions->intval($_SESSION['search'][$list_name]['page'] * $records_per_page);
        $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table WHERE $sql_where");
        $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table".($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')." WHERE $sql_where");
        $pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page);
@@ -357,6 +358,16 @@
                     }
                  }
                        break;
               case 'DATETIMETSTAMP':
                        if ($record[$key] > 0) {
                     // is value int?
                     if (preg_match("/^[0-9]+[\.]?[0-9]*$/", $record[$key], $p)) {
                              $record[$key] = date($this->lng('conf_format_datetime'), $record[$key]);
                     } else {
                              $record[$key] = date($this->lng('conf_format_datetime'), strtotime($record[$key]));
                     }
                  }
                        break;
               case 'DATE':
                        if ($record[$key] > 0) {
                     // is value int?
@@ -423,6 +434,12 @@
                        }
                        break;
               
               case 'DATETIMETSTAMP':
                        if($record[$key] > 0) {
                      $record[$key] = date('Y-m-d H:i:s',strtotime($record[$key]));
                        }
                        break;
                    case 'DATE':
                        if($record[$key] != '' && $record[$key] != '0000-00-00') {
                      $record[$key] = $record[$key];