diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index 102bb9234f3..c7d468951b6 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -41,6 +41,7 @@ sav files' # Used as array key seeked +tweek # Used as key marge # moral (var name) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 24d46f2f860..abe83bbd1a3 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -123,7 +123,6 @@ function getServerTimeZoneInt($refgmtdate = 'now') */ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) { - global $conf; if (empty($duration_value)) { return $time; } @@ -763,7 +762,7 @@ function getGMTEasterDatetime($year) */ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1, $includefriday = -1, $includemonday = -1) { - global $db, $conf, $mysoc; + global $db, $mysoc; $nbFerie = 0; @@ -1006,7 +1005,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', * @param int $timestampEnd Timestamp end UTC * @param int $lastday Last day is included, 0: no, 1:yes * @return int Number of days - * @see also num_public_holiday(), num_open_day() + * @see num_public_holiday(), num_open_day() */ function num_between_day($timestampStart, $timestampEnd, $lastday = 0) { @@ -1130,6 +1129,7 @@ function monthArray($outputlangs, $short = 0) return $montharray; } + /** * Return array of week numbers. * @@ -1147,12 +1147,13 @@ function getWeekNumbersOfMonth($month, $year) } return $TWeek; } + /** * Return array of first day of weeks. * - * @param string[] $TWeek array of week numbers (week 1 must be '01') + * @param string[] $TWeek array of week numbers we want (week 1 must be '01') * @param int $year Year number - * @return string[] First day of week (day 1 is '01') + * @return string[] First day of each week in entry (day 1 is '01') */ function getFirstDayOfEachWeek($TWeek, $year) { @@ -1165,6 +1166,7 @@ function getFirstDayOfEachWeek($TWeek, $year) } return $TFirstDayOfWeek; } + /** * Return array of last day of weeks. * @@ -1180,6 +1182,7 @@ function getLastDayOfEachWeek($TWeek, $year) } return $TLastDayOfWeek; } + /** * Return week number. * diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a6c1a383d67..db3f7e807ed 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4855,7 +4855,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco 'card', 'calendarlist', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype', 'cash-register', 'category', 'chart', 'check', 'clock', 'clone', 'close_title', 'code', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cross', 'cubes', 'check-circle', 'check-square', 'currency', 'multicurrency', - 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', + 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', + 'chevron-double-left', 'chevron-double-right', 'chevron-double-down', 'chevron-double-top', + 'commercial', 'companies', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice', 'edit', 'ellipsis-h', 'email', 'entity', 'envelope', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt', 'eye', 'filter', 'file', 'file-o', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus', 'font', @@ -4903,6 +4905,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco 'supplier_invoice' => 'file-invoice-dollar', 'supplier_invoicea' => 'file-excel', 'supplier_invoicer' => 'file-invoice-dollar', 'supplier_invoiced' => 'file-medical', 'bom' => 'shapes', 'card' => 'address-card', 'chart' => 'chart-line', 'company' => 'building', 'contact' => 'address-book', 'contract' => 'suitcase', 'collab' => 'people-arrows', 'conversation' => 'comments', 'country' => 'globe-americas', 'cron' => 'business-time', 'cross' => 'times', + 'chevron-double-left' => 'angle-double-left', 'chevron-double-right' => 'angle-double-right', 'chevron-double-down' => 'angle-double-down', 'chevron-double-top' => 'angle-double-up', 'donation' => 'file-alt', 'dynamicprice' => 'hand-holding-usd', 'setup' => 'cog', 'companies' => 'building', 'products' => 'cube', 'commercial' => 'suitcase', 'invoicing' => 'coins', 'accounting' => 'search-dollar', 'category' => 'tag', 'dollyrevert' => 'dolly', diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 33faff964fd..1cc900c7bd0 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -341,9 +341,9 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai $url = $urlwithroot.'/public/opensurvey/studs.php?sondage='.$object->id_sondage; print ''; -if ($action != 'edit') { +//if ($action != 'edit') { print ajax_autoselect("opensurveyurl", $url, 'image'); -} +//} print ''; diff --git a/htdocs/opensurvey/css/style.css b/htdocs/opensurvey/css/style.css index 820a4b39add..8e2d65d96c0 100644 --- a/htdocs/opensurvey/css/style.css +++ b/htdocs/opensurvey/css/style.css @@ -347,6 +347,10 @@ td.nom { td.nom { min-width: 100px; } + + button[name=choix_sondage] { + height: 100px; + } } td.vide { diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index b6e868fe940..fb62df59443 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -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; @@ -288,7 +288,7 @@ if (issetAndNoEmpty('moisapres_x') || issetAndNoEmpty('moisapres')) { $_SESSION["mois"] += 1; } - //On sauvegarde les heures deja entrées + // On sauvegarde les heures deja entrées if (issetAndNoEmpty('totalchoixjour', $_SESSION) === true) { $nbofchoice = count($_SESSION["totalchoixjour"]); for ($i = 0; $i < $nbofchoice; $i++) { @@ -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; @@ -335,11 +335,15 @@ 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; +// valeurs du nombre de jour dans le mois et du premier jour du mois +$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 '
'."\n"; print ''; print load_fiche_titre($langs->trans("CreatePoll").' (2 / 2)'); -//affichage de l'aide pour les jours +// Show help for days print '
'."\n"; print $langs->trans("OpenSurveyStep2")."\n"; print '
'."\n"; -//debut du tableau qui affiche le calendrier +// Show array with the calendar print '
'."\n"; print '
'."\n"; -print ''."\n"; // The div class=center has no effect on table, so we must keep the align=center for table -print ''; -print ''; -print ''."\n";
'.$motmois.' '.$_SESSION["annee"].'
'; -print ''; +print ''."\n"; // The div class=center has no effect on table, so we must keep the align=center for table +print ''; +print ''; -print ''; -print ''; +print ''; +print ''; +print ''."\n"; print '
'; +print ''; +//print ''; print ''; +print ''; +print ''; +//print ''; +print ''.$motmois.' '.$_SESSION["annee"].'
'; +//print ''; +print '
'; +print ''; +//print ''; +print ''; +print ''; +//print ''; print '
'."\n"; print ''."\n"; +print '
'; + print '
'."\n"; -print ''."\n"; // The div class=center has no effect on table, so we must keep the align=center for table +print '
'."\n"; // The div class=center has no effect on table, so we must keep the align=center for table print ''."\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 ''; + print ''; } print ''."\n"; @@ -532,6 +552,7 @@ if (issetAndNoEmpty('totalchoixjour', $_SESSION) || $erreur) { print $langs->trans("SelectDayDesc")."
\n"; print '
'; + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'.dol_print_date(mktime(0, 0, 0, 0, $i, 10), '%A').''; + print dol_print_date(mktime(0, 0, 0, 0, $i, 10), (empty($conf->dol_optimize_smallscreen) ? '%A' : '%a')); + print '
'."\n"; print ''."\n"; print ''."\n"; @@ -569,16 +590,16 @@ if (issetAndNoEmpty('totalchoixjour', $_SESSION) || $erreur) { } print '
'."\n"; + print '
'; // show buttons to cancel, delete days or create survey - print ''."\n"; - print ''."\n"; - print ''; - print ''; - print ''."\n"; - print''."\n"; - print ''."\n"; - print '


'."\n"; + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + print ''."\n"; + print '

'."\n"; + print ''."\n"; + print '
'; } print '