diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index a39698cd815..787f69de4a3 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -752,7 +752,13 @@ if (empty($reshook))
// Close all lines
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
{
- $object->cloture($user);
+ $object->closeAll($user);
+ }
+
+ // Close all lines
+ else if ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer)
+ {
+ $object->activateAll($user);
}
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer)
@@ -1313,6 +1319,11 @@ else
{
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1);
+ }
+ if ($action == 'activate')
+ {
+ print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ActivateAllOnContract"),$langs->trans("ConfirmActivateAllOnContract"),"confirm_activate",'',0,1);
+
}
/*
@@ -1617,7 +1628,7 @@ else
print $langs->trans("DateStartPlanned").': ';
if ($objp->date_debut)
{
- print dol_print_date($db->jdate($objp->date_debut));
+ print dol_print_date($db->jdate($objp->date_debut), 'day');
// Warning si date prevu passee et pas en service
if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) {
$warning_delay=$conf->contrat->services->inactifs->warning_delay / 3600 / 24;
@@ -1630,7 +1641,7 @@ else
print $langs->trans("DateEndPlanned").': ';
if ($objp->date_fin)
{
- print dol_print_date($db->jdate($objp->date_fin));
+ print dol_print_date($db->jdate($objp->date_fin), 'day');
if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) {
$warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24;
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
@@ -1849,21 +1860,21 @@ else
// Si pas encore active
if (! $objp->date_debut_reelle) {
print $langs->trans("DateStartReal").': ';
- if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle);
+ if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle, 'day');
else print $langs->trans("ContractStatusNotRunning");
}
// Si active et en cours
if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) {
print $langs->trans("DateStartReal").': ';
- print dol_print_date($objp->date_debut_reelle);
+ print dol_print_date($objp->date_debut_reelle, 'day');
}
// Si desactive
if ($objp->date_debut_reelle && $objp->date_fin_reelle) {
print $langs->trans("DateStartReal").': ';
- print dol_print_date($objp->date_debut_reelle);
+ print dol_print_date($objp->date_debut_reelle, 'day');
print ' - ';
print $langs->trans("DateEndReal").': ';
- print dol_print_date($objp->date_fin_reelle);
+ print dol_print_date($objp->date_fin_reelle, 'day');
}
if (! empty($objp->comment)) print "
".$objp->comment;
print '';
@@ -2071,6 +2082,10 @@ else
print '