diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 153644333b7..ea0b7a16eb2 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1126,9 +1126,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // State if (!getDolGlobalString('MEMBER_DISABLE_STATE')) { print ''.$langs->trans('State').''; - if ($soc->country_id) { + if ($soc->country_id || GETPOSTISSET('country_id')) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : $soc->state_id, $soc->country_code); + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : $soc->state_id, GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : $soc->country_code); } else { print $countrynotdefined; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index e5cb083f5b0..a3db32f86cb 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -250,7 +250,7 @@ if (empty($reshook)) { // Note: Correct date should be completed with location to have exact GM time of birth. $object->birthday = dol_mktime(0, 0, 0, GETPOSTINT("birthdaymonth"), GETPOSTINT("birthdayday"), GETPOSTINT("birthdayyear")); - $object->birthday_alert = GETPOSTINT("birthday_alert"); + $object->birthday_alert = (GETPOST('birthday_alert', 'alpha') == "on" ? 1 : 0); //Default language $object->default_lang = GETPOST('default_lang'); diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index bb4027978b1..5e0b71f4995 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -224,9 +224,9 @@ if ($action == 'edit') { print '     '; print ' '; if (!empty($object->birthday_alert)) { - print ''; + print ''; } else { - print ''; + print ''; } print ''; print ''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4009a3f749e..479176290ea 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -180,7 +180,9 @@ class ExtraFields // Add declaration of field into table $result2 = $this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $help, $default_value, $computed, $entity, $langfile, $enabled, $totalizable, $printable, $moreparams); $err2 = $this->errno; - if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { + if ($result2 > 0 + || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS') + || ($type == 'separate' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { $this->error = ''; $this->errno = '0'; return 1; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 980b72a2874..b60ea887f4f 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -271,12 +271,12 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y } if ($type == 'free') { - $out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '' : '').$amount.($mode ? '' : '').'&tag='.($mode ? '' : '').$freetag.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '' : '').price2num($amount, 'MT').($mode ? '' : '').'&tag='.($mode ? '' : '').$freetag.($mode ? '' : ''); if (getDolGlobalString('PAYMENT_SECURITY_TOKEN')) { if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { $out .= '&securekey='.urlencode(getDolGlobalString('PAYMENT_SECURITY_TOKEN')); } else { - $out .= '&securekey='.urlencode(dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2')); + $out .= '&securekey='.urlencode(dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 'sha1md5')); } } //if ($mode) $out.='&noidempotency=1'; @@ -298,7 +298,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + order_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5'); } $out .= ($mode ? '' : ''); } @@ -321,7 +321,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5'); } $out .= ($mode ? '' : ''); } @@ -344,7 +344,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + contractline_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5'); } $out .= ($mode ? '' : ''); } @@ -352,7 +352,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y } elseif ($type == 'member' || $type == 'membersubscription') { $newtype = 'member'; $out = $urltouse.'/public/payment/newpayment.php?source=member'; - $out .= '&amount='.$amount; + $out .= '&amount='.price2num($amount, 'MT'); $out .= '&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'member_ref'; @@ -366,11 +366,11 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= '&securekey='.urlencode(getDolGlobalString('PAYMENT_SECURITY_TOKEN')); } else { $out .= '&securekey='.($mode ? '' : ''); - if ($mode == 1) { + if ($mode == 1) { // mode tuto $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$newtype."' + member_ref)"; } - if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $newtype.$ref, '2'); + if ($mode == 0) { // mode real + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$newtype.$ref, 'sha1md5'); } $out .= ($mode ? '' : ''); } @@ -393,7 +393,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + donation_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5'); } $out .= ($mode ? '' : ''); } @@ -416,7 +416,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5'); } $out .= ($mode ? '' : ''); } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d901413cf17..54af1723370 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2140,19 +2140,19 @@ if ($action != 'dopayment') { } if ($source == 'order' && $object->billed) { - print '

'.$langs->trans("OrderBilled").''; + print '

'.$langs->trans("OrderBilled").'
'; } elseif ($source == 'invoice' && $object->paye) { - print '

'.$langs->trans("InvoicePaid").''; + print '

'.$langs->trans("InvoicePaid").'
'; } elseif ($source == 'donation' && $object->paid) { - print '

'.$langs->trans("DonationPaid").''; + print '

'.$langs->trans("DonationPaid").'
'; } else { // Membership can be paid and we still allow to make renewal if (($source == 'member' || $source == 'membersubscription') && $object->datefin > dol_now()) { $langs->load("members"); - print '
'; + print '
'; $s = $langs->trans("MembershipPaid", '{s1}'); print str_replace('{s1}', ''.dol_print_date($object->datefin, 'day').'', $s); - print '
'; + print '
'; print '
'.$langs->trans("PaymentWillBeRecordedForNextPeriod").'
'; print '
'; } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index b2eb7d56f7b..9121d0ec032 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -326,7 +326,7 @@ class Ticket extends CommonObject 'progress' => array('type' => 'integer', 'label' => 'Progression', 'visible' => -1, 'enabled' => 1, 'position' => 540, 'notnull' => -1, 'css' => 'right', 'help' => "", 'isameasure' => 1, 'csslist' => 'width50'), 'resolution' => array('type' => 'integer', 'label' => 'Resolution', 'visible' => -1, 'enabled' => 'getDolGlobalString("TICKET_ENABLE_RESOLUTION")', 'position' => 550, 'notnull' => 1), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'PDFTemplate', 'enabled' => 1, 'visible' => 0, 'position' => 560), - 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 570), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => 0, 'position' => 570), 'fk_statut' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 600, 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Unread', 1 => 'Read', 2 => 'Assigned', 3 => 'InProgress', 5 => 'NeedMoreInformation', 7 => 'OnHold', 8 => 'SolvedClosed', 9 => 'Deleted')), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 900), );