diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index d66bffefe10..ad59e64e89f 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -67,7 +67,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $refreshaction='refresh_'.$this->boxcode; include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; - $facturestatic=new Facture($db); $text = $langs->trans("BoxSuppliersInvoicesPerMonth",$max); $this->info_box_head = array( diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index f54fc336577..23e701af36e 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -67,7 +67,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $refreshaction='refresh_'.$this->boxcode; include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; - $facturestatic=new Facture($db); $text = $langs->trans("BoxSuppliersOrdersPerMonth",$max); $this->info_box_head = array( diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c45d2c7c999..eb92f7f66b0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -140,7 +140,7 @@ class FormFile if (empty($sectionid)) $out .= '
'; $out .= "\n\n\n"; - $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url); + $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm); $res = $hookmanager->executeHooks('formattachOptions',$parameters,$object); if (empty($res)) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a058b129d49..9ce429a318d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -86,7 +86,24 @@ function societe_prepare_head($object) if ($user->societe_id == 0) { - // Notes + if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Referers"); + $head[$h][2] = 'consumption'; + $h++; + } + + // Notifications + if (! empty($conf->notification->enabled)) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Notifications"); + $head[$h][2] = 'notify'; + $h++; + } + + // Notes $nbNote = 0; if(!empty($object->note_private)) $nbNote++; if(!empty($object->note_public)) $nbNote++; @@ -96,32 +113,15 @@ function societe_prepare_head($object) $head[$h][2] = 'note'; $h++; - if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) - { - $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Referers"); - $head[$h][2] = 'consumption'; - $h++; - } - // Attached files require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id; + $upload_dir = $conf->societe->dir_output . "/" . $object->id; $nbFiles = count(dol_dir_list($upload_dir)); $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'document'; $h++; - - // Notifications - if (! empty($conf->notification->enabled)) - { - $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Notifications"); - $head[$h][2] = 'notify'; - $h++; - } } // Log diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index f4359e17b6b..a116f2d851f 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -55,14 +55,22 @@ function contract_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id; - $head[$h][1] = $langs->trans("Note"); + $head[$h][1] = $langs->trans("Notes"); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files')); $head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 6a3187fb5fb..4b437d46e34 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -67,14 +67,22 @@ function fichinter_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->ficheinter->dir_output . "/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files')); $head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 5e3b2a7f91b..d318ceed8ad 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -58,18 +58,22 @@ function facturefourn_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$object->id; $head[$h][1] = $langs->trans('Notes'); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$object->ref; + $nbFiles = count(dol_dir_list($upload_dir,'files')); $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id; - /*$filesdir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($fac->id,2).$fac->id; - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listoffiles=dol_dir_list($filesdir,'files',1); - $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'documents'; $h++; @@ -126,18 +130,22 @@ function ordersupplier_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files')); $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id; - /*$filesdir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listoffiles=dol_dir_list($filesdir,'files',1); - $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 75b1bc95d00..3ad2787826f 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -74,18 +74,22 @@ function facture_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; $head[$h][1] = $langs->trans('Notes'); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files')); $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id; - /*$filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listoffiles=dol_dir_list($filesdir,'files',1); - $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index b7de009663e..25fa766aa3d 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -82,22 +82,26 @@ function commande_prepare_head($object) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf,$langs,$object,$head,$h,'order'); - $head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id; - /*$filesdir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listoffiles=dol_dir_list($filesdir,'files',1); - $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/ - $head[$h][1] = $langs->trans('Documents'); - $head[$h][2] = 'documents'; - $h++; - if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files')); + $head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + $head[$h][2] = 'documents'; + $h++; $head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$object->id; $head[$h][1] = $langs->trans("Info"); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 52978d65349..3e257b1c4a6 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -64,20 +64,27 @@ function project_prepare_head($object) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf,$langs,$object,$head,$h,'project'); + if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; + $head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + $head[$h][2] = 'notes'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files')); $head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id; - /*$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listoffiles=dol_dir_list($filesdir,'files',1); - $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'document'; $h++; - - $head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id; - $head[$h][1] = $langs->trans('Notes'); - $head[$h][2] = 'notes'; - $h++; - + // Then tab for sub level of projet, i mean tasks $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id; $head[$h][1] = $langs->trans("Tasks"); diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index db011bf3fad..34ab3bb5355 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -78,18 +78,22 @@ function propal_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files')); $head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id; - /*$filesdir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($propal->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listoffiles=dol_dir_list($filesdir,'files',1); - $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 9ab82a297fd..11551fcb8d0 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -166,10 +166,10 @@ class modBanque extends DolibarrModules $this->export_label[$r]='Bordereaux remise Chq/Fact'; $this->export_permission[$r]=array(array("banque","export")); $this->export_fields_array[$r]=array('ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation", - "bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","bch.date_bordereau"=>"DateBordereau","bch.number"=>"NumeroBordereau","bch.amount"=>"TotalBordereau","bch.nbcheque"=>"NbCheque","f.facnumber"=>"NumFacture" + "bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","bch.date_bordereau"=>"DateBordereau","bch.number"=>"NumeroBordereau","bch.ref_ext"=>"RefExt","bch.amount"=>"TotalBordereau","bch.nbcheque"=>"NbCheque","f.facnumber"=>"NumFacture" ); $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.num_chq'=>'Text','b.amount'=>'Number','b.num_releve'=>'Text','b.datec'=>"Date", - "bu.url_id"=>"Text","s.nom"=>"Text","bch.date_bordereau"=>"Date","bch.number"=>"Text","bch.amount"=>"Number","bch.nbcheque"=>"NumBer","f.facnumber"=>"Text" + "bu.url_id"=>"Text","s.nom"=>"Text","bch.date_bordereau"=>"Date","bch.number"=>"Number","bch.ref_ext"=>"Text","bch.amount"=>"Number","bch.nbcheque"=>"NumBer","f.facnumber"=>"Text" ); $this->export_entities_array[$r]=array('ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.num_chq'=>'account','b.amount'=>'account','b.num_releve'=>'account','b.datec'=>"account", "bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company","f.facnumber"=>"bill"); diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index d23ddf821ea..b7687199f7b 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -89,6 +89,8 @@ FirstDayOfHoliday=Premier jour de congés LastDayOfHoliday=Dernier jour de congés HolidaysMonthlyUpdate=Mise à jour mensuelle ManualUpdate=Mise à jour manuelle +Morning=Matin +Afternoon=Après-midi ## Configuration du Module ## ConfCP=Configuration du module Congés diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 9bf75d0a332..bb12125a345 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -158,7 +158,7 @@ $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; if ($agentid > 0) - $sql.= " GROUP BY s.rowid"; + $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname, f.type"; else $sql.= " GROUP BY u.rowid, s.nom, s.rowid, s.code_client, s.client, u.login, u.lastname, u.firstname, f.type "; $sql.= " ORDER BY $sortfield $sortorder "; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 9ce32a701cb..67bf8cef506 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -86,7 +86,7 @@ if ($socid > 0) { { print ''.$langs->trans('ThirdPartyName').''; print ''; - $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$socid,$socid,'socid','client=1',1,0,1); + $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$socid,$socid,'socid','client=1 OR client=3',1,0,1); print ''; $client = true; @@ -97,7 +97,7 @@ if ($socid > 0) { else { print ''.$langs->trans('ThirdPartyName').''; print ''; - $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$socid,null,'socid','client=1',1,0,1); + $form->form_thirdparty($_SERVER['PHP_SELF'],null,'socid','client=1 OR client=3',1,0,1); print ''; } @@ -176,9 +176,9 @@ $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; if ($client) - $sql.= " GROUP BY f.rowid"; + $sql.= " GROUP BY f.rowid, s.rowid, s.nom, s.code_client, s.client, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.type "; else - $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid "; + $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid, f.type "; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 26aaa953d78..e50534d1f7f 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -180,9 +180,9 @@ $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; if ($id > 0) - $sql.= " GROUP BY f.rowid"; + $sql.= " GROUP BY f.rowid, d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.type"; else - $sql.= " GROUP BY d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid"; + $sql.= " GROUP BY d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid, f.type"; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); @@ -312,4 +312,4 @@ $(document).ready(function() { $("#markRate").html(""); }); - \ No newline at end of file + diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 33b83b27fae..442b31bc367 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -142,55 +142,55 @@ $listofreferent=array( 'title'=>"ListProposalsAssociatedProject", 'class'=>'Propal', 'table'=>'propal', - 'test'=>$conf->propal->enabled), + 'test'=>$conf->propal->enabled && $user->rights->propale->lire), 'order'=>array( 'title'=>"ListOrdersAssociatedProject", 'class'=>'Commande', 'table'=>'commande', - 'test'=>$conf->commande->enabled), + 'test'=>$conf->commande->enabled && $user->rights->commande->lire), 'invoice'=>array( 'title'=>"ListInvoicesAssociatedProject", 'class'=>'Facture', 'table'=>'facture', - 'test'=>$conf->facture->enabled), + 'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'invoice_predefined'=>array( 'title'=>"ListPredefinedInvoicesAssociatedProject", 'class'=>'FactureRec', 'table'=>'facture_rec', - 'test'=>$conf->facture->enabled), + 'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'order_supplier'=>array( 'title'=>"ListSupplierOrdersAssociatedProject", 'class'=>'CommandeFournisseur', 'table'=>'commande_fournisseur', - 'test'=>$conf->fournisseur->enabled), + 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire), 'invoice_supplier'=>array( 'title'=>"ListSupplierInvoicesAssociatedProject", 'class'=>'FactureFournisseur', 'table'=>'facture_fourn', - 'test'=>$conf->fournisseur->enabled), + 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire), 'contract'=>array( 'title'=>"ListContractAssociatedProject", 'class'=>'Contrat', 'table'=>'contrat', - 'test'=>$conf->contrat->enabled), + 'test'=>$conf->contrat->enabled && $user->rights->contrat->lire), 'intervention'=>array( 'title'=>"ListFichinterAssociatedProject", 'class'=>'Fichinter', 'table'=>'fichinter', 'disableamount'=>1, - 'test'=>$conf->ficheinter->enabled), + 'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire), 'trip'=>array( 'title'=>"ListTripAssociatedProject", 'class'=>'Deplacement', 'table'=>'deplacement', 'disableamount'=>1, - 'test'=>$conf->deplacement->enabled), + 'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire), 'agenda'=>array( 'title'=>"ListActionsAssociatedProject", 'class'=>'ActionComm', 'table'=>'actioncomm', 'disableamount'=>1, - 'test'=>$conf->agenda->enabled) + 'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire) ); if ($action=="addelement")