diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 0d812d70009..daf15552300 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -621,6 +621,7 @@ if ($id == 11) // 'contract' => $langs->trans('Contract'), 'project' => $langs->trans('Project'), 'project_task' => $langs->trans('Task'), + 'ticket' => $langs->trans('Ticket'), 'agenda' => $langs->trans('Agenda'), 'dolresource' => $langs->trans('Resource'), // old deprecated @@ -1492,11 +1493,9 @@ if ($id) continue; } - if ($value == 'element') - { + if ($value == 'element') { $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; - } elseif ($value == 'source') - { + } elseif ($value == 'source') { $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow; } elseif ($valuetoshow == 'all') { $valuetoshow = $langs->trans('All'); diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index d29cdb7c6bb..1f0a00cb4b8 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -113,7 +113,6 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { $coldisplay++; print ''; - // print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, "units"); print ''; } diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 77638b875ff..f31db94403b 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -112,7 +112,6 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { $coldisplay++; print ''; - // print $form->selectUnits($line->fk_unit, "units"); print ''; } diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 33f7f3a0352..467f6b7b78b 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -58,11 +58,15 @@ if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $fieldtype); if (!$user->rights->banque->lire && !$user->rights->banque->consolidate) accessforbidden(); +$hookmanager->initHooks(array('bankline')); + /* * Actions */ - +$parameters = array('socid' => $socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($cancel) { if ($backtopage) diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 7e1b7fd0567..5aeec4f444c 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -40,11 +40,14 @@ if (!$user->rights->banque->transfer) $action = GETPOST('action', 'aZ09'); $error = 0; +$hookmanager->initHooks(array('banktransfer')); /* * Actions */ - +$parameters = array('socid' => $socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($action == 'add') { $langs->load("errors"); diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php index 5a1f093ce87..22b28d42761 100644 --- a/htdocs/core/boxes/box_shipments.php +++ b/htdocs/core/boxes/box_shipments.php @@ -105,6 +105,7 @@ class box_shipments extends ModeleBoxes if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; if (!empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) $sql .= " AND e.fk_statut = 1"; + if ($user->socid > 0) $sql.= " AND s.rowid = ".$user->socid; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND sc.fk_user = ".$user->id; else $sql .= " ORDER BY e.date_delivery, e.ref DESC "; $sql .= $this->db->plimit($max, 0); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 154db9db29f..3c6cb2fd54c 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1079,7 +1079,7 @@ if (empty($reshook)) $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - if (GETPOST('price_ht') != '') + if (GETPOST('price_ht') != '' || GETPOST('multicurrency_subprice') != '') { $up = price2num(GETPOST('price_ht')); $price_base_type = 'HT'; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d0314fb9c45..3bbae9c2cfe 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5428,7 +5428,6 @@ class Product extends CommonObject $langs->load('products'); $label_type = 'label'; - if ($type == 'short') { $label_type = 'short_label'; } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index b92c0508ffa..d081c07b2c8 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -487,7 +487,11 @@ if ($resql) } } - llxHeader('', $title, $helpurl, ''); + foreach ($searchCategoryProductList as $searchCategoryProduct) { + $paramsCat .= "&search_category_product_list[]=".urlencode($searchCategoryProduct); + } + llxHeader('', $title, $helpurl, '', 0, 0, "", "", $paramsCat); + // Displays product removal confirmation if (GETPOST('delprod')) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 22763134e22..d1513af17de 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3621,8 +3621,8 @@ class Societe extends CommonObject */ public function create_from_member(Adherent $member, $socname = '', $socalias = '', $customercode = '') { - // phpcs:enable - global $user, $langs; + // phpcs:enable + global $conf, $user, $langs; dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); @@ -3656,6 +3656,23 @@ class Societe extends CommonObject // Cree et positionne $this->id $result = $this->create($user); if ($result >= 0) { + // Auto-create contact on thirdparty creation + if (!empty($conf->global->THIRDPARTY_DEFAULT_CREATE_CONTACT)) { + // Fill fields needed by contact + $this->name_bis = $member->lastname; + $this->firstname = $member->firstname; + $this->civility_id = $member->civility_id; + + dol_syslog("We ask to create a contact/address too", LOG_DEBUG); + $result = $this->create_individual($user); + if ($result < 0) + { + setEventMessages($this->error, $this->errors, 'errors'); + $this->db->rollback(); + return -1; + } + } + $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql .= " SET fk_soc=".$this->id; $sql .= " WHERE rowid=".$member->id;