Exemplo n.º 1
0
 public function search()
 {
     $conditions = array();
     if ($this->data['extended']) {
         $conditions[] = 'match(Erlass.Betreff, Erlass.Dokument) against ("' . $this->data['extended'] . '" in boolean mode)';
     }
     foreach (self::$listNames as $listName) {
         $list = new FieldList($listName);
         $list->putConditionsInto($conditions);
     }
     if ($this->data['periodStart']) {
         $start = Erlass::standardizeDate($this->data['periodStart']);
         $conditions[] = 'Erlass.Datum>="' . $start . '"';
     }
     if ($this->data['periodEnd']) {
         $end = Erlass::standardizeDate($this->data['periodEnd']);
         $conditions[] = 'Erlass.Datum<="' . $end . '"';
     }
     if ($this->data['Aktenzeichen']) {
         $conditions[] = 'Erlass.Aktenzeichen="' . $this->data['Aktenzeichen'] . '"';
     }
     if (sizeof($this->themen) > 0) {
         $themaConditions = array();
         foreach ($this->themen as $thema) {
             if ($thema == '') {
                 continue;
             }
             $themaConditions[] = 'betrifft.Thema="' . $thema . '"';
         }
         if (sizeof($themaConditions) > 0) {
             $conditions[] = '(' . implode(' or ', $themaConditions) . ')';
         }
     }
     if (sizeof($conditions) < 1) {
         return null;
     }
     $query = 'select Erlass.id id, Erlass.Datum Datum,' . ' Erlass.Betreff Betreff, Erlass.Status Status from Erlass' . ' left join betrifft on Erlass.id=betrifft.Erlass' . ' where ' . implode(' and ', $conditions) . ' group by id' . ' order by Datum desc;';
     return mysql_query($query);
 }
Exemplo n.º 2
0
 private function fillItemsInto(HtmlTemplate $tmpl, $result)
 {
     while ($erlassArray = mysql_fetch_array($result)) {
         $item = $tmpl->addSubtemplate('erlassItem');
         $erlass = new Erlass($erlassArray);
         $erlass->assignToTmpl($item);
         if ($this->user->hasFileaccess()) {
             $item->addSubtemplate('erlassStatus');
         }
     }
 }