Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions registration-system/admin/pages_mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ public function getText() {
foreach ($this->environment->oconfig['essen'] as $key => $typ) {
$essen .= '<option value="' . $key . '">' . $typ . '</option>';
}
$maxtage = $this->fahrt->getLenTage();

$fahrt_bereich = $this->fahrt->getPossibleDates();
$tage = '';
for ($cnt = $maxtage; $cnt >= 0; $cnt--)
$tage .= '<option value="' . $cnt . '">' . $cnt . '</option>';
for ($i = 0; $i < sizeof($fahrt_bereich)-1; $i += 1)
$tage .= '<option value="' . date('Y-m-d', strtotime($fahrt_bereich[$i])) . '">' . $fahrt_bereich[$i] . '</option>';

return '
<script type="text/javascript">
Expand Down Expand Up @@ -138,7 +139,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,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was ist das denn mit der raute? neue medoo Syntax?
Sieht so aus, als sollte da on_waitlist stehen (?)

Copy link
Collaborator Author

@0x17de 0x17de Oct 20, 2017

Choose a reason for hiding this comment

The 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

Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand All @@ -154,7 +155,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];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitionssache, aber ich finde, dass die Logik falsch ist.
Wenn ich wähle, dass ich an Personen mailen will die an Tag 1, 2, und 3 da sind, dann meine ich nicht 'und' an allen Tagen, sondern meine die Leute, die an min einem der gwählten Tage da sind (glaube ich). Trippy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warum ist hier ein OR und bei allen anderen keys in $where nicht?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wegen 'in mindestens einer selektierten nacht anwesend' logik

Copy link
Owner

Choose a reason for hiding this comment

The 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]]
Wäre ja doof dann, weil die beiden anderen (bezahlt, auto) irrelevant werden.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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'];
Expand Down