34require
'../main.inc.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/expedition.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
49$langs->loadLangs(array(
"admin",
"sendings",
"other"));
55$action =
GETPOST(
'action',
'aZ09');
56$value =
GETPOST(
'value',
'alpha');
57$modulepart =
GETPOST(
'modulepart',
'aZ09');
59$label =
GETPOST(
'label',
'alpha');
60$scandir =
GETPOST(
'scan_dir',
'alpha');
64 $conf->global->EXPEDITION_ADDON_NUMBER =
'mod_expedition_safor';
73include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
75if ($action ==
'updateMask') {
76 $maskconst =
GETPOST(
'maskconstexpedition',
'aZ09');
77 $maskvalue =
GETPOST(
'maskexpedition',
'alpha');
78 if (!empty($maskconst) && preg_match(
'/_MASK$/', $maskconst)) {
84 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
86 setEventMessages($langs->trans(
"Error"),
null,
'errors');
89} elseif ($action ==
'set_param') {
90 $freetext =
GETPOST(
'SHIPPING_FREE_TEXT',
'restricthtml');
94 setEventMessages($langs->trans(
"Error"),
null,
'errors');
97 $draft =
GETPOST(
'SHIPPING_DRAFT_WATERMARK',
'alpha');
101 setEventMessages($langs->trans(
"Error"),
null,
'errors');
105 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
107} elseif ($action ==
'specimen') {
108 $modele =
GETPOST(
'module',
'alpha');
111 $exp->initAsSpecimen();
116 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
117 foreach ($dirmodels as $reldir) {
118 $file =
dol_buildpath($reldir.
"core/modules/expedition/doc/pdf_".$modele.
".modules.php", 0);
119 if (file_exists($file)) {
120 $classname =
"pdf_".$modele;
125 if ($classname !==
'') {
129 '@phan-var-force ModelePdfExpedition $module';
131 if (
$module->write_file($exp, $langs) > 0) {
132 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=expedition&file=SPECIMEN.pdf");
139 setEventMessages($langs->trans(
"ErrorModuleNotFound"),
null,
'errors');
140 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
142} elseif ($action ==
'set') {
145} elseif ($action ==
'del') {
152} elseif ($action ==
'setdoc') {
157 $conf->global->EXPEDITION_ADDON_PDF = $value;
165} elseif ($action ==
'setmodel') {
174$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
176$form =
new Form($db);
178llxHeader(
"", $langs->trans(
"SendingsSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-expedition');
180$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>';
182print
load_fiche_titre($langs->trans(
"SendingsSetup"), $linkback,
'title_setup');
186print
dol_get_fiche_head($head,
'shipment', $langs->trans(
"Sendings"), -1,
'shipment');
191$expedition->initAsSpecimen();
193printNumberingModuleList(
'expedition',
'mod_expedition_',
'EXPEDITION_ADDON_NUMBER', $langs->trans(
"SendingsNumberingModules"), $expedition,
'setmodel');
201printDocumentModelList(
'shipping',
'expedition',
'EXPEDITION_ADDON_PDF', $langs->trans(
"SendingsReceiptModel"), array(
202 'Logo' =>
'option_logo',
203 'PaymentMode' =>
'option_modereg',
204 'PaymentConditions' =>
'option_condreg',
205 'MultiLanguage' =>
'option_multilang',
206 'WatermarkOnDraftOrders' =>
'option_draft_watermark',
216print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post" spellcheck="false">';
217print
'<input type="hidden" name="token" value="'.newToken().
'">';
218print
'<input type="hidden" name="action" value="set_param">';
220print
'<table class="noborder centpercent">';
221print
'<tr class="liste_titre">';
222print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
226print
'<tr class="oddeven">';
227print
'<td>'.$langs->trans(
'SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
230print ajax_constantonoff(
'SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
233print
'<tr class="oddeven">';
234print
'<td>'.$langs->trans(
'SHIPPING_SELL_EAT_BY_DATE_PRE_SELECT_EARLIEST');
237print ajax_constantonoff(
'SHIPPING_SELL_EAT_BY_DATE_PRE_SELECT_EARLIEST');
247 $nbstandalone = $staticshipment->countStandalone();
248 if ($nbstandalone < 0) {
249 setEventMessages($staticshipment->error, $staticshipment->errors,
'errors');
252 print
'<tr class="oddeven">';
253 print
'<td>'.$langs->trans(
'SHIPMENT_STANDALONE').
' <span class="opacitymedium">('.$langs->trans(
"VersionExperimental").
')</span>';
254 if ($nbstandalone > 0) {
255 print
'<br><span class="opacitymedium">'.$langs->trans(
"ShipmentStandaloneCantBeDisabled", $nbstandalone).
'</span>';
259 print ajax_constantonoff(
'SHIPMENT_STANDALONE', array(),
null, 0, 0, 0, 2, 0, 0,
'',
'',
'inline-block', 0,
'', ($nbstandalone != 0 ? 1 : 0));
264$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
265$htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
266foreach ($substitutionarray as $key => $val) {
267 $htmltext .= $key.
'<br>';
271print
'<tr><td colspan="2">';
272print $form->textwithpicto($langs->trans(
"FreeLegalTextOnShippings"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
273$variablename =
'SHIPPING_FREE_TEXT';
275 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
277 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
279 print $doleditor->Create();
284print $form->textwithpicto($langs->trans(
"WatermarkOnDraftContractCards"), $htmltext, 1,
'help',
'', 0, 2,
'watermarktooltip');
286print
'<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.dol_escape_htmltag(
getDolGlobalString(
'SHIPPING_DRAFT_WATERMARK')).
'">';
290print
'<tr class="oddeven">';
291print
'<td>'.$langs->trans(
"AllowOnLineSign");
294print ajax_constantonoff(
'EXPEDITION_ALLOW_ONLINESIGN', array(),
null, 0, 0, 0, 2, 0, 1,
'',
'',
'inline-block', 0, $langs->transnoentitiesnoconv(
"WarningOnlineSignature",
'https://www.dolistore.com'));
298print
'<tr class="oddeven">';
299print
'<td>'.$langs->trans(
"DontPrefillShipmentQty");
302print ajax_constantonoff(
'SHIPMENT_DONT_PREFILL_QTY', array(),
null, 0, 0, 0, 2, 0, 1,
'',
'',
'inline-block', 0,
'');
307print
'<tr class="oddeven">';
308print
'<td>'.img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"Notifications").
'</td>';
310print $langs->trans(
"YouMayFindNotificationsFeaturesIntoModuleNotification");
314print
'<tr class="oddeven">';
315print
'<td>'.img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"MoreOptionsRelatedToPDF").
'</td>';
317print img_picto(
'',
'url',
'class="pictofixedwidth"').
'<a href="'.DOL_URL_ROOT.
'/admin/pdf_other.php">'.$langs->trans(
"SeeInPDFSetupPage").
'</a>';
322print $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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.