Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/admin/translation.php
This commit is contained in:
Laurent Destailleur 2018-01-11 01:14:20 +01:00
commit 90ddfc3f7f
6 changed files with 18 additions and 17 deletions

View File

@ -428,14 +428,14 @@ if ($mode == 'searchkey')
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
foreach($filearray as $file)
{
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
$moduledirname =(basename(dirname(dirname($dir_lang))));
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
$moduledirname =(basename(dirname(dirname($dir_lang))));
$langkey=$tmpfile;
if ($i > 0) $langkey.='@'.$moduledirname;
//var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey);
$langkey=$tmpfile;
if ($i > 0) $langkey.='@'.$moduledirname;
//var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey);
$result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite
$result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite
$result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
if ($result < 0) print 'Failed to load language file '.$tmpfile.'<br>'."\n";
else $nbtotaloffiles++;

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@ -280,14 +281,14 @@ class doc_generic_contract_odt extends ModelePDFContract
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->client;
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{
$socobject=$object->client;
$socobject=$object->thirdparty;
}
// Make substitution
$substitutionarray=array(

View File

@ -307,14 +307,14 @@ class doc_generic_product_odt extends ModelePDFProduct
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->client;
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{
$socobject=$object->client;
$socobject=$object->thirdparty;
}
// Make substitution
$substitutionarray=array(

View File

@ -304,14 +304,14 @@ class doc_generic_user_odt extends ModelePDFUser
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->client;
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{
$socobject=$object->client;
$socobject=$object->thirdparty;
}
// Open and load template

View File

@ -306,14 +306,14 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->client;
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{
$socobject=$object->client;
$socobject=$object->thirdparty;
}
// Make substitution
$substitutionarray=array(

View File

@ -4,7 +4,7 @@
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2015 Charlie Benke <charlies@patas-monkey.com>
* Copyright (C) 2015-2016 Abbes Bahfir <bafbes@gmail.com>
*
@ -308,7 +308,7 @@ if (empty($reshook))
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09');
if (empty($newlang)) $newlang=$srcobject->client->default_lang;
if (empty($newlang)) $newlang=$srcobject->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
@ -887,7 +887,7 @@ if ($action == 'create')
$projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:'');
$soc = $objectsrc->client;
$soc = $objectsrc->thirdparty;
$note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : GETPOST('note_private','none')));
$note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : GETPOST('note_public','none'));