Merge pull request #12101 from frederic34/typos

fix typo inspired by grandoc
This commit is contained in:
Laurent Destailleur 2019-10-12 03:29:40 +02:00 committed by GitHub
commit cffe46729d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 57 deletions

View File

@ -58,7 +58,7 @@ foreach my $file (keys %filelist) {
$ARGV[1]="$DESTI/$file"; $ARGV[1]="$DESTI/$file";
print "Convert file $ARGV[0] into $ARGV[1]\n"; print "Convert file $ARGV[0] into $ARGV[1]\n";
# MySQL to PostgreSQL dump file converter # MySQL to PostgreSQL dump file converter
# #
# For usage: perl mysql2pgsql.perl --help # For usage: perl mysql2pgsql.perl --help
@ -76,18 +76,18 @@ foreach my $file (keys %filelist) {
# 4) add debug option # 4) add debug option
# see rest of changelog at http://cvs.linux.hr/cvsweb.cgi/sql/mysql2pgsql # see rest of changelog at http://cvs.linux.hr/cvsweb.cgi/sql/mysql2pgsql
# 2003-12-16 jsp -- Joe Speigle <joe.speigle@jklh.us>: # 2003-12-16 jsp -- Joe Speigle <joe.speigle@jklh.us>:
# converts: s/\) *Type=MyISAM;/);/i, enum data type -> references, # converts: s/\) *Type=MyISAM;/);/i, enum data type -> references,
# auto_increment->sequences # auto_increment->sequences
# 2004-01-13 jsp -- moved project to gborg; both the above declined ownership # 2004-01-13 jsp -- moved project to gborg; both the above declined ownership
# 2004-06-29 converts: year(4), year(2) # 2004-06-29 converts: year(4), year(2)
# homepage: gborg.postgresql.org # homepage: gborg.postgresql.org
GetOptions("debug", "help"); GetOptions("debug", "help");
my $DEBUG = $opt_debug || 0; my $DEBUG = $opt_debug || 0;
my $HELP = $opt_help || 0; my $HELP = $opt_help || 0;
if (($HELP) || ! defined($ARGV[0]) || ! defined($ARGV[1])) { if (($HELP) || ! defined($ARGV[0]) || ! defined($ARGV[1])) {
print "Usage: perl $0 {--verbose|--help|--debug} mysql_dump_file.sql pg_dump_file.sql\n"; print "Usage: perl $0 {--verbose|--help|--debug} mysql_dump_file.sql pg_dump_file.sql\n";
print "\t* OPTIONS\n"; print "\t* OPTIONS\n";
@ -106,15 +106,15 @@ foreach my $file (keys %filelist) {
print "\tpg_dump_file.sql (undefined)\n"; print "\tpg_dump_file.sql (undefined)\n";
} }
exit 1; exit 1;
} }
open(IN,"<$ARGV[0]") || die "can't open mysql dump file $ARGV[0]"; open(IN,"<$ARGV[0]") || die "can't open mysql dump file $ARGV[0]";
open(OUT,">$ARGV[1]") || die "can't open pg dump file $ARGV[1]"; open(OUT,">$ARGV[1]") || die "can't open pg dump file $ARGV[1]";
print OUT "-- Generated by $PROG\n"; print OUT "-- Generated by $PROG\n";
print OUT "-- (c) 2004, PostgreSQL Inc.\n"; print OUT "-- (c) 2004, PostgreSQL Inc.\n";
print OUT "-- (c) 2005, Laurent Destailleur.\n"; print OUT "-- (c) 2005, Laurent Destailleur.\n";
print OUT "\n"; print OUT "\n";
# Output for create table and create index # Output for create table and create index
sub output_create { sub output_create {
# If command ends with "xxx,);", we change to "xxx);" # If command ends with "xxx,);", we change to "xxx);"
@ -128,7 +128,7 @@ foreach my $file (keys %filelist) {
print OUT $create_index; print OUT $create_index;
} }
} }
# Reset when moving from each "create table" to "insert" part of dump # Reset when moving from each "create table" to "insert" part of dump
sub reset_vars() { sub reset_vars() {
$create_sql=""; $create_sql="";
@ -137,24 +137,24 @@ foreach my $file (keys %filelist) {
$enum_column=''; $enum_column='';
} }
# Boucle sur contenu fichier source # Boucle sur contenu fichier source
#---------------------------------- #----------------------------------
while(<IN>) { while(<IN>) {
# comments or empty lines # comments or empty lines
if (/^-- \$Id/) { if (/^-- \$Id/) {
$_ =~ s/\$//g; $_ =~ s/\$//g;
print OUT $_; print OUT $_;
next; next;
} }
# comments or empty lines # comments or empty lines
if (/^#/ || /^$/ || /^--/) { if (/^#/ || /^$/ || /^--/) {
print OUT $_; print OUT $_;
next; next;
} }
if (/^USE\s*([^;]*);/) { if (/^USE\s*([^;]*);/) {
print OUT "\\c ". $1; print OUT "\\c ". $1;
next; next;
} }
if ($create_sql ne "") { # we are inside create table statement so lets process datatypes if ($create_sql ne "") { # we are inside create table statement so lets process datatypes
@ -167,14 +167,14 @@ foreach my $file (keys %filelist) {
# LDR Added "innodb" and "engine" # LDR Added "innodb" and "engine"
} }
elsif (/(ISAM|innodb)/i) { # end of create table sequence elsif (/(ISAM|innodb)/i) { # end of create table sequence
s/\) *type=(MyISAM|innodb);/);/i; s/\) *type=(MyISAM|innodb);/);/i;
s/\) *engine=(MyISAM|innodb);/);/i; s/\) *engine=(MyISAM|innodb);/);/i;
$create_sql =~ s/,$//g; # strip last , inside create table $create_sql =~ s/,$//g; # strip last , inside create table
$create_sql .= $_; $create_sql .= $_;
&output_create; &output_create;
&reset_vars(); &reset_vars();
next; next;
} }
# enum -> check # enum -> check
if (/([\w\"]*)\s+enum\s*\(((?:['"][\?\w]+['"]\s*,)+['"][\?\w]+['"])\)(.*)$/i) { if (/([\w\"]*)\s+enum\s*\(((?:['"][\?\w]+['"]\s*,)+['"][\?\w]+['"])\)(.*)$/i) {
@ -189,7 +189,7 @@ foreach my $file (keys %filelist) {
$enum_datafield{$enum_column} =~ s/\"/\'/g; $enum_datafield{$enum_column} =~ s/\"/\'/g;
$_ = qq~ $enum_column CHAR($maxlength) CHECK ($enum_column IN ($enum_datafield{$enum_column})) $suite\n~; $_ = qq~ $enum_column CHAR($maxlength) CHECK ($enum_column IN ($enum_datafield{$enum_column})) $suite\n~;
# int, auto_increment -> serial # int, auto_increment -> serial
} elsif (/^[\s\t]*(\w*)\s*.*int.*auto_increment/i) { } elsif (/^[\s\t]*(\w*)\s*.*int.*auto_increment/i) {
$seq = qq~${table}_${1}_seq~; $seq = qq~${table}_${1}_seq~;
s/[\s\t]*([a-zA-Z_0-9]*)\s*.*int.*auto_increment[^,]*/ $1 SERIAL PRIMARY KEY/ig; s/[\s\t]*([a-zA-Z_0-9]*)\s*.*int.*auto_increment[^,]*/ $1 SERIAL PRIMARY KEY/ig;
$create_sql.=$_; $create_sql.=$_;
@ -211,40 +211,40 @@ foreach my $file (keys %filelist) {
elsif (/tinyint/i) { elsif (/tinyint/i) {
s/tinyint/smallint/g; s/tinyint/smallint/g;
} }
# nuke unsigned # nuke unsigned
s/(int\w+|smallint)\s+unsigned/$1/gi; s/(int\w+|smallint)\s+unsigned/$1/gi;
# blob -> text # blob -> text
s/\w*blob/text/gi; s/\w*blob/text/gi;
# tinytext/mediumtext -> text # tinytext/mediumtext -> text
s/tinytext/text/gi; s/tinytext/text/gi;
s/mediumtext/text/gi; s/mediumtext/text/gi;
# char -> varchar # char -> varchar
# PostgreSQL would otherwise pad with spaces as opposed # PostgreSQL would otherwise pad with spaces as opposed
# to MySQL! Your user interface may depend on this! # to MySQL! Your user interface may depend on this!
s/(\s+)char/${1}varchar/gi; s/(\s+)char/${1}varchar/gi;
# nuke date representation (not supported in PostgreSQL) # nuke date representation (not supported in PostgreSQL)
s/datetime default '[^']+'/datetime/i; s/datetime default '[^']+'/datetime/i;
s/date default '[^']+'/datetime/i; s/date default '[^']+'/datetime/i;
s/time default '[^']+'/datetime/i; s/time default '[^']+'/datetime/i;
# 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
s/datetime not null/datetime/i; s/datetime not null/datetime/i;
s/datetime/timestamp/i; s/datetime/timestamp/i;
# nuke size of timestamp # nuke size of timestamp
s/timestamp\([^)]*\)/timestamp/i; s/timestamp\([^)]*\)/timestamp/i;
# double -> numeric # double -> numeric
s/^double/numeric/i; s/^double/numeric/i;
s/(\s*)double/${1}numeric/i; s/(\s*)double/${1}numeric/i;
# float -> numeric # float -> numeric
s/^float/numeric/i; s/^float/numeric/i;
s/(\s*)float/${1}numeric/i; s/(\s*)float/${1}numeric/i;
@ -261,7 +261,7 @@ foreach my $file (keys %filelist) {
$create_sql.=$_; $create_sql.=$_;
next; next;
} }
# unique key [name] (field) # unique key [name] (field)
if (/unique key\s*(\w*)\s*\((\w+)\)/i) { if (/unique key\s*(\w*)\s*\((\w+)\)/i) {
s/unique key\s*(\w*)\s*\((\w+)\)/UNIQUE\($2\)/i; s/unique key\s*(\w*)\s*\((\w+)\)/UNIQUE\($2\)/i;
@ -288,30 +288,30 @@ foreach my $file (keys %filelist) {
$create_index .= "CREATE INDEX $idxname ON $table ($fieldlist);\n"; $create_index .= "CREATE INDEX $idxname ON $table ($fieldlist);\n";
next; next;
} }
# index(field) # index(field)
if (/index\s*(\w*)\s*\((\w+)\)/i) { if (/index\s*(\w*)\s*\((\w+)\)/i) {
my $idxname=($1?"$1":"idx_${table}_$2"); my $idxname=($1?"$1":"idx_${table}_$2");
$create_index .= "CREATE INDEX $idxname ON $table ($2);\n"; $create_index .= "CREATE INDEX $idxname ON $table ($2);\n";
next; next;
} }
# primary key # primary key
if (/\bkey\b/i && !/^\s+primary key\s+/i) { if (/\bkey\b/i && !/^\s+primary key\s+/i) {
s/KEY(\s+)[^(]*(\s+)/$1 UNIQUE $2/i; # hack off name of the non-primary key s/KEY(\s+)[^(]*(\s+)/$1 UNIQUE $2/i; # hack off name of the non-primary key
} }
# key(xxx) # key(xxx)
if (/key\s*\((\w+)\)/i) { if (/key\s*\((\w+)\)/i) {
my $idxname="idx_${table}_$1"; my $idxname="idx_${table}_$1";
$create_index .= "CREATE INDEX $idxname ON $table ($1);\n"; $create_index .= "CREATE INDEX $idxname ON $table ($1);\n";
next; next;
} }
# Quote column names # Quote column names
s/(^\s*)([^\s\-\(]+)(\s*)/$1"$2"$3/gi if (!/\bkey\b/i); s/(^\s*)([^\s\-\(]+)(\s*)/$1"$2"$3/gi if (!/\bkey\b/i);
# Remap colums with names of existing system attribute # Remap columns with names of existing system attribute
if (/"oid"/i) { if (/"oid"/i) {
s/"oid"/"_oid"/g; s/"oid"/"_oid"/g;
print STDERR "WARNING: table $table uses column \"oid\" which is renamed to \"_oid\"\nYou should fix application manually! Press return to continue."; print STDERR "WARNING: table $table uses column \"oid\" which is renamed to \"_oid\"\nYou should fix application manually! Press return to continue.";
@ -330,13 +330,13 @@ foreach my $file (keys %filelist) {
s!\x85!... !g; # \ldots s!\x85!... !g; # \ldots
s!\x92!`!g; s!\x92!`!g;
} }
# fix dates '0000-00-00 00:00:00' (should be null) # fix dates '0000-00-00 00:00:00' (should be null)
s/'0000-00-00 00:00:00'/null/gi; s/'0000-00-00 00:00:00'/null/gi;
s/'0000-00-00'/null/gi; s/'0000-00-00'/null/gi;
s/'00:00:00'/null/gi; s/'00:00:00'/null/gi;
s/([12]\d\d\d)([01]\d)([0-3]\d)([0-2]\d)([0-6]\d)([0-6]\d)/'$1-$2-$3 $4:$5:$6'/; s/([12]\d\d\d)([01]\d)([0-3]\d)([0-2]\d)([0-6]\d)([0-6]\d)/'$1-$2-$3 $4:$5:$6'/;
if (/create\s+table\s+(\w+)/i) { if (/create\s+table\s+(\w+)/i) {
$create_sql = $_; $create_sql = $_;
/create\s*table\s*(\w+)/i; /create\s*table\s*(\w+)/i;
@ -345,11 +345,11 @@ foreach my $file (keys %filelist) {
print OUT $_; print OUT $_;
} }
} # end of if inside create_table } # end of if inside create_table
} # END while(<IN>) } # END while(<IN>)
close IN; close IN;
close OUT; close OUT;
} }
print "\n"; print "\n";
@ -358,4 +358,4 @@ print "\n";
print "Press a key to finish...\n"; print "Press a key to finish...\n";
$stop=<STDIN>; $stop=<STDIN>;
0; 0;

View File

@ -1282,7 +1282,7 @@ class Adherent extends CommonObject
$this->societe = $obj->company; $this->societe = $obj->company;
$this->company = $obj->company; $this->company = $obj->company;
$this->socid = $obj->fk_soc; $this->socid = $obj->fk_soc;
$this->fk_soc = $obj->fk_soc; // For backward comaptibility $this->fk_soc = $obj->fk_soc; // For backward compatibility
$this->address = $obj->address; $this->address = $obj->address;
$this->zip = $obj->zip; $this->zip = $obj->zip;
$this->town = $obj->town; $this->town = $obj->town;

View File

@ -416,7 +416,7 @@ if ($resql)
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre nowraponall" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year?$search_year:-1, 'search_year', 1, 20, 5, 0, 0, '', 'witdhauto valignmiddle'); $formother->select_year($search_year?$search_year:-1, 'search_year', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle');
print '</td>'; print '</td>';
} }
// Date next generation // Date next generation
@ -425,7 +425,7 @@ if ($resql)
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre nowraponall" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_date_when" value="'.$search_day_date_when.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_date_when" value="'.$search_day_date_when.'">';
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month_date_when" value="'.$search_month_date_when.'">'; print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month_date_when" value="'.$search_month_date_when.'">';
$formother->select_year($search_year_date_when?$search_year_date_when:-1, 'search_year_date_when', 1, 20, 5, 0, 0, '', 'witdhauto valignmiddle'); $formother->select_year($search_year_date_when?$search_year_date_when:-1, 'search_year_date_when', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle');
print '</td>'; print '</td>';
} }
// Extra fields // Extra fields

