From 1dec4c432008cd4d49aa2d7a148eb78523c6f2a5 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Thu, 14 Jun 2018 10:37:40 +0200 Subject: [PATCH 1/4] FIX: supplier order: product supplier ref not saved on addline --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index efa8be0f951..9783fc9911e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -409,7 +409,7 @@ if (empty($reshook)) $localtax2_tx, $idprod, $productsupplier->product_fourn_price_id, - $productsupplier->fourn_ref, + $productsupplier->ref_supplier, $remise_percent, 'HT', $pu_ttc, From f9a86ba43f0f56f163f7994dda9ab0e8db884a01 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 14 Jun 2018 14:01:05 +0200 Subject: [PATCH 2/4] Fix: MEMBER_MODIFY trigger not called if i change only extrafields --- htdocs/adherents/class/adherent.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 507695b0ffd..8736500757f 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -599,14 +599,14 @@ class Adherent extends CommonObject $error++; } } + } - if (! $error && ! $notrigger) - { - // Call trigger - $result=$this->call_trigger('MEMBER_MODIFY',$user); - if ($result < 0) { $error++; } - // End call triggers - } + if (! $error && ! $notrigger) + { + // Call trigger + $result=$this->call_trigger('MEMBER_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) From cb3704b67eb44aec8907ff4d6bed3ee138b2c252 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 15 Jun 2018 11:02:46 +0200 Subject: [PATCH 3/4] Fix can't add an attribute simply --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9dcd4c67035..1cf2f33980e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2010,7 +2010,7 @@ class Societe extends CommonObject $hookmanager=new HookManager($this->db); } $hookmanager->initHooks(array('societedao')); - $parameters=array('id'=>$this->id); + $parameters=array('id'=>$this->id, 'linkclose'=>$linkclose); $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; } From 3c80ce501bf9962d7dc4ec2c40ab43b0d5ccb5b5 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 15 Jun 2018 16:05:50 +0200 Subject: [PATCH 4/4] Fix missing hook on usercard (addMoreActionsButtons) --- htdocs/user/card.php | 127 ++++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 61 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 3779e3ed6fa..9d9b73bad09 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1619,85 +1619,90 @@ else print '
'; - if (! empty($object->email)) + $parameters=array(); + $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { - $langs->load("mails"); - print ''; - } - else - { - $langs->load("mails"); - print ''; - } - - if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) + if (! empty($object->email)) { - print ''; + $langs->load("mails"); + print ''; } else { - print ''; + $langs->load("mails"); + print ''; } - } - elseif ($caneditpassword && ! $object->ldap_sid && - (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - print ''; - } - // Si on a un gestionnaire de generation de mot de passe actif - if ($conf->global->USER_PASSWORD_GENERATED != 'none') - { - if ($object->statut == 0) + if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) + { + print ''; + } + else + { + print ''; + } } - elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + elseif ($caneditpassword && ! $object->ldap_sid && + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) + { + print ''; + } + + // Si on a un gestionnaire de generation de mot de passe actif + if ($conf->global->USER_PASSWORD_GENERATED != 'none') + { + if ($object->statut == 0) + { + print ''; + } + elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) + { + print ''; + } + + if ($object->statut == 0) + { + print ''; + } + else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) + { + if ($object->email) print ''; + else print ''; + } + } + + // Activer + if ($user->id <> $id && $candisableuser && $object->statut == 0 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + print ''; } - - if ($object->statut == 0) - { - print ''; - } - else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + // Desactiver + if ($user->id <> $id && $candisableuser && $object->statut == 1 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - if ($object->email) print ''; - else print ''; + print ''; } - } - - // Activer - if ($user->id <> $id && $candisableuser && $object->statut == 0 && - ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - print ''; - } - // Desactiver - if ($user->id <> $id && $candisableuser && $object->statut == 1 && - ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - print ''; - } - // Delete - if ($user->id <> $id && $candisableuser && - ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin + // Delete + if ($user->id <> $id && $candisableuser && + ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; - } - else - { - print ''; + if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin + { + print ''; + } + else + { + print ''; + } } } - + print "
\n";