diff --git a/htdocs/index.php b/htdocs/index.php index a930bb82243..dcd6e55b06d 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -23,9 +23,9 @@ /** - \file htdocs/index.php - \brief Page accueil par defaut - \version $Revision$ + \file htdocs/index.php + \brief Page accueil par defaut + \version $Revision$ */ require("./pre.inc.php"); @@ -40,16 +40,19 @@ if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home"; llxHeader(); -$userstring=$user->prenom . ' ' . $user->nom .' ('.$user->login.')'; -print_fiche_titre($langs->trans("WelcomeString",dolibarr_print_date(mktime(),"%A %d %B %Y"),$userstring), ''.$langs->trans("About").''); + +print_fiche_titre($langs->trans("HomeArea")); + if (defined("MAIN_MOTD") && strlen(trim(MAIN_MOTD))) { - print '
'.nl2br(MAIN_MOTD).'
'; + print '
'; + print nl2br(MAIN_MOTD); + print '

'; } // Affiche warning répertoire install existe (si utilisateur admin) -if ($user->admin) +if ($user->admin && ! defined("MAIN_REMOVE_INSTALL_WARNING")) { if (is_dir(DOL_DOCUMENT_ROOT."/install")) { @@ -58,9 +61,282 @@ if ($user->admin) print '
'.$langs->trans("WarningInstallDirExists",DOL_DOCUMENT_ROOT."/install").' '; print $langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install").'
'; print ''; + print "
\n"; } } -print "
\n"; + +print ''; + +print '
'; + + +/* + * Informations + */ +print ''; +print ''; +print ''; +$userstring=$user->fullname; +print ''; +print ''; +print ''; +print ''; +print '
'.$langs->trans("Informations").'
'.$langs->trans("User").''.$userstring.'
'.$langs->trans("LastAccess").''; +if ($user->datelastaccess) print dolibarr_print_date($user->datelastaccess,"%d %b %Y %H:%M:%S"); +else print $langs->trans("Unknown"); +print '
'; + +/* + * Bookmark + */ +/* +print '
'; + +$sql = "SELECT s.idp, s.nom,b.rowid as bid"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b"; +$sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id; +$sql .= " ORDER BY lower(s.nom) ASC"; + +$resql = $db->query($sql); + +if ( $resql ) +{ + $num = $db->num_rows($resql); + $i = 0; + if ($num) + { + print ''; + print "\n"; + $var = True; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var = !$var; + print ""; + print ''; + print ''; + print ''; + $i++; + } + print '
".$langs->trans("MyBookmarks")."
'.$obj->nom.''.img_delete().'
'; + } + $db->free($resql); +} +else +{ + dolibarr_print_error($db); +} +*/ + +print '
'; + + +/* + * Dolibarr Board + */ +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$var=true; + +// Nbre actions à faire (en retard) +if ($conf->commercial->enabled || $conf->compta->enabled) +{ + include_once("./actioncomm.class.php"); + $board=new ActionComm($db); + $board->load_board(); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Nbre commandes clients à honorer +if ($conf->commande->enabled && $user->rights->commande->lire) +{ + include_once("./commande/commande.class.php"); + $board=new Commande($db); + $board->load_board(); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Nbre propales ouvertes (expirées) +if ($conf->propal->enabled && $user->rights->propale->lire) +{ + include_once("./propal.class.php"); + $board=new Propal($db); + $board->load_board("opened"); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Nbre propales fermées signées (à facturer) +if ($conf->propal->enabled && $user->rights->propale->lire) +{ + include_once("./propal.class.php"); + $board=new Propal($db); + $board->load_board("signed"); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Nbre factures fournisseurs (à payer) +if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->facture->lire) +{ + include_once("./fourn/fournisseur.facture.class.php"); + $board=new FactureFournisseur($db); + $board->load_board(); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Nbre factures clients (à payer) +if ($conf->facture->enabled && $user->rights->facture->lire) +{ + include_once("./facture.class.php"); + $board=new Facture($db); + $board->load_board(); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Nbre services à activer (en retard) +if ($conf->contrat->enabled && $user->rights->contrat->lire) +{ + $langs->load("contracts"); + + include_once("./contrat/contrat.class.php"); + $board=new Contrat($db); + $board->load_board("inactives"); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +// Nbre services actifs (à renouveler) +if ($conf->contrat->enabled && $user->rights->contrat->lire) +{ + $langs->load("contracts"); + + include_once("./contrat/contrat.class.php"); + $board=new Contrat($db); + $board->load_board("expired"); + + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +print '
'.$langs->trans("DolibarrBoard").''.$langs->trans("Number").''.$langs->trans("Late").'  
'.img_object($langs->trans("Actions"),"task").''.$langs->trans("ActionsToDo").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->actions->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'.img_object($langs->trans("Orders"),"order").''.$langs->trans("OrdersToProcess").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->commande->traitement->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'.img_object($langs->trans("Propals"),"propal").''.$langs->trans("PropalsToClose").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->propal->cloture->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'.img_object($langs->trans("Propals"),"propal").''.$langs->trans("PropalsToBill").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->propal->facturation->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'.img_object($langs->trans("Bills"),"bill").''.$langs->trans("SupplierBillsToPay").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->facture->fournisseur->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'.img_object($langs->trans("Bills"),"bill").''.$langs->trans("CustomerBillsUnpayed").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->facture->client->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'.img_object($langs->trans("Contract"),"contract").''.$langs->trans("BoardNotActivatedServices").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->contrat->services->inactifs->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'.img_object($langs->trans("Contract"),"contract").''.$langs->trans("BoardRunningServices").''.$board->nbtodo.''; + print ''; + print $board->nbtodolate; + print ''; + print ' (>'.ceil($conf->contrat->services->expires->warning_delay/60/60/24).' '.$langs->trans("days").')'; + print ''; + if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning"); + else print ' '; + print '
'; + + +print '
'; /* @@ -72,7 +348,13 @@ $infobox=new InfoBox($db); $boxes=$infobox->listboxes("0"); // 0 = valeur pour la page accueil $NBCOLS=2; // Nombre de colonnes pour les boites -print ''; + +if (sizeof($boxes)) +{ + print '
'; + print_fiche_titre($langs->trans("OtherInformationsBoxes")); + print '
'; +} for ($ii=0, $ni=sizeof($boxes); $ii<$ni; $ii++) { if ($ii % $NBCOLS == 0) print "\n"; @@ -87,8 +369,11 @@ for ($ii=0, $ni=sizeof($boxes); $ii<$ni; $ii++) print ""; if ($ii % $NBCOLS == ($NBCOLS-1)) print "\n"; } -if ($ii % $NBCOLS == ($NBCOLS-1)) print "\n"; -print "
"; +if (sizeof($boxes)) +{ + if ($ii % $NBCOLS == ($NBCOLS-1)) print "\n"; + print ""; +} $db->close();