-
Notifications
You must be signed in to change notification settings - Fork 0
email filter by nights #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,10 +37,13 @@ public function getText() { | |
| foreach ($this->environment->oconfig['essen'] as $key => $typ) { | ||
| $essen .= '<option value="' . $key . '">' . $typ . '</option>'; | ||
| } | ||
| $maxtage = $this->fahrt->getLenTage(); | ||
| $fahrt_bereich = $this->environment->database->select('fahrten', ['von', 'bis'], ['fahrt_id' => $this->fahrt->getID()]); | ||
| $von = strtotime($fahrt_bereich[0]['von']); | ||
| $bis = strtotime($fahrt_bereich[0]['bis']); | ||
|
|
||
| $tage = ''; | ||
| for ($cnt = $maxtage; $cnt >= 0; $cnt--) | ||
| $tage .= '<option value="' . $cnt . '">' . $cnt . '</option>'; | ||
| for ($tag = $von; $tag < $bis; $tag += 24*60*60) | ||
| $tage .= '<option value="' . date('Y-m-d', $tag) . '">' . date('d.m.Y', $tag) . '</option>'; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warum zwei verschiedene datumsformate? ist das in der DB so? mir ist so, als wäre da irgendwo im environment eine funktion für datumsangaben. wäre wünschenswert die zu nutzen!
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. datumsformate sind so in der db - das rechte ist 'menschenleserlich' |
||
|
|
||
| return ' | ||
| <script type="text/javascript"> | ||
|
|
@@ -138,7 +141,7 @@ private function transformContacts() { | |
| } | ||
|
|
||
| private function buildQueryWhere() { | ||
| $where = ['fahrt_id' => $this->fahrt->getID(), 'OR' => ['on_waitlist' => 0, | ||
| $where = ['fahrt_id' => $this->fahrt->getID(), 'OR #waitlist' => ['on_waitlist' => 0, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was ist das denn mit der raute? neue medoo Syntax?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. das mit kommentar muss so. es gibt ja nun auch ein OR weiter unten bei nights. zwei or MUSS man mit medoo so lösen leider. wegen unique map keys
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kannte ich noch nicht, dachte das wäre nur irgendwie die neue syntax oder so. |
||
| 'AND' => [ | ||
| 'transferred[!]' => null, | ||
| 'on_waitlist' => 1 | ||
|
|
@@ -154,7 +157,12 @@ private function buildQueryWhere() { | |
| $where['abtyp'] = $_REQUEST['val_abtyp']; | ||
| } | ||
| if (isset($_REQUEST['check_nights'])) { | ||
| // TODO | ||
| $nights = $_REQUEST['val_nights']; | ||
| $conditions = []; | ||
| foreach ($nights as $night) | ||
| $conditions['AND #'.$night] = ['anday[<=]' => $night, 'abday[>]' => $night]; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitionssache, aber ich finde, dass die Logik falsch ist.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah. gute frage - ja, hier ist angenommen: an mindestens einer der selektierten nächte da. nicht gesagt 'NUR' in den nächten da. |
||
| if (sizeof($conditions) > 0) | ||
| $where['OR #nights'] = $conditions; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warum ist hier ein
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wegen 'in mindestens einer selektierten nacht anwesend' logik
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ja, das stimmt schon, bin mir nur nicht sicher, ob man lustige Seiteneffekte bekommt (Klammern/Scopes). Beispiel: [[bezahlt] UND [auto] ODER [nacht1] ODER [nacht1 UND nacht2]]
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. die oberste ebene ist via und verknüpft - darunter sind die einzelnen nächte via oder verknüpft. also hat keine aushebelnde wirkung auf die bisherige selektion |
||
| } | ||
| if (isset($_REQUEST['check_essen'])) { | ||
| $where['essen'] = $_REQUEST['val_essen']; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicht so elegant...
Lieber die entsprechende Funktion aus dem Fahrt-Objekt nehmen (bzw neu schreiben)! Ist einheitlicher und wenn sich was ändert, dann nur an einer Stelle. Dafür ist die Klasse ja da.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sehe ich mir an
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nutzt fahrt->getPossibleDates() in der neuen version