Commit 7f31d1a5 authored by Bate's avatar Bate

Planning2

parent 43a61085
......@@ -139,7 +139,10 @@ class planningv extends stdcontents
return;
}
$gaps_time = $this->planning->get_gaps_time($start, $end);
if($this->planning->weekly)
$gaps_time = $this->planning->get_gaps_time($start, $end);
else
$gaps_time = $this->planning->get_gaps_time(null, null);
if($gaps_time->lines <= 0)
{
$this->buffer .= "<p>Erreur: Heures des creneaux non trouvees</p>";
......
......@@ -427,10 +427,10 @@ class planning2 extends stdentity
AND start < '".gmdate("Y-m-d H:i:s",$end)."'
UNION DISTINCT
SELECT end as date FROM pl2_gap
WHERE id_planning = $this->id
AND end > '".gmdate("Y-m-d H:i:s",$start)."'
AND start < '".gmdate("Y-m-d H:i:s",$end)."'
ORDER BY date ASC");
WHERE id_planning = $this->id ".
(is_null($start)?"":("AND end > '".gmdate("Y-m-d H:i:s",$start)."' ")).
(is_null($end)?"":("AND start < '".gmdate("Y-m-d H:i:s",$end)."' ")).
"ORDER BY date ASC");
}
function get_gaps_names()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment