Fix opensurvey
This commit is contained in:
parent
5239f3c133
commit
fc4aeccf21
@ -37,7 +37,7 @@ if (empty($user->rights->opensurvey->read)) {
|
|||||||
|
|
||||||
// Init vars
|
// Init vars
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$numsondage = GETPOST("id");
|
$numsondage = GETPOST("id", 'alphanohtml');
|
||||||
|
|
||||||
$object = new Opensurveysondage($db);
|
$object = new Opensurveysondage($db);
|
||||||
$result = $object->fetch(0, $numsondage);
|
$result = $object->fetch(0, $numsondage);
|
||||||
@ -53,8 +53,8 @@ $nblines = $object->fetch_lines();
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Return to the results
|
// Return to the results
|
||||||
if (GETPOST('retoursondage')) {
|
if (GETPOST('cancel')) {
|
||||||
header('Location: results.php?id='.(GETPOSTISSET('id_sondage') ? GETPOST('id_sondage', 'aZ09') : GETPOST('id', 'int')));
|
header('Location: results.php?id='.(GETPOSTISSET('id_sondage') ? GETPOST('id_sondage', 'aZ09') : GETPOST('id', 'alphanohtml')));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,6 +427,7 @@ $title = $object->title." - ".$langs->trans('Card');
|
|||||||
$helpurl = '';
|
$helpurl = '';
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
$arrayofcss = array('/opensurvey/css/style.css');
|
$arrayofcss = array('/opensurvey/css/style.css');
|
||||||
|
|
||||||
llxHeader('', $title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss);
|
llxHeader('', $title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
@ -443,6 +444,7 @@ $toutsujet = str_replace("°", "'", $toutsujet);
|
|||||||
|
|
||||||
print '<form name="formulaire4" action="#" method="POST">'."\n";
|
print '<form name="formulaire4" action="#" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="id" value="'.GETPOST('id').'">';
|
||||||
|
|
||||||
$head = opensurvey_prepare_head($object);
|
$head = opensurvey_prepare_head($object);
|
||||||
|
|
||||||
@ -508,7 +510,6 @@ print '<div class="underbanner clearboth"></div>';
|
|||||||
|
|
||||||
print '<table class="border tableforfield centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
|
|
||||||
// Expire date
|
// Expire date
|
||||||
print '<tr><td>'.$langs->trans('ExpireDate').'</td><td>';
|
print '<tr><td>'.$langs->trans('ExpireDate').'</td><td>';
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
@ -575,9 +576,11 @@ if (GETPOST('ajoutsujet')) {
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form name="formulaire" action="" method="POST">'."\n";
|
print '<form name="formulaire" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.GETPOST('backtopage', 'alpha').'">';
|
print '<input type="hidden" name="backtopage" value="'.GETPOST('backtopage', 'alpha').'">';
|
||||||
|
print '<input type="hidden" name="id" value="'.GETPOST('id', 'alpha').'">';
|
||||||
|
print '<input type="hidden" name="ajoutsujet" value="1">';
|
||||||
|
|
||||||
print '<div class="center">'."\n";
|
print '<div class="center">'."\n";
|
||||||
print "<br><br>\n";
|
print "<br><br>\n";
|
||||||
@ -591,7 +594,7 @@ if (GETPOST('ajoutsujet')) {
|
|||||||
print '<input type="submit" class="button" name="ajoutercolonne" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
|
print '<input type="submit" class="button" name="ajoutercolonne" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
|
||||||
print '<input type="hidden" name="id_sondage" value="'.dol_escape_htmltag($object->id_sondage).'">';
|
print '<input type="hidden" name="id_sondage" value="'.dol_escape_htmltag($object->id_sondage).'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button button-cancel" name="retoursondage" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||||
print '<br><br>'."\n";
|
print '<br><br>'."\n";
|
||||||
} else {
|
} else {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
@ -644,7 +647,7 @@ if (GETPOST('ajoutsujet')) {
|
|||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
print' <input type="submit" class="button" name="ajoutercolonne" value="'.dol_escape_htmltag($langs->trans("Add")).'">'."\n";
|
print' <input type="submit" class="button" name="ajoutercolonne" value="'.dol_escape_htmltag($langs->trans("Add")).'">'."\n";
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button button-cancel" name="retoursondage" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
@ -757,10 +760,10 @@ if ($object->format == "D") {
|
|||||||
} else {
|
} else {
|
||||||
$next = intval($toutsujet[$i + 1]);
|
$next = intval($toutsujet[$i + 1]);
|
||||||
}
|
}
|
||||||
if ($next && dol_print_date($cur, "%a %e") == dol_print_date($next, "%a %e") && dol_print_date($cur, "%B") == dol_print_date($next, "%B")) {
|
if ($next && dol_print_date($cur, "%a %d") == dol_print_date($next, "%a %d") && dol_print_date($cur, "%B") == dol_print_date($next, "%B")) {
|
||||||
$colspan++;
|
$colspan++;
|
||||||
} else {
|
} else {
|
||||||
print '<td colspan='.$colspan.' class="jour">'.dol_print_date($cur, "%a %e").'</td>'."\n";
|
print '<td colspan='.$colspan.' class="jour">'.dol_print_date($cur, "%a %d").'</td>'."\n";
|
||||||
|
|
||||||
$colspan = 1;
|
$colspan = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -424,10 +424,10 @@ if ($object->format == "D") {
|
|||||||
} else {
|
} else {
|
||||||
$next = intval($toutsujet[$i + 1]);
|
$next = intval($toutsujet[$i + 1]);
|
||||||
}
|
}
|
||||||
if ($next && dol_print_date($cur, "%a %e") == dol_print_date($next, "%a %e") && dol_print_date($cur, "%B") == dol_print_date($next, "%B")) {
|
if ($next && dol_print_date($cur, "%a %d") == dol_print_date($next, "%a %d") && dol_print_date($cur, "%B") == dol_print_date($next, "%B")) {
|
||||||
$colspan++;
|
$colspan++;
|
||||||
} else {
|
} else {
|
||||||
print '<td colspan="'.$colspan.'" class="jour">'.dol_print_date($cur, "%a %e").'</td>'."\n";
|
print '<td colspan="'.$colspan.'" class="jour">'.dol_print_date($cur, "%a %d").'</td>'."\n";
|
||||||
$colspan = 1;
|
$colspan = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user