Commit c636a0f5 authored by Bate's avatar Bate

Planning2

parent 20442622
......@@ -381,6 +381,13 @@ class planning2 extends stdentity
"SELECT DISTINCT name_gap FROM pl2_gap WHERE id_planning = $this->id ORDER BY name_gap");
}
function get_gap_info( $gap_id )
{
return new requete($this->db,
"SELECT id_gap, name_gap, start, end FROM pl2_gap
WHERE id_gap = $gap_id");
}
function get_gaps_from_names( $name )
{
return new requete($this->db,
......
......@@ -38,6 +38,23 @@ if (isset($_REQUEST["id_planning"]))
$cts = new contents($planning->name);
if($_REQUEST["action"] === "add_to_gap" && isset($_REQUEST["gap_id"]))
{
$gap = $planning->get_gap_info();
if( list ( $id_gap, $name_gap, $start, $end ) = $gap->get_row())
{
$frm = new form("add_to_gap","./planning2.php",true,"POST","Permanence sur le creneau $name_gap de $planning->name");
$frm->add_hidden("action","do_add_to_gap");
$frm->add_hidden("gap_id",$gap_id);
if($planning->weekly)
{
$frm->add_date_field("start", "Date de debut ",strtotime($planning->start),true);
$frm->add_date_field("start", "Date de fin ",strtotime($planning->end),true);
}
$frm->add_submit("do_add_to_gap","Valider");
}
}
$planningv = new planningv("",$site->db,$planning->id, time(), time()+7*24*3600);
$cts->add($planningv);
......
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