27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/reception.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
42$langs->loadLangs(array(
"admin",
"receptions",
'other'));
49$action =
GETPOST(
'action',
'aZ09');
50$value =
GETPOST(
'value',
'alpha');
51$modulepart =
GETPOST(
'modulepart',
'aZ09');
53$label =
GETPOST(
'label',
'alpha');
54$scandir =
GETPOST(
'scan_dir',
'alpha');
68 $conf->global->RECEPTION_ADDON_NUMBER =
'mod_reception_beryl';
77include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
79if ($action ==
'updateMask') {
80 $maskconst =
GETPOST(
'maskconstreception',
'aZ09');
81 $maskvalue =
GETPOST(
'maskreception',
'alpha');
82 if (!empty($maskconst) && preg_match(
'/_MASK$/', $maskconst)) {
88 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
90 setEventMessages($langs->trans(
"Error"),
null,
'errors');
93} elseif ($action ==
'set_param') {
94 $freetext =
GETPOST(
'RECEPTION_FREE_TEXT',
'restricthtml');
98 setEventMessages($langs->trans(
"Error"),
null,
'errors');
101 $draft =
GETPOST(
'RECEPTION_DRAFT_WATERMARK',
'alpha');
105 setEventMessages($langs->trans(
"Error"),
null,
'errors');
109 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
111} elseif ($action ==
'specimen') {
112 $modele =
GETPOST(
'module',
'alpha');
115 $exp->initAsSpecimen();
120 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
121 foreach ($dirmodels as $reldir) {
122 $file =
dol_buildpath($reldir.
"core/modules/reception/doc/pdf_".$modele.
".modules.php", 0);
123 if (file_exists($file)) {
124 $classname =
"pdf_".$modele;
129 if ($classname !==
'') {
133 '@phan-var-force ModelePdfReception $module';
136 if (
$module->write_file($exp, $langs) > 0) {
137 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=reception&file=SPECIMEN.pdf");
144 setEventMessages($langs->trans(
"ErrorModuleNotFound"),
null,
'errors');
145 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
147} elseif ($action ==
'set') {
150} elseif ($action ==
'del') {
157} elseif ($action ==
'setdoc') {
162 $conf->global->RECEPTION_ADDON_PDF = $value;
170} elseif ($action ==
'setmodel') {
181$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
183$form =
new Form($db);
185llxHeader(
'', $langs->trans(
"ReceptionsSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-reception_setup');
187$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
189print
load_fiche_titre($langs->trans(
"ReceptionsSetup"), $linkback,
'title_setup');
193print
dol_get_fiche_head($head,
'reception', $langs->trans(
"Receptions"), -1,
'reception');
198$reception->initAsSpecimen();
200printNumberingModuleList(
'reception',
'mod_reception_',
'RECEPTION_ADDON_NUMBER', $langs->trans(
"ReceptionsNumberingModules"), $reception,
'setmodel');
207printDocumentModelList(
'reception',
'reception',
'RECEPTION_ADDON_PDF', $langs->trans(
"ReceptionsReceiptModel"), array(
208 'Logo' =>
'option_logo',
209 'PaymentMode' =>
'option_modereg',
210 'PaymentConditions' =>
'option_condreg',
211 'MultiLanguage' =>
'option_multilang',
212 'WatermarkOnDraftOrders' =>
'option_draft_watermark',
224print
'<table class="noborder centpercent">';
225print
'<tr class="liste_titre">';
226print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
240print
'<tr class="oddeven">';
241print
'<td>'.img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"MoreOptionsRelatedToPDF").
'</td>';
243print img_picto(
'',
'url',
'class="pictofixedwidth"').
'<a href="'.DOL_URL_ROOT.
'/admin/pdf_other.php">'.$langs->trans(
"SeeInPDFSetupPage").
'</a>';
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage receptions.
if(! $sortfield) if(! $sortorder) $module
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
reception_admin_prepare_head()
Return array head with list of tabs to view object information.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.