Commit cf2452a3 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

fix à distance : pour le + disabled checkbox for notifications

parent 690dd90a
......@@ -174,6 +174,8 @@
//On montre le groupe si pas distance
$mform->hideIf('groupdate2', 'presence', 'eq', 2);
$daysarray=array();
$days=array(0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5);
$daysarray[] = $mform->createElement('select', 'daysnotif', "jours avant la séance", $days);
......@@ -181,17 +183,35 @@
$daysarray[] = $mform->createElement('checkbox', 'selectdayscheck', 'Activer');
$mform->addGroup($daysarray, 'groupdays', 'Notification', array(' '), false);
$mform->disabledIf('groupdays', 'selectdayscheck');
$mform->disabledIf('groupdays', 'daterenducheck2');
$mform->disabledIf('groupdays', 'daterenducheck');
$mform->hideIf('groupdays', 'presence', 'neq', 2);
$daysarray=array();
$daysarray[] = $mform->createElement('select', 'daysnotif2', "jours avant le rendu", $days);
$daysarray[]=$mform->createElement('html', ' <span id="days-text">jours avant le rendu</span>');
$daysarray[] = $mform->createElement('checkbox', 'selectdayscheck2', 'Activer');
$mform->addGroup($daysarray, 'groupdays2', 'Notification', array(' '), false);
$mform->disabledIf('groupdays2', 'selectdayscheck2');
$mform->disabledIf('groupdays2', 'daterenducheck2');
$mform->hideIf('groupdays2', 'presence', 'eq', 2);
//on ne peut pas activer des notifs s'il n'y a pas de date de rendu/date de cours
if($section_config['presence']){
$mform->setDefault('presence', $section_config['presence']);
}
if($section_config['daterendu']){
if(isset($section_config['presence']) && $section_config['presence']==2){
error_log("on passe là");
$mform->setDefault('daterendu', $section_config['daterendu']);
$mform->setDefault('daterenducheck', "1");
}
else if(isset($section_config['presence'])){
error_log("non on passe là");
$mform->setDefault('daterendu2', $section_config['daterendu']);
$mform->setDefault('daterenducheck2', "1");
}
......@@ -239,10 +259,15 @@
}
else if(isset($data['daterenducheck2'])){
$data['daterendu']=$data['daterendu2'];
}
if(!isset($data['selectdayscheck'])){
if(isset($data['daysnotif2'])){
$data['daysnotif']=$data["daysnotif2"];
}
if(array_key_exists('daysnotif', $section_config) && $section_config['daysnotif']>-1){
$data['daysnotif']=-1;
}
else{
unset($data['daysnotif']);
......
......@@ -182,10 +182,10 @@ class format_iena_renderer extends format_topics_renderer{
if (isset($param_section->presence)) {
if ($param_section->presence == 1) {
$section->presence = "En présence";
$string_date_presence="Pour le ";
$string_date_presence="Le ";
} else if ($param_section->presence == 2) {
$section->presence = "À distance";
$string_date_presence="Le ";
$string_date_presence="Pour le ";
}
}
......
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