From 70b0f0042edc59904964930938b7588ffe4bca4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Sun, 26 Oct 2008 15:55:50 +0000 Subject: [PATCH] Qual: Uniformize use of dolibarr_print_date --- htdocs/adherents/card_subscriptions.php | 2 +- htdocs/adherents/cotisations.php | 2 +- htdocs/adherents/index.php | 2 +- htdocs/comm/fiche.php | 1 - htdocs/comm/propal.php | 13 +++++++------ htdocs/comm/propal/stats/month.php | 2 +- htdocs/commande/stats/month.php | 2 +- htdocs/compta/bank/graph.php | 9 ++++----- htdocs/compta/commande/liste.php | 13 +++++++------ htdocs/compta/facture/apercu.php | 2 +- htdocs/compta/facture/stats/month.php | 2 +- htdocs/compta/propal.php | 12 +++++++----- htdocs/compta/resultat/index.php | 2 +- htdocs/compta/sociales/charges.php | 2 +- htdocs/compta/stats/comp.php | 8 ++++---- htdocs/compta/stats/exercices.php | 10 +++++----- htdocs/compta/stats/index.php | 8 ++++---- htdocs/compta/tva/index.php | 2 +- htdocs/compta/tva/quadri.php | 2 +- htdocs/compta/tva/quadri_detail.php | 4 ++-- htdocs/contrat/fiche.php | 4 ++-- htdocs/docs/class/courrier-droit-editeur.class.php | 2 +- htdocs/expedition/liste.php | 13 +++++++------ htdocs/expedition/stats/expeditionstats.class.php | 4 ++-- htdocs/fichinter/rapport.php | 4 ++-- htdocs/lib/functions.lib.php | 6 +++--- htdocs/product.class.php | 2 +- htdocs/stats.class.php | 4 ++-- htdocs/translate.class.php | 2 +- 29 files changed, 72 insertions(+), 69 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 1e8670d8aef..d74697dd304 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -452,7 +452,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer) print '<tr><td>'.$langs->trans("Label").'</td>'; print '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' '; - print strftime("%Y",($datefrom?$datefrom:time())).'" ></td></tr>'; + print dolibarr_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>'; } print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>'; diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index fc6d0e045ca..9cf292e42e5 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -226,7 +226,7 @@ if ($result) print '<td>'; if ($allowinsertbankafter && $user->rights->banque->modifier && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation) { - print "<input name=\"label\" type=\"text\" class=\"flat\" size=\"30\" value=\"".$langs->trans("Subscriptions").' '.strftime("%Y",$objp->dateadh)."\" >\n"; + print "<input name=\"label\" type=\"text\" class=\"flat\" size=\"30\" value=\"".$langs->trans("Subscriptions").' '.dolibarr_print_date($objp->dateadh,"%Y")."\" >\n"; // print "<td><input name=\"debit\" type=\"text\" size=8></td>"; // print "<td><input name=\"credit\" type=\"text\" size=8></td>"; print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 6115986a983..533d32ec65d 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -254,7 +254,7 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object($result); - $year=strftime("%Y",$objp->dateadh); + $year=dolibarr_print_date($objp->dateadh,"%Y"); $Total[$year]+=$objp->cotisation; $Number[$year]+=1; $tot+=$objp->cotisation; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index a3556924796..56d66061712 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -140,7 +140,6 @@ if ($socid > 0) $objsoc->id=$socid; $objsoc->fetch($socid,$to); - $dac = strftime("%Y-%m-%d %H:%M", time()); if ($errmesg) { print "<b>$errmesg</b><br>"; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index ad6a89df976..e9c92e231ec 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2024,14 +2024,15 @@ else // Date propale print '<td align="center">'; - $y = strftime('%Y',$objp->dp); - $m = strftime('%m',$objp->dp); - - print strftime('%d',$objp->dp)."\n"; + $y = dolibarr_print_date($objp->dp,'%Y'); + $m = dolibarr_print_date($objp->dp,'%m'); + $mt= dolibarr_print_date($objp->dp,'%b'); + $d = dolibarr_print_date($objp->dp,'%d'); + print $d."\n"; print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'&month='.$m.'">'; - print dolibarr_print_date($objp->dp,'%b')."</a>\n"; + print $mt."</a>\n"; print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'">'; - print strftime('%Y',$objp->dp)."</a></td>\n"; + print $y."</a></td>\n"; // Date fin validite if ($objp->dfv) diff --git a/htdocs/comm/propal/stats/month.php b/htdocs/comm/propal/stats/month.php index bc4f1211479..dde41bd2848 100644 --- a/htdocs/comm/propal/stats/month.php +++ b/htdocs/comm/propal/stats/month.php @@ -125,7 +125,7 @@ $data = array(); for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(ucfirst(substr(strftime("%b",dolibarr_mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]); + $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]); } if (!$user->rights->societe->client->voir || $user->societe_id) diff --git a/htdocs/commande/stats/month.php b/htdocs/commande/stats/month.php index 7a729cdb599..f506caae1f3 100644 --- a/htdocs/commande/stats/month.php +++ b/htdocs/commande/stats/month.php @@ -140,7 +140,7 @@ $data = array(); for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(ucfirst(substr(strftime("%b",dolibarr_mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]); + $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]); } if (!$user->rights->societe->client->voir || $user->societe_id) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index eef574ad600..c213bc793d5 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -50,9 +50,9 @@ if ($_GET["account"] || $_GET["ref"]) if (! empty($_GET["lib"])) $conf->global->MAIN_GRAPH_LIBRARY=$_GET["lib"]; $datetime = time(); - $year = strftime("%Y", $datetime); - $month = strftime("%m", $datetime); - $day = strftime("%d", $datetime); + $year = dolibarr_print_date($datetime, "%Y"); + $month = dolibarr_print_date($datetime, "%m"); + $day = dolibarr_print_date($datetime, "%d"); if (! empty($_GET["year"])) $year=sprintf("%04d",$_GET["year"]); if (! empty($_GET["month"])) $month=sprintf("%02d",$_GET["month"]); @@ -166,7 +166,6 @@ if ($_GET["account"] || $_GET["ref"]) $i = 0; while ($xmonth == $month) { - //print strftime ("%e %d %m %y",$day)."\n"; $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0); if ($day > time()) { @@ -601,7 +600,7 @@ if ($_GET["account"] || $_GET["ref"]) { $data_credit[$i] = isset($credits[substr("0".($i+1),-2)]) ? $credits[substr("0".($i+1),-2)] : 0; $data_debit[$i] = isset($debits[substr("0".($i+1),-2)]) ? $debits[substr("0".($i+1),-2)] : 0; - $labels[$i] = strftime("%b",dolibarr_mktime(12,0,0,$i+1,1,2000)); + $labels[$i] = dolibarr_print_date(dolibarr_mktime(12,0,0,$i+1,1,2000),"%b"); $datamin[$i] = $acct->min_desired; } diff --git a/htdocs/compta/commande/liste.php b/htdocs/compta/commande/liste.php index d2cabdc2216..22277bf0b32 100644 --- a/htdocs/compta/commande/liste.php +++ b/htdocs/compta/commande/liste.php @@ -158,14 +158,15 @@ if ($resql) print "</td>"; print "<td align=\"center\">"; - $y = strftime("%Y",$objp->date_commande); - $m = strftime("%m",$objp->date_commande); - - print strftime("%d",$objp->date_commande)."\n"; + $y = dolibarr_print_date($objp->date_commande,"%Y"); + $m = dolibarr_print_date($objp->date_commande,"%m"); + $mt = dolibarr_print_date($objp->date_commande,"%b"); + $d = dolibarr_print_date($objp->date_commande,"%d"); + print $d."\n"; print " <a href=\"liste.php?year=$y&month=$m\">"; - print strftime("%B",$objp->date_commande)."</a>\n"; + print $mt."</a>\n"; print " <a href=\"liste.php?year=$y\">"; - print strftime("%Y",$objp->date_commande)."</a></td>\n"; + print $y."</a></td>\n"; print '<td align="right">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facture,5).'</td>'; print "</tr>\n"; diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index 3992e5cbda9..815ea416ecd 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -166,7 +166,7 @@ if ($_GET["facid"] > 0) print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$fac->ref.'-detail.pdf</a></td>'; print '<td align="right">'.filesize($filedetail). ' bytes</td>'; - print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'</td>'; + print '<td align="right">'.dolibarr_print_date(filemtime($filedetail),"%d %b %Y %H:%M:%S").'</td>'; print '</tr>'; } diff --git a/htdocs/compta/facture/stats/month.php b/htdocs/compta/facture/stats/month.php index e0874eae705..82907b53649 100644 --- a/htdocs/compta/facture/stats/month.php +++ b/htdocs/compta/facture/stats/month.php @@ -124,7 +124,7 @@ $data = array(); for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(ucfirst(substr(strftime("%b",dolibarr_mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]); + $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]); } $filename_avg = $dir."/invoicesaverage-".$year.".png"; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 2b2e87a2d58..53461ea3144 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -777,13 +777,15 @@ else // Date print "<td align=\"right\">"; - $y = strftime("%Y",$objp->dp); - $m = strftime("%m",$objp->dp); - print strftime("%d",$objp->dp)."\n"; + $y = dolibarr_print_date($objp->dp,"%Y"); + $m = dolibarr_print_date($objp->dp,"%m"); + $mt = dolibarr_print_date($objp->dp,"%b"); + $d = dolibarr_print_date($objp->dp,"%d"); + print $d."\n"; print " <a href=\"propal.php?year=$y&month=$m\">"; - print strftime("%B",$objp->dp)."</a>\n"; + print $b."</a>\n"; print " <a href=\"propal.php?year=$y\">"; - print strftime("%Y",$objp->dp)."</a></td>\n"; + print $y."</a></td>\n"; // Prix print "<td align=\"right\">".price($objp->total_ht)."</td>\n"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 09890fdc1c4..b2bca3bc756 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -495,7 +495,7 @@ for ($mois = 1 ; $mois <= 12 ; $mois++) { $var=!$var; print '<tr '.$bc[$var].'>'; - print "<td>".strftime("%B",dolibarr_mktime(12,0,0,$mois,1,$annee))."</td>"; + print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$mois,1,$annee),"%b")."</td>"; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { $case = strftime("%Y-%m",dolibarr_mktime(12,0,0,$mois,1,$annee)); diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 4f3af0eecf4..8e19643ab0b 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -284,7 +284,7 @@ if ($chid > 0) print "<td>"; if ($cha->paye==0 && $_GET['action'] == 'edit') { - print "<input type=\"text\" name=\"period\" value=\"".strftime("%Y%m%d",$cha->periode)."\"> (YYYYMMDD)"; + print "<input type=\"text\" name=\"period\" value=\"".dolibarr_print_date($cha->periode,"%Y%m%d")."\"> (YYYYMMDD)"; } else { diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php index 981c9727edb..90c0b899557 100644 --- a/htdocs/compta/stats/comp.php +++ b/htdocs/compta/stats/comp.php @@ -188,7 +188,7 @@ function pt ($db, $sql, $year) { if ($obj->dm > $month ) { for ($b = $month ; $b < $obj->dm ; $b++) { print "<tr $bc[$var]>"; - print "<td>".strftime("%B",mktime(12,0,0,$b, 1, $year))."</td>\n"; + print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">0</td>\n"; print "</tr>\n"; $var=!$var; @@ -199,7 +199,7 @@ function pt ($db, $sql, $year) { if ($obj->sum > 0) { print "<tr $bc[$var]>"; print "<td><a href=\"comp.php?details=1&year=$year&month=$obj->dm\">"; - print strftime("%B",mktime(12,0,0,$obj->dm, 1, $year))."</td>\n"; + print dolibarr_print_date(dolibarr_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">".price($obj->sum)."</td>\n"; print "</TR>\n"; @@ -220,7 +220,7 @@ function pt ($db, $sql, $year) { for ($b = $beg + 1 ; $b < 13 ; $b++) { $var=!$var; print "<tr $bc[$var]>"; - print "<td>".strftime("%B",mktime(12,0,0,$b, 1, $year))."</td>\n"; + print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">0</td>\n"; print "</tr>\n"; $ca[$b] = 0; @@ -295,7 +295,7 @@ function ppt ($db, $year, $socid) $delta = $ca[$b] - $prev[$b]; $deltat = $deltat + $delta ; print "<tr $bc[$var]>"; - print "<td>".strftime("%B",mktime(12,0,0,$b, 1, $year))."</td>\n"; + print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">".price($delta)."</td>\n"; print "</tr>\n"; } diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php index d1dbe171c49..fb8ff3d1cc8 100644 --- a/htdocs/compta/stats/exercices.php +++ b/htdocs/compta/stats/exercices.php @@ -123,7 +123,7 @@ function pt ($db, $sql, $year) { if ($obj->dm > $month ) { for ($b = $month ; $b < $obj->dm ; $b++) { print "<tr $bc[$var]>"; - print "<td>".strftime("%B",mktime(12,0,0,$b, 1, $year))."</td>\n"; + print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">0</td>\n"; print "</tr>\n"; $var=!$var; @@ -134,7 +134,7 @@ function pt ($db, $sql, $year) { if ($obj->sum > 0) { print "<tr $bc[$var]>"; print "<td>"; - print strftime("%B",mktime(12,0,0,$obj->dm, 1, $year))."</td>\n"; + print dolibarr_print_date(dolibarr_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">".price($obj->sum)."</td>\n"; print "</tr>\n"; @@ -155,7 +155,7 @@ function pt ($db, $sql, $year) { for ($b = $beg + 1 ; $b < 13 ; $b++) { $var=!$var; print "<tr $bc[$var]>"; - print "<td>".strftime("%B",mktime(12,0,0,$b, 1, $year))."</td>\n"; + print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n"; print "<td align=\"right\">0</td>\n"; print "</tr>\n"; $ca[$b] = 0; @@ -234,7 +234,7 @@ function ppt ($db, $year, $socid) $delta = $ca[$b] - $prev[$b]; $deltat = $deltat + $delta ; print "<TR $bc[$var]>"; - print "<TD>".strftime("%B",mktime(12,0,0,$b, 1, $year))."</TD>\n"; + print "<TD>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</TD>\n"; print "<TD align=\"right\">".price($delta)."</TD>\n"; print "<TD align=\"right\">".price($deltat)."</TD>\n"; print "</TR>\n"; @@ -255,5 +255,5 @@ ppt($db, $cyear, $socid); $db->close(); -llxFooter('$Date$ révision $Revision$'); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 3c6e39af39b..b6ffb981c6a 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -177,12 +177,12 @@ for ($mois = 1 ; $mois < 13 ; $mois++) $var=!$var; print "<tr $bc[$var]>"; - print "<td>".strftime("%B",mktime(1,1,1,$mois,1,2000))."</td>"; + print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$mois,1,2000),"%b")."</td>"; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - $casenow = strftime("%Y-%m",mktime()); - $case = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee)); - $caseprev = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee-1)); + $casenow = dolibarr_print_date(mktime(),"%Y-%m"); + $case = dolibarr_print_date(mktime(1,1,1,$mois,1,$annee),"%Y-%m"); + $caseprev = dolibarr_print_date(mktime(1,1,1,$mois,1,$annee-1),"%Y-%m"); if ($annee == $year_current) { $total_CA += $cum[$case]; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 984a8675afe..38eedc8b546 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -248,7 +248,7 @@ if ($conf->compta->mode == "CREANCES-DETTES") { $var=!$var; print "<tr $bc[$var]>"; - print '<td nowrap>'.strftime("%b %Y",dolibarr_mktime(0,0,0,$m,1,$y)).'</td>'; + print '<td nowrap>'.dolibarr_print_date(dolibarr_mktime(0,0,0,$m,1,$y),"%b %Y").'</td>'; $x_coll = tva_coll($db, $y, $m); print "<td nowrap align=\"right\">".price($x_coll)."</td>"; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index 0901ee4b1b8..81404305ad0 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -217,7 +217,7 @@ if ($conf->compta->mode == "CREANCES-DETTES") $subtot_paye_vat = 0; for ($q = 1 ; $q <= 4 ; $q++ ) { - print "<tr class=\"liste_titre\"><td colspan=\"8\">".$langs->trans("Quadri")." $q (".strftime("%b %Y",mktime(0,0,0,(($q-1)*3)+1,1,$y)).' - '.strftime("%b %Y",mktime(0,0,0,($q*3),1,$y)).")</td></tr>"; + print "<tr class=\"liste_titre\"><td colspan=\"8\">".$langs->trans("Quadri")." $q (".dolibarr_print_date(dolibarr_mktime(0,0,0,(($q-1)*3)+1,1,$y),"%b %Y").' - '.dolibarr_print_date(dolibarr_mktime(0,0,0,($q*3),1,$y),"%b %Y").")</td></tr>"; $var=true; $x_coll = tva_coll($db, $y, $q); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 346d72f407e..d772fe9cb2b 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -84,7 +84,7 @@ if ($modetax==1) // Caluclate on invoice for goods and services { $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); $nom.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&q='.$q.'&modetax=0">','</a>').')'; - $period=$year_start.' - '.$langs->trans("Quadri")." $q (".strftime("%b %Y",dolibarr_mktime(12,0,0,(($q-1)*3)+1,1,$year_start)).' - '.strftime("%b %Y",dolibarr_mktime(12,0,0,($q*3),1,$year_start)).")"; + $period=$year_start.' - '.$langs->trans("Quadri")." $q (".dolibarr_print_date(dolibarr_mktime(12,0,0,(($q-1)*3)+1,1,$year_start),"%b %Y").' - '.dolibarr_print_date(dolibarr_mktime(12,0,0,($q*3),1,$year_start),"%b %Y").")"; $prevyear=$year_start; $prevquarter=$q; if ($prevquarter > 1) $prevquarter--; else { $prevquarter=4; $prevyear--; } @@ -113,7 +113,7 @@ if ($modetax==0) // Invoice for goods, payment for services { $nom=$langs->trans("VATReportByQuartersInInputOutputMode"); $nom.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&q='.$q.'&modetax=1">','</a>').')'; - $period=$year_start.' - '.$langs->trans("Quadri")." $q (".strftime("%b %Y",dolibarr_mktime(12,0,0,(($q-1)*3)+1,1,$year_start)).' - '.strftime("%b %Y",dolibarr_mktime(12,0,0,($q*3),1,$year_start)).")"; + $period=$year_start.' - '.$langs->trans("Quadri")." $q (".dolibarr_print_date(dolibarr_mktime(12,0,0,(($q-1)*3)+1,1,$year_start),"%b %Y").' - '.dolibarr_print_date(dolibarr_mktime(12,0,0,($q*3),1,$year_start),"%b %Y").")"; $prevyear=$year_start; $prevquarter=$q; if ($prevquarter > 1) $prevquarter--; else { $prevquarter=4; $prevyear--; } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index abf3072f113..d4caa58909a 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -968,7 +968,7 @@ else //print '<br />'; $dateactstart = dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $dateactend = dolibarr_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); - $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",strftime("%A %d %B %Y", $dateactstart)),"confirm_active"); + $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dolibarr_print_date($dateactstart,"%A %d %B %Y")),"confirm_active"); print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; } @@ -980,7 +980,7 @@ else //print '<br />'; $dateactstart = dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $dateactend = dolibarr_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); - $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",strftime("%A %d %B %Y", $dateactend)),"confirm_closeline"); + $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",dolibarr_print_date($dateactend,"%A %d %B %Y")),"confirm_closeline"); print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; } diff --git a/htdocs/docs/class/courrier-droit-editeur.class.php b/htdocs/docs/class/courrier-droit-editeur.class.php index 4824a18cbe1..9971ce23415 100644 --- a/htdocs/docs/class/courrier-droit-editeur.class.php +++ b/htdocs/docs/class/courrier-droit-editeur.class.php @@ -48,7 +48,7 @@ class pdf_courrier_droit_editeur $this->marge_haute=10; $this->marge_basse=10; - $this->name = "Courrier des droits ".strftime("%Y", time()); + $this->name = "Courrier des droits ".dolibarr_print_date(time(),"%Y"); $this->file = '1'.strftime("%Y", time()).'.pdf'; } diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php index a2836786428..6ad91371779 100644 --- a/htdocs/expedition/liste.php +++ b/htdocs/expedition/liste.php @@ -149,14 +149,15 @@ if ($resql) } print "<td align=\"right\">"; - $y = strftime("%Y",$objp->date_expedition); - $m = strftime("%m",$objp->date_expedition); - - print strftime("%d",$objp->date_expedition)."\n"; + $y = dolibarr_print_date($objp->date_expedition,"%Y"); + $m = dolibarr_print_date($objp->date_expedition,"%m"); + $mt = dolibarr_print_date($objp->date_expedition,"%b"); + $d = dolibarr_print_date($objp->date_expedition,"%d"); + print $d."\n"; print " <a href=\"propal.php?year=$y&month=$m\">"; - print strftime("%B",$objp->date_expedition)."</a>\n"; + print $b."</a>\n"; print " <a href=\"propal.php?year=$y\">"; - print strftime("%Y",$objp->date_expedition)."</a></TD>\n"; + print $y."</a></TD>\n"; print '<td align="right">'.$expedition->LibStatut($objp->fk_statut,5).'</td>'; print "</tr>\n"; diff --git a/htdocs/expedition/stats/expeditionstats.class.php b/htdocs/expedition/stats/expeditionstats.class.php index 9059575975f..47a0fbbe138 100644 --- a/htdocs/expedition/stats/expeditionstats.class.php +++ b/htdocs/expedition/stats/expeditionstats.class.php @@ -85,7 +85,7 @@ class ExpeditionStats for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(strftime("%b",dolibarr_mktime(12,12,12,$i,1,$year)), $res[$i]); + $data[$i-1] = array(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"), $res[$i]); } return $data; @@ -101,7 +101,7 @@ class ExpeditionStats for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(strftime("%b",dolibarr_mktime(12,12,12,$i,1,$year)), + $data[$i-1] = array(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"), $data1[$i][1], $data2[$i][1]); } diff --git a/htdocs/fichinter/rapport.php b/htdocs/fichinter/rapport.php index 1b13d009111..8fde011fb7c 100644 --- a/htdocs/fichinter/rapport.php +++ b/htdocs/fichinter/rapport.php @@ -93,7 +93,7 @@ $sql .= " ORDER BY $sortfield $sortorder "; if ( $db->query($sql) ) { $num = $db->num_rows(); - $title = "Rapport d'activit� de " . strftime("%B %Y",strtotime ($start)); + $title = $langs->trans("Report")." ".dolibarr_print_date(strtotime($start),"%B %Y"); print_barre_liste($title, $page, "rapport.php","&socid=$socid",$sortfield,$sortorder,'',$num); $i = 0; @@ -124,7 +124,7 @@ if ( $db->query($sql) ) print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->rowid.$filter."\">".$objp->nom."</a></TD>\n"; } print '<td>'.nl2br($objp->description).'</td>'; - print "<td>".strftime("%d %B %Y",$objp->dp)."</td>\n"; + print "<td>".dolibarr_print_date($objp->dp,"%d %B %Y")."</td>\n"; print '<td align="center">'.sprintf("%.1f",$objp->duree).'</td>'; $DureeTotal += $objp->duree; print "</tr>\n"; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 3a63e06b949..255b4f4d7c7 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -2400,13 +2400,13 @@ function create_exdir($dir) /** - \brief Retourne le num�ro de la semaine par rapport a une date + \brief Retourne le numero de la semaine par rapport a une date \param time Date au format 'timestamp' - \return int Num�ro de semaine + \return int Numero de semaine */ function numero_semaine($time) { - $stime = strftime( '%Y-%m-%d',$time); + $stime = strftime('%Y-%m-%d',$time); if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?',$stime,$reg)) { diff --git a/htdocs/product.class.php b/htdocs/product.class.php index b53f70c6c20..0f2f308b9a1 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -1418,7 +1418,7 @@ class Product extends CommonObject for ($j = 0 ; $j < 12 ; $j++) { - $idx=ucfirst(substr( strftime("%b",mktime(12,0,0,$month,1,$year)) ,0,3) ); + $idx=ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$month,1,$year),"%b") ,0,3) ); $monthnum=sprintf("%02s",$month); $result[$j] = array($idx,isset($tab[$year.$month])?$tab[$year.$month]:0); diff --git a/htdocs/stats.class.php b/htdocs/stats.class.php index 529d9ae51f8..2b329c61ffb 100644 --- a/htdocs/stats.class.php +++ b/htdocs/stats.class.php @@ -196,7 +196,7 @@ class Stats for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(ucfirst(substr(strftime("%b",dolibarr_mktime(12,0,0,$i,1,$year)),0,3)), $res[$i]); + $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]); } return $data; @@ -236,7 +236,7 @@ class Stats for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(ucfirst(substr(strftime("%b",dolibarr_mktime(12,0,0,$i,1,$year)),0,3)), $res[$i]); + $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]); } return $data; diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index c5e057974db..f8dea38d4a2 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -163,7 +163,7 @@ class Translate { * \brief Load in a memory array, translation key-value for a particular file. * If data for file already loaded, do nothing. * All data in translation array are stored in ISO-8859-1 format. - * \param domain File name to load (.lang file) + * \param domain File name to load (.lang file). Use @ before value if domain is in a module directory. * \param alt Use alternate file even if file in target language is found * \return int <0 if KO, >0 if OK * \remarks tab_loaded is completed with $domain key. -- GitLab