View File

@ -63,7 +63,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple substitution key => substitution value
* *
* @param User $user User * @param User $user User
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output
@ -101,7 +101,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple substitution key => substitution value
* *
* @param Societe $mysoc Object thirdparty * @param Societe $mysoc Object thirdparty
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output
@ -161,7 +161,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple substitution key => substitution value
* *
* @param Societe $object Object * @param Societe $object Object
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output
@ -242,7 +242,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple substitution key => substitution value
* *
* @param Contact $object contact * @param Contact $object contact
* @param Translate $outputlangs object for output * @param Translate $outputlangs object for output
@ -723,7 +723,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple substitution key => substitution value
* *
* @param Object $object Dolibarr Object * @param Object $object Dolibarr Object
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output

View File

@ -1625,7 +1625,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
*/ */
/** /**
* uasort callback function to Sort colums fields * uasort callback function to Sort columns fields
* *
* @param array $a PDF lines array fields configs * @param array $a PDF lines array fields configs
* @param array $b PDF lines array fields configs * @param array $b PDF lines array fields configs
@ -1663,7 +1663,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
// Positionning // Positionning
$curX = $this->page_largeur-$this->marge_droite; // start from right $curX = $this->page_largeur-$this->marge_droite; // start from right
// Array witdh // Array width
$arrayWidth = $this->page_largeur-$this->marge_droite-$this->marge_gauche; $arrayWidth = $this->page_largeur-$this->marge_droite-$this->marge_gauche;
// Count flexible column // Count flexible column
@ -1671,7 +1671,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$countFlexCol = 0; $countFlexCol = 0;
foreach ($this->cols as $colKey => &$colDef) foreach ($this->cols as $colKey => &$colDef)
{ {
if (!$this->getColumnStatus($colKey)) continue; // continue if desable if (!$this->getColumnStatus($colKey)) continue; // continue if disabled
if (!empty($colDef['scale'])){ if (!empty($colDef['scale'])){
// In case of column widht is defined by percentage // In case of column widht is defined by percentage

View File

@ -2010,7 +2010,7 @@ Licensed under the MIT license.
ctx.lineTo(xrange.to + subPixel, yrange.to); ctx.lineTo(xrange.to + subPixel, yrange.to);
} else { } else {
ctx.moveTo(xrange.from, yrange.to + subPixel); ctx.moveTo(xrange.from, yrange.to + subPixel);
ctx.lineTo(xrange.to, yrange.to + subPixel); ctx.lineTo(xrange.to, yrange.to + subPixel);
} }
ctx.stroke(); ctx.stroke();
} else { } else {
@ -2525,9 +2525,9 @@ Licensed under the MIT license.
radius = series.points.radius, radius = series.points.radius,
symbol = series.points.symbol; symbol = series.points.symbol;
// If the user sets the line width to 0, we change it to a very // If the user sets the line width to 0, we change it to a very
// small value. A line width of 0 seems to force the default of 1. // small value. A line width of 0 seems to force the default of 1.
// Doing the conditional here allows the shadow setting to still be // Doing the conditional here allows the shadow setting to still be
// optional even with a lineWidth of 0. // optional even with a lineWidth of 0.
if( lw == 0 ) if( lw == 0 )