From 0446c3da41894d49257a8026364d5c810565ef7d Mon Sep 17 00:00:00 2001 From: raphael_bertrand Date: Wed, 3 Sep 2008 07:36:57 +0000 Subject: [PATCH] Chronodocs module support --- htdocs/comm/fiche.php | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 37862820da2..a3556924796 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,12 +35,14 @@ if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT."/facture.class.php" if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); +if (!empty($conf->global->MAIN_MODULE_CHRONODOCS)) require_once(DOL_DOCUMENT_ROOT."/chronodocs/chronodocs_entries.class.php"); $langs->load("companies"); $langs->load("orders"); $langs->load("bills"); $langs->load("contracts"); if ($conf->fichinter->enabled) $langs->load("interventions"); +if (!empty($conf->global->MAIN_MODULE_CHRONODOCS)) $langs->load("chronodocs"); // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; @@ -584,6 +587,43 @@ if ($socid > 0) } print ""; } + + /* + * Last linked chronodocs + */ + if(!empty($conf->global->MAIN_MODULE_CHRONODOCS) && $user->rights->chronodocs->entries->read) + { + print ''; + $chronodocs_static=new Chronodocs_entries($db); + $result=$chronodocs_static->get_list($MAXLIST,0,"f.date_c","DESC",$objsoc->id); + if (is_array($result)) + { + $var=true; + $i = 0 ; + //$num = sizeOf($result); + $num=$chronodocs_static->get_nb_chronodocs($objsoc->id); + + if ($num > 0) { + print ''; + print ''; + print ''; + } + while ($i < $num && $i < $MAXLIST) { + $obj = array_shift($result); + $var = !$var; + print ""; + print ''; + + print ""; + print "\n"; + print ""; + + $i++; + } + } + + print "
'.$langs->trans("LastChronodocs",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllChronodocs").' ('.$num.')
'.img_object($langs->trans("ShowChronodocs"),"generic")." ".$obj->ref.'".dolibarr_trunc($obj->title,30) ."".dolibarr_print_date($obj->dp,'day')."
"; + } print ""; print "\n"; @@ -629,6 +669,11 @@ if ($socid > 0) print ''.$langs->trans("AddContact").''; } + if(!empty($conf->global->MAIN_MODULE_CHRONODOCS) && $user->rights->chronodocs->entries->write) + { + print ''.$langs->trans("AddChronodoc").''; + } + print ''; print '
';