NEW Can change dynamically number of records visible into lists.
This commit is contained in:
parent
e67be201ed
commit
bc33b19d7d
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -32,19 +32,20 @@ $langs->load("members");
|
||||
|
||||
$filter=$_GET["filter"];
|
||||
$statut=isset($_GET["statut"])?$_GET["statut"]:1;
|
||||
$search_ref=GETPOST('search_ref');
|
||||
$search_lastname=GETPOST('search_lastname');
|
||||
$search_login=GETPOST('search_login');
|
||||
$search_note=GETPOST('search_note');
|
||||
$search_ref=GETPOST('search_ref','alpha');
|
||||
$search_lastname=GETPOST('search_lastname','alpha');
|
||||
$search_login=GETPOST('search_login','alpha');
|
||||
$search_note=GETPOST('search_note','alpha');
|
||||
$search_account=GETPOST('search_account','int');
|
||||
$search_amount=GETPOST('search_amount','int');
|
||||
$search_amount=GETPOST('search_amount','alpha');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
$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 = $conf->liste_limit * $page ;
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
@ -101,28 +102,21 @@ if ($search_ref)
|
||||
if (is_numeric($search_ref)) $sql.= " AND (c.rowid = ".$db->escape($search_ref).")";
|
||||
else $sql.=" AND 1 = 2"; // Always wrong
|
||||
}
|
||||
if ($search_lastname)
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$db->escape($search_lastname)."%' OR d.lastname LIKE '%".$db->escape($search_lastname)."%' OR d.societe LIKE '%".$db->escape($search_lastname)."%')";
|
||||
}
|
||||
if ($search_login)
|
||||
{
|
||||
$sql.= " AND d.login LIKE '%".$db->escape($search_login)."%'";
|
||||
}
|
||||
if ($search_note)
|
||||
{
|
||||
$sql.= " AND c.note LIKE '%".$db->escape($search_note)."%'";
|
||||
}
|
||||
if ($search_account > 0)
|
||||
{
|
||||
$sql.= " AND b.fk_account = ".$search_account;
|
||||
}
|
||||
if ($search_amount)
|
||||
{
|
||||
$sql.=" AND c.cotisation = ".$db->escape($search_amount);
|
||||
}
|
||||
if ($search_lastname) $sql.= natural_search(array('d.firstname','d.lastname','d.societe'), $search_lastname);
|
||||
if ($search_login) $sql.= natural_search('c.cotisation', $search_login);
|
||||
if ($search_note) $sql.= natural_search('c.note', $search_note);
|
||||
if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
|
||||
if ($search_amount) $sql.= natural_search('c.cotisation', $search_amount, 1);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$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);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@ -133,24 +127,29 @@ if ($result)
|
||||
$title=$langs->trans("ListOfSubscriptions");
|
||||
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
|
||||
|
||||
$param="";
|
||||
$param='';
|
||||
$param.="&statut=$statut&date_select=$date_select";
|
||||
|
||||
if ($search_lastname) $param.="&search_lastname=".$search_lastname;
|
||||
if ($search_login) $param.="&search_login=".$search_login;
|
||||
if ($search_acount) $param.="&search_account=".$search_account;
|
||||
if ($search_amount) $param.="&search_amount=".$search_amount;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
||||
}
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -164,7 +163,8 @@ if ($result)
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.cotisation",$param,"",'colspan="2" align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.cotisation",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ if ($result)
|
||||
print '</td>';
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre" colspan="2" align="right">';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
@ -270,7 +270,9 @@ if ($result)
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
|
||||
|
||||
// Price
|
||||
print '<td align="right" colspan="2">'.price($objp->cotisation).'</td>';
|
||||
print '<td align="right">'.price($objp->cotisation).'</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>";
|
||||
|
||||
@ -290,7 +292,8 @@ if ($result)
|
||||
}
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="right" colspan="2">'.price($total)."</td>\n";
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -50,11 +50,12 @@ $catid = GETPOST("catid",'int');
|
||||
$sall=GETPOST("sall");
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
$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 = $conf->liste_limit * $page ;
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder=($filter=='outofdate'?"ASC":"DESC"); }
|
||||
@ -143,6 +144,7 @@ if ($filter == 'outofdate') $sql.=" AND (datefin IS NULL OR datefin < '".$db->id
|
||||
$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 with no order and no limits
|
||||
$nbtotalofrecords = 0;
|
||||
@ -152,9 +154,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
if ($resql) $nbtotalofrecords = $db->num_rows($resql);
|
||||
else dol_print_error($db);
|
||||
}
|
||||
// Add order and limit
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
// Add limit
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
dol_syslog("get list", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
@ -185,7 +186,8 @@ if ($resql)
|
||||
$titre.=" (".$membertype->libelle.")";
|
||||
}
|
||||
|
||||
$param="";
|
||||
$param='';
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($statut != "") $param.="&statut=".$statut;
|
||||
if ($search_nom) $param.="&search_nom=".$search_nom;
|
||||
if ($search_login) $param.="&search_login=".$search_login;
|
||||
@ -193,12 +195,17 @@ if ($resql)
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
if ($type > 0) $param.="&type=".$type;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
@ -396,10 +403,7 @@ if ($resql)
|
||||
print "</table>\n";
|
||||
print '</form>';
|
||||
|
||||
if ($num > $conf->liste_limit)
|
||||
{
|
||||
print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'');
|
||||
}
|
||||
if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -72,11 +72,11 @@ if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
|
||||
$filtert=$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 ; }
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder)
|
||||
{
|
||||
@ -142,20 +142,8 @@ $form=new Form($db);
|
||||
$userstatic=new User($db);
|
||||
|
||||
$nav='';
|
||||
$nav.='<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
if ($optioncss != '') $nav.= '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">';
|
||||
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
|
||||
if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
|
||||
if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
if ($showbirthday) $nav.='<input type="hidden" name="showbirthday" value="1">';
|
||||
if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
|
||||
if ($type) $nav.='<input type="hidden" name="type" value="'.$type.'">';
|
||||
if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
||||
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
|
||||
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
|
||||
$nav.='</form>';
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
@ -166,6 +154,7 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
$listofextcals=array();
|
||||
|
||||
$param='';
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($actioncode != '') $param.="&actioncode=".$actioncode;
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
@ -220,6 +209,14 @@ if ($dateselect > 0) $sql.= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AN
|
||||
if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'";
|
||||
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$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);
|
||||
//print $sql;
|
||||
|
||||
@ -279,13 +276,30 @@ if ($resql)
|
||||
$s = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav);
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?'.$param.'">'."\n";
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
$nav='';
|
||||
if ($optioncss != '') $nav.= '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">';
|
||||
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
|
||||
if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
|
||||
if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
if ($showbirthday) $nav.='<input type="hidden" name="showbirthday" value="1">';
|
||||
if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
|
||||
if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
||||
print $nav;
|
||||
|
||||
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, -1 * $nbtotalofrecords, '', 0, $nav, '', $limit);
|
||||
|
||||
$i = 0;
|
||||
$i = 0;
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
|
||||
@ -242,10 +242,10 @@ $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
|
||||
|
||||
$tmpday = $first_day;
|
||||
|
||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a>\n";
|
||||
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week;
|
||||
$nav.=" </span>\n";
|
||||
$nav.="<a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
|
||||
$nav.="<a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>\n";
|
||||
$nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||
$picto='calendarweek';
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -37,11 +37,11 @@ $action=GETPOST('action','alpha');
|
||||
$month=GETPOST('month');
|
||||
$year=GETPOST('year');
|
||||
|
||||
$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 ; }
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="a.datep";
|
||||
@ -84,6 +84,14 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
|
||||
//$sql.= " AND percent = 100";
|
||||
$sql.= " GROUP BY year, month, df";
|
||||
$sql.= " ORDER BY year DESC, month DESC, df DESC";
|
||||
|
||||
$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);
|
||||
|
||||
//print $sql;
|
||||
@ -93,7 +101,18 @@ if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print_barre_liste($langs->trans("Actions"), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num);
|
||||
$param='';
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
print_barre_liste($langs->trans("Actions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -143,6 +162,9 @@ if ($resql)
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
print '</form>';
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
@ -42,14 +42,16 @@ $langs->load("margins");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque');
|
||||
|
||||
$description=GETPOST("description");
|
||||
$debit=GETPOST("debit");
|
||||
$credit=GETPOST("credit");
|
||||
$type=GETPOST("type");
|
||||
$account=GETPOST("account");
|
||||
$description=GETPOST("description",'alpha');
|
||||
$debit=GETPOST("debit",'alpha');
|
||||
$credit=GETPOST("credit",'alpha');
|
||||
$type=GETPOST("type",'alpha');
|
||||
$account=GETPOST("account",'alpha');
|
||||
$bid=GETPOST("bid","int");
|
||||
$search_dt_start = dol_mktime(0, 0, 0, GETPOST('search_start_dtmonth', 'int'), GETPOST('search_start_dtday', 'int'), GETPOST('search_start_dtyear', 'int'));
|
||||
$search_dt_end = dol_mktime(0, 0, 0, GETPOST('search_end_dtmonth', 'int'), GETPOST('search_end_dtday', 'int'), GETPOST('search_end_dtyear', 'int'));
|
||||
$search_thirdparty=GETPOST("thirdparty",'alpha');
|
||||
$search_req_nb=GETPOST("req_nb",'alpha');
|
||||
|
||||
$param='';
|
||||
if (!empty($description)) $param.='&description='.$description;
|
||||
@ -63,14 +65,14 @@ if (dol_strlen($search_dt_start) > 0)
|
||||
if (dol_strlen($search_dt_end) > 0)
|
||||
$param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int');
|
||||
|
||||
$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 = $conf->liste_limit * $page;
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='b.dateo';
|
||||
|
||||
@ -82,6 +84,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$credit="";
|
||||
$account="";
|
||||
$bid="";
|
||||
$search_req_nb='';
|
||||
$search_thirdparty='';
|
||||
}
|
||||
|
||||
/*
|
||||
@ -111,15 +115,15 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
|
||||
$sql.= " WHERE b.fk_account = ba.rowid";
|
||||
$sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")";
|
||||
if (GETPOST("req_nb"))
|
||||
if ($search_req_nb)
|
||||
{
|
||||
$sql.= " AND b.num_chq LIKE '%".$db->escape(GETPOST("req_nb"))."%'";
|
||||
$param.='&req_nb='.urlencode(GETPOST("req_nb"));
|
||||
$sql.= " AND b.num_chq LIKE '%".$db->escape($search_req_nb)."%'";
|
||||
$param.='&req_nb='.urlencode($search_req_nb);
|
||||
}
|
||||
if (GETPOST("thirdparty"))
|
||||
if ($search_thirdparty)
|
||||
{
|
||||
$sql.=" AND s.nom LIKE '%".$db->escape(GETPOST("thirdparty"))."%'";
|
||||
$param.='&thirdparty='.urlencode(GETPOST("thirdparty"));
|
||||
$sql.=" AND s.nom LIKE '%".$db->escape($search_thirdparty)."%'";
|
||||
$param.='&thirdparty='.urlencode($search_thirdparty);
|
||||
}
|
||||
if ($bid)
|
||||
{
|
||||
@ -137,22 +141,19 @@ if (dol_strlen($search_dt_end)>0) {
|
||||
$sql .= " AND b.dateo <= '" . $db->idate($search_dt_end) . "'";
|
||||
}
|
||||
// Search criteria amount
|
||||
$si=0;
|
||||
$debit = price2num(str_replace('-','',$debit));
|
||||
$credit = price2num(str_replace('-','',$credit));
|
||||
if (is_numeric($debit)) {
|
||||
$si++;
|
||||
$sqlw[$si] .= " b.amount = -" . $debit;
|
||||
}
|
||||
if (is_numeric($credit)) {
|
||||
$si++;
|
||||
$sqlw[$si] .= " b.amount = " . $credit;
|
||||
}
|
||||
// Other search criteria
|
||||
for ($i = 1 ; $i <= $si; $i++) {
|
||||
$sql .= " AND " . $sqlw[$i];
|
||||
}
|
||||
if ($debit) $sql.= natural_search('- b.amount', $debit, 1);
|
||||
if ($credit) $sql.= natural_search('b.amount', $credit, 1);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$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);
|
||||
//print $sql;
|
||||
|
||||
@ -164,25 +165,30 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="search_form">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
print '<input type="hidden" name="action" value="search">';
|
||||
if (! empty($_REQUEST['bid'])) print '<input type="hidden" name="bid" value="'.$_REQUEST["bid"].'">';
|
||||
|
||||
// Title
|
||||
$bankcateg=new BankCateg($db);
|
||||
if (GETPOST("bid"))
|
||||
{
|
||||
$result=$bankcateg->fetch(GETPOST("bid"));
|
||||
print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,'', 'title_bank.png');
|
||||
print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_bank.png', 0, '', '', $limit);
|
||||
}
|
||||
else
|
||||
{
|
||||
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', 'title_bank.png');
|
||||
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_bank.png', 0, '', '', $limit);
|
||||
}
|
||||
|
||||
print '<form method="post" action="search.php" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
||||
print '<input type="hidden" name="action" value="search">';
|
||||
if (! empty($_REQUEST['bid'])) print '<input type="hidden" name="bid" value="'.$_REQUEST["bid"].'">';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('StartDate') . ' ';
|
||||
$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
|
||||
@ -209,6 +215,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Debit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -218,17 +225,18 @@ if ($resql)
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="req_nb" value="'.GETPOST("req_nb").'" size="2"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="req_nb" value="'.$search_req_nb.'" size="2"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="description" size="10" value="'.$description.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="thirdparty" value="'.GETPOST("thirdparty").'" size="10"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="thirdparty" value="'.$search_thirdparty.'" size="10"></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="text" class="flat" name="debit" size="4" value="'.$debit.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="text" class="flat" name="credit" size="4" value="'.$credit.'">';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
@ -325,6 +333,9 @@ if ($resql)
|
||||
$bankaccountstatic->label=$objp->bankref;
|
||||
print $bankaccountstatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>";
|
||||
}
|
||||
$i++;
|
||||
@ -336,6 +347,7 @@ if ($resql)
|
||||
print '<td align="right">' . price($total_debit * - 1) . '</td>';
|
||||
print '<td align="right">' . price($total_credit) . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -38,12 +38,13 @@ $langs->load("bills");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'banque', '','');
|
||||
|
||||
$search_ref = GETPOST('search_ref','int');
|
||||
$search_ref = GETPOST('search_ref','alpha');
|
||||
$search_account = GETPOST('search_account','int');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
@ -101,6 +102,7 @@ else if ($year > 0)
|
||||
{
|
||||
$sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -109,29 +111,36 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= " ORDER BY $sortfield $sortorder";
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
//print "$sql";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$params='';
|
||||
$param='';
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_bank.png', '', '', $limit);
|
||||
|
||||
print '<table class="liste">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bc.number","",$params,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"dp","",$params,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$params,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NbOfCheques"),$_SERVER["PHP_SELF"],"bc.nbcheque","",$params,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"bc.amount","",$params,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"bc.statut","",$params,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bc.number","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NbOfCheques"),$_SERVER["PHP_SELF"],"bc.nbcheque","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"bc.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"bc.statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -151,6 +160,7 @@ if ($resql)
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="6" name="search_amount" value="'.$search_amount.'">';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
@ -192,7 +202,11 @@ if ($resql)
|
||||
// Statut
|
||||
print '<td align="right">';
|
||||
print $checkdepositstatic->LibStatut($objp->statut,5);
|
||||
print "</td></tr>\n";
|
||||
print '</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -200,7 +214,7 @@ if ($resql)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td colspan="6">'.$langs->trans("None")."</td>";
|
||||
print '<td colspan="7">'.$langs->trans("None")."</td>";
|
||||
print '</tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
@ -57,9 +57,9 @@ $search_amount=GETPOST("search_amount",'alpha'); // alpha because we must be
|
||||
$search_company=GETPOST("search_company",'alpha');
|
||||
$search_payment_num=GETPOST('search_payment_num','alpha');
|
||||
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
@ -184,6 +184,7 @@ else
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -192,12 +193,10 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
//print "$sql";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
@ -211,9 +210,16 @@ if ($resql)
|
||||
$paramlist.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):"");
|
||||
if ($optioncss != '') $paramlist.='&optioncss='.urlencode($optioncss);
|
||||
|
||||
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num, $nbtotalofrecords,'title_accountancy.png');
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num, $nbtotalofrecords,'title_accountancy.png', 0, '', '', $limit);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"p.rowid","",$paramlist,"",$sortfield,$sortorder);
|
||||
|
||||
@ -113,8 +113,8 @@ llxHeader();
|
||||
$tva = new Tva($db);
|
||||
|
||||
|
||||
$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous()."</a>";
|
||||
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next()."</a>";
|
||||
$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a>";
|
||||
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";
|
||||
|
||||
print load_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear");
|
||||
|
||||
|
||||
@ -73,7 +73,6 @@ $sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page', 'int');
|
||||
$userid=GETPOST('userid','int');
|
||||
$begin=GETPOST('begin');
|
||||
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="p.lastname";
|
||||
if ($page < 0) { $page = 0; }
|
||||
@ -333,6 +332,16 @@ $parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
// Add order
|
||||
if($view == "recent")
|
||||
{
|
||||
$sql.= $db->order("p.datec","DESC");
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
}
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -341,15 +350,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
// Add order and limit
|
||||
// Add limit
|
||||
if($view == "recent")
|
||||
{
|
||||
$sql.= $db->order("p.datec","DESC");
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
}
|
||||
|
||||
|
||||
@ -2965,7 +2965,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois
|
||||
* @param string $sortorder ordre de tri ('' par defaut)
|
||||
* @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction()
|
||||
* @param int $num number of records found by select with limit+1
|
||||
* @param int $totalnboflines Total number of records/lines for all pages (if known)
|
||||
* @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to no show number.
|
||||
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
|
||||
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
|
||||
* @param string $morehtml More html to show
|
||||
@ -2979,7 +2979,9 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
global $conf,$langs;
|
||||
|
||||
$savlimit = $limit;
|
||||
|
||||
$savtotalnboflines = $totalnboflines;
|
||||
$totalnboflines=abs($totalnboflines);
|
||||
|
||||
if ($picto == 'setup') $picto='title_setup.png';
|
||||
if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif';
|
||||
if ($limit < 0) $limit = $conf->liste_limit;
|
||||
@ -3000,9 +3002,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
// Left
|
||||
if ($picto && $titre) print '<td class="nobordernopadding hideonsmartphone" width="40" align="left" valign="middle">'.img_picto('', $picto, '', $pictoisfullpath).'</td>';
|
||||
print '<td class="nobordernopadding"><div class="titre">'.$titre;
|
||||
if (!empty($totalnboflines) && !empty($titre)) {
|
||||
print ' ('.$totalnboflines.')';
|
||||
}
|
||||
if (!empty($titre) && $savtotalnboflines > 0) print ' ('.$totalnboflines.')';
|
||||
print '</div></td>';
|
||||
|
||||
// Center
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
@ -60,8 +60,8 @@ $page=GETPOST("page",'int');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -233,7 +233,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
@ -261,9 +260,7 @@ if ($resql)
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
if ($search_status >= 0) $param.="&search_status=".$search_status;
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy');
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
@ -271,7 +268,9 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
if ($search_all)
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy',0,'','',$limit);
|
||||
|
||||
if ($search_all)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2016 Laurent Destailleur <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -61,6 +62,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_amount="";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -83,12 +85,14 @@ if ($filtre) {
|
||||
}
|
||||
$sql.= " GROUP BY l.rowid, l.label, l.capital, l.datestart, l.dateend";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$numall = 0;
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$numall = $db->num_rows($result);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
//print $sql;
|
||||
@ -105,9 +109,15 @@ if ($resql)
|
||||
if ($search_amount) $param.="&search_amount=".$search_amount_ht;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $numall,'title_generic.png');
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -116,6 +126,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Capital"),$_SERVER["PHP_SELF"],"l.capital","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"l.datestart","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"l.paid","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
// Filters lines
|
||||
@ -124,6 +135,7 @@ if ($resql)
|
||||
print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
|
||||
print '<td class="liste_titre" align="right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td></td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
@ -154,6 +166,8 @@ if ($resql)
|
||||
|
||||
print '<td align="right" class="nowrap">'.$loan_static->LibStatut($obj->paid,5,$obj->alreadypayed).'</a></td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
@ -167,6 +181,7 @@ else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user