diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 2903cee2a88..f7fd5d9b2bb 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -379,6 +379,7 @@ if ($resql) if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($socid > 0) $param.='&socid='.urlencode($socid); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_product_category != '') $param.='&search_product_category='.$search_product_category; // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4e589aa6529..9fbac4b7977 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -384,6 +384,7 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall) $param.='&sall='.urlencode($sall); @@ -401,12 +402,19 @@ if ($resql) if ($search_user > 0) $param.='&search_user='.urlencode($search_user); if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); if ($search_total_ht != '') $param.='&search_total_ht='.urlencode($search_total_ht); - if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat); - if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc); - if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); + if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat); + if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc); + if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); + if ($search_town != '') $param .= '&search_town='.urlencode($search_town); + if ($search_zip != '') $param .= '&search_zip='.urlencode($search_zip); + if ($search_state != '') $param .= '&search_state='.urlencode$search_state); + if ($search_country != '') $param .= '&search_country='.urlencode($search_country); + if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category); if ($show_files) $param.='&show_files=' .urlencode($show_files); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($billed != '') $param.='&billed='.urlencode($billed); + // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 6c9707e4ff9..1056ef97640 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -189,13 +189,16 @@ if (empty($reshook)) $qualified_for_stock_change = $object->hasProductsOrServices(1); } - $result = $object->delete($user, 0, $idwarehouse); - if ($result > 0) { - header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1'); - exit(); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; + if ($object->is_erasable()) + { + $result = $object->delete($user, 0, $idwarehouse); + if ($result > 0) { + header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1'); + exit(); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; + } } } @@ -1448,7 +1451,7 @@ if (empty($reshook)) $line->origin = $object->origin; $line->origin_id = $line->id; $line->fetch_optionals($line->id); - + // Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée if ($line->fk_remise_except) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 7dfd39171e9..5a6c0594cd0 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -549,6 +549,8 @@ if ($resql) if ($search_refcustomer) $param.='&search_refcustomer=' .urlencode($search_refcustomer); if ($search_type != '') $param.='&search_type='.urlencode($search_type); if ($search_societe) $param.='&search_societe=' .urlencode($search_societe); + if ($search_town) $param.='&search_town='.urlencode($search_town); + if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale); if ($search_user > 0) $param.='&search_user=' .urlencode($search_user); if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b403f0f87dd..b4e4e0c8614 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -467,14 +467,14 @@ class Expedition extends CommonObject // Check parameters if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; - $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.billed"; + $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet, e.billed"; $sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery"; $sql.= ", e.fk_shipping_method, e.tracking_number"; - $sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= ", e.note_private, e.note_public"; $sql.= ', e.fk_incoterms, e.location_incoterms'; $sql.= ', i.libelle as libelle_incoterms'; + $sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON e.fk_incoterms = i.rowid'; @@ -512,6 +512,7 @@ class Expedition extends CommonObject $this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility $this->origin_id = $obj->origin_id; $this->billed = $obj->billed; + $this->fk_project = $obj->fk_projet; $this->trueWeight = $obj->weight; $this->weight_units = $obj->weight_units; @@ -1034,6 +1035,7 @@ class Expedition extends CommonObject $sql.= " fk_shipping_method=".((isset($this->shipping_method_id) && $this->shipping_method_id > 0)?$this->shipping_method_id:"null").","; $sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").","; $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; + $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; $sql.= " height=".(($this->trueHeight != '')?$this->trueHeight:"null").","; $sql.= " width=".(($this->trueWidth != '')?$this->trueWidth:"null").","; $sql.= " size_units=".(isset($this->size_units)?$this->size_units:"null").","; @@ -2443,7 +2445,7 @@ class ExpeditionLigne extends CommonObjectLine dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); $this->error.=($this->error?', '.$errmsg:$errmsg); } - + $this->db->rollback(); return -1*$error; } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index d8e9925c08f..5e23ee96db1 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -253,13 +253,16 @@ if ($resql) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall) $param.= "&sall=".urlencode($sall); - if ($search_ref_exp) $param.= "&search_ref_exp=".urlencode($search_ref_exp); - if ($search_ref_liv) $param.= "&search_ref_liv=".urlencode($search_ref_liv); + if ($search_ref_exp) $param.= "&search_ref_exp=".urlencode($search_ref_exp); + if ($search_ref_liv) $param.= "&search_ref_liv=".urlencode($search_ref_liv); if ($search_ref_customer) $param.= "&search_ref_customer=".urlencode($search_ref_customer); - if ($search_company) $param.= "&search_company=".urlencode($search_company); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_company) $param.= "&search_company=".urlencode($search_company); + if ($search_town) $param.= '&search_town='.urlencode($search_town); + if ($search_zip) $param.= '&search_zip='.urlencode($search_zip); + if ($viewstatut != '') $param.= '&viewstatut='.urlencode($viewstatut); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 40e3083e125..d3d5eb1ebcf 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -653,8 +653,10 @@ if (empty($reshook)) if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); - $error++; + $errors = $object->errors; + $error++; } + // Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined) if (!empty($user->rights->categorie->lire)) { @@ -735,6 +737,7 @@ if (empty($reshook)) { $error++; $object->error .= $object->db->lasterror(); + setEventMessages($object->error, $object->errors, 'errors'); } }