diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index ac09e1864b6..347052f86be 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos GarcĂ­a * Copyright (C) 2012-2016 Philippe Grand - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * * 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 @@ -1418,11 +1418,11 @@ else // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' '; + print ''.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' '; } // Type - print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; + print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; // Morphy print ''.$langs->trans("Nature").''.$object->getmorphylib().''; @@ -1463,7 +1463,7 @@ else print ''; // Birthday - print ''; + print ''; // Public print ''; diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 1299f2400dc..92331d2cc88 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -591,11 +591,11 @@ if ($rowid > 0) // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; } // Type - print '\n"; + print '\n"; // Morphy print ''; @@ -630,7 +630,7 @@ if ($rowid > 0) print '
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().'
'; // Birthday - print ''; + print ''; // Public print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index e759e93a635..375365eaf41 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -996,7 +996,7 @@ class ActionComm extends CommonObject } $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); } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index b8aa683097f..a9f764903df 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -322,7 +322,7 @@ abstract class CommonDocGenerator * * @param Object $object Main object to use as data source * @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 */ function get_substitutionarray_object($object,$outputlangs,$array_key='object') diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index aeb7ea4cd8f..8db0d2001cd 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -130,7 +130,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode * @param string $type type of barcode (EAN, ISBN, ...) * @return string Value if OK, '' if module not configured, <0 if KO */ - function getNextValue($objproduct,$type='') + function getNextValue($objproduct=null,$type='') { global $db,$conf; diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index d03302f36b7..00f5fb967f7 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -91,7 +91,7 @@ abstract class ModeleNumRefBarCode * @param int $type Type * @return string Value */ - function getNextValue($objsoc=0,$type=-1) + function getNextValue($objsoc=null,$type=-1) { global $langs; return $langs->trans("Function_getNextValue_InModuleNotWorking"); diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index 0e5965b8793..4a228488947 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -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 'type'=>'left', // This is a Top menu entry 'titre'=>'MenuDirectPrinting', - 'mainmenu'=>'printing', - 'url'=>'/printing/index.php', + 'url'=>'/printing/index.php?mainmenu=home&leftmenu=admintools', 'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>300, 'enabled'=>'$conf->printing->enabled && $leftmenu==\'admintools\'', diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index dfdc17b81ce..2a236e6d62c 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -108,25 +108,26 @@ class doc_generic_project_odt extends ModelePDFProjects * * @param Project $object Main object to use as data source * @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 */ - function get_substitutionarray_object($object,$outputlangs) + function get_substitutionarray_object($object,$outputlangs,$array_key='object') { global $conf; $resarray=array( - 'object_id'=>$object->id, - 'object_ref'=>$object->ref, - 'object_title'=>$object->title, - 'object_description'=>$object->description, - 'object_date_creation'=>dol_print_date($object->date_c,'day'), - 'object_date_modification'=>dol_print_date($object->date_m,'day'), - 'object_date_start'=>dol_print_date($object->date_start,'day'), - 'object_date_end'=>dol_print_date($object->date_end,'day'), - 'object_note_private'=>$object->note_private, - 'object_note_public'=>$object->note_public, - 'object_public'=>$object->public, - 'object_statut'=>$object->getLibStatut() + $array_key.'_id'=>$object->id, + $array_key.'_ref'=>$object->ref, + $array_key.'_title'=>$object->title, + $array_key.'_description'=>$object->description, + $array_key.'_date_creation'=>dol_print_date($object->date_c,'day'), + $array_key.'_date_modification'=>dol_print_date($object->date_m,'day'), + $array_key.'_date_start'=>dol_print_date($object->date_start,'day'), + $array_key.'_date_end'=>dol_print_date($object->date_end,'day'), + $array_key.'_note_private'=>$object->note_private, + $array_key.'_note_public'=>$object->note_public, + $array_key.'_public'=>$object->public, + $array_key.'_statut'=>$object->getLibStatut() ); // Retrieve extrafields diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index fb0d229f6b6..1dba105217d 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -109,25 +109,26 @@ class doc_generic_task_odt extends ModelePDFTask * * @param Project $object Main object to use as data source * @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 */ - function get_substitutionarray_object($object,$outputlangs) + function get_substitutionarray_object($object,$outputlangs,$array_key='object') { global $conf; $resarray=array( - 'object_id'=>$object->id, - 'object_ref'=>$object->ref, - 'object_title'=>$object->title, - 'object_description'=>$object->description, - 'object_date_creation'=>dol_print_date($object->date_c,'day'), - 'object_date_modification'=>dol_print_date($object->date_m,'day'), - 'object_date_start'=>dol_print_date($object->date_start,'day'), - 'object_date_end'=>dol_print_date($object->date_end,'day'), - 'object_note_private'=>$object->note_private, - 'object_note_public'=>$object->note_public, - 'object_public'=>$object->public, - 'object_statut'=>$object->getLibStatut() + $array_key.'_id'=>$object->id, + $array_key.'_ref'=>$object->ref, + $array_key.'_title'=>$object->title, + $array_key.'_description'=>$object->description, + $array_key.'_date_creation'=>dol_print_date($object->date_c,'day'), + $array_key.'_date_modification'=>dol_print_date($object->date_m,'day'), + $array_key.'_date_start'=>dol_print_date($object->date_start,'day'), + $array_key.'_date_end'=>dol_print_date($object->date_end,'day'), + $array_key.'_note_private'=>$object->note_private, + $array_key.'_note_public'=>$object->note_public, + $array_key.'_public'=>$object->public, + $array_key.'_statut'=>$object->getLibStatut() ); // Retrieve extrafields diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index ba7acead6d1..aebc7aa008a 100644 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -106,11 +106,14 @@ abstract class ModeleNumRefSuppliersInvoices return true; } - /** Returns next value assigned - * - * @return string Valeur - */ - function getNextValue() + /** Returns next value assigned + * + * @param Societe $objsoc Object third party + * @param Object $object Object + * @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; return $langs->trans("NotAvailable"); diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 7cb5b74fac3..f8e9e052995 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -30,6 +30,7 @@ if (! $res) die("Include of main fails"); require 'class/dolresource.class.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 $langs->load("resource"); @@ -265,7 +266,8 @@ else { 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)) { $head=fichinter_prepare_head($fichinter); @@ -283,11 +285,11 @@ else // Customer - if ( is_null($fichinter->client) ) + if ( is_null($fichinter->thirdparty) ) $fichinter->fetch_thirdparty(); print ""; - print ''; + print ''; print "
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Public").''.yn($object->public).'
".$langs->trans("Company")."'.$fichinter->client->getNomUrl(1).'
'.$fichinter->thirdparty->getNomUrl(1).'
"; dol_fiche_end();