Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.7' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/commande/class/commande.class.php
	htdocs/core/class/dolgraph.class.php
	htdocs/langs/en_AU/main.lang
	htdocs/langs/fr_FR/admin.lang
	htdocs/langs/fr_FR/main.lang
	htdocs/langs/fr_FR/other.lang
  • Loading branch information
eldy committed Mar 16, 2015
2 parents daf853d + 04c88b0 commit 6d7b340
Show file tree
Hide file tree
Showing 1,156 changed files with 34,552 additions and 3,390 deletions.
2 changes: 1 addition & 1 deletion .tx/config
@@ -1,6 +1,6 @@
[main]
host = https://www.transifex.com
lang_map = uz: uz_UZ
lang_map = uz: uz_UZ, sw: sw_SW

[dolibarr.accountancy]
file_filter = htdocs/langs/<lang>/accountancy.lang
Expand Down
16 changes: 15 additions & 1 deletion dev/fixaltlanguages.sh
Expand Up @@ -32,13 +32,18 @@ then
for dir in `find htdocs/langs/$3* -type d`
do
dirshort=`basename $dir`

#echo $dirshort

export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'`
export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'`
aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'`
if [ $aaupper = "EN" ]
then
aaupper="US"
fi
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
if [ "$aa" != "$bblower" ]
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
then
reflang="htdocs/langs/"$aa"_"$aaupper
if [ -d $reflang ]
Expand All @@ -48,6 +53,15 @@ then
echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
for fic in `ls htdocs/langs/${aa}_${bb}/*.lang`;
do f=`cat $fic | wc -l`;
#echo $f lines into file $fic;
if [ $f = 1 ]
then
echo Only one line remainging into file $fic, we delete it;
rm $fic
fi;
done
fi
fi
done;
Expand Down
75 changes: 74 additions & 1 deletion dev/translation/strip_language_file.php
Expand Up @@ -60,6 +60,7 @@

$lPrimary = isset($argv[1])?$argv[1]:'';
$lSecondary = isset($argv[2])?$argv[2]:'';
$lEnglish = 'en_US';
$filesToProcess = isset($argv[3])?$argv[3]:'';

if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
Expand All @@ -73,6 +74,7 @@

$aPrimary = array();
$aSecondary = array();
$aEnglish = array();

// Define array $filesToProcess
if ($filesToProcess == 'all')
Expand All @@ -96,6 +98,7 @@
{
$lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
$lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
$lEnglishFile = 'htdocs/langs/'.$lEnglish.'/'.$fileToProcess;
$output = $lSecondaryFile . '.delta';

print "---- Process language file ".$lSecondaryFile."\n";
Expand All @@ -114,6 +117,13 @@
continue;
}

if ( ! is_readable($lEnglishFile) ) {
$rc = 3;
$msg = "Cannot read english language file $lEnglishFile. We discard this file.";
print $msg . "\n";
continue;
}

// Start reading and parsing Secondary

if ( $handle = fopen($lSecondaryFile, 'r') )
Expand Down Expand Up @@ -172,6 +182,65 @@
}


// Start reading and parsing English

if ( $handle = fopen($lEnglishFile, 'r') )
{
print "Read English File $lEnglishFile:\n";
$cnt = 0;
while (($line = fgets($handle)) !== false)
{
$cnt++;

// strip comments
if ( preg_match("/^\w*#/", $line) ) {
continue;
}
// strip empty lines
if ( preg_match("/^\w*$/", $line) ) {
continue;
}

$a = mb_split('=', trim($line), 2);
if ( count($a) != 2 ) {
print "ERROR in file $lEnglishFile, line $cnt: " . trim($line) . "\n";
continue;
}

list($key, $value) = $a;

// key is redundant
if ( array_key_exists($key, $aEnglish) ) {
print "Key $key is redundant in file $lEnglishFile (line: $cnt).\n";
continue;
}

// String has no value
if ( $value == '' ) {
print "Key $key has no value in file $lEnglishFile (line: $cnt).\n";
continue;
}

$aEnglish[$key] = trim($value);
}
if ( ! feof($handle) )
{
$rc = 5;
$msg = "Unexpected fgets() fail";
print $msg . " (rc=$rc).\n";
exit($rc);
}
fclose($handle);
}
else {
$rc = 6;
$msg = "Cannot open file $lEnglishFile";
print $msg . " (rc=$rc).\n";
exit($rc);
}



// Start reading and parsing Primary. See rules in header!

$arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand');
Expand Down Expand Up @@ -246,7 +315,11 @@
}

// String exists in both files and does not match
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key))
if (
(! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)
)
{
//print "Key $key differs so we add it into new secondary language (line: $cnt).\n";
fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n");
Expand Down
20 changes: 14 additions & 6 deletions dev/translation/txpull.sh
Expand Up @@ -13,7 +13,7 @@ then
echo "This pull remote transifex files to local dir."
echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
echo " Using -f will overwrite local file (does not work with 'all')."
echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]"
echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] [-s]"
exit
fi

Expand All @@ -26,13 +26,21 @@ fi

