From e1ba69eee02949c8e05cbaa9e9d10a28e1bee034 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Jul 2017 00:19:30 +0200 Subject: [PATCH] Fix edit of automatic event should keep its type. --- htdocs/comm/action/card.php | 11 +++++++++-- htdocs/comm/action/listactions.php | 8 +++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5e38a85898e..14ab91a2f31 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -955,8 +955,15 @@ if ($id > 0) // Type of event if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''.$langs->trans("Type").''; - $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + print ''.$langs->trans("Type").''; + if ($object->type_code != 'AC_OTH_AUTO') + { + $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + } + else + { + print ''.$langs->trans("Action".$object->type_code); + } print ''; } diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 55f73575f78..9cb14454cd5 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -347,11 +347,13 @@ if ($resql) if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { - $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; + $tmpforcreatebutton=dol_getdate(dol_now(), true); + + $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; - $link = ''; + $link = ''; $link.= $langs->trans("NewAction"); $link.= ''; } @@ -527,7 +529,7 @@ if ($resql) // Status/Percent $datep=$db->jdate($obj->datep); - print ''.$actionstatic->LibStatut($obj->percent,3,1,$datep).''; + print ''.$actionstatic->LibStatut($obj->percent,3,0,$datep).''; print '';