Fix: Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
This commit is contained in:
parent
ac2d7aab7c
commit
5efe1cd470
@ -138,7 +138,7 @@ if ($action == 'update')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Suppression attribut
|
// Suppression attribut
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
if(isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_GET["attrname"]))
|
if(isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_GET["attrname"]))
|
||||||
|
|||||||
@ -54,7 +54,7 @@ $AdherentsResilies=array();
|
|||||||
|
|
||||||
$AdherentType=array();
|
$AdherentType=array();
|
||||||
|
|
||||||
# Liste les adherents
|
// Liste les adherents
|
||||||
$sql = "SELECT t.rowid, t.libelle, t.cotisation,";
|
$sql = "SELECT t.rowid, t.libelle, t.cotisation,";
|
||||||
$sql.= " d.statut, count(d.rowid) as somme";
|
$sql.= " d.statut, count(d.rowid) as somme";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
|
|||||||
@ -125,7 +125,7 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
if (! $this->type_id && $this->type_code)
|
if (! $this->type_id && $this->type_code)
|
||||||
{
|
{
|
||||||
# Get id from code
|
// Get id from code
|
||||||
$cactioncomm=new CActionComm($this->db);
|
$cactioncomm=new CActionComm($this->db);
|
||||||
$result=$cactioncomm->fetch($this->type_code);
|
$result=$cactioncomm->fetch($this->type_code);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -66,8 +66,8 @@ if ($_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Ce rapport de tresorerie est base sur llx_bank (car doit inclure les transactions sans facture)
|
// Ce rapport de tresorerie est base sur llx_bank (car doit inclure les transactions sans facture)
|
||||||
# plutot que sur llx_paiement + llx_paiementfourn
|
// plutot que sur llx_paiement + llx_paiementfourn
|
||||||
|
|
||||||
$sql = "SELECT SUM(b.amount)";
|
$sql = "SELECT SUM(b.amount)";
|
||||||
$sql.= ", date_format(b.dateo,'%Y-%m') as dm";
|
$sql.= ", date_format(b.dateo,'%Y-%m') as dm";
|
||||||
|
|||||||
@ -349,8 +349,8 @@ class Conf
|
|||||||
if (! isset($this->global->FCKEDITOR_EDITORNAME)) $this->global->FCKEDITOR_EDITORNAME='ckeditor'; // fckeditor to switch
|
if (! isset($this->global->FCKEDITOR_EDITORNAME)) $this->global->FCKEDITOR_EDITORNAME='ckeditor'; // fckeditor to switch
|
||||||
|
|
||||||
// Format for date (used by default when not found or searched in lang)
|
// Format for date (used by default when not found or searched in lang)
|
||||||
$this->format_date_short="%d/%m/%Y"; # Format of day with PHP/C tags (strftime functions)
|
$this->format_date_short="%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions)
|
||||||
$this->format_date_short_java="dd/MM/yyyy"; # Format of day with Java tags
|
$this->format_date_short_java="dd/MM/yyyy"; // Format of day with Java tags
|
||||||
$this->format_hour_short="%H:%M";
|
$this->format_hour_short="%H:%M";
|
||||||
$this->format_hour_short_duration="%H:%M";
|
$this->format_hour_short_duration="%H:%M";
|
||||||
$this->format_date_text_short="%d %b %Y";
|
$this->format_date_text_short="%d %b %Y";
|
||||||
|
|||||||
@ -396,7 +396,7 @@ class RssParser
|
|||||||
$this->inimage = true;
|
$this->inimage = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
# handle atom content constructs
|
// handle atom content constructs
|
||||||
elseif ( $this->_format == 'atom' and in_array($el, $this->_CONTENT_CONSTRUCTS) )
|
elseif ( $this->_format == 'atom' and in_array($el, $this->_CONTENT_CONSTRUCTS) )
|
||||||
{
|
{
|
||||||
// avoid clashing w/ RSS mod_content
|
// avoid clashing w/ RSS mod_content
|
||||||
|
|||||||
@ -395,13 +395,13 @@ if ($step == 2 && $datatoexport)
|
|||||||
// Select request if all fields are selected
|
// Select request if all fields are selected
|
||||||
$sqlmaxforexport=$objexport->build_sql(0,array());
|
$sqlmaxforexport=$objexport->build_sql(0,array());
|
||||||
|
|
||||||
# $this->array_export_module[0]=$module;
|
// $this->array_export_module[0]=$module;
|
||||||
# $this->array_export_code[0]=$module->export_code[$r];
|
// $this->array_export_code[0]=$module->export_code[$r];
|
||||||
# $this->array_export_label[0]=$module->export_label[$r];
|
// $this->array_export_label[0]=$module->export_label[$r];
|
||||||
# $this->array_export_sql[0]=$module->export_sql[$r];
|
// $this->array_export_sql[0]=$module->export_sql[$r];
|
||||||
# $this->array_export_fields[0]=$module->export_fields_array[$r];
|
// $this->array_export_fields[0]=$module->export_fields_array[$r];
|
||||||
# $this->array_export_entities[0]=$module->export_fields_entities[$r];
|
// $this->array_export_entities[0]=$module->export_fields_entities[$r];
|
||||||
# $this->array_export_alias[0]=$module->export_fields_alias[$r];
|
// $this->array_export_alias[0]=$module->export_fields_alias[$r];
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
@ -59,14 +59,14 @@ error_reporting(E_ALL ^ E_NOTICE);
|
|||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
|
|
||||||
|
|
||||||
# Define vars
|
// Define vars
|
||||||
$conffiletoshowshort = "conf.php";
|
$conffiletoshowshort = "conf.php";
|
||||||
# Define localization of conf file
|
// Define localization of conf file
|
||||||
$conffile = "conf/conf.php";
|
$conffile = "conf/conf.php";
|
||||||
$conffiletoshow = "htdocs/conf/conf.php";
|
$conffiletoshow = "htdocs/conf/conf.php";
|
||||||
# For debian/redhat like systems
|
// For debian/redhat like systems
|
||||||
#$conffile = "/etc/dolibarr/conf.php";
|
//$conffile = "/etc/dolibarr/conf.php";
|
||||||
#$conffiletoshow = "/etc/dolibarr/conf.php";
|
//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||||
|
|
||||||
|
|
||||||
// Include configuration
|
// Include configuration
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
|
|
||||||
$s='';
|
$s='';
|
||||||
$s.='<select name="filter" class="flat">';
|
$s.='<select name="filter" class="flat">';
|
||||||
# Add prospect of a particular level
|
// Add prospect of a particular level
|
||||||
$sql = "SELECT code, label";
|
$sql = "SELECT code, label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
||||||
$sql.= " WHERE active > 0";
|
$sql.= " WHERE active > 0";
|
||||||
@ -160,7 +160,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
|
|
||||||
$cibles = array();
|
$cibles = array();
|
||||||
|
|
||||||
# List prospects levels
|
// List prospects levels
|
||||||
$prospectlevel=array();
|
$prospectlevel=array();
|
||||||
$sql = "SELECT code, label";
|
$sql = "SELECT code, label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
||||||
|
|||||||
@ -169,7 +169,7 @@ class mailing_framboise extends MailingTargets
|
|||||||
$s='';
|
$s='';
|
||||||
$s.='<select name="filter" class="flat">';
|
$s.='<select name="filter" class="flat">';
|
||||||
|
|
||||||
# Show categories
|
// Show categories
|
||||||
$sql = "SELECT rowid, label, type, visible";
|
$sql = "SELECT rowid, label, type, visible";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
$sql.= " WHERE type = 3"; // We keep only categories for members
|
$sql.= " WHERE type = 3"; // We keep only categories for members
|
||||||
|
|||||||
@ -163,7 +163,7 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
$s='';
|
$s='';
|
||||||
$s.='<select name="filter" class="flat">';
|
$s.='<select name="filter" class="flat">';
|
||||||
|
|
||||||
# Show categories
|
// Show categories
|
||||||
$sql = "SELECT rowid, label, type, visible";
|
$sql = "SELECT rowid, label, type, visible";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
$sql.= " WHERE type in (1,2)"; // We keep only categories for suppliers and customers/prospects
|
$sql.= " WHERE type in (1,2)"; // We keep only categories for suppliers and customers/prospects
|
||||||
|
|||||||
@ -184,15 +184,15 @@ else
|
|||||||
dolibarr_install_syslog("we try to create conf file '$conffile'");
|
dolibarr_install_syslog("we try to create conf file '$conffile'");
|
||||||
$confexists=0;
|
$confexists=0;
|
||||||
|
|
||||||
# First we try by copying example
|
// First we try by copying example
|
||||||
if (@copy($conffile.".example", $conffile))
|
if (@copy($conffile.".example", $conffile))
|
||||||
{
|
{
|
||||||
# Success
|
// Success
|
||||||
dolibarr_install_syslog("copied file ".$conffile.".example into ".$conffile." done successfully.");
|
dolibarr_install_syslog("copied file ".$conffile.".example into ".$conffile." done successfully.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# If failed, we try to create an empty file
|
// If failed, we try to create an empty file
|
||||||
dolibarr_install_syslog("failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.", LOG_WARNING);
|
dolibarr_install_syslog("failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.", LOG_WARNING);
|
||||||
|
|
||||||
$fp = @fopen($conffile, "w");
|
$fp = @fopen($conffile, "w");
|
||||||
@ -298,7 +298,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# If a database access is available, we set more variable
|
// If a database access is available, we set more variable
|
||||||
if ($ok)
|
if ($ok)
|
||||||
{
|
{
|
||||||
if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0;
|
if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0;
|
||||||
@ -313,7 +313,7 @@ else
|
|||||||
$dolibarrversiontoinstallarray=versiondolibarrarray();
|
$dolibarrversiontoinstallarray=versiondolibarrarray();
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show title
|
// Show title
|
||||||
if (! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ! empty($conf->global->MAIN_VERSION_LAST_INSTALL))
|
if (! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ! empty($conf->global->MAIN_VERSION_LAST_INSTALL))
|
||||||
{
|
{
|
||||||
print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.(empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE).'</font></b><br>';
|
print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.(empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE).'</font></b><br>';
|
||||||
@ -334,7 +334,7 @@ else
|
|||||||
// Array of install choices
|
// Array of install choices
|
||||||
print '<table width="100%" border="1" cellpadding="2">';
|
print '<table width="100%" border="1" cellpadding="2">';
|
||||||
|
|
||||||
# Show first install line
|
// Show first install line
|
||||||
print '<tr><td nowrap="nowrap" align="center"><b>'.$langs->trans("FreshInstall").'</b>';
|
print '<tr><td nowrap="nowrap" align="center"><b>'.$langs->trans("FreshInstall").'</b>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -362,7 +362,7 @@ else
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
|
||||||
# Show upgrade lines
|
// Show upgrade lines
|
||||||
$allowupgrade=true;
|
$allowupgrade=true;
|
||||||
if (empty($dolibarr_main_db_host)) // This means install process was not run
|
if (empty($dolibarr_main_db_host)) // This means install process was not run
|
||||||
{
|
{
|
||||||
|
|||||||
@ -181,15 +181,15 @@ if (! empty($force_install_message))
|
|||||||
if (! empty($main_url)) $dolibarr_main_url_root=$main_url;
|
if (! empty($main_url)) $dolibarr_main_url_root=$main_url;
|
||||||
if (empty($dolibarr_main_url_root))
|
if (empty($dolibarr_main_url_root))
|
||||||
{
|
{
|
||||||
# If defined (Ie: Apache with Linux)
|
// If defined (Ie: Apache with Linux)
|
||||||
if (isset($_SERVER["SCRIPT_URI"])) {
|
if (isset($_SERVER["SCRIPT_URI"])) {
|
||||||
$dolibarr_main_url_root=$_SERVER["SCRIPT_URI"];
|
$dolibarr_main_url_root=$_SERVER["SCRIPT_URI"];
|
||||||
}
|
}
|
||||||
# If defined (Ie: Apache with Caudium)
|
// If defined (Ie: Apache with Caudium)
|
||||||
elseif (isset($_SERVER["SERVER_URL"]) && isset($_SERVER["DOCUMENT_URI"])) {
|
elseif (isset($_SERVER["SERVER_URL"]) && isset($_SERVER["DOCUMENT_URI"])) {
|
||||||
$dolibarr_main_url_root=$_SERVER["SERVER_URL"].$_SERVER["DOCUMENT_URI"];
|
$dolibarr_main_url_root=$_SERVER["SERVER_URL"].$_SERVER["DOCUMENT_URI"];
|
||||||
}
|
}
|
||||||
# If SCRIPT_URI, SERVER_URL, DOCUMENT_URI not defined (Ie: Apache 2.0.44 for Windows)
|
// If SCRIPT_URI, SERVER_URL, DOCUMENT_URI not defined (Ie: Apache 2.0.44 for Windows)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$proto='http';
|
$proto='http';
|
||||||
@ -197,11 +197,11 @@ if (empty($dolibarr_main_url_root))
|
|||||||
else $serverport=$_SERVER["SERVER_NAME"];
|
else $serverport=$_SERVER["SERVER_NAME"];
|
||||||
$dolibarr_main_url_root=$proto."://".$serverport.$_SERVER["SCRIPT_NAME"];
|
$dolibarr_main_url_root=$proto."://".$serverport.$_SERVER["SCRIPT_NAME"];
|
||||||
}
|
}
|
||||||
# Clean proposed URL
|
// Clean proposed URL
|
||||||
$dolibarr_main_url_root = preg_replace('/\/fileconf\.php$/','',$dolibarr_main_url_root); # Remove the /fileconf.php
|
$dolibarr_main_url_root = preg_replace('/\/fileconf\.php$/','',$dolibarr_main_url_root); // Remove the /fileconf.php
|
||||||
$dolibarr_main_url_root = preg_replace('/\/$/','',$dolibarr_main_url_root); # Remove the /
|
$dolibarr_main_url_root = preg_replace('/\/$/','',$dolibarr_main_url_root); // Remove the /
|
||||||
$dolibarr_main_url_root = preg_replace('/\/index\.php$/','',$dolibarr_main_url_root); # Remove the /index.php
|
$dolibarr_main_url_root = preg_replace('/\/index\.php$/','',$dolibarr_main_url_root); // Remove the /index.php
|
||||||
$dolibarr_main_url_root = preg_replace('/\/install$/','',$dolibarr_main_url_root); # Remove the /install
|
$dolibarr_main_url_root = preg_replace('/\/install$/','',$dolibarr_main_url_root); // Remove the /install
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -77,14 +77,14 @@ else
|
|||||||
$includeconferror='';
|
$includeconferror='';
|
||||||
|
|
||||||
|
|
||||||
# Define vars
|
// Define vars
|
||||||
$conffiletoshowshort = "conf.php";
|
$conffiletoshowshort = "conf.php";
|
||||||
# Define localization of conf file
|
// Define localization of conf file
|
||||||
$conffile = "../conf/conf.php";
|
$conffile = "../conf/conf.php";
|
||||||
$conffiletoshow = "htdocs/conf/conf.php";
|
$conffiletoshow = "htdocs/conf/conf.php";
|
||||||
# For debian/redhat like systems
|
// For debian/redhat like systems
|
||||||
#$conffile = "/etc/dolibarr/conf.php";
|
//$conffile = "/etc/dolibarr/conf.php";
|
||||||
#$conffiletoshow = "/etc/dolibarr/conf.php";
|
//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||||
|
|
||||||
|
|
||||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if ($ok)
|
|||||||
$from='^'.$versionfrom;
|
$from='^'.$versionfrom;
|
||||||
$to=$versionto.'\.sql$';
|
$to=$versionto.'\.sql$';
|
||||||
|
|
||||||
# Recupere list fichier
|
// Recupere list fichier
|
||||||
$filesindir=array();
|
$filesindir=array();
|
||||||
$handle=opendir($dir);
|
$handle=opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
@ -178,7 +178,7 @@ if ($ok)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Boucle sur chaque fichier
|
// Boucle sur chaque fichier
|
||||||
foreach($filelist as $file)
|
foreach($filelist as $file)
|
||||||
{
|
{
|
||||||
print '<tr><td nowrap>';
|
print '<tr><td nowrap>';
|
||||||
|
|||||||
@ -292,7 +292,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
|||||||
$from='^'.$versionfrom;
|
$from='^'.$versionfrom;
|
||||||
$to=$versionto.'\.sql$';
|
$to=$versionto.'\.sql$';
|
||||||
|
|
||||||
# Recupere list fichier
|
// Get files list
|
||||||
$filesindir=array();
|
$filesindir=array();
|
||||||
$handle=opendir($dir);
|
$handle=opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
@ -308,7 +308,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
|||||||
print '<div class="error">'.$langs->trans("ErrorCanNotReadDir",$dir).'</div>';
|
print '<div class="error">'.$langs->trans("ErrorCanNotReadDir",$dir).'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Define which file to run
|
// Define which file to run
|
||||||
foreach($filesindir as $file)
|
foreach($filesindir as $file)
|
||||||
{
|
{
|
||||||
if (preg_match('/'.$from.'/i',$file))
|
if (preg_match('/'.$from.'/i',$file))
|
||||||
@ -321,7 +321,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Boucle sur chaque fichier
|
// Boucle sur chaque fichier
|
||||||
foreach($filelist as $file)
|
foreach($filelist as $file)
|
||||||
{
|
{
|
||||||
print '<tr><td nowrap>';
|
print '<tr><td nowrap>';
|
||||||
|
|||||||
@ -154,11 +154,11 @@ class DoliDb
|
|||||||
*/
|
*/
|
||||||
function convertSQLFromMysql($line,$type='auto')
|
function convertSQLFromMysql($line,$type='auto')
|
||||||
{
|
{
|
||||||
# Removed empty line if this is a comment line for SVN tagging
|
// Removed empty line if this is a comment line for SVN tagging
|
||||||
if (preg_match('/^--\s\$Id/i',$line)) {
|
if (preg_match('/^--\s\$Id/i',$line)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
# Return line if this is a comment
|
// Return line if this is a comment
|
||||||
if (preg_match('/^#/i',$line) || preg_match('/^$/i',$line) || preg_match('/^--/i',$line))
|
if (preg_match('/^#/i',$line) || preg_match('/^$/i',$line) || preg_match('/^--/i',$line))
|
||||||
{
|
{
|
||||||
return $line;
|
return $line;
|
||||||
@ -176,8 +176,8 @@ class DoliDb
|
|||||||
{
|
{
|
||||||
$line=preg_replace('/\s/',' ',$line); // Replace tabulation with space
|
$line=preg_replace('/\s/',' ',$line); // Replace tabulation with space
|
||||||
|
|
||||||
# we are inside create table statement so lets process datatypes
|
// we are inside create table statement so lets process datatypes
|
||||||
if (preg_match('/(ISAM|innodb)/i',$line)) { # end of create table sequence
|
if (preg_match('/(ISAM|innodb)/i',$line)) { // end of create table sequence
|
||||||
$line=preg_replace('/\)[\s\t]*type[\s\t]*=[\s\t]*(MyISAM|innodb);/i',');',$line);
|
$line=preg_replace('/\)[\s\t]*type[\s\t]*=[\s\t]*(MyISAM|innodb);/i',');',$line);
|
||||||
$line=preg_replace('/\)[\s\t]*engine[\s\t]*=[\s\t]*(MyISAM|innodb);/i',');',$line);
|
$line=preg_replace('/\)[\s\t]*engine[\s\t]*=[\s\t]*(MyISAM|innodb);/i',');',$line);
|
||||||
$line=preg_replace('/,$/','',$line);
|
$line=preg_replace('/,$/','',$line);
|
||||||
@ -190,51 +190,51 @@ class DoliDb
|
|||||||
$line=$newline;
|
$line=$newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
# tinyint type conversion
|
// tinyint type conversion
|
||||||
$line=str_replace('tinyint','smallint',$line);
|
$line=str_replace('tinyint','smallint',$line);
|
||||||
|
|
||||||
# nuke unsigned
|
// nuke unsigned
|
||||||
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
|
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
|
||||||
|
|
||||||
# blob -> text
|
// blob -> text
|
||||||
$line=preg_replace('/\w*blob/i','text',$line);
|
$line=preg_replace('/\w*blob/i','text',$line);
|
||||||
|
|
||||||
# tinytext/mediumtext -> text
|
// tinytext/mediumtext -> text
|
||||||
$line=preg_replace('/tinytext/i','text',$line);
|
$line=preg_replace('/tinytext/i','text',$line);
|
||||||
$line=preg_replace('/mediumtext/i','text',$line);
|
$line=preg_replace('/mediumtext/i','text',$line);
|
||||||
|
|
||||||
# change not null datetime field to null valid ones
|
// change not null datetime field to null valid ones
|
||||||
# (to support remapping of "zero time" to null
|
// (to support remapping of "zero time" to null
|
||||||
$line=preg_replace('/datetime not null/i','datetime',$line);
|
$line=preg_replace('/datetime not null/i','datetime',$line);
|
||||||
$line=preg_replace('/datetime/i','timestamp',$line);
|
$line=preg_replace('/datetime/i','timestamp',$line);
|
||||||
|
|
||||||
# double -> numeric
|
// double -> numeric
|
||||||
$line=preg_replace('/^double/i','numeric',$line);
|
$line=preg_replace('/^double/i','numeric',$line);
|
||||||
$line=preg_replace('/(\s*)double/i','\\1numeric',$line);
|
$line=preg_replace('/(\s*)double/i','\\1numeric',$line);
|
||||||
# float -> numeric
|
// float -> numeric
|
||||||
$line=preg_replace('/^float/i','numeric',$line);
|
$line=preg_replace('/^float/i','numeric',$line);
|
||||||
$line=preg_replace('/(\s*)float/i','\\1numeric',$line);
|
$line=preg_replace('/(\s*)float/i','\\1numeric',$line);
|
||||||
|
|
||||||
# unique index(field1,field2)
|
// unique index(field1,field2)
|
||||||
if (preg_match('/unique index\s*\((\w+\s*,\s*\w+)\)/i',$line))
|
if (preg_match('/unique index\s*\((\w+\s*,\s*\w+)\)/i',$line))
|
||||||
{
|
{
|
||||||
$line=preg_replace('/unique index\s*\((\w+\s*,\s*\w+)\)/i','UNIQUE\(\\1\)',$line);
|
$line=preg_replace('/unique index\s*\((\w+\s*,\s*\w+)\)/i','UNIQUE\(\\1\)',$line);
|
||||||
}
|
}
|
||||||
|
|
||||||
# We remove end of requests "AFTER fieldxxx"
|
// We remove end of requests "AFTER fieldxxx"
|
||||||
$line=preg_replace('/AFTER [a-z0-9_]+/i','',$line);
|
$line=preg_replace('/AFTER [a-z0-9_]+/i','',$line);
|
||||||
|
|
||||||
# We remove start of requests "ALTER TABLE tablexxx" if this is a DROP INDEX
|
// We remove start of requests "ALTER TABLE tablexxx" if this is a DROP INDEX
|
||||||
$line=preg_replace('/ALTER TABLE [a-z0-9_]+ DROP INDEX/i','DROP INDEX',$line);
|
$line=preg_replace('/ALTER TABLE [a-z0-9_]+ DROP INDEX/i','DROP INDEX',$line);
|
||||||
|
|
||||||
# Translate order to rename fields
|
// Translate order to rename fields
|
||||||
if (preg_match('/ALTER TABLE ([a-z0-9_]+) CHANGE(?: COLUMN)? ([a-z0-9_]+) ([a-z0-9_]+)(.*)$/i',$line,$reg))
|
if (preg_match('/ALTER TABLE ([a-z0-9_]+) CHANGE(?: COLUMN)? ([a-z0-9_]+) ([a-z0-9_]+)(.*)$/i',$line,$reg))
|
||||||
{
|
{
|
||||||
$line = "-- ".$line." replaced by --\n";
|
$line = "-- ".$line." replaced by --\n";
|
||||||
$line.= "ALTER TABLE ".$reg[1]." RENAME COLUMN ".$reg[2]." TO ".$reg[3];
|
$line.= "ALTER TABLE ".$reg[1]." RENAME COLUMN ".$reg[2]." TO ".$reg[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
# Translate order to modify field format
|
// Translate order to modify field format
|
||||||
if (preg_match('/ALTER TABLE ([a-z0-9_]+) MODIFY(?: COLUMN)? ([a-z0-9_]+) (.*)$/i',$line,$reg))
|
if (preg_match('/ALTER TABLE ([a-z0-9_]+) MODIFY(?: COLUMN)? ([a-z0-9_]+) (.*)$/i',$line,$reg))
|
||||||
{
|
{
|
||||||
$line = "-- ".$line." replaced by --\n";
|
$line = "-- ".$line." replaced by --\n";
|
||||||
@ -248,24 +248,24 @@ class DoliDb
|
|||||||
// TODO Add alter to set default value or null/not null if there is this in $reg[3]
|
// TODO Add alter to set default value or null/not null if there is this in $reg[3]
|
||||||
}
|
}
|
||||||
|
|
||||||
# alter table add primary key (field1, field2 ...) -> We remove the primary key name not accepted by PostGreSQL
|
// alter table add primary key (field1, field2 ...) -> We remove the primary key name not accepted by PostGreSQL
|
||||||
# ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, entity);
|
// ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, entity);
|
||||||
if (preg_match('/ALTER\s+TABLE\s*(.*)\s*ADD\s+PRIMARY\s+KEY\s*(.*)\s*\((.*)$/i',$line,$reg))
|
if (preg_match('/ALTER\s+TABLE\s*(.*)\s*ADD\s+PRIMARY\s+KEY\s*(.*)\s*\((.*)$/i',$line,$reg))
|
||||||
{
|
{
|
||||||
$line = "-- ".$line." replaced by --\n";
|
$line = "-- ".$line." replaced by --\n";
|
||||||
$line.= "ALTER TABLE ".$reg[1]." ADD PRIMARY KEY (".$reg[3];
|
$line.= "ALTER TABLE ".$reg[1]." ADD PRIMARY KEY (".$reg[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
# Translate order to drop foreign keys
|
// Translate order to drop foreign keys
|
||||||
# ALTER TABLE llx_dolibarr_modules DROP FOREIGN KEY fk_xxx;
|
// ALTER TABLE llx_dolibarr_modules DROP FOREIGN KEY fk_xxx;
|
||||||
if (preg_match('/ALTER\s+TABLE\s*(.*)\s*DROP\s+FOREIGN\s+KEY\s*(.*)$/i',$line,$reg))
|
if (preg_match('/ALTER\s+TABLE\s*(.*)\s*DROP\s+FOREIGN\s+KEY\s*(.*)$/i',$line,$reg))
|
||||||
{
|
{
|
||||||
$line = "-- ".$line." replaced by --\n";
|
$line = "-- ".$line." replaced by --\n";
|
||||||
$line.= "ALTER TABLE ".$reg[1]." DROP CONSTRAINT ".$reg[2];
|
$line.= "ALTER TABLE ".$reg[1]." DROP CONSTRAINT ".$reg[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
# alter table add [unique] [index] (field1, field2 ...)
|
// alter table add [unique] [index] (field1, field2 ...)
|
||||||
# ALTER TABLE llx_accountingaccount ADD INDEX idx_accountingaccount_fk_pcg_version (fk_pcg_version)
|
// ALTER TABLE llx_accountingaccount ADD INDEX idx_accountingaccount_fk_pcg_version (fk_pcg_version)
|
||||||
if (preg_match('/ALTER\s+TABLE\s*(.*)\s*ADD\s+(UNIQUE INDEX|INDEX|UNIQUE)\s+(.*)\s*\(([\w,\s]+)\)/i',$line,$reg))
|
if (preg_match('/ALTER\s+TABLE\s*(.*)\s*ADD\s+(UNIQUE INDEX|INDEX|UNIQUE)\s+(.*)\s*\(([\w,\s]+)\)/i',$line,$reg))
|
||||||
{
|
{
|
||||||
$fieldlist=$reg[4];
|
$fieldlist=$reg[4];
|
||||||
|
|||||||
@ -4023,14 +4023,14 @@ function utf8_check($str)
|
|||||||
// We must use here a binary strlen function (so not dol_strlen)
|
// We must use here a binary strlen function (so not dol_strlen)
|
||||||
for ($i=0; $i<strlen($str); $i++)
|
for ($i=0; $i<strlen($str); $i++)
|
||||||
{
|
{
|
||||||
if (ord($str[$i]) < 0x80) continue; # 0bbbbbbb
|
if (ord($str[$i]) < 0x80) continue; // 0bbbbbbb
|
||||||
elseif ((ord($str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb
|
elseif ((ord($str[$i]) & 0xE0) == 0xC0) $n=1; // 110bbbbb
|
||||||
elseif ((ord($str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb
|
elseif ((ord($str[$i]) & 0xF0) == 0xE0) $n=2; // 1110bbbb
|
||||||
elseif ((ord($str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb
|
elseif ((ord($str[$i]) & 0xF8) == 0xF0) $n=3; // 11110bbb
|
||||||
elseif ((ord($str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb
|
elseif ((ord($str[$i]) & 0xFC) == 0xF8) $n=4; // 111110bb
|
||||||
elseif ((ord($str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b
|
elseif ((ord($str[$i]) & 0xFE) == 0xFC) $n=5; // 1111110b
|
||||||
else return false; # Does not match any model
|
else return false; // Does not match any model
|
||||||
for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?
|
for ($j=0; $j<$n; $j++) { // n bytes matching 10bbbbbb follow ?
|
||||||
if ((++$i == strlen($str)) || ((ord($str[$i]) & 0xC0) != 0x80))
|
if ((++$i == strlen($str)) || ((ord($str[$i]) & 0xC0) != 0x80))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,11 +79,11 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$IBS_SITE="1999888"; # Site test
|
$IBS_SITE="1999888"; // Site test
|
||||||
if (empty($conf->global->PAYBOX_IBS_SITE)) $conf->global->PAYBOX_IBS_SITE=$IBS_SITE;
|
if (empty($conf->global->PAYBOX_IBS_SITE)) $conf->global->PAYBOX_IBS_SITE=$IBS_SITE;
|
||||||
$IBS_RANG="99"; # Rang test
|
$IBS_RANG="99"; // Rang test
|
||||||
if (empty($conf->global->PAYBOX_IBS_RANG)) $conf->global->PAYBOX_IBS_RANG=$IBS_RANG;
|
if (empty($conf->global->PAYBOX_IBS_RANG)) $conf->global->PAYBOX_IBS_RANG=$IBS_RANG;
|
||||||
$IBS_DEVISE="978"; # Euro
|
$IBS_DEVISE="978"; // Euro
|
||||||
if (empty($conf->global->PAYBOX_IBS_DEVISE)) $conf->global->PAYBOX_IBS_DEVISE=$IBS_DEVISE;
|
if (empty($conf->global->PAYBOX_IBS_DEVISE)) $conf->global->PAYBOX_IBS_DEVISE=$IBS_DEVISE;
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|||||||
@ -75,13 +75,13 @@ function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG)
|
|||||||
dol_syslog("Paybox.lib::print_paybox_redirect", LOG_DEBUG);
|
dol_syslog("Paybox.lib::print_paybox_redirect", LOG_DEBUG);
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$PBX_IDENTIFIANT="2"; # Identifiant pour v2 test
|
$PBX_IDENTIFIANT="2"; // Identifiant pour v2 test
|
||||||
if ($conf->global->PAYBOX_PBX_IDENTIFIANT) $PBX_IDENTIFIANT=$conf->global->PAYBOX_PBX_IDENTIFIANT;
|
if ($conf->global->PAYBOX_PBX_IDENTIFIANT) $PBX_IDENTIFIANT=$conf->global->PAYBOX_PBX_IDENTIFIANT;
|
||||||
$IBS_SITE="1999888"; # Site test
|
$IBS_SITE="1999888"; // Site test
|
||||||
if ($conf->global->PAYBOX_IBS_SITE) $IBS_SITE=$conf->global->PAYBOX_IBS_SITE;
|
if ($conf->global->PAYBOX_IBS_SITE) $IBS_SITE=$conf->global->PAYBOX_IBS_SITE;
|
||||||
$IBS_RANG="99"; # Rang test
|
$IBS_RANG="99"; // Rang test
|
||||||
if ($conf->global->PAYBOX_IBS_RANG) $IBS_RANG=$conf->global->PAYBOX_IBS_RANG;
|
if ($conf->global->PAYBOX_IBS_RANG) $IBS_RANG=$conf->global->PAYBOX_IBS_RANG;
|
||||||
$IBS_DEVISE="840"; # Currency (Dollar US by default)
|
$IBS_DEVISE="840"; // Currency (Dollar US by default)
|
||||||
if ($CURRENCY == 'EUR') $IBS_DEVISE="978";
|
if ($CURRENCY == 'EUR') $IBS_DEVISE="978";
|
||||||
if ($CURRENCY == 'USD') $IBS_DEVISE="840";
|
if ($CURRENCY == 'USD') $IBS_DEVISE="840";
|
||||||
|
|
||||||
@ -112,10 +112,10 @@ function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG)
|
|||||||
|
|
||||||
// Definition des parametres vente produit pour paybox
|
// Definition des parametres vente produit pour paybox
|
||||||
$IBS_CMD=$TAG;
|
$IBS_CMD=$TAG;
|
||||||
$IBS_TOTAL=$PRICE*100; # En centimes
|
$IBS_TOTAL=$PRICE*100; // En centimes
|
||||||
$IBS_MODE=1; # Mode formulaire
|
$IBS_MODE=1; // Mode formulaire
|
||||||
$IBS_PORTEUR=$EMAIL;
|
$IBS_PORTEUR=$EMAIL;
|
||||||
$IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des parametres du get de validation en reponse (url a definir sous paybox)
|
$IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; // Format des parametres du get de validation en reponse (url a definir sous paybox)
|
||||||
//$IBS_TXT="<center><b>".$langsiso->trans("YouWillBeRedirectedOnPayBox")."</b><br><i>".$langsiso->trans("PleaseBePatient")."...</i><br></center>";
|
//$IBS_TXT="<center><b>".$langsiso->trans("YouWillBeRedirectedOnPayBox")."</b><br><i>".$langsiso->trans("PleaseBePatient")."...</i><br></center>";
|
||||||
$IBS_TXT=' '; // Use a space
|
$IBS_TXT=' '; // Use a space
|
||||||
$IBS_BOUTPI=$langs->trans("Wait");
|
$IBS_BOUTPI=$langs->trans("Wait");
|
||||||
|
|||||||
@ -142,7 +142,7 @@ else
|
|||||||
{
|
{
|
||||||
$sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";
|
$sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";
|
||||||
}
|
}
|
||||||
# if the type is not 1, we show all products (type = 0,2,3)
|
// if the type is not 1, we show all products (type = 0,2,3)
|
||||||
if (dol_strlen($type))
|
if (dol_strlen($type))
|
||||||
{
|
{
|
||||||
if ($type == 1) $sql.= " AND p.fk_product_type = '1'";
|
if ($type == 1) $sql.= " AND p.fk_product_type = '1'";
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if ($sall)
|
|||||||
{
|
{
|
||||||
$sql.= " AND (p.ref like '%".$db->escape($sall)."%' OR p.label like '%".$db->escape($sall)."%' OR p.description like '%".$db->escape($sall)."%' OR p.note like '%".$db->escape($sall)."%')";
|
$sql.= " AND (p.ref like '%".$db->escape($sall)."%' OR p.label like '%".$db->escape($sall)."%' OR p.description like '%".$db->escape($sall)."%' OR p.note like '%".$db->escape($sall)."%')";
|
||||||
}
|
}
|
||||||
# if the type is not 1, we show all products (type = 0,2,3)
|
// if the type is not 1, we show all products (type = 0,2,3)
|
||||||
if (dol_strlen($type))
|
if (dol_strlen($type))
|
||||||
{
|
{
|
||||||
if ($type==1) {
|
if ($type==1) {
|
||||||
|
|||||||
@ -262,7 +262,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
### Gestion du logo de la société
|
// Gestion du logo de la société
|
||||||
$dir = $conf->societe->dir_output."/".$object->id."/logos/";
|
$dir = $conf->societe->dir_output."/".$object->id."/logos/";
|
||||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||||
if ($file_OK)
|
if ($file_OK)
|
||||||
@ -293,7 +293,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
### Gestion du logo de la société
|
// Gestion du logo de la société
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -338,7 +338,7 @@ if (empty($reshook))
|
|||||||
$error = $object->error; $errors = $object->errors;
|
$error = $object->error; $errors = $object->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
### Gestion du logo de la société
|
// Gestion du logo de la société
|
||||||
$dir = $conf->societe->dir_output."/".$object->id."/logos";
|
$dir = $conf->societe->dir_output."/".$object->id."/logos";
|
||||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||||
if ($file_OK)
|
if ($file_OK)
|
||||||
@ -381,7 +381,7 @@ if (empty($reshook))
|
|||||||
$errors[] = "ErrorBadImageFormat";
|
$errors[] = "ErrorBadImageFormat";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
### Gestion du logo de la société
|
// Gestion du logo de la société
|
||||||
|
|
||||||
if (! $error && ! count($errors))
|
if (! $error && ! count($errors))
|
||||||
{
|
{
|
||||||
@ -594,7 +594,7 @@ else
|
|||||||
|
|
||||||
$object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
|
$object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||||
|
|
||||||
### Gestion du logo de la société
|
// Gestion du logo de la société
|
||||||
$dir = $conf->societe->dir_output."/".$object->id."/logos";
|
$dir = $conf->societe->dir_output."/".$object->id."/logos";
|
||||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||||
if ($file_OK)
|
if ($file_OK)
|
||||||
|
|||||||
@ -73,14 +73,14 @@ else
|
|||||||
|
|
||||||
$includeconferror='';
|
$includeconferror='';
|
||||||
|
|
||||||
# Define vars
|
// Define vars
|
||||||
$conffiletoshowshort = "conf.php";
|
$conffiletoshowshort = "conf.php";
|
||||||
# Define localization of conf file
|
// Define localization of conf file
|
||||||
$conffile = "../conf/conf.php";
|
$conffile = "../conf/conf.php";
|
||||||
$conffiletoshow = "htdocs/conf/conf.php";
|
$conffiletoshow = "htdocs/conf/conf.php";
|
||||||
# For debian/redhat like systems
|
// For debian/redhat like systems
|
||||||
#$conffile = "/etc/dolibarr/conf.php";
|
//$conffile = "/etc/dolibarr/conf.php";
|
||||||
#$conffiletoshow = "/etc/dolibarr/conf.php";
|
//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||||
|
|
||||||
$charset="UTF-8"; // If not output format found in any conf file
|
$charset="UTF-8"; // If not output format found in any conf file
|
||||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||||
|
|||||||
@ -56,7 +56,7 @@ print '<br><br>';
|
|||||||
$limit=4;
|
$limit=4;
|
||||||
$arrayofwidgets=array(
|
$arrayofwidgets=array(
|
||||||
// Widget for Laurent Destailleur
|
// Widget for Laurent Destailleur
|
||||||
array('name'=>'Laurent Destailleur', # id user 4702
|
array('name'=>'Laurent Destailleur', // id user 4702
|
||||||
'sort'=>1,
|
'sort'=>1,
|
||||||
'logo'=>'logoUrl='.urlencode('http://www.nltechno.com/images/logo_nltechno_long.jpg'), // Put your own logo
|
'logo'=>'logoUrl='.urlencode('http://www.nltechno.com/images/logo_nltechno_long.jpg'), // Put your own logo
|
||||||
'id'=>'4256,4255', // Put of list of sparkangels widget id (for each language)
|
'id'=>'4256,4255', // Put of list of sparkangels widget id (for each language)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user