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

This commit is contained in:
Laurent Destailleur 2016-07-27 12:32:01 +02:00
commit 03767286ef
11 changed files with 53 additions and 47 deletions

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2016 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2012-2016 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -1418,11 +1418,11 @@ else
// Login // Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{ {
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
} }
// Type // Type
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n"; print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
// Morphy // Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>'; print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
@ -1463,7 +1463,7 @@ else
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Birthday // Birthday
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
// Public // Public
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>'; print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';

View File

@ -591,11 +591,11 @@ if ($rowid > 0)
// Login // Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{ {
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
} }
// Type // Type
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n"; print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
// Morphy // Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>'; print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
@ -630,7 +630,7 @@ if ($rowid > 0)
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Birthday // Birthday
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
// Public // Public
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>'; print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';

View File

@ -996,7 +996,7 @@ class ActionComm extends CommonObject
} }
$this->date_creation = $this->db->jdate($obj->datec); $this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem); if (! empty($obj->fk_user_mod)) $this->date_modification = $this->db->jdate($obj->datem);
} }
$this->db->free($result); $this->db->free($result);
} }

View File

@ -322,7 +322,7 @@ abstract class CommonDocGenerator
* *
* @param Object $object Main object to use as data source * @param Object $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @param array_key $array_key Name of the key for return array * @param string $array_key Name of the key for return array
* @return array Array of substitution * @return array Array of substitution
*/ */
function get_substitutionarray_object($object,$outputlangs,$array_key='object') function get_substitutionarray_object($object,$outputlangs,$array_key='object')

View File

