Removed "defined"
This commit is contained in:
parent
90886bb97f
commit
edda2d759e
@ -19,10 +19,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/dev/generate-facture.php
|
* \file htdocs/dev/generate-facture.php
|
||||||
\brief Script de generation de donnees aleatoires pour les factures
|
* \brief Script de generation de donnees aleatoires pour les factures
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Test si mode batch
|
// Test si mode batch
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -19,11 +19,11 @@
|
|||||||
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
|
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/dev/generate-produit.php
|
* \file htdocs/dev/generate-produit.php
|
||||||
\brief Script de generation de donnees aleatoires pour les produits
|
* \brief Script de generation de donnees aleatoires pour les produits
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Test si mode batch
|
// Test si mode batch
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
@ -52,15 +52,15 @@ define (GEN_NUMBER_PRODUIT, 5);
|
|||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$num = $db->num_rows(); $i = 0;
|
$num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
||||||
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
||||||
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $commandesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
while ($i < $num) { $row = $db->fetch_row($i); $commandesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -20,10 +20,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/dev/generate-propale.php
|
* \file htdocs/dev/generate-propale.php
|
||||||
\brief Script de generation de donnees aleatoires pour les propales
|
* \brief Script de generation de donnees aleatoires pour les propales
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Test si mode batch
|
// Test si mode batch
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
@ -49,7 +49,7 @@ define (GEN_NUMBER_PROPAL, 5);
|
|||||||
|
|
||||||
$sql = "SELECT min(rowid) FROM ".MAIN_DB_PREFIX."user";
|
$sql = "SELECT min(rowid) FROM ".MAIN_DB_PREFIX."user";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$user = new User($db, $row[0]);
|
$user = new User($db, $row[0]);
|
||||||
@ -58,14 +58,14 @@ if ($resql)
|
|||||||
$socids = array();
|
$socids = array();
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num_socs = $db->num_rows($resql);
|
$num_socs = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num_socs)
|
while ($i < $num_socs)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$socids[$i] = $row[0];
|
$socids[$i] = $row[0];
|
||||||
}
|
}
|
||||||
@ -74,14 +74,14 @@ if ($resql)
|
|||||||
$contids = array();
|
$contids = array();
|
||||||
$sql = "SELECT rowid, fk_soc FROM ".MAIN_DB_PREFIX."socpeople";
|
$sql = "SELECT rowid, fk_soc FROM ".MAIN_DB_PREFIX."socpeople";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num_conts = $db->num_rows($resql);
|
$num_conts = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num_conts)
|
while ($i < $num_conts)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$contids[$row[1]][0] = $row[0]; // A ameliorer
|
$contids[$row[1]][0] = $row[0]; // A ameliorer
|
||||||
}
|
}
|
||||||
@ -90,14 +90,14 @@ if ($resql)
|
|||||||
$prodids = array();
|
$prodids = array();
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE envente=1";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE envente=1";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num_prods = $db->num_rows($resql);
|
$num_prods = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num_prods)
|
while ($i < $num_prods)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$prodids[$i] = $row[0];
|
$prodids[$i] = $row[0];
|
||||||
}
|
}
|
||||||
@ -106,9 +106,9 @@ if ($resql)
|
|||||||
$user->rights->propale->valider=1;
|
$user->rights->propale->valider=1;
|
||||||
|
|
||||||
|
|
||||||
if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"))
|
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php");
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php");
|
||||||
}
|
}
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -118,23 +118,23 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
|||||||
$i++;
|
$i++;
|
||||||
$socid = rand(1, $num_socs);
|
$socid = rand(1, $num_socs);
|
||||||
print "Proposal ".$i." for socid ".$socid;
|
print "Proposal ".$i." for socid ".$socid;
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
|
|
||||||
|
|
||||||
$obj = $conf->global->PROPALE_ADDON;
|
$obj = $conf->global->PROPALE_ADDON;
|
||||||
$modPropale = new $obj;
|
$modPropale = new $obj;
|
||||||
$numpr = $modPropale->getNextValue($soc);
|
$numpr = $modPropale->getNextValue($soc);
|
||||||
|
|
||||||
$propal = new Propal($db, $socids[$socid]);
|
$propal = new Propal($db, $socids[$socid]);
|
||||||
|
|
||||||
$propal->ref = $numpr;
|
$propal->ref = $numpr;
|
||||||
$propal->contactid = $contids[$socids[$socid]][0];
|
$propal->contactid = $contids[$socids[$socid]][0];
|
||||||
$propal->datep = time();
|
$propal->datep = time();
|
||||||
$propal->cond_reglement_id = 3;
|
$propal->cond_reglement_id = 3;
|
||||||
$propal->mode_reglement_id = 3;
|
$propal->mode_reglement_id = 3;
|
||||||
$propal->author = $user->id;
|
$propal->author = $user->id;
|
||||||
|
|
||||||
$result=$propal->create($user);
|
$result=$propal->create($user);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,10 +20,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/dev/generate-societe.php
|
* \file htdocs/dev/generate-societe.php
|
||||||
\brief Script de generation de donnees aleatoires pour les societes
|
* \brief Script de generation de donnees aleatoires pour les societes
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Test si mode batch
|
// Test si mode batch
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
@ -45,7 +45,7 @@ include_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
|||||||
$villes = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono");
|
$villes = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono");
|
||||||
$prenoms = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie");
|
$prenoms = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie");
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parametre
|
* Parametre
|
||||||
*/
|
*/
|
||||||
@ -55,15 +55,15 @@ define (GEN_NUMBER_SOCIETE, 10);
|
|||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$num = $db->num_rows(); $i = 0;
|
$num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
||||||
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
||||||
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $commandesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
while ($i < $num) { $row = $db->fetch_row($i); $commandesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user