diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index a396e2f3702..20b86bd4516 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -257,21 +257,34 @@ if ($_GET["action"] == 'create') print ''; // Lien avec calendrier si module activé - if ($conf->webcal->enabled) - { - $langs->load("other"); - print ''.$langs->trans("AddCalendarEntry").''; - if (! $user->webcal_login) { - print ''; - print ' '.$langs->trans("ErrorWebcalLoginNotDefined","id."\">".$user->login.""); - print ''; - } else { - print ''; - } - - print ''; - } - + if ($conf->webcal->enabled) { + if ($conf->webcal->syncro != 'never') + { + $langs->load("other"); + if (! $user->webcal_login) + { + print ''.$langs->trans("AddCalendarEntry").''; + print ''; + print ' '.$langs->trans("ErrorWebcalLoginNotDefined","id."\">".$user->login.""); + print ''; + print ''; + } + else + { + if ($conf->webcal->syncro == 'always') + { + print ''; + } + else + { + print ''.$langs->trans("AddCalendarEntry").''; + print 'webcal->syncro=='always' || $conf->webcal->syncro=='yesbydefault')?' checked':'').'>'; + print ''; + } + } + } + } + print ''.$langs->trans("Comment").''; print ''; print '';