if(GETPOST("button_removefilter_x")||GETPOST("button_removefilter.x")||GETPOST("button_removefilter"))// All test are required to be compatible with all browsers
{
$search_name="";
...
...
@@ -132,6 +177,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$mode='';
$filter='';
}
}
/*
* View
...
...
@@ -141,8 +188,6 @@ $now=dol_now();
$form=newForm($db);
llxHeader();
$sql="SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
foreach($extrafields->attribute_labelas$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."contrat as c,";
$sql.=" ".MAIN_DB_PREFIX."societe as s,";
if(!$user->rights->societe->client->voir&&!$socid)$sql.=" ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
$sql.=" ".MAIN_DB_PREFIX."contratdet as cd";
if(is_array($extrafields->attribute_label)&&count($extrafields->attribute_label))$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."contratdet_extrafields as ef on (cd.rowid = ef.fk_object)";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
if($search_product_category>0)$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product';
if(!empty($filter_op1)&&$filter_op1!=-1&&$filter_date1!='')$sql.=" AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'";
if(!empty($filter_op2)&&$filter_op2!=-1&&$filter_date2!='')$sql.=" AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'";
if(!empty($filter_opcloture)&&$filter_opcloture!=-1&&$filter_datecloture!='')$sql.=" AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'";
if($massactionbutton||$massaction)// If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined