diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 0ee75bd2bc1..26c74ae9503 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -848,21 +848,17 @@ if ($socid > 0) } } - if ($user->rights->societe->contact->creer) + /*if ($user->rights->societe->contact->creer) { print ''.$langs->trans("AddContact").''; - } - - if(!empty($conf->global->MAIN_MODULE_CHRONODOCS) && $user->rights->chronodocs->entries->write) - { - print ''.$langs->trans("AddChronodoc").''; - } + }*/ print ''; print "
\n"; if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) { + print '
'; // List of contacts show_contacts($conf,$langs,$db,$objsoc); } diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index c4f4b83c7bf..8fde9b2cfff 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -32,6 +32,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php"); $WIDTH=500; $HEIGHT=200; +$userid=GETPOST('userid'); +$socid=GETPOST('socid'); // Security check if ($user->societe_id > 0) { diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 003590ae350..ce1c8f9366f 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -309,7 +309,7 @@ if ($socid > 0) } } - print ''.$langs->trans("AddContact").''; + //print ''.$langs->trans("AddContact").''; print ''; @@ -318,6 +318,7 @@ if ($socid > 0) if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) { + print '
'; // List of contacts show_contacts($conf,$langs,$db,$societe); } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 52f14101396..142af42bcb4 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -1,6 +1,6 @@ - * Copyright (c) 2004-2009 Laurent Destailleur + * Copyright (c) 2004-2011 Laurent Destailleur * * 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 @@ -20,9 +20,9 @@ /** * \file htdocs/commande/stats/index.php * \ingroup commande - * \brief Page des stats commandes + * \brief Page with customers or suppliers orders statistics * \version $Id$ -*/ + */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); @@ -34,15 +34,16 @@ $HEIGHT=200; $mode='customer'; if (isset($_GET["mode"])) $mode=$_GET["mode"]; - if ($mode == 'customer' && ! $user->rights->commande->lire) accessforbidden(); if ($mode == 'supplier' && ! $user->rights->fournisseur->commande->lire) accessforbidden(); +$userid=GETPOST('userid'); +$socid=GETPOST('socid'); // Security check if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; + $action = ''; + $socid = $user->societe_id; } $year = strftime("%Y", time()); @@ -59,13 +60,13 @@ llxHeader(); if ($mode == 'customer') { - $title=$langs->trans("OrdersStatistics"); - $dir=$conf->commande->dir_temp; + $title=$langs->trans("OrdersStatistics"); + $dir=$conf->commande->dir_temp; } if ($mode == 'supplier') { - $title=$langs->trans("OrdersStatisticsSuppliers"); - $dir=$conf->fournisseur->dir_output.'/commande/temp'; + $title=$langs->trans("OrdersStatisticsSuppliers"); + $dir=$conf->fournisseur->dir_output.'/commande/temp'; } print_fiche_titre($title, $mesg); @@ -82,15 +83,15 @@ $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { - $filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$user->id.'-'.$year.'.png'; + $filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png'; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$user->id.'-'.$year.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$user->id.'-'.$year.'.png'; } else { - $filenamenb = $dir.'/ordersnbinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$year.'.png'; + $filenamenb = $dir.'/ordersnbinyear-'.$year.'.png'; + if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$year.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$year.'.png'; } $px = new DolGraph(); @@ -98,25 +99,25 @@ $mesg = $px->isGraphKo(); if (! $mesg) { $px->SetData($data); - $px->SetPrecisionY(0); - $i=$startyear; - while ($i <= $endyear) - { - $legend[]=$i; - $i++; - } + $px->SetPrecisionY(0); + $i=$startyear; + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } $px->SetLegend($legend); $px->SetMaxValue($px->GetCeilMaxValue()); - $px->SetMinValue(min(0,$px->GetFloorMinValue())); + $px->SetMinValue(min(0,$px->GetFloorMinValue())); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); $px->SetYLabel($langs->trans("NbOfOrder")); $px->SetShading(3); - $px->SetHorizTickIncrement(1); - $px->SetPrecisionY(0); + $px->SetHorizTickIncrement(1); + $px->SetPrecisionY(0); $px->mode='depth'; - $px->SetTitle($langs->trans("NumberOfOrdersByMonth")); - $px->draw($filenamenb); + $px->SetTitle($langs->trans("NumberOfOrdersByMonth")); + $px->draw($filenamenb); } // Build graphic amount of object @@ -126,41 +127,41 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { - $filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$user->id.'-'.$year.'.png'; + $filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png'; + if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$user->id.'-'.$year.'.png'; + if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$user->id.'-'.$year.'.png'; } else { - $filenameamount = $dir.'/ordersamountinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$year.'.png'; + $filenameamount = $dir.'/ordersamountinyear-'.$year.'.png'; + if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$year.'.png'; + if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$year.'.png'; } $px = new DolGraph(); $mesg = $px->isGraphKo(); if (! $mesg) { - $px->SetData($data); - $i=$startyear; - while ($i <= $endyear) - { - $legend[]=$i; - $i++; - } - $px->SetLegend($legend); - $px->SetMaxValue($px->GetCeilMaxValue()); - $px->SetMinValue(min(0,$px->GetFloorMinValue())); - $px->SetWidth($WIDTH); - $px->SetHeight($HEIGHT); - $px->SetYLabel($langs->trans("AmountOfOrders")); - $px->SetShading(3); - $px->SetHorizTickIncrement(1); - $px->SetPrecisionY(0); - $px->mode='depth'; - $px->SetTitle($langs->trans("AmountOfOrdersByMonthHT")); + $px->SetData($data); + $i=$startyear; + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px->SetLegend($legend); + $px->SetMaxValue($px->GetCeilMaxValue()); + $px->SetMinValue(min(0,$px->GetFloorMinValue())); + $px->SetWidth($WIDTH); + $px->SetHeight($HEIGHT); + $px->SetYLabel($langs->trans("AmountOfOrders")); + $px->SetShading(3); + $px->SetHorizTickIncrement(1); + $px->SetPrecisionY(0); + $px->mode='depth'; + $px->SetTitle($langs->trans("AmountOfOrdersByMonthHT")); - $px->draw($filenameamount); + $px->draw($filenameamount); } print ''; @@ -180,24 +181,24 @@ print ''; $oldyear=0; foreach ($data as $val) { - $year = $val['year']; - while ($year && $oldyear > $year+1) - { // If we have empty year - $oldyear--; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } - print ''; + $year = $val['year']; + while ($year && $oldyear > $year+1) + { // If we have empty year + $oldyear--; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + print ''; print ''; - print ''; - print ''; - print ''; - print ''; - $oldyear=$year; + print ''; + print ''; + print ''; + print ''; + $oldyear=$year; } print '
'.$oldyear.'000
'.$oldyear.'000
'.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
'.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
'; @@ -210,9 +211,9 @@ print ''; print '
'; if ($mesg) { print $mesg; } else { - print ''.$langs->trans('; - print "
\n"; - print ''.$langs->trans('; + print ''.$langs->trans('; + print "
\n"; + print ''.$langs->trans('; } print '
'; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index f660e2eef7b..2e8cdcd52b1 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -33,6 +33,8 @@ $langs->load("trips"); $WIDTH=500; $HEIGHT=200; +$userid=GETPOST('userid'); +$socid=GETPOST('socid'); // Securite acces client if ($user->societe_id > 0) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1717f7700c7..433d6dfa6da 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -60,6 +60,7 @@ $socid=GETPOST('socid'); $action=GETPOST('action'); $confirm=GETPOST('confirm'); $lineid=GETPOST('lineid'); +$userid=GETPOST('userid'); // Security check $fieldid = isset($_GET["ref"])?'facnumber':'rowid'; @@ -1098,10 +1099,7 @@ if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['cancel' } -/* - * Ordonnancement des lignes - */ - +// Modify line position (up) if ($action == 'up' && $user->rights->facture->creer) { $object->fetch($id); @@ -1123,7 +1121,7 @@ if ($action == 'up' && $user->rights->facture->creer) Header ('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); exit; } - +// Modify line position (down) if ($action == 'down' && $user->rights->facture->creer) { $object->fetch($id); @@ -2926,20 +2924,18 @@ else $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; + if (! $sortorder) $sortorder='DESC'; + if (! $sortfield) $sortfield='f.datef'; + $limit = $conf->liste_limit; + $pageprev = $page - 1; $pagenext = $page + 1; $month =GETPOST('month','int'); $year =GETPOST('year','int'); - $limit = $conf->liste_limit; - if (! $sortorder) $sortorder='DESC'; - if (! $sortfield) $sortfield='f.datef'; - $facturestatic=new Facture($db); - if ($page == -1) $page = 0 ; - $sql = 'SELECT '; $sql.= ' f.rowid as facid, f.facnumber, f.type, f.increment, f.total, f.total_ttc,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; @@ -2955,6 +2951,11 @@ else $sql.= " AND f.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= ' AND s.rowid = '.$socid; + if ($userid) + { + if ($userid == -1) $sql.=' AND f.fk_user_author IS NULL'; + else $sql.=' AND f.fk_user_author = '.$user->id; + } if ($_GET['filtre']) { $filtrearr = explode(',', $_GET['filtre']); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 781750c8d62..83c1207ca6c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -160,6 +160,12 @@ class Facture extends CommonObject dol_syslog("Facture::Create user=".$user->id); // Check parameters + if (empty($date) || empty($user->id)) + { + $this->error="ErrorBadParameter"; + dol_syslog("Facture::create Try to create an invoice with an empty parameter (user, date, ...)", LOG_ERR); + return -3; + } $soc = new Societe($this->db); $result=$soc->fetch($this->socid); if ($result < 0) diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index 1381f12661e..84b6506c5cf 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -32,8 +32,9 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'); $langs->load("bills"); // Security check -$facid = GETPOST("facid"); -$socid = GETPOST("socid"); +$facid =GETPOST("facid"); +$socid =GETPOST("socid"); +$userid=GETPOST('userid'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'facture',$facid,''); @@ -102,6 +103,11 @@ else $sql.= " AND sc.fk_user = " .$user->id; } if ($socid > 0) $sql.= " AND f.fk_soc = ".$socid; + if ($userid) + { + if ($userid == -1) $sql.= " AND f.fk_user_author IS NULL"; + else $sql.= " AND f.fk_user_author = ".$userid; + } // Search criteria if ($_REQUEST["search_ref"]) $sql .=" AND p.rowid=".$_REQUEST["search_ref"]; if ($_REQUEST["search_account"]) $sql .=" AND b.fk_account=".$_REQUEST["search_account"]; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 581b342640d..859c3e9c6ba 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -179,7 +179,7 @@ else { dol_print_error($db); } -// On ajoute les paiements anciennes version, non lies par paiement_facture +// On ajoute les paiements ancienne version, non lies par paiement_facture donc sans user if ($modecompta != 'CREANCES-DETTES') { $sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(p.amount) as amount_ttc"; @@ -221,7 +221,7 @@ print ""; print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"name","",'&year='.($year).'&modecompta='.$modecompta,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Percentage"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); -if ($conf->commande->enabled && $conf->global->MAIN_FEATURES_LEVEL == 2) print_liste_field_titre($langs->trans("OrderStats"),$_SERVER["PHP_SELF"],"","","",'align="center" width="20%"'); +if ($conf->global->MAIN_FEATURES_LEVEL == 2) print_liste_field_titre($langs->trans("OtherStatistics"),$_SERVER["PHP_SELF"],"","","",'align="center" width="20%"'); print "\n"; $var=true; @@ -250,8 +250,9 @@ if (sizeof($amount)) foreach($arrayforsort as $key => $value) { $var=!$var; - print ""; + print ""; + // Third party $fullname=$name[$key]; if ($key >= 0) { $linkname=''.img_object($langs->trans("ShowUser"),'user').' '.$fullname.''; @@ -260,16 +261,35 @@ if (sizeof($amount)) $linkname=$langs->trans("PaymentsNotLinkedToUser"); } print "".$linkname."\n"; - print ''.price($amount[$key]).''; - print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal,2).'%' : ' ').''; - if ($conf->commande->enabled && $conf->global->MAIN_FEATURES_LEVEL == 2) + + // Amount + print ''; + if ($modecompta != 'CREANCES-DETTES') { - if($key>0){ - print ''.img_picto($langs->trans("Show"),"stats").''; - } else { - print '   ' ; - } + if ($key > 0) print ''; + else print ''; } + else + { + if ($key > 0) print ''; + else print ''; + } + print price($amount[$key]); + print ''; + + // Percent + print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal,2).'%' : ' ').''; + + // Other stats + if ($conf->global->MAIN_FEATURES_LEVEL == 2) + { + print ''; + if ($conf->commande->enabled && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + if ($conf->facture->enabled && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if ($conf->propal->enabled && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + print ''; + } + print "\n"; $i++; } diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index f924e501fc6..5c45f3c74f8 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -227,6 +227,7 @@ print ""; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"nom","",'&year='.($year).'&modecompta='.$modecompta,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Percentage"),$_SERVER["PHP_SELF"],"amount_ttc","",'&year='.($year).'&modecompta='.$modecompta,'align="right"',$sortfield,$sortorder); +if ($conf->global->MAIN_FEATURES_LEVEL == 2) print_liste_field_titre($langs->trans("OtherStatistics"),$_SERVER["PHP_SELF"],"","","",'align="center" width="20%"'); print "\n"; $var=true; @@ -255,8 +256,9 @@ if (sizeof($amount)) foreach($arrayforsort as $key=>$value) { $var=!$var; - print ""; + print ""; + // Third party $fullname=$name[$key]; if ($key > 0) { $linkname=''.img_object($langs->trans("ShowCompany"),'company').' '.$fullname.''; @@ -265,19 +267,44 @@ if (sizeof($amount)) $linkname=$langs->trans("PaymentsNotLinkedToInvoice"); } print "".$linkname."\n"; + + // Amount print ''; - if ($key > 0) print ''; - else print ''; + if ($modecompta != 'CREANCES-DETTES') + { + if ($key > 0) print ''; + else print ''; + } + else + { + if ($key > 0) print ''; + else print ''; + } print price($amount[$key]); print ''; print ''; + + // Percent; print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : ' ').''; + + // Other stats + if ($conf->global->MAIN_FEATURES_LEVEL == 2) + { + print ''; + if ($conf->commande->enabled && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + if ($conf->facture->enabled && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if ($conf->propal->enabled && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + print ''; + } + print "\n"; $i++; } // Total - print ''.$langs->trans("Total").''.price($catotal).' '; + print ''.$langs->trans("Total").''.price($catotal).' '; + if ($conf->global->MAIN_FEATURES_LEVEL == 2) print ' '; + print ''; $db->free($result); } diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 210fd4c1e0b..a3d8515d5a1 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -39,8 +39,9 @@ else { $year_end=$year_start + ($nbofyear-1); } +$userid=GETPOST('userid'); +$socid=GETPOST('socid'); // Security check -$socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; if ($user->societe_id > 0) $socid = $user->societe_id; if (!$user->rights->compta->resultat->lire && !$user->rights->accounting->comptarapport->lire) accessforbidden(); diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 4c63f7d99e5..2ae68ac69cf 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -379,16 +379,17 @@ if ( $societe->fetch($socid) ) } } - if ($user->rights->societe->contact->creer) + /*if ($user->rights->societe->contact->creer) { print "".$langs->trans("AddContact").""; - } + }*/ print ''; print '
'; if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) { + print '
'; // List of contacts show_contacts($conf,$langs,$db,$societe); } diff --git a/htdocs/install/doctemplates/invoices/template_invoice.odt b/htdocs/install/doctemplates/invoices/template_invoice.odt index c1693757a7c..2d50e435221 100644 Binary files a/htdocs/install/doctemplates/invoices/template_invoice.odt and b/htdocs/install/doctemplates/invoices/template_invoice.odt differ diff --git a/htdocs/install/doctemplates/thirdparties/template_thirdparty.odt b/htdocs/install/doctemplates/thirdparties/template_thirdparty.odt index 850711d5760..cce1a70fb92 100644 Binary files a/htdocs/install/doctemplates/thirdparties/template_thirdparty.odt and b/htdocs/install/doctemplates/thirdparties/template_thirdparty.odt differ diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 03cfb3326e4..d0783df6f10 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -305,6 +305,7 @@ Option=Option List=List FullList=Full list Statistics=Statistics +OtherStatistics=Other statistics Status=Status Ref=Ref. RefSupplier=Ref. supplier diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index a93e0f0925f..77cd55a8570 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -305,6 +305,7 @@ Option=Option List=Liste FullList=Liste complète Statistics=Statistiques +OtherStatistics=Autres statistics Status=État Ref=Réf. RefSupplier=Réf. fournisseur diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index d72dc232ff4..45c7d3b298c 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -337,8 +337,9 @@ function getFormeJuridiqueLabel($code) * @param lang Object lang * @param db Database handler * @param object Third party object + * @param backtopage Url to go once contact is created */ -function show_projects($conf,$langs,$db,$object) +function show_projects($conf,$langs,$db,$object,$backtopage='') { global $user; @@ -348,8 +349,14 @@ function show_projects($conf,$langs,$db,$object) { $langs->load("projects"); + $buttoncreate=''; + if ($conf->projet->enabled && $user->rights->projet->creer) + { + $buttoncreate=''.$langs->trans("AddProject").''; + } + print "\n"; - print_titre($langs->trans("ProjectsDedicatedToThisThirdParty")); + print_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,''); print "\n".''; $sql = "SELECT p.rowid,p.title,p.ref,p.public, p.dateo as do, p.datee as de"; @@ -426,8 +433,9 @@ function show_projects($conf,$langs,$db,$object) * @param lang Object lang * @param db Database handler * @param object Third party object + * @param backtopage Url to go once contact is created */ -function show_contacts($conf,$langs,$db,$object) +function show_contacts($conf,$langs,$db,$object,$backtopage='') { global $user; global $bc; @@ -441,8 +449,15 @@ function show_contacts($conf,$langs,$db,$object) $user->fetch_clicktodial(); // lecture des infos de clicktodial } + $buttoncreate=''; + if ($user->rights->societe->contact->creer) + { + $buttoncreate=''.$langs->trans("AddContact").''."\n"; + } + print "\n"; - print_titre($langs->trans("ContactsForCompany")); + print_fiche_titre($langs->trans("ContactsForCompany"),$buttoncreate,''); + print "\n".'
'."\n"; print ''; @@ -496,13 +511,13 @@ function show_contacts($conf,$langs,$db,$object) print ''; print ''; if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) { - print ''; } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index d45e694e176..4e3873f80e5 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1838,15 +1838,16 @@ else print ''.$langs->trans("Modify").''."\n"; } - if ($user->rights->societe->contact->creer) + /*if ($user->rights->societe->contact->creer) { print ''.$langs->trans("AddContact").''."\n"; } + */ - if ($conf->projet->enabled && $user->rights->projet->creer) + /*if ($conf->projet->enabled && $user->rights->projet->creer) { print ''.$langs->trans("AddProject").''."\n"; - } + }*/ if ($user->rights->societe->supprimer) { @@ -1879,8 +1880,7 @@ else $somethingshown=$formfile->show_documents('company',$soc->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$soc->default_lang); print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("Name").''; - print ''; + print ''; print img_edit(); print ''; + print ''; print img_object($langs->trans("Rendez-Vous"),"action"); print ''; - print '
'; @@ -1892,11 +1892,11 @@ else // Contacts list if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - $result=show_contacts($conf,$langs,$db,$soc); + $result=show_contacts($conf,$langs,$db,$soc,$_SERVER["PHP_SELF"].'?socid='.$soc->id); } // Projects list - $result=show_projects($conf,$langs,$db,$soc); + $result=show_projects($conf,$langs,$db,$soc,$_SERVER["PHP_SELF"].'?socid='.$soc->id); } }