28require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
57 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
78function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir =
'', $template =
'standard', $filename =
'tmp_cards')
82 $langs->load(
"members");
87 $err = error_reporting();
90 error_reporting($err);
93 $srctemplatepath =
'';
98 $code = $conf->global->ADHERENT_CARDS_ADDON_PDF;
107 $tmp = explode(
':', $template, 2);
108 if (!empty($tmp[1])) {
110 $srctemplatepath = $tmp[1];
112 $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)) {
131 $classname = $prefix.
'_'.$template;
145 $obj =
new $classname($db);
149 $sav_charset_output = $outputlangs->charset_output;
150 if ($obj->write_file($arrayofmembers, $outputlangs, $srctemplatepath,
'member', 0, $filename) > 0) {
151 $outputlangs->charset_output = $sav_charset_output;
154 $outputlangs->charset_output = $sav_charset_output;
159 dol_print_error(
'', $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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return 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.