Skip to content

Commit

Permalink
Merge pull request #12101 from frederic34/typos
Browse files Browse the repository at this point in the history
fix typo inspired by grandoc
  • Loading branch information
eldy committed Oct 12, 2019
2 parents dfaf2ae + 9f59656 commit cffe467
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 57 deletions.
86 changes: 43 additions & 43 deletions dev/tools/dolibarr-mysql2pgsql.pl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$ARGV[1]="$DESTI/$file";

print "Convert file $ARGV[0] into $ARGV[1]\n";

# MySQL to PostgreSQL dump file converter
#
# For usage: perl mysql2pgsql.perl --help
Expand All @@ -76,18 +76,18 @@
# 4) add debug option
# see rest of changelog at http://cvs.linux.hr/cvsweb.cgi/sql/mysql2pgsql
# 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
# 2004-01-13 jsp -- moved project to gborg; both the above declined ownership
# 2004-06-29 converts: year(4), year(2)
# homepage: gborg.postgresql.org
# homepage: gborg.postgresql.org

GetOptions("debug", "help");

my $DEBUG = $opt_debug || 0;
my $HELP = $opt_help || 0;


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 "\t* OPTIONS\n";
Expand All @@ -106,15 +106,15 @@
print "\tpg_dump_file.sql (undefined)\n";
}
exit 1;
}
}

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]";
print OUT "-- Generated by $PROG\n";
print OUT "-- (c) 2004, PostgreSQL Inc.\n";
print OUT "-- (c) 2005, Laurent Destailleur.\n";
print OUT "\n";

# Output for create table and create index
sub output_create {
# If command ends with "xxx,);", we change to "xxx);"
Expand All @@ -128,7 +128,7 @@
print OUT $create_index;
}
}

# Reset when moving from each "create table" to "insert" part of dump
sub reset_vars() {
$create_sql="";
Expand All @@ -137,24 +137,24 @@
$enum_column='';
}


# Boucle sur contenu fichier source
#----------------------------------
while(<IN>) {

# comments or empty lines
if (/^-- \$Id/) {
if (/^-- \$Id/) {
$_ =~ s/\$//g;
print OUT $_;
print OUT $_;
next;
}
# comments or empty lines
if (/^#/ || /^$/ || /^--/) {
print OUT $_;
print OUT $_;
next;
}
if (/^USE\s*([^;]*);/) {
print OUT "\\c ". $1;
if (/^USE\s*([^;]*);/) {
print OUT "\\c ". $1;
next;
}
if ($create_sql ne "") { # we are inside create table statement so lets process datatypes
Expand All @@ -167,14 +167,14 @@
# LDR Added "innodb" and "engine"
}
elsif (/(ISAM|innodb)/i) { # end of create table sequence
s/\) *type=(MyISAM|innodb);/);/i;
s/\) *engine=(MyISAM|innodb);/);/i;
s/\) *type=(MyISAM|innodb);/);/i;
s/\) *engine=(MyISAM|innodb);/);/i;
$create_sql =~ s/,$//g; # strip last , inside create table
$create_sql .= $_;
&output_create;
&reset_vars();
next;
}
}

# enum -> check
if (/([\w\"]*)\s+enum\s*\(((?:['"][\?\w]+['"]\s*,)+['"][\?\w]+['"])\)(.*)$/i) {
Expand All @@ -189,7 +189,7 @@
$enum_datafield{$enum_column} =~ s/\"/\'/g;
$_ = qq~ $enum_column CHAR($maxlength) CHECK ($enum_column IN ($enum_datafield{$enum_column})) $suite\n~;
# 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~;
s/[\s\t]*([a-zA-Z_0-9]*)\s*.*int.*auto_increment[^,]*/ $1 SERIAL PRIMARY KEY/ig;
$create_sql.=$_;
Expand All @@ -211,40 +211,40 @@
elsif (/tinyint/i) {
s/tinyint/smallint/g;
}

# nuke unsigned
s/(int\w+|smallint)\s+unsigned/$1/gi;


# blob -> text
s/\w*blob/text/gi;

# tinytext/mediumtext -> text
s/tinytext/text/gi;
s/mediumtext/text/gi;

# char -> varchar
# PostgreSQL would otherwise pad with spaces as opposed
# to MySQL! Your user interface may depend on this!
s/(\s+)char/${1}varchar/gi;

# nuke date representation (not supported in PostgreSQL)
s/datetime default '[^']+'/datetime/i;
s/date default '[^']+'/datetime/i;
s/time default '[^']+'/datetime/i;

# change not null datetime field to null valid ones
# (to support remapping of "zero time" to null
s/datetime not null/datetime/i;
s/datetime/timestamp/i;