if [ "x$1" = "xall" ]
then
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
cd htdocs/lang
for dir in `find htdocs/langs/* -type d`
do
echo "tx pull -l $fic $2 $3"
tx pull -l $fic $2 $3
fic=`basename $dir`
if [ $fic != "en_US" ]
then
echo "tx pull -l $fic $2 $3"
tx pull -l $fic $2 $3
fi
done
cd -
else
echo "tx pull -l $1 $2 $3 $4"
tx pull -l $1 $2 $3 $4
echo "tx pull -l $1 $2 $3 $4 $5"
tx pull -l $1 $2 $3 $4 $5
fi

echo Think to launch also:
echo "> dev/fixaltlanguages.sh fix all"
2 changes: 1 addition & 1 deletion htdocs/admin/const.php
Expand Up @@ -229,7 +229,7 @@
$sql.= ", entity";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
if (empty($user->entity) && $debug) {} // to force for superadmin
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin
else $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
$sql.= " ORDER BY entity, name ASC";

Expand Down
9 changes: 7 additions & 2 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -110,7 +110,12 @@ class Commande extends CommonOrder
var $fk_incoterms;
var $location_incoterms;
var $libelle_incoterms; //Used into tooltip


// Pour board
var $nbtodo;
var $nbtodolate;


/**
* ERR Not engouch stock
*/
Expand Down Expand Up @@ -1476,7 +1481,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')

//Incoterms
$this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms;
$this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms;

$this->extraparams = (array) json_decode($obj->extraparams, true);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/dolgraph.class.php
Expand Up @@ -65,7 +65,7 @@ class DolGraph
var $bgcolorgrid=array(255,255,255); // array(R,G,B)
var $datacolor; // array(array(R,G,B),...)

protected $stringtoshow; // To store string to output graph into HTML page
private $_stringtoshow; // To store string to output graph into HTML page


/**
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -2495,7 +2495,7 @@ function dol_print_error($db='',$error='')
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{
$out.=$langs->trans("DolibarrHasDetectedError").".<br>\n";
if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
$out.=$langs->trans("InformationToHelpDiagnose").":<br>\n";

$out.="<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n";
Expand Down
35 changes: 27 additions & 8 deletions htdocs/core/modules/project/doc/pdf_baleine.modules.php
Expand Up @@ -28,6 +28,7 @@
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';


/**
Expand Down Expand Up @@ -77,6 +78,7 @@ function __construct($db)
// Defini position des colonnes
$this->posxref=$this->marge_gauche+1;
$this->posxlabel=$this->marge_gauche+25;
$this->posxworkload=$this->marge_gauche+100;
$this->posxprogress=$this->marge_gauche+140;
$this->posxdatestart=$this->marge_gauche+150;
$this->posxdateend=$this->marge_gauche+170;
Expand Down Expand Up @@ -216,20 +218,22 @@ function write_file($object,$outputlangs)
$progress=$object->lines[$i]->progress.'%';
$datestart=dol_print_date($object->lines[$i]->date_start,'day');
$dateend=dol_print_date($object->lines[$i]->date_end,'day');

$planned_workload=convertSecondToTime($object->lines[$i]->planned_workload,'allhourmin');

$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page

$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell(60, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
$pdf->MultiCell($this->posxlabel-$this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
$pdf->SetXY($this->posxlabel, $curY);
$pdf->MultiCell(108, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
$pdf->SetXY($this->posxworkload, $curY);
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload, 0, 'R');
$pdf->SetXY($this->posxprogress, $curY);
$pdf->MultiCell(16, 3, $progress, 0, 'L');
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
$pdf->SetXY($this->posxdatestart, $curY);
$pdf->MultiCell(20, 3, $datestart, 0, 'L');
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
$pdf->SetXY($this->posxdateend, $curY);
$pdf->MultiCell(20, 3, $dateend, 0, 'L');
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');


$pageposafter=$pdf->getPage();
Expand Down Expand Up @@ -362,8 +366,23 @@ function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0,
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size);

$pdf->SetXY($this->posxref-1, $tab_top+2);
$pdf->MultiCell(80,2, $outputlangs->transnoentities("Tasks"),'','L');
$pdf->SetXY($this->posxref, $tab_top+1);
$pdf->MultiCell($this->posxlabel-$this->posxref,3, $outputlangs->transnoentities("Tasks"),'','L');

$pdf->SetXY($this->posxlabel, $tab_top+1);
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L');

$pdf->SetXY($this->posxworkload, $tab_top+1);
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R');

$pdf->SetXY($this->posxprogress, $tab_top+1);
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, '%', 0, 'R');

$pdf->SetXY($this->posxdatestart, $tab_top+1);
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, '', 0, 'C');

$pdf->SetXY($this->posxdateend, $tab_top+1);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');

}

Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/societe/mod_codecompta_aquarium.php
Expand Up @@ -45,8 +45,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
function __construct()
{
global $conf;
if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
if (! isset($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) || trim($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) == '') $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
if (! isset($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) || trim($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) == '') $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
$this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER;
$this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER;
}
Expand Down

0 comments on commit 6d7b340

Please sign in to comment.