diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index a5038fc2e78..444f4a1b55d 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -33,14 +33,93 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); +$action=GETPOST('action','alpha'); +$massaction=GETPOST('massaction','alpha'); +$show_files=GETPOST('show_files','int'); +$confirm=GETPOST('confirm','alpha'); +$toselect = GETPOST('toselect', 'array'); + +$statut=GETPOST('statut')?GETPOST('statut', 'alpha'):'opened'; // 'all' or ''='opened' +$optioncss = GETPOST('optioncss','alpha'); + // Security check if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'banque'); -$statut=GETPOST('statut'); +$diroutputmassaction=$conf->banque->dir_output . '/temp/massgeneration/'.$user->id; + +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='b.label'; +if (! $sortorder) $sortorder='ASC'; + +// Initialize technical object to manage context to save list fields +$contextpage='bankaccountlist'; + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array($contextpage)); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('bankaccount'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'b.ref'=>'Ref', + 'b.label'=>'Label', +); + +$checkedtypetiers=0; +$arrayfields=array( + 'b.ref'=>array('label'=>$langs->trans("BankAccounts"), 'checked'=>1), + 'accountype'=>array('label'=>$langs->trans("AccountType"), 'checked'=>1), + 'b.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), + 'b.number'=>array('label'=>$langs->trans("AccountIdShort"), 'checked'=>1), + 'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1), + 'b.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'b.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'b.clos'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>1010), +); +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } +} +/* + * Actions + */ +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +// Purge search criteria +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +{ + $statut = 'all'; + +} + + + /* * View */ @@ -50,11 +129,48 @@ $title=$langs->trans('BankAccounts'); // Load array of financial accounts (opened by default) $accounts = array(); -$sql = "SELECT rowid, courant, rappro"; -$sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; +$sql = "SELECT rowid, label, courant, rappro"; +// Add fields from extrafields +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bankcacount_extrafields as ef on (c.rowid = ef.fk_object)"; $sql.= " WHERE entity IN (".getEntity('bank_account', 1).")"; -if ($statut != 'all') $sql.= " AND clos = 0"; -$sql.= $db->order('label', 'ASC'); +if ($statut == 'opened') $sql.= " AND clos = 0"; +if ($statut == 'closed') $sql.= " AND clos = 1"; + +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; + +$sql.= $db->order($sortfield,$sortorder); + +// Count total nb of records +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + +$sql.= $db->plimit($limit + 1,$offset); $resql = $db->query($sql); if ($resql) @@ -70,38 +186,212 @@ if ($resql) $db->free($resql); } -$nbtotalofrecords = $num; $help_url='EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas'; llxHeader('',$title,$help_url); $link=''; -if ($statut == '') $link=''.$langs->trans("IncludeClosedAccount").''; -if ($statut == 'all') $link=''.$langs->trans("OnlyOpenedAccount").''; - -print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$link,$num,$nbtotalofrecords,'title_bank.png',0,'','',$limit, 1); +$num_rows = count($accounts); -/* - * Comptes courants (courant = 1) - */ -print ''; -print ''; -print ''; -print ''; +$arrayofselected=is_array($toselect)?$toselect:array(); + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($statut != '') $param.='&statut='.$statut; +if ($show_files) $param.='&show_files=' .$show_files; +if ($optioncss != '') $param.='&optioncss='.$optioncss; +// Add $param from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); +} + +// List of mass actions available +$arrayofmassactions = array( +// 'presend'=>$langs->trans("SendByMail"), +// 'builddoc'=>$langs->trans("PDFMerge"), +); +if ($user->rights->banque->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); +if ($massaction == 'presend') $arrayofmassactions=array(); +$massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + +// Lines of title fields +print ''; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_bank.png',0,'','',$limit, 1); + + +if ($sall) +{ + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); +} + +$moreforfilter=''; + + +// Bank accounts +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook +if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; +else $moreforfilter = $hookmanager->resPrint; + +if (! empty($moreforfilter)) +{ + print '
'; + print $moreforfilter; + print '
'; +} + +$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; +//$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + +print '
'.$langs->trans("CurrentAccounts").''.$langs->trans("Bank").''.$langs->trans("AccountIdShort").'
'."\n"; + +// Fields title +print ''; +if (! empty($arrayfields['b.ref']['checked'])) print_liste_field_titre($arrayfields['b.ref']['label'],$_SERVER["PHP_SELF"],'b.ref','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titre($arrayfields['accountype']['label'],$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['b.label']['checked'])) print_liste_field_titre($arrayfields['b.label']['label'],$_SERVER["PHP_SELF"],'b.label','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'],$_SERVER["PHP_SELF"],'b.number','',$param,'',$sortfield,$sortorder); print ''; print ''; print ''; +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } +} +// Hook fields +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; + +print ''; +// Ref +if (! empty($arrayfields['b.ref']['checked'])) +{ + print ''; +} +// Account type +if (! empty($arrayfields['accountype']['checked'])) +{ + print ''; +} +// Ref +if (! empty($arrayfields['b.label']['checked'])) +{ + print ''; +} +// Number +if (! empty($arrayfields['b.number']['checked'])) +{ + print ''; +} +// Transactions to reconcile +if (! empty($arrayfields['toreconcile']['checked'])) +{ + print ''; +} +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } +} +// Fields from hook +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Date creation +if (! empty($arrayfields['b.datec']['checked'])) +{ + print ''; +} +// Date modification +if (! empty($arrayfields['b.tms']['checked'])) +{ + print ''; +} +// Statut +if (! empty($arrayfields['b.clos']['checked'])) +{ + print ''; +} +// Balance +print ''; +// Action column +print ''; +print ''; + + + $total = array(); $found = 0; $var=true; foreach ($accounts as $key=>$type) { - if ($type == 1) - { + //if ($type == 1) + //{ $found++; $acc = new Account($db); @@ -110,8 +400,16 @@ foreach ($accounts as $key=>$type) $var = !$var; $solde = $acc->solde(1); + + + + print ''; print ''; + print ''; print ''; print ''; print ''; - print ''; - - $total[$acc->currency_code] += $solde; - } -} -if (! $found) print ''; -// Total -foreach ($total as $key=>$solde) -{ - print ''; -} - -print '
'.$langs->trans("TransactionsToConciliate").''.$langs->trans("Status").''.$langs->trans("BankBalance").'
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; + print ''; + print ''; + $array=array( + 'opened'=>$langs->trans("Opened"), + 'closed'=>$langs->trans("Closed") + ); + print $form->selectarray("statut", $array, $statut, 1); + print ''; +$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); +print $searchpitco; +print '
'.$acc->getNomUrl(1).''; + print $langs->trans("CashAccounts"); + print $acc->type_lib[$acc->type]; + print ''.$acc->bank.''.$acc->number.''; @@ -131,143 +429,35 @@ foreach ($accounts as $key=>$type) print ''; print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print '
'.$langs->trans("None").'
'.$langs->trans("Total").' '.$key.''.price($solde, 0, $langs, 0, 0, -1, $key).'
'; -print '
'; - -/* - * Comptes caisse/liquide (courant = 2) - */ -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - -$total = array(); $found = 0; -$var=true; -foreach ($accounts as $key=>$type) -{ - if ($type == 2) - { - $found++; - - $acc = new Account($db); - $acc->fetch($key); - - $var = !$var; - $solde = $acc->solde(1); - - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $total[$acc->currency_code] += $solde; - } -} -if (! $found) -{ - $var = !$var; - print ''; -} -// Total -foreach ($total as $key=>$solde) -{ - print ''; -} - -print '
'.$langs->trans("CashAccounts").'   '.$langs->trans("Status").''.$langs->trans("BankBalance").'
'.$acc->getNomUrl(1).''.$acc->bank.'  '.$acc->getLibStatut(2).''; - print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; - print '
'.$langs->trans("None").'
'.$langs->trans("Total").' '.$key.''.price($solde, 0, $langs, 0, 0, -1, $key).'
'; -print '
'; - -/* - * Comptes placements (courant = 0) - */ -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - -$total = array(); $found = 0; -$var=true; -foreach ($accounts as $key=>$type) -{ - if ($type == 0) - { - $found++; - - $acc = new Account($db); - $acc->fetch($key); - - $var = !$var; - $solde = $acc->solde(1); - - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if (! $i) $totalarray['nbfield']++; + print ''; $total[$acc->currency_code] += $solde; - } -} -if (! $found) -{ - $var = !$var; - print ''; + //} } +if (! $found) print ''; // Total foreach ($total as $key=>$solde) { - print ''; + print ''; } -print "
'.$langs->trans("SavingAccounts").''.$langs->trans("Bank").''.$langs->trans("Numero").''.$langs->trans("TransactionsToConciliate").''.$langs->trans("Status").''.$langs->trans("BankBalance").'
'.$acc->getNomUrl(1).''.$acc->bank.''.$acc->number.''; - if ($acc->rappro) + + // Action column + print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { - $result=$acc->load_board($user,$acc->id); - if ($result<0) { - setEventMessages($acc->error, $acc->errors, 'errors'); - } else { - print $result->nbtodo; - if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')'; - } + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; } - else print $langs->trans("FeatureDisabled"); - print ''.$acc->getLibStatut(2).''; - print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print '
'.$langs->trans("None").'
'.$langs->trans("None").'
'.$langs->trans("Total").' '.$key.''.price($solde, 0, $langs, 0, 0, -1, $key).'
'.$langs->trans("Total").' '.$key.''.price($solde, 0, $langs, 0, 0, -1, $key).'
"; +print ''; /* - * Boutons d'actions + * Buttons actions */ print '
'."\n"; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 8b466d655b3..a2384158926 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -383,16 +383,6 @@ if ($resql) $moreforfilter=''; - // If the user can view thirdparties other than his' - if ($user->rights->societe->client->voir || $socid) - { - $langs->load("commercial"); - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300'); - $moreforfilter.='
'; - } - // If the user can view user other than himself $moreforfilter.='
'; $moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': '; @@ -411,6 +401,16 @@ if ($resql) $moreforfilter.='
'; } + // If the user can view thirdparties other than his' + if ($user->rights->societe->client->voir || $socid) + { + $langs->load("commercial"); + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; + $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300'); + $moreforfilter.='
'; + } + if (! empty($moreforfilter)) { print '
'; @@ -586,7 +586,9 @@ if ($resql) print ''."\n"; - $i = 0; + $i=0; + $var=true; + $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); @@ -612,6 +614,7 @@ if ($resql) print $projectstatic->getNomUrl(1); if ($projectstatic->hasDelay()) print img_warning($langs->trans('Late')); print ''; + if (! $i) $totalarray['nbfield']++; } // Title if (! empty($arrayfields['p.title']['checked'])) @@ -619,6 +622,7 @@ if ($resql) print ''; print dol_trunc($obj->title,80); print ''; + if (! $i) $totalarray['nbfield']++; } // Company if (! empty($arrayfields['s.nom']['checked'])) @@ -635,6 +639,7 @@ if ($resql) print ' '; } print ''; + if (! $i) $totalarray['nbfield']++; } // Sales Representatives if (! empty($arrayfields['commercial']['checked'])) @@ -676,6 +681,7 @@ if ($resql) print ' '; } print ''; + if (! $i) $totalarray['nbfield']++; } // Date start if (! empty($arrayfields['p.dateo']['checked'])) @@ -683,13 +689,15 @@ if ($resql) print ''; print dol_print_date($db->jdate($obj->date_start),'day'); print ''; - } + if (! $i) $totalarray['nbfield']++; + } // Date end if (! empty($arrayfields['p.datee']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_end),'day'); print ''; + if (! $i) $totalarray['nbfield']++; } // Visibility if (! empty($arrayfields['p.public']['checked'])) @@ -698,31 +706,46 @@ if ($resql) if ($obj->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print ''; + if (! $i) $totalarray['nbfield']++; } // Amount if (! empty($arrayfields['p.opp_amount']['checked'])) { print ''; - if ($obj->opp_status_code) print price($obj->opp_amount, 1, '', 1, -1, -1, ''); + if ($obj->opp_status_code) + { + print price($obj->opp_amount, 1, '', 1, -1, -1, ''); + $totalarray['totalopp'] += $obj->opp_amount; + } print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield']; } if (! empty($arrayfields['p.fk_opp_status']['checked'])) { print ''; if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code); print ''; - } + if (! $i) $totalarray['nbfield']++; + } if (! empty($arrayfields['p.opp_percent']['checked'])) { print ''; if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%'; print ''; - } + if (! $i) $totalarray['nbfield']++; + } if (! empty($arrayfields['p.budget_amount']['checked'])) { print ''; - if ($obj->budget_amount != '') print price($obj->budget_amount, 1, '', 1, -1, -1); + if ($obj->budget_amount != '') + { + print price($obj->budget_amount, 1, '', 1, -1, -1); + $totalarray['totalbudget'] += $obj->budget_amount; + } print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalbudgetfield']=$totalarray['nbfield']; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) @@ -740,6 +763,7 @@ if ($resql) print ''; } } + if (! $i) $totalarray['nbfield']++; } // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); @@ -751,6 +775,7 @@ if ($resql) print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); print ''; + if (! $i) $totalarray['nbfield']++; } // Date modification if (! empty($arrayfields['p.tms']['checked'])) @@ -758,16 +783,26 @@ if ($resql) print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour'); print ''; + if (! $i) $totalarray['nbfield']++; } // Status if (! empty($arrayfields['p.fk_statut']['checked'])) { $projectstatic->statut = $obj->fk_statut; print ''.$projectstatic->getLibStatut(5).''; + if (! $i) $totalarray['nbfield']++; } - // Action column - print ''; - + // Action column + print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print ''; + if (! $i) $totalarray['nbfield']++; + print "\n"; } @@ -775,6 +810,27 @@ if ($resql) $i++; } + + // Show total line + if (isset($totalarray['totaloppfield']) || isset($totalarray['totalbudgetfield'])) + { + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if ($i == 1) + { + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; + } + elseif ($totalarray['totaloppfield'] == $i) print ''.price($totalarray['totalopp']).''; + elseif ($totalarray['totalbudgetfield'] == $i) print ''.price($totalarray['totalbudget']).''; + else print ''; + } + print ''; + } + $db->free($resql); $parameters=array('sql' => $sql); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f32685f6eeb..bf5a0e66085 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2773,6 +2773,9 @@ tr.liste_titre_topborder td { .liste_titre td a.notasortlink { color: rgb(); } +.liste_titre td a.notasortlink:hover { + background: transparent; +} tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre_sel, form.liste_titre_sel div { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fb0a8d972b2..4c790b20d44 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2638,6 +2638,9 @@ tr.liste_titre_topborder td { .liste_titre td a.notasortlink { color: rgb(); } +.liste_titre td a.notasortlink:hover { + background: transparent; +} div.liste_titre { padding-left: 3px; }