# nuke size of timestamp
s/timestamp\([^)]*\)/timestamp/i;

# double -> numeric
s/^double/numeric/i;
s/(\s*)double/${1}numeric/i;

# float -> numeric
s/^float/numeric/i;
s/(\s*)float/${1}numeric/i;
Expand All @@ -261,7 +261,7 @@
$create_sql.=$_;
next;
}

# unique key [name] (field)
if (/unique key\s*(\w*)\s*\((\w+)\)/i) {
s/unique key\s*(\w*)\s*\((\w+)\)/UNIQUE\($2\)/i;
Expand All @@ -288,30 +288,30 @@
$create_index .= "CREATE INDEX $idxname ON $table ($fieldlist);\n";
next;
}

# index(field)
if (/index\s*(\w*)\s*\((\w+)\)/i) {
my $idxname=($1?"$1":"idx_${table}_$2");
$create_index .= "CREATE INDEX $idxname ON $table ($2);\n";
next;
}

# primary key
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
}

# key(xxx)
if (/key\s*\((\w+)\)/i) {
my $idxname="idx_${table}_$1";
$create_index .= "CREATE INDEX $idxname ON $table ($1);\n";
next;
}

# Quote column names
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) {
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.";
Expand All @@ -330,13 +330,13 @@
s!\x85!... !g; # \ldots
s!\x92!`!g;
}

# fix dates '0000-00-00 00:00:00' (should be null)
s/'0000-00-00 00:00:00'/null/gi;
s/'0000-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'/;

if (/create\s+table\s+(\w+)/i) {
$create_sql = $_;
/create\s*table\s*(\w+)/i;
Expand All @@ -345,11 +345,11 @@
print OUT $_;
}
} # end of if inside create_table
} # END while(<IN>)
} # END while(<IN>)

close IN;
close OUT;

}

print "\n";
Expand All @@ -358,4 +358,4 @@
print "Press a key to finish...\n";
$stop=<STDIN>;

0;
0;
2 changes: 1 addition & 1 deletion htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ public function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_opt
$this->societe = $obj->company;
$this->company = $obj->company;
$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->zip = $obj->zip;
$this->town = $obj->town;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/facture/invoicetemplate_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
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.'">';
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>';
}
// Date next generation
Expand All @@ -425,7 +425,7 @@
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.'">';
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>';
}
// Extra fields
Expand Down
10 changes: 5 additions & 5 deletions htdocs/core/class/commondocgenerator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct($db)

// 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 Translate $outputlangs Language object for output
Expand Down Expand Up @@ -101,7 +101,7 @@ public function get_substitutionarray_user($user, $outputlangs)

// 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 Translate $outputlangs Language object for output
Expand Down Expand Up @@ -161,7 +161,7 @@ public function get_substitutionarray_mysoc($mysoc, $outputlangs)

// 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 Translate $outputlangs Language object for output
Expand Down Expand Up @@ -242,7 +242,7 @@ public function get_substitutionarray_thirdparty($object, $outputlangs)

// 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 Translate $outputlangs object for output
Expand Down Expand Up @@ -723,7 +723,7 @@ public function get_substitutionarray_shipment_lines($line, $outputlangs)

// 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 Translate $outputlangs Language object for output
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide
*/

/**
* uasort callback function to Sort colums fields
* uasort callback function to Sort columns fields
*
* @param array $a PDF lines array fields configs
* @param array $b PDF lines array fields configs
Expand Down Expand Up @@ -1663,15 +1663,15 @@ public function prepareArrayColumnField($object, $outputlangs, $hidedetails = 0,
// Positionning
$curX = $this->page_largeur-$this->marge_droite; // start from right

// Array witdh
// Array width
$arrayWidth = $this->page_largeur-$this->marge_droite-$this->marge_gauche;

// Count flexible column
$totalDefinedColWidth = 0;
$countFlexCol = 0;
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'])){
// In case of column widht is defined by percentage
Expand Down
6 changes: 3 additions & 3 deletions htdocs/includes/jquery/plugins/flot/jquery.flot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,7 @@ Licensed under the MIT license.
ctx.lineTo(xrange.to + subPixel, yrange.to);
} else {
ctx.moveTo(xrange.from, yrange.to + subPixel);
ctx.lineTo(xrange.to, yrange.to + subPixel);
ctx.lineTo(xrange.to, yrange.to + subPixel);
}
ctx.stroke();
} else {
Expand Down Expand Up @@ -2525,9 +2525,9 @@ Licensed under the MIT license.
radius = series.points.radius,
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.
// 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.

if( lw == 0 )
Expand Down

0 comments on commit cffe467

Please sign in to comment.