29require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
58 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
79function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir =
'', $template =
'standard', $filename =
'tmp_cards')
83 $langs->load(
"members");
88 $err = error_reporting();
91 error_reporting($err);
94 $srctemplatepath =
'';
108 $tmp = explode(
':', $template, 2);
109 if (!empty($tmp[1])) {
111 $srctemplatepath = $tmp[1];
113 $srctemplatepath = $code;
119 $dirmodels = array(
'/');
120 if (is_array($conf->modules_parts[
'models'])) {
121 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
123 foreach ($dirmodels as $reldir) {
124 foreach (array(
'doc',
'pdf') as $prefix) {
125 $file = $prefix.
"_".$template.
".class.php";
128 $file =
dol_buildpath($reldir.
"core/modules/member/doc/".$file, 0);
129 if (file_exists($file)) {
130 $classname = $prefix.
'_'.$template;
134 if ($classname !==
'') {
141 if ($classname !==
'') {
144 $obj =
new $classname($db);
146 '@phan-var-force ModelePDFMember $obj';
150 $sav_charset_output = $outputlangs->charset_output;
151 if ($obj->write_file($arrayofmembers, $outputlangs, $srctemplatepath,
'member', 0, $filename) > 0) {
152 $outputlangs->charset_output = $sav_charset_output;
155 $outputlangs->charset_output = $sav_charset_output;
160 dol_print_error(
null, $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file));
Parent class of document generator for members cards.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir='', $template='standard', $filename='tmp_cards')
Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF.