34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/expedition.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
50$langs->loadLangs(array(
"admin",
"sendings",
"other"));
56$action =
GETPOST(
'action',
'aZ09');
57$value =
GETPOST(
'value',
'alpha');
58$modulepart =
GETPOST(
'modulepart',
'aZ09');
60$label =
GETPOST(
'label',
'alpha');
61$scandir =
GETPOST(
'scan_dir',
'alpha');
65 $conf->global->EXPEDITION_ADDON_NUMBER =
'mod_expedition_safor';
74include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
76if ($action ==
'updateMask') {
77 $maskconst =
GETPOST(
'maskconstexpedition',
'aZ09');
78 $maskvalue =
GETPOST(
'maskexpedition',
'alpha');
79 if (!empty($maskconst) && preg_match(
'/_MASK$/', $maskconst)) {
85 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
87 setEventMessages($langs->trans(
"Error"),
null,
'errors');
90} elseif ($action ==
'set_param') {
91 $freetext =
GETPOST(
'SHIPPING_FREE_TEXT',
'restricthtml');
95 setEventMessages($langs->trans(
"Error"),
null,
'errors');
98 $draft =
GETPOST(
'SHIPPING_DRAFT_WATERMARK',
'alpha');
102 setEventMessages($langs->trans(
"Error"),
null,
'errors');
106 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
108} elseif ($action ==
'specimen') {
109 $modele =
GETPOST(
'module',
'alpha');
112 $exp->initAsSpecimen();
117 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
118 foreach ($dirmodels as $reldir) {
119 $file =
dol_buildpath($reldir.
"core/modules/expedition/doc/pdf_".$modele.
".modules.php", 0);
120 if (file_exists($file)) {
121 $classname =
"pdf_".$modele;
126 if ($classname !==
'') {
130 '@phan-var-force ModelePdfExpedition $module';
132 if (
$module->write_file($exp, $langs) > 0) {
133 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=expedition&file=SPECIMEN.pdf");
140 setEventMessages($langs->trans(
"ErrorModuleNotFound"),
null,
'errors');
141 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
143} elseif ($action ==
'set') {
146} elseif ($action ==
'del') {
153} elseif ($action ==
'setdoc') {
158 $conf->global->EXPEDITION_ADDON_PDF = $value;
166} elseif ($action ==
'setmodel') {
175$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
177$form =
new Form($db);
179llxHeader(
"", $langs->trans(
"SendingsSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-expedition');
181$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>';
183print
load_fiche_titre($langs->trans(
"SendingsSetup"), $linkback,
'title_setup');
187print
dol_get_fiche_head($head,
'shipment', $langs->trans(
"Sendings"), -1,
'shipment');
192$expedition->initAsSpecimen();
194printNumberingModuleList(
'expedition',
'mod_expedition_',
'EXPEDITION_ADDON_NUMBER', $langs->trans(
"SendingsNumberingModules"), $expedition,
'setmodel');
202printDocumentModelList(
'shipping',
'expedition',
'EXPEDITION_ADDON_PDF', $langs->trans(
"SendingsReceiptModel"), array(
203 'Logo' =>
'option_logo',
204 'PaymentMode' =>
'option_modereg',
205 'PaymentConditions' =>
'option_condreg',
206 'MultiLanguage' =>
'option_multilang',
207 'WatermarkOnDraftOrders' =>
'option_draft_watermark',
217print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post" spellcheck="false">';
218print
'<input type="hidden" name="token" value="'.newToken().
'">';
219print
'<input type="hidden" name="action" value="set_param">';
221print
'<table class="noborder centpercent">';
222print
'<tr class="liste_titre">';
223print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
227print
'<tr class="oddeven">';
228print
'<td>'.$langs->trans(
'SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
231print ajax_constantonoff(
'SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
234print
'<tr class="oddeven">';
235print
'<td>'.$langs->trans(
'SHIPPING_SELL_EAT_BY_DATE_PRE_SELECT_EARLIEST');
238print ajax_constantonoff(
'SHIPPING_SELL_EAT_BY_DATE_PRE_SELECT_EARLIEST');
242$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
243$htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
244foreach ($substitutionarray as $key => $val) {
245 $htmltext .= $key.
'<br>';
249print
'<tr><td colspan="2">';
250print $form->textwithpicto($langs->trans(
"FreeLegalTextOnShippings"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
251$variablename =
'SHIPPING_FREE_TEXT';
253 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
255 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
257 print $doleditor->Create();
262print $form->textwithpicto($langs->trans(
"WatermarkOnDraftContractCards"), $htmltext, 1,
'help',
'', 0, 2,
'watermarktooltip');
264print
'<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.dol_escape_htmltag(
getDolGlobalString(
'SHIPPING_DRAFT_WATERMARK')).
'">';
268print
'<tr class="oddeven">';
269print
'<td>'.$langs->trans(
"AllowOnLineSign");
272print ajax_constantonoff(
'EXPEDITION_ALLOW_ONLINESIGN', array(),
null, 0, 0, 0, 2, 0, 1,
'',
'',
'inline-block', 0, $langs->transnoentitiesnoconv(
"WarningOnlineSignature",
'https://www.dolistore.com'));
276print
'<tr class="oddeven">';
277print
'<td>'.$langs->trans(
"DontPrefillShipmentQty");
280print ajax_constantonoff(
'SHIPMENT_DONT_PREFILL_QTY', array(),
null, 0, 0, 0, 2, 0, 1,
'',
'',
'inline-block', 0,
'');
285print
'<tr class="oddeven">';
286print
'<td>'.img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"Notifications").
'</td>';
288print $langs->trans(
"YouMayFindNotificationsFeaturesIntoModuleNotification");
292print
'<tr class="oddeven">';
293print
'<td>'.img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"MoreOptionsRelatedToPDF").
'</td>';
295print img_picto(
'',
'url',
'class="pictofixedwidth"').
'<a href="'.DOL_URL_ROOT.
'/admin/pdf_other.php">'.$langs->trans(
"SeeInPDFSetupPage").
'</a>';
300print $form->buttonsSaveCancel(
"Modify",
'');
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 a WYSIWYG editor.
if(! $sortfield) if(! $sortorder) $module
expedition_admin_prepare_head()
Return array head with list of tabs to view object information.
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.
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.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.