|
|
|
|
@@ -38,7 +38,7 @@ if (!$user->hasRight('opensurvey', 'write')) {
|
|
|
|
|
$_SESSION["formatsondage"] = "D";
|
|
|
|
|
|
|
|
|
|
$erreur = false;
|
|
|
|
|
$erreurNbchoice = 0;
|
|
|
|
|
$erreurNb = 0;
|
|
|
|
|
$choixdate = '';
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@@ -250,14 +250,14 @@ if (!isset($_SESSION['annee'])) {
|
|
|
|
|
$_SESSION['annee'] = date('Y');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//mise a jour des valeurs de session si bouton retour a aujourd'hui
|
|
|
|
|
// Update value of date period into the session
|
|
|
|
|
if (!issetAndNoEmpty('choixjourajout') && !issetAndNoEmpty('choixjourretrait') && (issetAndNoEmpty('retourmois') || issetAndNoEmpty('retourmois_x'))) {
|
|
|
|
|
$_SESSION["jour"] = date("j");
|
|
|
|
|
$_SESSION["mois"] = date("n");
|
|
|
|
|
$_SESSION["annee"] = date("Y");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//mise a jour des valeurs de session si mois avant
|
|
|
|
|
// Update value of date period into the session
|
|
|
|
|
if (issetAndNoEmpty('moisavant_x') || issetAndNoEmpty('moisavant')) {
|
|
|
|
|
if ($_SESSION["mois"] == 1) {
|
|
|
|
|
$_SESSION["mois"] = 12;
|
|
|
|
|
@@ -279,7 +279,7 @@ if (issetAndNoEmpty('moisavant_x') || issetAndNoEmpty('moisavant')) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//mise a jour des valeurs de session si mois apres
|
|
|
|
|
// Update value of date period into the session
|
|
|
|
|
if (issetAndNoEmpty('moisapres_x') || issetAndNoEmpty('moisapres')) {
|
|
|
|
|
if ($_SESSION["mois"] == 12) {
|
|
|
|
|
$_SESSION["mois"] = 1;
|
|
|
|
|
@@ -301,7 +301,7 @@ if (issetAndNoEmpty('moisapres_x') || issetAndNoEmpty('moisapres')) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//mise a jour des valeurs de session si annee avant
|
|
|
|
|
// Update value of date period into the session
|
|
|
|
|
if (issetAndNoEmpty('anneeavant_x') || issetAndNoEmpty('anneeavant')) {
|
|
|
|
|
$_SESSION["annee"] -= 1;
|
|
|
|
|
|
|
|
|
|
@@ -318,7 +318,7 @@ if (issetAndNoEmpty('anneeavant_x') || issetAndNoEmpty('anneeavant')) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//mise a jour des valeurs de session si annee apres
|
|
|
|
|
// Update value of date period into the session
|
|
|
|
|
if (issetAndNoEmpty('anneeapres_x') || issetAndNoEmpty('anneeapres')) {
|
|
|
|
|
$_SESSION["annee"] += 1;
|
|
|
|
|
|
|
|
|
|
@@ -336,10 +336,14 @@ if (issetAndNoEmpty('anneeapres_x') || issetAndNoEmpty('anneeapres')) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// valeurs du nombre de jour dans le mois et du premier jour du mois
|
|
|
|
|
$nbrejourmois = idate("t", mktime(0, 0, 0, (int) $_SESSION["mois"], 1, (int) $_SESSION["annee"]));
|
|
|
|
|
$premierjourmois = idate("N", mktime(0, 0, 0, (int) $_SESSION["mois"], 1, (int) $_SESSION["annee"])) - 1;
|
|
|
|
|
$nbrejourmois = idate("t", dol_get_first_day((int) $_SESSION["annee"], (int) $_SESSION["mois"]));
|
|
|
|
|
$premierjourmois = dol_print_date(dol_get_first_day((int) $_SESSION["annee"], (int) $_SESSION["mois"]), "%w") - 1;
|
|
|
|
|
//var_dump(dol_get_first_day((int) $_SESSION["annee"], (int) $_SESSION["mois"]));
|
|
|
|
|
//var_dump($premierjourmois);
|
|
|
|
|
|
|
|
|
|
//traduction de la valeur du mois
|
|
|
|
|
// TODO Support option getDolGlobalString('MAIN_START_WEEK') == 0 (sunday = first day of week)
|
|
|
|
|
|
|
|
|
|
// translate month
|
|
|
|
|
if (is_int($_SESSION["mois"]) && $_SESSION["mois"] > 0 && $_SESSION["mois"] < 13) {
|
|
|
|
|
$motmois = dol_print_date(mktime(0, 0, 0, (int) $_SESSION["mois"], 10), '%B');
|
|
|
|
|
} else {
|
|
|
|
|
@@ -347,39 +351,55 @@ if (is_int($_SESSION["mois"]) && $_SESSION["mois"] > 0 && $_SESSION["mois"] < 13
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Debut du formulaire et bandeaux de tete
|
|
|
|
|
// Start form
|
|
|
|
|
print '<form name="formulaire" action="" method="POST">'."\n";
|
|
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
|
|
|
|
|
|
|
print load_fiche_titre($langs->trans("CreatePoll").' (2 / 2)');
|
|
|
|
|
|
|
|
|
|
//affichage de l'aide pour les jours
|
|
|
|
|
// Show help for days
|
|
|
|
|
print '<div class="bodydate">'."\n";
|
|
|
|
|
print $langs->trans("OpenSurveyStep2")."\n";
|
|
|
|
|
print '</div>'."\n";
|
|
|
|
|
|
|
|
|
|
//debut du tableau qui affiche le calendrier
|
|
|
|
|
// Show array with the calendar
|
|
|
|
|
print '<div class="corps">'."\n";
|
|
|
|
|
print '<div class="center">'."\n";
|
|
|
|
|
print '<table align="center">'."\n"; // The div class=center has no effect on table, so we must keep the align=center for table
|
|
|
|
|
print '<tr><td><input type="image" class="buttonwebsite" name="anneeavant" value="<<" src="../img/rewind.png"></td>';
|
|
|
|
|
print '<td><input type="image" class="buttonwebsite" name="moisavant" value="<" src="../img/previous.png"></td>';
|
|
|
|
|
print '<td width="150px" class="center"> '.$motmois.' '.$_SESSION["annee"].'<br>';
|
|
|
|
|
print '<input type="image" name="retourmois" class="buttonreset" alt="'.dol_escape_htmltag($langs->trans("BackToCurrentMonth")).'" title="'.dol_escape_htmltag($langs->trans("BackToCurrentMonth")).'" value="" src="'.img_picto('', 'refresh', '', 0, 1).'">';
|
|
|
|
|
print '<table class="center">'."\n"; // The div class=center has no effect on table, so we must keep the align=center for table
|
|
|
|
|
print '<tr>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print '<button type="submit" name="anneeavant" value="<<">'.img_picto($langs->trans("PreviousYear"), 'chevron-double-left', 'class="double"').'</button>';
|
|
|
|
|
//print '<input type="image" class="buttonwebsite" name="anneeavant" value="<<" src="../img/rewind.png">';
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td><input type="image" class="buttonwebsite" name="moisapres" value=">" src="../img/next.png"></td>';
|
|
|
|
|
print '<td><input type="image" class="buttonwebsite" name="anneeapres" value=">>" src="../img/fforward.png"></td><td></td><td></td><td></td><td></td><td></td><td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print '<button type="submit" name="moisavant" value="<">'.img_picto($langs->trans("PreviousMonth"), 'chevron-left', 'class="double"').'</button>';
|
|
|
|
|
//print '<input type="image" class="buttonwebsite" name="moisavant" value="<" src="../img/previous.png">';
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td width="150px" class="center size15x">'.$motmois.' '.$_SESSION["annee"].'<br>';
|
|
|
|
|
//print '<input type="image" name="retourmois" class="buttonreset" alt="'.dol_escape_htmltag($langs->trans("BackToCurrentMonth")).'" title="'.dol_escape_htmltag($langs->trans("BackToCurrentMonth")).'" value="" src="'.img_picto('', 'refresh', '', 0, 1).'">';
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print '<button type="submit" name="moisapres" value=">">'.img_picto($langs->trans("NextMonth"), 'chevron-right', 'class="double"').'</button>';
|
|
|
|
|
//print '<input type="image" class="buttonwebsite" name="moisapres" value=">" src="../img/next.png">';
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print '<button type="submit" name="anneeapres" value=">>">'.img_picto($langs->trans("NextYear"), 'chevron-double-right', 'class="double"').'</button>';
|
|
|
|
|
//print '<input type="image" class="buttonwebsite" name="anneeapres" value=">>" src="../img/fforward.png">';
|
|
|
|
|
print '</td></tr>'."\n";
|
|
|
|
|
print '</table>'."\n";
|
|
|
|
|
print '</div>'."\n";
|
|
|
|
|
|
|
|
|
|
print '<br>';
|
|
|
|
|
|
|
|
|
|
print '<div class="center calendrier">'."\n";
|
|
|
|
|
print '<table align="center">'."\n"; // The div class=center has no effect on table, so we must keep the align=center for table
|
|
|
|
|
print '<table class="center">'."\n"; // The div class=center has no effect on table, so we must keep the align=center for table
|
|
|
|
|
print '<tr>'."\n";
|
|
|
|
|
|
|
|
|
|
//affichage des jours de la semaine en haut du tableau
|
|
|
|
|
// show list of days in title line
|
|
|
|
|
for ($i = 0; $i < 7; $i++) {
|
|
|
|
|
print '<td align="center" class="joursemaine">'.dol_print_date(mktime(0, 0, 0, 0, $i, 10), '%A').'</td>';
|
|
|
|
|
print '<td class="center joursemaine">';
|
|
|
|
|
print dol_print_date(mktime(0, 0, 0, 0, $i, 10), (empty($conf->dol_optimize_smallscreen) ? '%A' : '%a'));
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</tr>'."\n";
|
|
|
|
|
@@ -532,6 +552,7 @@ if (issetAndNoEmpty('totalchoixjour', $_SESSION) || $erreur) {
|
|
|
|
|
print $langs->trans("SelectDayDesc")."<br>\n";
|
|
|
|
|
print '</div><br>';
|
|
|
|
|
|
|
|
|
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
|
|
|
|
print '<table>'."\n";
|
|
|
|
|
print '<tr>'."\n";
|
|
|
|
|
print '<td></td>'."\n";
|
|
|
|
|
@@ -569,16 +590,16 @@ if (issetAndNoEmpty('totalchoixjour', $_SESSION) || $erreur) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</table>'."\n";
|
|
|
|
|
print '</div>';
|
|
|
|
|
|
|
|
|
|
// show buttons to cancel, delete days or create survey
|
|
|
|
|
print '<table>'."\n";
|
|
|
|
|
print '<tr>'."\n";
|
|
|
|
|
print '<td><input type="submit" class="button small" name="reset" value="'.dol_escape_htmltag($langs->trans("RemoveAllDays")).'"></td>';
|
|
|
|
|
print '<td><input type="submit" class="button small" name="reporterhoraires" value="'.dol_escape_htmltag($langs->trans("CopyHoursOfFirstDay")).'"></td>';
|
|
|
|
|
print '<td><input type="submit" class="button small" name="resethoraires" value="'.dol_escape_htmltag($langs->trans("RemoveAllHours")).'"></td></tr>'."\n";
|
|
|
|
|
print'<tr><td colspan="3"><br><br></td></tr>'."\n";
|
|
|
|
|
print '<tr><td colspan="3" align="center"><input type="submit" class="button" name="confirmation" value="'.$langs->trans("CreatePoll").'"></td></tr>'."\n";
|
|
|
|
|
print '</table>'."\n";
|
|
|
|
|
print '<br><div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
|
|
|
|
print '<input type="submit" class="button small" name="reset" value="'.dol_escape_htmltag($langs->trans("RemoveAllDays")).'">';
|
|
|
|
|
print '<input type="submit" class="button small" name="reporterhoraires" value="'.dol_escape_htmltag($langs->trans("CopyHoursOfFirstDay")).'">';
|
|
|
|
|
print '<input type="submit" class="button small" name="resethoraires" value="'.dol_escape_htmltag($langs->trans("RemoveAllHours")).'">'."\n";
|
|
|
|
|
print '<br><br>'."\n";
|
|
|
|
|
print '<input type="submit" class="button" name="confirmation" value="'.$langs->trans("CreatePoll").'">'."\n";
|
|
|
|
|
print '</div>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|