Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
3ef215c3eb
@ -46,6 +46,13 @@ $offset = $limit * $page;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
|
$search_start = -1;
|
||||||
|
if(GETPOST('search_startyear')!='') $search_start = dol_mktime(0, 0, 0, GETPOST('search_startmonth'), GETPOST('search_startday'), GETPOST('search_startyear'));
|
||||||
|
|
||||||
|
$search_end = -1;
|
||||||
|
if(GETPOST('search_endyear')!='') $search_end= dol_mktime(0, 0, 0, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear'));
|
||||||
|
|
||||||
|
|
||||||
if (empty($sortfield)) $sortfield='rowid';
|
if (empty($sortfield)) $sortfield='rowid';
|
||||||
if (empty($sortorder)) $sortorder='DESC';
|
if (empty($sortorder)) $sortorder='DESC';
|
||||||
|
|
||||||
@ -128,7 +135,7 @@ else if($action === 'downloadcsv') {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder);
|
$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder, $search_start, $search_end);
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
@ -154,7 +161,27 @@ print ' </div>';
|
|||||||
|
|
||||||
|
|
||||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
|
|
||||||
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre_filter">';
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
|
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print $form->select_date($search_start,'search_start');
|
||||||
|
print $form->select_date($search_end,'search_end');
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="liste_titre" colspan="7"> </td>';
|
||||||
|
|
||||||
|
// Action column
|
||||||
|
print '<td class="liste_titre" align="middle">';
|
||||||
|
$searchpicto=$form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print getTitleFieldOfList($langs->trans('#'), 0, $_SERVER["PHP_SELF"],'rowid','','','',$sortfield,$sortorder,'minwidth50 ')."\n";
|
print getTitleFieldOfList($langs->trans('#'), 0, $_SERVER["PHP_SELF"],'rowid','','','',$sortfield,$sortorder,'minwidth50 ')."\n";
|
||||||
@ -226,6 +253,9 @@ foreach($blocks as &$block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
|
|||||||
@ -580,9 +580,11 @@ class BlockedLog
|
|||||||
* @param int $limit max number of element, 0 for all
|
* @param int $limit max number of element, 0 for all
|
||||||
* @param string $sortfield sort field
|
* @param string $sortfield sort field
|
||||||
* @param string $sortorder sort order
|
* @param string $sortorder sort order
|
||||||
|
* @param int $search_start start time limit
|
||||||
|
* @param int $search_end end time limit
|
||||||
* @return array array of object log
|
* @return array array of object log
|
||||||
*/
|
*/
|
||||||
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '')
|
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_start = -1, $search_end = -1)
|
||||||
{
|
{
|
||||||
global $conf, $cachedlogs;
|
global $conf, $cachedlogs;
|
||||||
|
|
||||||
@ -610,8 +612,10 @@ class BlockedLog
|
|||||||
WHERE element='".$element."' AND fk_object=".(int) $fk_object;
|
WHERE element='".$element."' AND fk_object=".(int) $fk_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($search_start > 0) $sql.=" AND date_creation >= '".$this->db->idate($search_start)."'";
|
||||||
|
if($search_end> 0) $sql.=" AND date_creation <= '".$this->db->idate($search_end)."'";
|
||||||
|
|
||||||
$sql.=$this->db->order($sortfield, $sortorder);
|
$sql.=$this->db->order($sortfield, $sortorder);
|
||||||
//($order<0 ? ' ORDER BY rowid DESC ' : ' ORDER BY rowid ASC ');
|
|
||||||
|
|
||||||
if($limit > 0 )$sql.=' LIMIT '.$limit;
|
if($limit > 0 )$sql.=' LIMIT '.$limit;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user