mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Replace function rand with mt_rand (prepare php 8)
This commit is contained in:
@@ -117,7 +117,7 @@ $result=0;
|
||||
while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
||||
{
|
||||
$i++;
|
||||
$socid = rand(1, $num_socs);
|
||||
$socid = mt_rand(1, $num_socs);
|
||||
print "Proposal ".$i." for socid ".$socid;
|
||||
|
||||
$soc = new Societe($db);
|
||||
@@ -140,14 +140,14 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
||||
$result=$propal->create($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$nbp = rand(2, 5);
|
||||
$nbp = mt_rand(2, 5);
|
||||
$xnbp = 0;
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$prodid = rand(1, $num_prods);
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$propal->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
|
||||
$result=$propal->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
|
||||
Reference in New Issue
Block a user