Filter on date extrafield timestamp and datetime disabled (not possible

yet)
This commit is contained in:
Laurent Destailleur 2017-12-20 18:30:41 +01:00
parent 9d10eb57f2
commit b03d0134a7
5 changed files with 17 additions and 12 deletions

View File

@ -79,7 +79,7 @@ $search_year=GETPOST("search_year","int");
$viewstatut=GETPOST('viewstatut','alpha');
$optioncss = GETPOST('optioncss','alpha');
$object_statut=GETPOST('propal_statut','alpha');
$object_statut=GETPOST('search_statut','alpha');
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
@ -572,7 +572,7 @@ if ($resql)
if (! empty($arrayfields['p.fk_statut']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
$formpropal->selectProposalStatus($viewstatut,1);
$formpropal->selectProposalStatus($viewstatut, 1, 0, 1, 'customer', 'search_statut');
print '</td>';
}
// Action column

View File

@ -212,7 +212,7 @@ class Form
}
else if (preg_match('/^ckeditor/',$typeofdata))
{
$tmp=explode(':',$typeofdata);
$tmp=explode(':',$typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor($htmlname, ($editvalue?$editvalue:$value), ($tmp[2]?$tmp[2]:''), ($tmp[3]?$tmp[3]:'100'), ($tmp[1]?$tmp[1]:'dolibarr_notes'), 'In', ($tmp[5]?$tmp[5]:0), true, true, ($tmp[6]?$tmp[6]:'20'), ($tmp[7]?$tmp[7]:'100'));
$ret.=$doleditor->Create(1);

View File

@ -17,11 +17,16 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
}
else
elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
{
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_');
}
elseif (in_array($typeofextrafield, array('datetime','timestamp')))
{
// TODO
// Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes
}
print '</td>';
}
}

View File

@ -83,11 +83,10 @@ $search_total_ht=GETPOST('search_total_ht','alpha');
$search_total_vat=GETPOST('search_total_vat','alpha');
$search_total_ttc=GETPOST('search_total_ttc','alpha');
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$search_billed = GETPOST('search_billed','int');
$search_project_ref=GETPOST('search_project_ref','alpha');
$status=GETPOST('statut','alpha');
$billed=GETPOST('billed','int');
$viewstatut=GETPOST('viewstatut');
// Security check
@ -212,6 +211,7 @@ if (empty($reshook))
$deliverymonth='';
$deliveryyear='';
$billed='';
$search_billed='';
$toselect='';
$search_array_options=array();
}
@ -478,7 +478,7 @@ if ($status)
if ($status == '6,7') $title.=' - '.$langs->trans("StatusOrderCanceled");
else $title.=' - '.$langs->trans($commandestatic->statuts[$status]);
}
if ($billed > 0) $title.=' - '.$langs->trans("Billed");
if ($search_billed > 0) $title.=' - '.$langs->trans("Billed");
//$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
$help_url='';
@ -525,7 +525,7 @@ if ($search_refsupp) $sql.= natural_search("cf.ref_supplier", $search_refsupp);
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname','u.login'), $search_request_author) ;
if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed;
if ($search_billed != '' && $search_billed >= 0) $sql .= " AND cf.billed = ".$search_billed;
//Required triple check because statut=0 means draft filter
if (GETPOST('statut', 'intcomma') !== '')
@ -630,8 +630,8 @@ if ($resql)
if ($search_total_ttc != '') $param.="&search_total_ttc=".$search_total_ttc;
if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
if ($search_status >= 0) $param.="&search_status=".$search_status;
if ($search_project_ref >= 0) $param.="&search_project_ref=".$search_project_ref;
if ($billed != '') $param.="&billed=".$billed;
if ($search_project_ref >= 0) $param.="&search_project_ref=".$search_project_ref;
if ($search_billed != '') $param.="&search_billed=".$search_billed;
if ($show_files) $param.='&show_files=' .$show_files;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
@ -883,7 +883,7 @@ if ($resql)
if (! empty($arrayfields['cf.billed']['checked']))
{
print '<td class="liste_titre" align="center">';
print $form->selectyesno('billed', $billed, 1, 0, 1);
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1);
print '</td>';
}
// Action column

View File

@ -2488,7 +2488,7 @@ table.liste td, table.noborder td, div.noborder form div {
line-height: 1.2em;
}
div.liste_titre_bydiv .divsearchfield {
padding: 2px 1px 2px 0px; /* t r b l */
padding: 2px 1px 2px 7px; /* t r b l */
}
tr.box_titre .nobordernopadding td {