FIX user odt
This commit is contained in:
parent
abeba95de9
commit
cff9fa0e6b
@ -320,16 +320,29 @@ abstract class CommonDocGenerator
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define array with couple subtitution key => subtitution value
|
||||||
|
*
|
||||||
|
* @param Object $object Dolibarr Object
|
||||||
|
* @param Translate $outputlangs Language object for output
|
||||||
|
* @param boolean $recursive Want to fetch child array or child object
|
||||||
|
* @return array Array of substitution key->code
|
||||||
|
*/
|
||||||
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
|
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
|
||||||
foreach($object as $key => $value) {
|
$array_other = array();
|
||||||
if(!is_array($value) && !is_object($value)) {
|
if(!empty($object)) {
|
||||||
$array_other['object_'.$key] = $value;
|
foreach($object as $key => $value) {
|
||||||
}
|
if(!is_array($value) && !is_object($value)) {
|
||||||
if(is_array($value) && $recursive){
|
$array_other['object_'.$key] = $value;
|
||||||
foreach($value as $key2 => $val) {
|
|
||||||
$array_other[$key][$key2] = $this->get_substitutionarray_each_var_object($val,$outputlangs,false);
|
|
||||||
}
|
}
|
||||||
}
|
if(is_array($value) && $recursive){
|
||||||
|
if(!empty($value)) {
|
||||||
|
foreach($value as $key2 => $val) {
|
||||||
|
$array_other[$key][$key2] = $this->get_substitutionarray_each_var_object($val,$outputlangs,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $array_other;
|
return $array_other;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,34 @@ abstract class ModelePDFUser extends CommonDocGenerator
|
|||||||
$type='user';
|
$type='user';
|
||||||
$liste=array();
|
$liste=array();
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
$liste=getListOfModels($db,$type,$maxfilenamelength);
|
||||||
|
return $liste;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parent class to manage intervention document templates
|
||||||
|
*/
|
||||||
|
abstract class ModelePDFUserGroup extends CommonDocGenerator
|
||||||
|
{
|
||||||
|
var $error='';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return list of active generation modules
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
|
* @return array List of templates
|
||||||
|
*/
|
||||||
|
static function liste_modeles($db,$maxfilenamelength=0)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$type='usergroup';
|
||||||
|
$liste=array();
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
$liste=getListOfModels($db,$type,$maxfilenamelength);
|
$liste=getListOfModels($db,$type,$maxfilenamelength);
|
||||||
return $liste;
|
return $liste;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user