diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 8f94f29f7ca..415728cb3e9 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -163,7 +163,7 @@ if (isModEnabled("propal") && $user->hasRight("propal", "lire")) { $obj = $db->fetch_object($resql); if ($i >= $max) { - $othernb += 1; + $othernb++; $i++; $total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc); continue; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f144b97e922..cdffc5c1961 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2192,13 +2192,16 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) * @param int $status -1=No filter on statut, 0 or 1 = Filter on status * @param array $listofoppstatus List of opportunity status * @param array $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', ) + * @param int $max Max nb of record to show in HTML list * @return void */ -function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array()) +function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array(), $max = 0) { global $langs, $conf, $user; global $theme_datacolor; + $maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $listofstatus = array_keys($listofoppstatus); @@ -2229,8 +2232,6 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $title = $langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$status]); } - $arrayidtypeofcontact = array(); - print ''; print '
'; print ''; @@ -2309,11 +2310,15 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $resql = $db->query($sql2); if ($resql) { + $othernb = 0; $total_task = 0; $total_opp_amount = 0; $ponderated_opp_amount = 0; + $total_plannedworkload = 0; + $total_declaredprogressworkload = 0; $num = $db->num_rows($resql); + $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); $i = 0; print ''; @@ -2340,11 +2345,23 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks } print "\n"; - $total_plannedworkload = 0; - $total_declaredprogressworkload = 0; - while ($i < $num) { + while ($i < $nbofloop) { $objp = $db->fetch_object($resql); + if ($max && $i >= $max) { + $othernb++; + $i++; + $total_task += $objp->nb; + $total_opp_amount += $objp->opp_amount; + $opp_weighted_amount = $objp->opp_percent * $objp->opp_amount / 100; + $ponderated_opp_amount += price2num($opp_weighted_amount); + $plannedworkload = $objp->planned_workload; + $total_plannedworkload += $plannedworkload; + $declaredprogressworkload = $objp->declared_progess_workload; + $total_declaredprogressworkload += $declaredprogressworkload; + continue; + } + $projectstatic->id = $objp->projectid; $projectstatic->user_author_id = $objp->fk_user_creat; $projectstatic->public = $objp->public; @@ -2451,13 +2468,21 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print "\n"; - $total_task = $total_task + $objp->nb; - $total_opp_amount = $total_opp_amount + $objp->opp_amount; + $total_task += $objp->nb; + $total_opp_amount += $objp->opp_amount; } $i++; } + if ($othernb) { + print ''; + print ''; + print "\n"; + } + print ''; print '"; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index be215e891eb..ad03c48258b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1028,17 +1028,17 @@ if (!empty($arrayfields['f.ref_supplier']['checked'])) { if (!empty($arrayfields['f.type']['checked'])) { print ''; @@ -1065,11 +1065,11 @@ if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1543,7 +1543,7 @@ if ($num > 0) { // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1551,8 +1551,8 @@ if ($num > 0) { } // Town if (!empty($arrayfields['s.town']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -1560,7 +1560,7 @@ if ($num > 0) { } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; if (!$i) { @@ -1569,7 +1569,9 @@ if ($num > 0) { } // State if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1620,14 +1622,14 @@ if ($num > 0) { // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht'; } - $totalarray['val']['f.total_ht'] += $obj->total_ht; + $totalarray['val']['f.total_ht'] += $obj->total_ht; } // Amount VAT if (!empty($arrayfields['f.total_vat']['checked'])) { @@ -1726,7 +1728,7 @@ if ($num > 0) { // Currency if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1734,16 +1736,16 @@ if ($num > 0) { // Currency rate if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } // Amount HT if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e954f429781..4f743cc58f7 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1102,7 +1102,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print '
'; + print ''.$langs->trans("More").'...'.($othernb < $maxofloop ? ' ('.$othernb.')' : '').''; + print '
'.$langs->trans("Total")."'; $listtype = array( - FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), - FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), - FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), - FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), + FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), + FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), + FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), + FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), ); /* - if (!empty($conf->global->INVOICE_USE_SITUATION)) - { - $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); - } - */ + if (!empty($conf->global->INVOICE_USE_SITUATION)) + { + $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); + } + */ //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); print ''; print '
'; /* - print $langs->trans('From').' '; - print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); - print '
'; - print '
'; - print $langs->trans('to').' ';*/ + print $langs->trans('From').' '; + print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); + print '
'; + print '
'; + print $langs->trans('to').' ';*/ print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); print '
'.$langs->trans("Alert"); print '
'; @@ -1487,7 +1487,7 @@ if ($num > 0) { // Label if (!empty($arrayfields['f.label']['checked'])) { print '
'; - print $obj->label; + print dol_escape_htmltag($obj->label); print ''; - print $thirdparty->name_alias; + print dol_escape_htmltag($thirdparty->name_alias); print ''; - print $obj->town; + print ''; + print dol_escape_htmltag($obj->town); print ''; + print ''; print dol_escape_htmltag($obj->zip); print '".$obj->state_name."'; + print dol_escape_htmltag($obj->state_name); + print "'.price($obj->total_ht)."'.price($obj->total_ht)."'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; - $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); - print "'; + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); + print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_ht)."
'.$langs->trans("OpportunityStatus").''; print '
'; - print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 1, 1); + print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1); // Opportunity probability print ' %'; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 2698a4b1a21..27885de31b9 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -193,9 +193,8 @@ print '
'; */ include DOL_DOCUMENT_ROOT.'/projet/graph_opportunities.inc.php'; - // List of draft projects -print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppstatus, array('projectlabel', 'plannedworkload', 'declaredprogress', 'prospectionstatus', 'projectstatus')); +print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppstatus, array('projectlabel', 'plannedworkload', 'declaredprogress', 'prospectionstatus', 'projectstatus'), $max); print '
';