@ -130,7 +130,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param string $type type of barcode (EAN, ISBN, ...) * @param string $type type of barcode (EAN, ISBN, ...)
* @return string Value if OK, '' if module not configured, <0 if KO * @return string Value if OK, '' if module not configured, <0 if KO
*/ */
function getNextValue($objproduct,$type='') function getNextValue($objproduct=null,$type='')
{ {
global $db,$conf; global $db,$conf;

View File

@ -91,7 +91,7 @@ abstract class ModeleNumRefBarCode
* @param int $type Type * @param int $type Type
* @return string Value * @return string Value
*/ */
function getNextValue($objsoc=0,$type=-1) function getNextValue($objsoc=null,$type=-1)
{ {
global $langs; global $langs;
return $langs->trans("Function_getNextValue_InModuleNotWorking"); return $langs->trans("Function_getNextValue_InModuleNotWorking");

View File

@ -108,8 +108,7 @@ class modPrinting extends DolibarrModules
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Put 0 if this is a top menu $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Put 0 if this is a top menu
'type'=>'left', // This is a Top menu entry 'type'=>'left', // This is a Top menu entry
'titre'=>'MenuDirectPrinting', 'titre'=>'MenuDirectPrinting',
'mainmenu'=>'printing', 'url'=>'/printing/index.php?mainmenu=home&leftmenu=admintools',
'url'=>'/printing/index.php',
'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>300, 'position'=>300,
'enabled'=>'$conf->printing->enabled && $leftmenu==\'admintools\'', 'enabled'=>'$conf->printing->enabled && $leftmenu==\'admintools\'',

View File

@ -108,25 +108,26 @@ class doc_generic_project_odt extends ModelePDFProjects
* *
* @param Project $object Main object to use as data source * @param Project $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @param string $array_key Name of the key for return array
* @return array Array of substitution * @return array Array of substitution
*/ */
function get_substitutionarray_object($object,$outputlangs) function get_substitutionarray_object($object,$outputlangs,$array_key='object')
{ {
global $conf; global $conf;
$resarray=array( $resarray=array(
'object_id'=>$object->id, $array_key.'_id'=>$object->id,
'object_ref'=>$object->ref, $array_key.'_ref'=>$object->ref,
'object_title'=>$object->title, $array_key.'_title'=>$object->title,
'object_description'=>$object->description, $array_key.'_description'=>$object->description,
'object_date_creation'=>dol_print_date($object->date_c,'day'), $array_key.'_date_creation'=>dol_print_date($object->date_c,'day'),
'object_date_modification'=>dol_print_date($object->date_m,'day'), $array_key.'_date_modification'=>dol_print_date($object->date_m,'day'),
'object_date_start'=>dol_print_date($object->date_start,'day'), $array_key.'_date_start'=>dol_print_date($object->date_start,'day'),
'object_date_end'=>dol_print_date($object->date_end,'day'), $array_key.'_date_end'=>dol_print_date($object->date_end,'day'),
'object_note_private'=>$object->note_private, $array_key.'_note_private'=>$object->note_private,
'object_note_public'=>$object->note_public, $array_key.'_note_public'=>$object->note_public,
'object_public'=>$object->public, $array_key.'_public'=>$object->public,
'object_statut'=>$object->getLibStatut() $array_key.'_statut'=>$object->getLibStatut()
); );
// Retrieve extrafields // Retrieve extrafields

View File

@ -109,25 +109,26 @@ class doc_generic_task_odt extends ModelePDFTask
* *
* @param Project $object Main object to use as data source * @param Project $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @param string $array_key Name of the key for return array
* @return array Array of substitution * @return array Array of substitution
*/ */
function get_substitutionarray_object($object,$outputlangs) function get_substitutionarray_object($object,$outputlangs,$array_key='object')
{ {
global $conf; global $conf;
$resarray=array( $resarray=array(
'object_id'=>$object->id, $array_key.'_id'=>$object->id,
'object_ref'=>$object->ref, $array_key.'_ref'=>$object->ref,
'object_title'=>$object->title, $array_key.'_title'=>$object->title,
'object_description'=>$object->description, $array_key.'_description'=>$object->description,
'object_date_creation'=>dol_print_date($object->date_c,'day'), $array_key.'_date_creation'=>dol_print_date($object->date_c,'day'),
'object_date_modification'=>dol_print_date($object->date_m,'day'), $array_key.'_date_modification'=>dol_print_date($object->date_m,'day'),
'object_date_start'=>dol_print_date($object->date_start,'day'), $array_key.'_date_start'=>dol_print_date($object->date_start,'day'),
'object_date_end'=>dol_print_date($object->date_end,'day'), $array_key.'_date_end'=>dol_print_date($object->date_end,'day'),
'object_note_private'=>$object->note_private, $array_key.'_note_private'=>$object->note_private,
'object_note_public'=>$object->note_public, $array_key.'_note_public'=>$object->note_public,
'object_public'=>$object->public, $array_key.'_public'=>$object->public,
'object_statut'=>$object->getLibStatut() $array_key.'_statut'=>$object->getLibStatut()
); );
// Retrieve extrafields // Retrieve extrafields

View File

@ -106,11 +106,14 @@ abstract class ModeleNumRefSuppliersInvoices
return true; return true;
} }
/** Returns next value assigned /** Returns next value assigned
* *
* @return string Valeur * @param Societe $objsoc Object third party
*/ * @param Object $object Object
function getNextValue() * @param string $mode 'next' for next value or 'last' for last value
* @return string Value if OK, 0 if KO
*/
function getNextValue($objsoc,$object,$mode)
{ {
global $langs; global $langs;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");

View File

@ -30,6 +30,7 @@ if (! $res) die("Include of main fails");
require 'class/dolresource.class.php'; require 'class/dolresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("resource"); $langs->load("resource");
@ -265,7 +266,8 @@ else
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
$fichinter = fetchObjectByElement($element_id, $element); $fichinter = new Fichinter($db);
$fichinter->fetch($element_id);
if (is_object($fichinter)) if (is_object($fichinter))
{ {
$head=fichinter_prepare_head($fichinter); $head=fichinter_prepare_head($fichinter);
@ -283,11 +285,11 @@ else
// Customer // Customer
if ( is_null($fichinter->client) ) if ( is_null($fichinter->thirdparty) )
$fichinter->fetch_thirdparty(); $fichinter->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>"; print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$fichinter->client->getNomUrl(1).'</td></tr>'; print '<td colspan="3">'.$fichinter->thirdparty->getNomUrl(1).'</td></tr>';
print "</table>"; print "</table>";
dol_fiche_end(); dol_fiche_end();