Skip to content

Commit

Permalink
Merge branch 'Dolibarr:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JonBendtsen authored Nov 29, 2024
2 parents d735d0a + dd67fe7 commit 72cb9b2
Show file tree
Hide file tree
Showing 25 changed files with 94 additions and 197 deletions.
132 changes: 0 additions & 132 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -17544,138 +17544,6 @@ parameters:
count: 1
path: ../../htdocs/core/tpl/originproductline.tpl.php

-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$disabled might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$dol_url_root might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$focus_element might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined
count: 10
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$mode might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$urllogo might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$user might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$username might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordforgotten.tpl.php

-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$disabled might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$dol_url_root might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$focus_element might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined
count: 18
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$mode might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$newpass1 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$newpass2 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$passworduidhash might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$setnewpassword might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$urllogo might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$user might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$username might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/core/tpl/passwordreset.tpl.php

-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,9 @@ function refreshNatureCss() {
// State
if (!getDolGlobalString('MEMBER_DISABLE_STATE')) {
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($soc->country_id) {
if ($soc->country_id || GETPOSTISSET('country_id')) {

Check failure on line 1129 in htdocs/adherents/card.php

View workflow job for this annotation

GitHub Actions / phpstan / php-stan (8.2)

Function  GETPOSTISSET not found.

Check failure on line 1129 in htdocs/adherents/card.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

card.php: PhanUndeclaredFunction: Call to undeclared function \ GETPOSTISSET()

Check failure on line 1129 in htdocs/adherents/card.php

View workflow job for this annotation

GitHub Actions / phpstan

Function  GETPOSTISSET not found.
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;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/agenda_extsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@
$selectedvalue = 1;
}

print "<table class=\"noborder\" width=\"100%\">";
print "<table class=\"noborder centpercent\">";

print "<tr class=\"liste_titre\">";
print '<td>'.$langs->trans("Parameter")."</td>";
print '<td class="center">'.$langs->trans("Value")."</td>";
print '<td class="center"></td>';
print "</tr>";

// Show external agenda
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/agenda_other.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
$sql = "SELECT nom";
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
$sql .= " WHERE type = 'action'";
$sql .= " AND entity = ".$conf->entity;
$sql .= " AND entity = ".((int) $conf->entity);

$resql = $db->query($sql);
if ($resql) {
Expand Down Expand Up @@ -346,7 +346,7 @@
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '<td class="right"></td>'."\n";
print '</tr>'."\n";

// AGENDA_DEFAULT_VIEW
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/agenda_reminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '<td class="right"></td>'."\n";
print '</tr>'."\n";

// AGENDA REMINDER BROWSER
Expand Down
6 changes: 3 additions & 3 deletions htdocs/admin/agenda_xcal.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@

print '<tr class="liste_titre">';
print "<td>".$langs->trans("Parameter")."</td>";
print "<td>".$langs->trans("Value")."</td>";
print "<td></td>";
//print "<td>".$langs->trans("Examples")."</td>";
print "<td>&nbsp;</td>";
print "</tr>";
Expand Down Expand Up @@ -180,8 +180,8 @@

clearstatcache();

//if ($mesg) print "<br>$mesg<br>";
print "<br>";

print "<br><br>";


// Define $urlwithroot
Expand Down
3 changes: 1 addition & 2 deletions htdocs/admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,8 @@
if (!is_numeric($checkRes) && $checkRes != '') {
$langs->load("errors");
setEventMessages($modulename.' : '.$langs->trans($checkRes), null, 'errors');
$error++;
}

$error++;
} catch (Exception $e) {
// Nothing done
}
Expand Down
1 change: 1 addition & 0 deletions htdocs/commande/class/api_orders.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ public function createOrderShipment($id, $warehouse_id)
$shipment = new Expedition($this->db);
$shipment->socid = $this->commande->socid;
$shipment->origin_id = $this->commande->id;
$shipment->origin = $this->commande->element;
$result = $shipment->create(DolibarrApiAccess::$user);
if ($result <= 0) {
throw new RestException(500, 'Error on creating expedition :'.$this->db->lasterror());
Expand Down
2 changes: 1 addition & 1 deletion htdocs/contact/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@

// 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');
Expand Down
4 changes: 2 additions & 2 deletions htdocs/contact/perso.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@
print ' &nbsp; &nbsp; ';
print '<label for="birthday_alert">'.$langs->trans("BirthdayAlert").':</label> ';
if (!empty($object->birthday_alert)) {
print '<input type="checkbox" id="birthday_alert" name="birthday_alert" checked>';
print '<input type="checkbox" id="birthday_alert" name="birthday_alert" value="1" checked>';
} else {
print '<input type="checkbox" id="birthday_alert" name="birthday_alert">';
print '<input type="checkbox" id="birthday_alert" name="birthday_alert" value="1">';
}
print '</td>';
print '</tr>';
Expand Down
6 changes: 4 additions & 2 deletions htdocs/core/class/extrafields.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ public function addExtraField($attrname, $label, $type, $pos, $size, $elementtyp
// 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;
Expand Down Expand Up @@ -1499,7 +1501,7 @@ public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $
$sql .= $sqlwhere;
//print $sql;

$sql .= ' ORDER BY '.implode(', ', $fields_label);
$sql .= $this->db->order(implode(',', $fields_label));

dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
$resql = $this->db->query($sql);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -7577,7 +7577,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer,
$buyer_country_code = $thirdparty_buyer->country_code;
$buyer_in_cee = isInEEC($thirdparty_buyer);

dol_syslog("get_default_tva: seller use vat=".$seller_use_vat.", seller country=".$seller_country_code.", seller in cee=".((string) (int) $seller_in_cee).", buyer vat number=".$thirdparty_buyer->tva_intra." buyer country=".$buyer_country_code.", buyer in cee=".((string) (int) $buyer_in_cee).", idprod=".$idprod.", idprodfournprice=".$idprodfournprice.", SERVICE_ARE_ECOMMERCE_200238EC=".(getDolGlobalString('SERVICES_ARE_ECOMMERCE_200238EC') ? $conf->global->SERVICES_ARE_ECOMMERCE_200238EC : ''));
dol_syslog("get_default_tva: seller use vat=".$seller_use_vat.", seller country=".$seller_country_code.", seller in cee=".((string) (int) $seller_in_cee).", buyer vat number=".$thirdparty_buyer->tva_intra." buyer country=".$buyer_country_code.", buyer in cee=".((string) (int) $buyer_in_cee).", idprod=".$idprod.", idprodfournprice=".$idprodfournprice.", SERVICE_ARE_ECOMMERCE_200238EC=".(getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC') ? $conf->global->SERVICE_ARE_ECOMMERCE_200238EC : ''));

// If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm)
// we use the buyer VAT.
Expand Down
22 changes: 11 additions & 11 deletions htdocs/core/lib/payments.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y
}

if ($type == 'free') {
$out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '<span style="color: #666666">' : '').$amount.($mode ? '</span>' : '').'&tag='.($mode ? '<span style="color: #666666">' : '').$freetag.($mode ? '</span>' : '');
$out = $urltouse.'/public/payment/newpayment.php?amount='.($mode ? '<span style="color: #666666">' : '').price2num($amount, 'MT').($mode ? '</span>' : '').'&tag='.($mode ? '<span style="color: #666666">' : '').$freetag.($mode ? '</span>' : '');
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';
Expand All @@ -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 ? '</span>' : '');
}
Expand All @@ -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 ? '</span>' : '');
}
Expand All @@ -344,15 +344,15 @@ 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 ? '</span>' : '');
}
}
} 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 ? '<span style="color: #666666">' : '');
if ($mode == 1) {
$out .= 'member_ref';
Expand All @@ -366,11 +366,11 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y
$out .= '&securekey='.urlencode(getDolGlobalString('PAYMENT_SECURITY_TOKEN'));
} else {
$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
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 ? '</span>' : '');
}
Expand All @@ -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 ? '</span>' : '');
}
Expand All @@ -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 ? '</span>' : '');
}
Expand Down
6 changes: 5 additions & 1 deletion htdocs/core/tpl/onlinepaymentlinks.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
* @var Conf $conf
* @var Translate $langs
* @var string $servicename
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
Expand Down
Loading

0 comments on commit 72cb9b2

Please sign in to comment.