Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo phan and Co 💊 #31214

Merged
merged 20 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup MariaDB
uses: ankane/setup-mariadb@v1
uses: frederic34/setup-mariadb@v1
with:
# mariadb-version: ${{ matrix.mariadb-version }}
database: travis # Specify your database name
Expand Down
1 change: 1 addition & 0 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ return [
'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'],
'htdocs/compta/cashcontrol/class/cashcontrol.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
Expand Down
20 changes: 11 additions & 9 deletions htdocs/admin/system/database.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2014 Laurent Destailleur <[email protected]>
* Copyright (C) 2004 Sebastien Di Cintio <[email protected]>
* Copyright (C) 2004 Benoit Mortier <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2014 Laurent Destailleur <[email protected]>
* Copyright (C) 2004 Sebastien Di Cintio <[email protected]>
* Copyright (C) 2004 Benoit Mortier <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -41,19 +42,19 @@
*/

if ($action == 'convertutf8unicode') { // Test on permission already done.
$sql = "ALTER DATABASE ".$db->sanitize($table[0])." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
$sql = "ALTER DATABASE CHARACTER SET utf8 COLLATE utf8_unicode_ci";
$db->query($sql);
}
if ($action == 'convertutf8mb4unicode') { // Test on permission already done.
$sql = "ALTER DATABASE ".$db->sanitize($table[0])." CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";
$sql = "ALTER DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";
$db->query($sql);
}
if ($action == 'convertutf8general') { // Test on permission already done.
$sql = "ALTER DATABASE ".$db->sanitize($table[0])." CHARACTER SET utf8 COLLATE utf8_general_ci";
$sql = "ALTER DATABASE CHARACTER SET utf8 COLLATE utf8_general_ci";
$db->query($sql);
}
if ($action == 'convertutf8mb4general') { // Test on permission already done.
$sql = "ALTER DATABASE ".$db->sanitize($table[0])." CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci";
$sql = "ALTER DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci";
$db->query($sql);
}

Expand Down Expand Up @@ -90,6 +91,7 @@
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>';
$defaultcollation = $db->getDefaultCollationDatabase();
print dolPrintHTML($defaultcollation);
global $dolibarr_main_db_collation;
if ($db->type == 'mysqli') {
if ($defaultcollation != $dolibarr_main_db_collation) {
print img_warning('The database default value of collation '.$defaultcollation.' differs from conf setup '.$dolibarr_main_db_collation);
Expand Down
5 changes: 3 additions & 2 deletions htdocs/admin/system/dbtable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* Copyright (C) 2004 Sebastien Di Cintio <[email protected]>
* Copyright (C) 2004 Benoit Mortier <[email protected]>
* Copyright (C) 2005-2012 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -63,7 +64,7 @@
}

$sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE ".$db->sanitize($collation); // We must not sanitize the $row[1]
$reslq2 = $db->query($sql);
$resql2 = $db->query($sql);
if (!$resql2) {
setEventMessages($db->lasterror(), null, 'warnings');
}
Expand Down
15 changes: 8 additions & 7 deletions htdocs/compta/cashcontrol/cashcontrol_card.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <[email protected]>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2013 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2013 Charles-Fr BENKE <[email protected]>
* Copyright (C) 2015 Jean-François Ferry <[email protected]>
* Copyright (C) 2016 Marcos García <[email protected]>
* Copyright (C) 2018 Andreu Bisquerra <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -162,15 +163,15 @@
}
$error = 0;
foreach ($arrayofpaymentmode as $key => $val) {
$object->$key = price2num(GETPOST($key.'_amount', 'alpha'));
$object->$key = (float) price2num(GETPOST($key.'_amount', 'alpha'));
}

