28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
59 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
83 $langs->load(
"members");
88 $err = error_reporting();
91 error_reporting($err);
94 $srctemplatepath =
'';
99 if (!empty($conf->global->ADHERENT_CARDS_ADDON_PDF))
101 $code = $conf->global->ADHERENT_CARDS_ADDON_PDF;
105 }
else $code = $modele;
108 $tmp = explode(
':', $template, 2);
112 $srctemplatepath = $tmp[1];
113 }
else $srctemplatepath = $code;
116 $file =
''; $classname =
''; $filefound = 0;
117 $dirmodels = array(
'/');
118 if (is_array($conf->modules_parts[
'models'])) $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
119 foreach ($dirmodels as $reldir)
121 foreach (array(
'doc',
'pdf') as $prefix)
123 $file = $prefix.
"_".$template.
".class.php";
126 $file =
dol_buildpath($reldir.
"core/modules/member/doc/".$file, 0);
127 if (file_exists($file))
130 $classname = $prefix.
'_'.$template;
134 if ($filefound)
break;
143 $obj =
new $classname($db);
147 $sav_charset_output = $outputlangs->charset_output;
148 if ($obj->write_file($arrayofmembers, $outputlangs, $srctemplatepath) > 0)
150 $outputlangs->charset_output = $sav_charset_output;
153 $outputlangs->charset_output = $sav_charset_output;
158 dol_print_error(
'', $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file));
members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir= '', $template= 'standard')
Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Parent class of document generator for members cards.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.