diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 7146e89648e..4c9935b76a8 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -311,6 +311,7 @@ print ''; print ''; print ''; print ''; +print ''; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 1dd6f0a0f12..76e15127098 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -555,14 +555,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.$langs->trans('MulticurrencyAmountTTC').''; print ''.$langs->trans('MulticurrencyAlreadyPaid').''; print ''.$langs->trans('MulticurrencyRemainderToPay').''; + print ''.$langs->trans('MulticurrencyPaymentAmount').''; } print ''.$langs->trans('AmountTTC').''; print ''.$langs->trans('AlreadyPaid').''; print ''.$langs->trans('RemainderToPay').''; print ''.$langs->trans('PaymentAmount').''; - if (!empty($conf->multicurrency->enabled)) { - print ''.$langs->trans('MulticurrencyPaymentAmount').''; - } print ''; $total = 0; @@ -657,6 +655,24 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print price($sign * $multicurrency_remaintopay); } print ''; + + print ''; + // Add remind multicurrency amount + $namef = 'multicurrency_amount_'.$objp->facid; + $nameRemain = 'multicurrency_remain_'.$objp->facid; + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { + if ($action != 'add_paiement') { + if (!empty($conf->use_javascript_ajax)) { + print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); + } + print ''; + print ''; + } else { + print ''; + print ''; + } + } + print ""; } print ''.price($sign * $objp->total_ttc).''; @@ -690,29 +706,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ""; - // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) { - print ''; - - // Add remind multicurrency amount - $namef = 'multicurrency_amount_'.$objp->facid; - $nameRemain = 'multicurrency_remain_'.$objp->facid; - - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { - if ($action != 'add_paiement') { - if (!empty($conf->use_javascript_ajax)) { - print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); - } - print ''; - print ''; - } else { - print ''; - print ''; - } - } - print ""; - } - print "\n"; $total += $objp->total_ht; $total_ttc += $objp->total_ttc; @@ -730,6 +723,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ' '; print ' '; print ' '; + print ''; } print ''.price($sign * $total_ttc).''; print ''.price($sign * $totalrecu); @@ -742,9 +736,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''; print ''; // Autofilled - if (!empty($conf->multicurrency->enabled)) { - print ''; - } print "\n"; } print "\n"; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 111d65e8c7f..644bd115d4b 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1557,9 +1557,8 @@ if ($action == 'create') { print ''; // Tracking Number - print ''.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->rights->reception->creer).''; - print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->rights->reception->creer, 'string', $object->tracking_number); + print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->rights->reception->creer, 'safehtmlstring', $object->tracking_number); print ''; // Incoterms diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8622e293906..68218ab16bd 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -448,19 +448,15 @@ if (empty($reshook)) { $object->lang = GETPOST('default_lang', 'aZ09'); // Do we update also ->entity ? - if (!empty($conf->multicompany->enabled)) { // If multicompany is not enabled, we never update the entity of a user. - if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $object->entity = 1; // all users are in master entity + if (!empty($conf->multicompany->enabled && $user->entity == 0 && !empty($user->admin))) { // If multicompany is not enabled, we never update the entity of a user. + if (GETPOST('superadmin', 'int')) { + $object->entity = 0; } else { - // A user should not be able to move a user into another entity. Only superadmin should be able to do this. - if ($user->entity == 0 && $user->admin) { - if (GETPOST("superadmin")) { - // We try to set the user as superadmin. - $object->entity = 0; - } else { - // We try to change the entity of user - $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $object->entity); - } + if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $object->entity = 1; // all users are in master entity + } else { + // We try to change the entity of user + $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $object->entity); } } } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9540f082a4c..09bb34ddef3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1773,7 +1773,9 @@ class User extends CommonObject $sql .= ", salaryextra= ".($this->salaryextra != '' ? "'".$this->db->escape($this->salaryextra)."'" : "null"); } $sql .= ", weeklyhours= ".($this->weeklyhours != '' ? "'".$this->db->escape($this->weeklyhours)."'" : "null"); - $sql .= ", entity = ".((int) $this->entity); + if (!empty($user->admin) && empty($user->entity) && $user->id != $this->id) { + $sql .= ", entity = ".((int) $this->entity); // entity flag can be set/unset only by an another superadmin user + } $sql .= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null'); $sql .= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); $sql .= ", fk_warehouse = ".($this->fk_warehouse > 0 ? $this->fk_warehouse : "null");