diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 20b86bd4516..b2c1e1ab5cf 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -20,7 +20,7 @@ * $Source$ */ -/*! +/** \file htdocs/comm/action/fiche.php \ingroup commercial \brief Page de la fiche action commercial @@ -256,34 +256,7 @@ if ($_GET["action"] == 'create') print_duree_select("duree"); print ''; - // Lien avec calendrier si module activé - 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 ''; - } - } - } - } + add_row_for_webcal_link(); print ''.$langs->trans("Comment").''; print ''; @@ -375,12 +348,7 @@ if ($_GET["action"] == 'create') } print ''; - // Lien avec calendrier si module activé - if ($conf->webcal->enabled) - { - $langs->load("other"); - print ''.$langs->trans("AddCalendarEntry").''; - } + add_row_for_webcal_link(); // Description print ''.$langs->trans("Description").''; @@ -520,4 +488,47 @@ if ($_GET["id"]) $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); + + + +/** + \brief Ajoute une ligne de tableau a 2 colonnes pour avoir l'option webcalendar +*/ +function add_row_for_webcal_link() +{ + global $conf,$langs,$user; + + // Lien avec calendrier si module activé + 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 ''; + } + } + } + } +} + + ?> + +