From 89296e3011eb9dc7f1a7a0c8d1862d6a8e076173 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 5 Nov 2014 22:27:26 +0100 Subject: [PATCH 1/5] Typo search list --- htdocs/compta/deplacement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index da0e3e21dcd..42a6713c1ce 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -115,7 +115,7 @@ if ($month > 0) } 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.= " AND d.dated 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); From 4c95cab35feb3c1b1fc1e4539acf923c0ec032ea Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 6 Nov 2014 07:13:03 +0100 Subject: [PATCH 2/5] Improve search in customer command list --- htdocs/commande/list.php | 96 ++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 84f8e455d11..ea17d895b95 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -43,9 +43,9 @@ $orderyear=GETPOST("orderyear","int"); $ordermonth=GETPOST("ordermonth","int"); $deliveryyear=GETPOST("deliveryyear","int"); $deliverymonth=GETPOST("deliverymonth","int"); -$sref=GETPOST('sref','alpha'); -$sref_client=GETPOST('sref_client','alpha'); -$snom=GETPOST('snom','alpha'); +$search_ref=GETPOST('search_ref','alpha'); +$search_ref_customer=GETPOST('search_ref_customer','alpha'); +$search_company=GETPOST('search_company','alpha'); $sall=GETPOST('sall'); $socid=GETPOST('socid','int'); $search_user=GETPOST('search_user','int'); @@ -69,6 +69,20 @@ $limit = $conf->liste_limit; $viewstatut=GETPOST('viewstatut'); +// Purge search criteria +if (GETPOST("button_removefilter")) +{ + $search_categ=''; + $search_user=''; + $search_sale=''; + $search_ref=''; + $search_ref_customer=''; + $search_company=''; + $orderyear=''; + $ordermonth=''; + $deliverymonth=''; + $deliveryyear=''; +} // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('orderlist')); @@ -81,24 +95,6 @@ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -// Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x")) -{ - $search_categ=''; - $search_user=''; - $search_sale=''; - $search_ref=''; - $search_refcustomer=''; - $search_societe=''; - $search_montant_ht=''; - $orderyear=''; - $ordermonth=''; - $deliverymonth=''; - $deliveryyear=''; -} - - - /* * View */ @@ -128,8 +124,8 @@ $sql.= ' WHERE c.fk_soc = s.rowid'; $sql.= ' AND c.entity = '.$conf->entity; if ($socid) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($sref) { - $sql .= natural_search('c.ref', $sref); +if ($search_ref) { + $sql .= natural_search('c.ref', $search_ref); } if ($sall) { @@ -188,13 +184,13 @@ else if ($deliveryyear > 0) { $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'"; } -if (!empty($snom)) +if (!empty($search_company)) { - $sql .= natural_search('s.nom', $snom); + $sql .= natural_search('s.nom', $search_company); } -if (!empty($sref_client)) +if (!empty($search_ref_customer)) { - $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; + $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($search_ref_customer).'%\''; } if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; if ($search_user > 0) @@ -246,15 +242,15 @@ if ($resql) $title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); $param='&socid='.$socid.'&viewstatut='.$viewstatut; - if ($ordermonth) $param.='&ordermonth='.$ordermonth; - if ($orderyear) $param.='&orderyear='.$orderyear; - if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; - if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; - if ($sref) $param.='&sref='.$sref; - if ($snom) $param.='&snom='.$snom; - if ($sref_client) $param.='&sref_client='.$sref_client; - if ($search_user > 0) $param.='&search_user='.$search_user; - if ($search_sale > 0) $param.='&search_sale='.$search_sale; + if ($ordermonth) $param.='&ordermonth='.$ordermonth; + if ($orderyear) $param.='&orderyear='.$orderyear; + if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; + if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; + if ($search_ref) $param.='&search_ref='.$search_ref; + if ($search_company) $param.='&search_company='.$search_company; + if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer; + if ($search_user > 0) $param.='&search_user='.$search_user; + if ($search_sale > 0) $param.='&search_sale='.$search_sale; $num = $db->num_rows($resql); print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); @@ -294,33 +290,35 @@ if ($resql) print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'c.fk_statut','',$param,'align="right"',$sortfield,$sortorder); print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5); - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); - print ' '; - print ''; - print ''; - print ''; + print ''; + print ' '; + print ''; + print ''; + print "\n"; $var=true; $total=0; @@ -443,12 +441,12 @@ if ($resql) print ''; // Order date - print ''; + print ''; print dol_print_date($db->jdate($objp->date_commande), 'day'); print ''; // Delivery date - print ''; + print ''; print dol_print_date($db->jdate($objp->date_livraison), 'day'); print ''; From b60f834d8d8bdaea1d0ead34b1fb8582e7745d02 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 6 Nov 2014 07:19:16 +0100 Subject: [PATCH 3/5] Improve search into supplier command list --- htdocs/fourn/commande/list.php | 44 +++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 58abe457831..97b8900bd4b 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -39,12 +39,12 @@ $langs->load("sendings"); $search_ref=GETPOST('search_ref'); $search_refsupp=GETPOST('search_refsupp'); -$search_nom=GETPOST('search_nom'); +$search_company=GETPOST('search_company'); $search_user=GETPOST('search_user'); $search_ttc=GETPOST('search_ttc'); $sall=GETPOST('search_all'); $search_status=GETPOST('search_status','int'); -if ($search_status == '') $search_status=-1; + $page = GETPOST('page','int'); $socid = GETPOST('socid','int'); @@ -58,6 +58,18 @@ $orderid = GETPOST('orderid'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande'); +// Purge search criteria +if (GETPOST("button_removefilter")) +{ + $search_ref=''; + $search_refsupp=''; + $search_company=''; + $search_user=''; + $search_ttc=''; + $search_status=''; +} + +if ($search_status == '') $search_status=-1; /* * View @@ -102,9 +114,9 @@ if ($search_ref) { $sql .= natural_search('cf.ref', $search_ref); } -if ($search_nom) +if ($search_company) { - $sql .= natural_search('s.nom', $search_nom); + $sql .= natural_search('s.nom', $search_company); } if ($search_user) { @@ -154,13 +166,14 @@ if ($resql) $i = 0; $param=""; - if ($search_ref) $param.="&search_ref=".$search_ref; - if ($search_nom) $param.="&search_nom=".$search_nom; - if ($search_user) $param.="&search_user=".$search_user; - if ($search_ttc) $param.="&search_ttc=".$search_ttc; - if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; - if ($socid) $param.="&socid=".$socid; - if ($search_status >= 0) $param.="&search_status=".$search_status; + if ($search_ref) $param.="&search_ref=".$search_ref; + if ($search_company) $param.="&search_company=".$search_company; + if ($search_user) $param.="&search_user=".$search_user; + if ($search_ttc) $param.="&search_ttc=".$search_ttc; + if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; + if ($socid) $param.="&socid=".$socid; + if ($search_status >= 0) $param.="&search_status=".$search_status; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); print '
'; print ''; @@ -180,7 +193,7 @@ if ($resql) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -188,10 +201,9 @@ if ($resql) print ''; - print ''; - print ''; + print '\n"; $var=true; From a8b3153f5413de7a0e4b1d32c9ef4f1edd245584 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 6 Nov 2014 19:47:27 +0100 Subject: [PATCH 4/5] Improve search in list --- htdocs/comm/action/listactions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index c330540cb03..53243d0c165 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -99,6 +99,13 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi $filterd=$user->id; } +// Purge search criteria +if (GETPOST("button_removefilter")) +{ + $datestart=''; + $dateend=''; +} + // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('agendalist')); @@ -278,8 +285,7 @@ if ($resql) //print ''; print ''; print ''; print "\n"; From acbbe823e8fe8e947f41a4818f810e94c7a2f87c Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 6 Nov 2014 20:04:51 +0100 Subject: [PATCH 5/5] Typo --- htdocs/comm/propal/list.php | 7 +++---- htdocs/contact/list.php | 1 - htdocs/fourn/commande/list.php | 1 - htdocs/product/list.php | 4 ++-- htdocs/product/stock/mouvement.php | 1 - 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 2b8e478d37d..96d633bd834 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -323,10 +323,9 @@ if ($result) $formpropal->selectProposalStatus($viewstatut,1); print ''; print ''; + print ''; + print ''; + print ''; print "\n"; $var=true; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a311c87cffc..2e28328085a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -357,7 +357,6 @@ if ($result) print ''; print ''; print ''; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 97b8900bd4b..ab0fd08d3f0 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -45,7 +45,6 @@ $search_ttc=GETPOST('search_ttc'); $sall=GETPOST('search_all'); $search_status=GETPOST('search_status','int'); - $page = GETPOST('page','int'); $socid = GETPOST('socid','int'); $sortorder = GETPOST('sortorder','alpha'); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 55b9beb259c..ebf8b77f722 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -510,7 +510,7 @@ else $product_static->status_buy = $objp->tobuy; $product_static->status = $objp->tosell; // Status (to sell) - print ''; // Status (to buy) - print ''; print ''; print "\n";
 '; $formorder->selectSupplierOrderStatus($search_status,1,'search_status'); print ''; - print ''; - print '
'; + print ''; + print "
'; - //print '  '; - //print ''; + print ''; print '
'; - print ''; - print ' '; - print ''; - print '
'; print ''; - print ' '; print ''; print '
'; + print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { @@ -519,7 +519,7 @@ else print ''; + print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 50b46c7003f..06e089c5209 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -461,7 +461,6 @@ if ($resql) print ''; print ''; - print '  '; print ''; print '