if (!$error) {
$object->day_close = GETPOSTINT('closeday');
$object->month_close = GETPOSTINT('closemonth');
$object->year_close = GETPOSTINT('closeyear');

$object->opening = price2num(GETPOST('opening', 'alpha'));
$object->opening = (float) price2num(GETPOST('opening', 'alpha'));
$object->posmodule = GETPOST('posmodule', 'alpha');
$object->posnumber = GETPOST('posnumber', 'alpha');

Expand Down Expand Up @@ -206,9 +207,9 @@
$object->year_close = GETPOST('closeyear', 'int');
*/

$object->cash = price2num(GETPOST('cash_amount', 'alpha'));
$object->card = price2num(GETPOST('card_amount', 'alpha'));
$object->cheque = price2num(GETPOST('cheque_amount', 'alpha'));
$object->cash = (float) price2num(GETPOST('cash_amount', 'alpha'));
$object->card = (float) price2num(GETPOST('card_amount', 'alpha'));
$object->cheque = (float) price2num(GETPOST('cheque_amount', 'alpha'));

$result = $object->update($user);

Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/cashcontrol/cashcontrol_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,10 @@

$object->posmodule = $obj->posmodule;
$object->cash = $obj->cash;
$object->cheque = $obj->cheque;
$object->card = $obj->card;
$object->opening = $obj->opening;
$object->year_close = $obj->year_close;
$object->cheque = $obj->cheque;

// Output Kanban
$selected = -1;
Expand Down
53 changes: 52 additions & 1 deletion htdocs/compta/cashcontrol/class/cashcontrol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,75 @@ class CashControl extends CommonObject
* @var int Object Id
*/
public $id;

/**
* @var string Label
*/
public $label;

/**
* @var float Amount at opening
*/
public $opening;

/**
* @var int Status
*/
public $status;

/**
* @var int Year close
*/
public $year_close;

/**
* @var int Month close
*/
public $month_close;

/**
* @var int Day close
*/
public $day_close;

/**
* @var string posmodule
*/
public $posmodule;

/**
* @var string posnumber
*/
public $posnumber;

/**
* @var float Cash amount
*/
public $cash;

/**
* @var float cheque amount
*/
public $cheque;

/**
* @var float Card amountS
*/
public $card;

/**
* @var int User ID create
*/
public $fk_user_creat;

/**
* @var int|string $date_valid
* @var int|'' $date_valid
*/
public $date_valid;

/**
* @var int User ID
*/
public $fk_user_valid;


Expand Down
2 changes: 1 addition & 1 deletion htdocs/contact/document.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2014-2024 Alexandre Spangaro <[email protected]>
* Copyright (C) 2015-2021 Frederic France <[email protected]>
* Copyright (C) 2015-2024 Frédéric France <[email protected]>
* Copyright (C) 2017 Regis Houssin <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/actions_printing.inc.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2014-2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <[email protected]>
/* Copyright (C) 2014-2016 Laurent Destailleur <[email protected]>
* Copyright (C) 2014-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/class/html.formprojet.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* Copyright (c) 2013 Florian Henry <[email protected]>
* Copyright (C) 2015 Marcos García <[email protected]>
* Copyright (C) 2018 Charlene Benke <[email protected]>
/* Copyright (c) 2013 Florian Henry <[email protected]>
* Copyright (C) 2015 Marcos García <[email protected]>
* Copyright (C) 2018 Charlene Benke <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Benjamin Falière <[email protected]>
Expand Down Expand Up @@ -402,7 +402,7 @@ public function selectTasks($socid = -1, $selected = 0, $htmlname = 'taskid', $m
if (!empty($show_empty)) {
$out .= '<option value="0" class="optiongrey">';
if (!is_numeric($show_empty)) {
//if (!empty($conf->use_javascript_ajax)) $out .= '<span class="opacitymedium">aaa';
//if (!empty($conf->use_javascript_ajax)) $out .= '<span class="opacitymedium">';
$out .= $show_empty;
//if (!empty($conf->use_javascript_ajax)) $out .= '</span>';
} else {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6332,7 +6332,7 @@ function load_fiche_titre($title, $morehtmlright = '', $picto = 'generic', $pict
}

$return .= "\n";
$return .= '<table '.($id ? 'id="'.$id.'" ' : '').'class="centpercent notopnoleftnoright table-fiche-title'.($morecssontable ? ' '.$morecssontable : '').'">'; // maring bottom must be same than into print_barre_list
$return .= '<table '.($id ? 'id="'.$id.'" ' : '').'class="centpercent notopnoleftnoright table-fiche-title'.($morecssontable ? ' '.$morecssontable : '').'">'; // margin bottom must be same than into print_barre_list
$return .= '<tr class="titre">';
if ($picto) {
$return .= '<td class="nobordernopadding widthpictotitle valignmiddle col-picto">'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).'</td>';
Expand Down Expand Up @@ -6407,7 +6407,7 @@ function print_barre_liste($title, $page, $file, $options = '', $sortfield = '',

print "\n";
print "<!-- Begin print_barre_liste -->\n";
print '<table class="centpercent notopnoleftnoright table-fiche-title'.($morecss ? ' '.$morecss : '').'"><tr>'; // maring bottom must be same than into load_fiche_tire
print '<table class="centpercent notopnoleftnoright table-fiche-title'.($morecss ? ' '.$morecss : '').'"><tr>'; // margin bottom must be same than into load_fiche_tire

// Left

Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/agenda.lang
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ PropalClosedRefusedInDolibarr=Proposal %s refused
PropalValidatedInDolibarr=Proposal %s validated
PropalBackToDraftInDolibarr=Proposal %s go back to draft status
PropalClassifiedBilledInDolibarr=Proposal %s classified billed
InvoiceCreatedInDolibarr=Invoice %s created
InvoiceValidatedInDolibarr=Invoice %s validated
InvoiceValidatedInDolibarrFromPos=Invoice %s validated from POS
InvoiceBackToDraftInDolibarr=Invoice %s go back to draft status
Expand Down
4 changes: 2 additions & 2 deletions htdocs/variants/admin/admin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2016 Marcos García <[email protected]>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2016 Marcos García <[email protected]>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions htdocs/zapier/class/api_zapier.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <[email protected]>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
7 changes: 4 additions & 3 deletions htdocs/zapier/class/hook.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <[email protected]>
* Copyright (C) 2019-2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
/* Copyright (C) 2017 Laurent Destailleur <[email protected]>
* Copyright (C) 2019-2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
Expand Down
Loading