distinguer les vacations sur le flag validateholiday (fixes #29)
This commit is contained in:
@@ -182,14 +182,25 @@ while($row=$queryold->fetch()) {
|
|||||||
|
|
||||||
writeligne("");
|
writeligne("");
|
||||||
writeligne("== Récupération Event");
|
writeligne("== Récupération Event");
|
||||||
$q="SELECT * FROM schedule_event";
|
$q="SELECT * FROM schedule_event, schedule_task WHERE event_task=task_id";
|
||||||
$queryold=$bddold->prepare($q);
|
$queryold=$bddold->prepare($q);
|
||||||
$queryold->execute();
|
$queryold->execute();
|
||||||
while($row=$queryold->fetch()) {
|
while($row=$queryold->fetch()) {
|
||||||
|
// Event vacation ?
|
||||||
|
$isvacation=false;
|
||||||
|
if($row["task_id"]<=-70) $isvacation=true;
|
||||||
|
if($row["task_id"]==-85 || $row["task_id"]==-70) $isvacation=true;
|
||||||
|
|
||||||
|
// Validation
|
||||||
|
$validate=$row["event_validate"];
|
||||||
|
$validateholiday=false;
|
||||||
|
if($isvacation) $validateholiday=$row["event_validate"];
|
||||||
|
|
||||||
|
// Génération de l'event
|
||||||
writeligne($row["event_id"]);
|
writeligne($row["event_id"]);
|
||||||
$q="INSERT IGNORE INTO event (id, description, start, end, allday, duration, validate, validateholiday, task_id, user_id ) VALUES (?,?,?,?,?,?,?,?,?,?)";
|
$q="INSERT IGNORE INTO event (id, description, start, end, allday, duration, validate, validateholiday, task_id, user_id ) VALUES (?,?,?,?,?,?,?,?,?,?)";
|
||||||
$query=$bddnew->prepare($q);
|
$query=$bddnew->prepare($q);
|
||||||
$query->execute([$row["event_id"],$row["event_description"],$row["event_start"],$row["event_end"],$row["event_allday"],$row["event_duration"],$row["event_validate"],$row["event_validate"],$row["event_task"],$row["event_user"] ]);
|
$query->execute([$row["event_id"],$row["event_description"],$row["event_start"],$row["event_end"],$row["event_allday"],$row["event_duration"],$validate,$validateholiday,$row["event_task"],$row["event_user"] ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeligne("");
|
writeligne("");
|
||||||
|
Reference in New Issue
Block a user