Skip to content

Commit

Permalink
replace deprecated (#31803)
Browse files Browse the repository at this point in the history
* replace deprecated

* replace deprecated
  • Loading branch information
frederic34 authored Nov 13, 2024
1 parent 44371d6 commit 9067c6d
Show file tree
Hide file tree
Showing 100 changed files with 195 additions and 101 deletions.
3 changes: 2 additions & 1 deletion dev/examples/code/create_invoice.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -55,7 +56,7 @@
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();


print "***** ".$script_file." (".$version.") *****\n";
Expand Down
3 changes: 2 additions & 1 deletion dev/examples/code/create_order.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -53,7 +54,7 @@
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();


print "***** ".$script_file." (".$version.") *****\n";
Expand Down
3 changes: 2 additions & 1 deletion dev/examples/code/create_product.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -53,7 +54,7 @@
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();


print "***** ".$script_file." (".$version.") *****\n";
Expand Down
3 changes: 2 additions & 1 deletion dev/examples/code/create_user.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -53,7 +54,7 @@
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();


print "***** ".$script_file." (".$version.") *****\n";
Expand Down
3 changes: 2 additions & 1 deletion dev/examples/code/get_contracts.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -53,7 +54,7 @@
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();


print "***** ".$script_file." (".$version.") *****\n";
Expand Down
3 changes: 2 additions & 1 deletion dev/initdata/generate-invoice.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 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 Expand Up @@ -104,7 +105,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();


$socids = array();
Expand Down
3 changes: 2 additions & 1 deletion dev/initdata/generate-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -110,7 +111,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();

$societesid = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe where client in (1, 3)";
Expand Down
3 changes: 2 additions & 1 deletion dev/initdata/generate-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -58,7 +59,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();


$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
Expand Down
3 changes: 2 additions & 1 deletion dev/initdata/generate-proposal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -106,7 +107,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();


$socids = array();
Expand Down
3 changes: 2 additions & 1 deletion dev/initdata/generate-thirdparty.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 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 Expand Up @@ -61,7 +62,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();


$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
Expand Down
3 changes: 2 additions & 1 deletion dev/initdata/import-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 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 Expand Up @@ -83,7 +84,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();

// Ask confirmation
if (! $confirmed) {
Expand Down
3 changes: 2 additions & 1 deletion dev/initdata/import-thirdparties.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 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 Expand Up @@ -83,7 +84,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();

// Ask confirmation
if (! $confirmed) {
Expand Down
2 changes: 1 addition & 1 deletion dev/initdata/import-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();

// Ask confirmation
if (! $confirmed) {
Expand Down
2 changes: 1 addition & 1 deletion dev/initdata/purge-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
print 'An admin user with login "admin" must exists to use this script.'."\n";
exit;
}
//$user->getrights();
//$user->loadRights();


print "Purge all data for this database:\n";
Expand Down
4 changes: 2 additions & 2 deletions scripts/cron/cron_run_jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
// Language Management
$langs->loadLangs(array('main', 'admin', 'cron', 'dict'));

$user->getrights();
$user->loadRights();

if (isset($argv[3]) && $argv[3]) {
$id = $argv[3];
Expand Down Expand Up @@ -245,7 +245,7 @@
exit(1);
}
}
$user->getrights();
$user->loadRights();
}

// Reload langs
Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/AbstractRestAPITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 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 Expand Up @@ -35,7 +36,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
$conf->global->MAIN_UMASK = '0666';
Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/AccountingAccountTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 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 Expand Up @@ -35,7 +36,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;

Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/ActionCommTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 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 Expand Up @@ -34,7 +35,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;

Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/AdherentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 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 Expand Up @@ -36,7 +37,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;

Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/AdminLibTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 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 Expand Up @@ -35,7 +36,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;

Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/AllTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 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 Expand Up @@ -62,7 +63,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
$conf->global->MAIN_UMASK = '666';
Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/AssetModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 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 Expand Up @@ -34,7 +35,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;

Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/BOMTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) ---Put here your own copyright and developer email---
* Copyright (C) 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 Expand Up @@ -33,7 +34,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;

Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/BankAccountTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 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 Expand Up @@ -35,7 +36,7 @@
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
$user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;

Expand Down
Loading

0 comments on commit 9067c6d

Please sign in to comment.