Merge remote-tracking branch 'upstream/develop' into productbatch

This commit is contained in:
Frédéric France 2022-09-01 19:55:24 +02:00
commit 47c5ec7fc6
24 changed files with 443 additions and 388 deletions

View File

@ -632,7 +632,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;

View File

@ -24,6 +24,7 @@ fi
if [ "x$1" = "xfix" ] if [ "x$1" = "xfix" ]
then then
find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \; find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \;
find ./htdocs/install/ -type d -exec chmod ug+rw {} \;
chmod a+x ./scripts/*/*.php chmod a+x ./scripts/*/*.php
chmod a+x ./scripts/*/*.sh chmod a+x ./scripts/*/*.sh
chmod g-w ./scripts/*/*.php chmod g-w ./scripts/*/*.php

View File

@ -167,10 +167,30 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print $enabledisablehtml; print $enabledisablehtml;
print '<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(empty($conf->global->MEMBER_ENABLE_PUBLIC) ? 0 : 1).'">'; print '<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(empty($conf->global->MEMBER_ENABLE_PUBLIC) ? 0 : 1).'">';
print '<br><br>';
print '<br>';
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';
if (isModEnabled('multicompany')) {
$entity_qr = '?entity='.$conf->entity;
} else {
$entity_qr = '';
}
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
print '<br>'; print '<br>';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
@ -248,29 +268,6 @@ print dol_get_fiche_end();
print '</form>'; print '</form>';
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';
if (isModEnabled('multicompany')) {
$entity_qr = '?entity='.$conf->entity;
} else {
$entity_qr = '';
}
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
}
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -385,6 +385,20 @@ if ($mode == 'other') {
print '<td class="titlefieldmiddle"></td>'; print '<td class="titlefieldmiddle"></td>';
print '</tr>'; print '</tr>';
// Show Quick Add link
print '<tr class="oddeven"><td>' . $langs->trans("ShowQuickAddLink") . '</td><td>';
print ajax_constantonoff("MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
print '</tr>';
// Max size of lists // Max size of lists
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>'; print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
print '</tr>'; print '</tr>';
@ -449,12 +463,6 @@ if ($mode == 'other') {
print '</tr>'; print '</tr>';
*/ */
// Show Quick Add link
print '<tr class="oddeven"><td>' . $langs->trans("ShowQuickAddLink") . '</td><td>';
print ajax_constantonoff("MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '</tr>';
// Show bugtrack link // Show bugtrack link
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc")); print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));
@ -463,14 +471,6 @@ if ($mode == 'other') {
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
print '</tr>';
// Disable javascript and ajax // Disable javascript and ajax
print '<tr class="oddeven"><td>' . $form->textwithpicto($langs->trans("DisableJavascript"), $langs->trans("DisableJavascriptNote")) . '</td><td>'; print '<tr class="oddeven"><td>' . $form->textwithpicto($langs->trans("DisableJavascript"), $langs->trans("DisableJavascriptNote")) . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other'); print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');

View File

@ -101,7 +101,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
} }
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml'); $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
if (!empty($text_home)) { if (GETPOSTISSET('TICKET_PUBLIC_TEXT_HOME')) {
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
} else { } else {
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
@ -235,12 +235,10 @@ $head = ticketAdminPrepareHead();
print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.DOL_URL_ROOT.'/public/ticket/index.php?entity='.$conf->entity.'" target="_blank" rel="noopener noreferrer">'.dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 2).'</a>';
print dol_get_fiche_end();
$param = ''; $param = '';
print '<br>';
$enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
// Button off, click to enable // Button off, click to enable
@ -256,9 +254,30 @@ if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $enabledisablehtml; print $enabledisablehtml;
print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? 0 : 1).'">'; print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? 0 : 1).'">';
print '<br><br>'; print dol_get_fiche_end();
if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print '<br>';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> :<br>';
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
print '<br><br>';
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >'; print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setvar">'; print '<input type="hidden" name="action" value="setvar">';
@ -371,8 +390,8 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
print '</td></tr>'; print '</td></tr>';
// Texte d'accueil homepage // Text on home page
$public_text_home = $conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans('TicketPublicInterfaceTextHome'); $public_text_home = getDolGlobalString('TICKET_PUBLIC_TEXT_HOME', '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc").'</span>');
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>'; print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
print '</td><td>'; print '</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -383,7 +402,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help'); print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help');
print '</td></tr>'; print '</td></tr>';
// Texte d'aide à la saisie du message // Text to help to enter a ticket
$public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'); $public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe');
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>'; print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
print '</td><td>'; print '</td><td>';

View File

@ -328,7 +328,7 @@ class FormTicket
print '</td></tr>'; print '</td></tr>';
// Severity // Severity
print '<tr><td><span class="fieldrequired"><label for="selectseverity_code">'.$langs->trans("TicketSeverity").'</span></label></td><td>'; print '<tr><td><span class="none"><label for="selectseverity_code">'.$langs->trans("TicketSeverity").'</span></label></td><td>';
$this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1); $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1);
print '</td></tr>'; print '</td></tr>';
@ -643,7 +643,7 @@ class FormTicket
print dol_get_fiche_end(); print dol_get_fiche_end();
} }
print '<br>'; print '<br><br>';
print $form->buttonsSaveCancel(((isset($this->withreadid) && $this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : "")); print $form->buttonsSaveCancel(((isset($this->withreadid) && $this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));

View File

@ -119,7 +119,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&amp;leftmenu=product&amp;action=create&amp;type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&amp;leftmenu=product&amp;action=create&amp;type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&amp;leftmenu=product&amp;type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&amp;leftmenu=product&amp;type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&amp;type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&amp;type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&amp;type=0', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&amp;type=0&amp;search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__);

View File

@ -1812,11 +1812,11 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
if (isModEnabled('comptabilite')) { if (isModEnabled('comptabilite')) {
// Files // Files
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files'); $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
} }
// Bilan, resultats // Bilan, resultats
$newmenu->add("/compta/resultat/index.php?leftmenu=report&amp;mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) {
$newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire);
@ -1998,7 +1998,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
} }
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
$langs->load("stocks"); $langs->load("stocks");
$newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
$newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
} }
if (isModEnabled('variants')) { if (isModEnabled('variants')) {

View File

@ -451,7 +451,7 @@ if ($step == 1 || !$datatoexport) {
print $label; print $label;
print '</td><td class="right">'; print '</td><td class="right">';
if ($objexport->array_export_perms[$key]) { if ($objexport->array_export_perms[$key]) {
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.'&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15x"').'</a>'; print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.'&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15"').'</a>';
} else { } else {
print '<span class="opacitymedium">'.$langs->trans("NotEnoughPermissions").'</span>'; print '<span class="opacitymedium">'.$langs->trans("NotEnoughPermissions").'</span>';
} }

View File

@ -394,7 +394,7 @@ if ($step == 1 || !$datatoimport) {
print $objimport->array_import_label[$key]; print $objimport->array_import_label[$key];
print '</td><td style="text-align: right">'; print '</td><td style="text-align: right">';
if ($objimport->array_import_perms[$key]) { if ($objimport->array_import_perms[$key]) {
print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=2&datatoimport='.$objimport->array_import_code[$key].$param.'">'.img_picto($langs->trans("NewImport"), 'next', 'class="fa-15x"').'</a>'; print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=2&datatoimport='.$objimport->array_import_code[$key].$param.'">'.img_picto($langs->trans("NewImport"), 'next', 'class="fa-15"').'</a>';
} else { } else {
print $langs->trans("NotEnoughPermissions"); print $langs->trans("NotEnoughPermissions");
} }
@ -499,7 +499,7 @@ if ($step == 2 && $datatoimport) {
print '</td>'; print '</td>';
// Action button // Action button
print '<td style="text-align:right">'; print '<td style="text-align:right">';
print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=3&format='.$key.$param.'">'.img_picto($langs->trans("SelectFormat"), 'next', 'class="fa-15x"').'</a>'; print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=3&format='.$key.$param.'">'.img_picto($langs->trans("SelectFormat"), 'next', 'class="fa-15"').'</a>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
@ -727,7 +727,7 @@ if ($step == 3 && $datatoimport) {
print '">'.img_delete().'</a></td>'; print '">'.img_delete().'</a></td>';
// Action button // Action button
print '<td style="text-align:right">'; print '<td style="text-align:right">';
print '<a href="'.$_SERVER['PHP_SELF'].'?step=4'.$param.'&filetoimport='.urlencode($relativepath).'">'.img_picto($langs->trans("NewImport"), 'next', 'class="fa-15x"').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?step=4'.$param.'&filetoimport='.urlencode($relativepath).'">'.img_picto($langs->trans("NewImport"), 'next', 'class="fa-15"').'</a>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -2223,7 +2223,7 @@ NoExternalModuleWithUpdate=No updates found for external modules
SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) SwaggerDescriptionFile=Swagger API description file (for use with redoc for example)
YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead.
RandomlySelectedIfSeveral=Randomly selected if several pictures are available RandomlySelectedIfSeveral=Randomly selected if several pictures are available
SalesRepresentativeInfo=For Proposals, Orders, Invoces. SalesRepresentativeInfo=For Proposals, Orders, Invoices.
DatabasePasswordObfuscated=Database password is obfuscated in conf file DatabasePasswordObfuscated=Database password is obfuscated in conf file
DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file
APIsAreNotEnabled=APIs modules are not enabled APIsAreNotEnabled=APIs modules are not enabled

View File

@ -24,6 +24,7 @@ StockAtDateInFuture=Date in the future
StocksByLotSerial=Stocks by lot/serial StocksByLotSerial=Stocks by lot/serial
LotSerial=Lots/Serials LotSerial=Lots/Serials
LotSerialList=List of lot/serials LotSerialList=List of lot/serials
SubjectToLotSerialOnly=Products subject to lot/serial only
Movements=Movements Movements=Movements
ErrorWarehouseRefRequired=Warehouse reference name is required ErrorWarehouseRefRequired=Warehouse reference name is required
ListOfWarehouses=List of warehouses ListOfWarehouses=List of warehouses

View File

@ -296,7 +296,7 @@ TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket
TicketCloseEmailBodyInfosTrackUrlCustomer=You can consult the history of this ticket by clicking the following link TicketCloseEmailBodyInfosTrackUrlCustomer=You can consult the history of this ticket by clicking the following link
TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface. TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface.
TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system. TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system.
TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request. TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe your question. Provide the most information possible to allow us to correctly identify your request.
TicketPublicMsgViewLogIn=Please enter ticket tracking ID TicketPublicMsgViewLogIn=Please enter ticket tracking ID
TicketTrackId=Public Tracking ID TicketTrackId=Public Tracking ID
OneOfTicketTrackId=One of your tracking ID OneOfTicketTrackId=One of your tracking ID

View File

@ -1153,6 +1153,11 @@ if (!defined('NOLOGIN')) {
$conf->theme = $user->conf->MAIN_THEME; $conf->theme = $user->conf->MAIN_THEME;
$conf->css = "/theme/".$conf->theme."/style.css.php"; $conf->css = "/theme/".$conf->theme."/style.css.php";
} }
} else {
// We may have NOLOGIN set, but NOREQUIREUSER not
if (!empty($user) && method_exists($user, 'loadDefaultValues')) {
$user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0
}
} }

View File

@ -41,7 +41,7 @@ $snom = GETPOST("snom", 'alpha');
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT; $type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT;
$search_barcode = GETPOST("search_barcode", 'alpha'); $search_barcode = GETPOST("search_barcode", 'alpha');
$toolowstock = GETPOST('toolowstock'); $search_toolowstock = GETPOST('search_toolowstock');
$tosell = GETPOST("tosell"); $tosell = GETPOST("tosell");
$tobuy = GETPOST("tobuy"); $tobuy = GETPOST("tobuy");
$fourn_id = GETPOST("fourn_id", 'int'); $fourn_id = GETPOST("fourn_id", 'int');
@ -116,7 +116,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$tobuy = ""; $tobuy = "";
$search_sale = ""; $search_sale = "";
$search_categ = ""; $search_categ = "";
$toolowstock = ''; $search_toolowstock = '';
$fourn_id = ''; $fourn_id = '';
$sbarcode = ''; $sbarcode = '';
$search_stock_physique = ''; $search_stock_physique = '';
@ -210,7 +210,7 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint; $sql .= $hookmanager->resPrint;
$sql_having = ''; $sql_having = '';
if ($toolowstock) { if ($search_toolowstock) {
$sql_having .= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte"; $sql_having .= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte";
} }
if ($search_stock_physique != '') { if ($search_stock_physique != '') {
@ -296,8 +296,8 @@ if ($resql) {
if ($search_categ > 0) { if ($search_categ > 0) {
$param .= "&search_categ=".urlencode($search_categ); $param .= "&search_categ=".urlencode($search_categ);
} }
if ($toolowstock) { if ($search_toolowstock) {
$param .= "&toolowstock=".urlencode($toolowstock); $param .= "&search_toolowstock=".urlencode($search_toolowstock);
} }
if ($sbarcode) { if ($sbarcode) {
$param .= "&sbarcode=".urlencode($sbarcode); $param .= "&sbarcode=".urlencode($sbarcode);
@ -336,7 +336,7 @@ if ($resql) {
} }
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock ? ' checked' : '').'>'; $moreforfilter .= '<label for="search_toolowstock">'.$langs->trans("StockTooLow").' </label><input type="checkbox" id="search_toolowstock" name="search_toolowstock" value="1"'.($search_toolowstock ? ' checked' : '').'>';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
if (!empty($moreforfilter)) { if (!empty($moreforfilter)) {

View File

@ -52,7 +52,8 @@ $type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT;
$search_barcode = GETPOST("search_barcode", 'alpha'); $search_barcode = GETPOST("search_barcode", 'alpha');
$search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha');
$search_batch = GETPOST('search_batch', 'alpha'); $search_batch = GETPOST('search_batch', 'alpha');
$toolowstock = GETPOST('toolowstock'); $search_toolowstock = GETPOST('search_toolowstock');
$search_subjecttolotserial = GETPOST('search_subjecttolotserial');
$tosell = GETPOST("tosell"); $tosell = GETPOST("tosell");
$tobuy = GETPOST("tobuy"); $tobuy = GETPOST("tobuy");
$fourn_id = GETPOST("fourn_id", 'int'); $fourn_id = GETPOST("fourn_id", 'int');
@ -173,7 +174,8 @@ if (empty($reshook)) {
$tobuy = ""; $tobuy = "";
$search_sale = ""; $search_sale = "";
$search_categ = ""; $search_categ = "";
$toolowstock = ''; $search_toolowstock = '';
$search_subjecttolotserial = '';
$search_batch = ''; $search_batch = '';
$search_warehouse = ''; $search_warehouse = '';
$fourn_id = ''; $fourn_id = '';
@ -252,6 +254,9 @@ if (dol_strlen($type)) {
$sql .= " AND p.fk_product_type <> '1'"; $sql .= " AND p.fk_product_type <> '1'";
} }
} }
if ($search_subjecttolotserial) {
$sql .= " AND p.tobatch > 0";
}
if ($sref) { if ($sref) {
$sql .= natural_search("p.ref", $sref); $sql .= natural_search("p.ref", $sref);
} }
@ -318,7 +323,7 @@ $sql .= " e.ref, e.lieu, e.fk_parent,";
$sql .= " pb.batch, pb.eatby, pb.sellby,"; $sql .= " pb.batch, pb.eatby, pb.sellby,";
$sql .= " pl.rowid, pl.eatby, pl.sellby"; $sql .= " pl.rowid, pl.eatby, pl.sellby";
$sql_having = ''; $sql_having = '';
if ($toolowstock) { if ($search_toolowstock) {
$sql_having .= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet $sql_having .= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet
} }
if ($search_stock_physique != '') { if ($search_stock_physique != '') {
@ -437,8 +442,11 @@ if ($sbarcode) {
if ($search_warehouse) { if ($search_warehouse) {
$param .= "&search_warehouse=".urlencode($search_warehouse); $param .= "&search_warehouse=".urlencode($search_warehouse);
} }
if ($toolowstock) { if ($search_toolowstock) {
$param .= "&toolowstock=".urlencode($toolowstock); $param .= "&search_toolowstock=".urlencode($search_toolowstock);
}
if ($search_subjecttolotserial) {
$param .= "&search_subjecttolotserial=".urlencode($search_subjecttolotserial);
} }
if ($search_sale) { if ($search_sale) {
$param .= "&search_sale=".urlencode($search_sale); $param .= "&search_sale=".urlencode($search_sale);
@ -487,7 +495,7 @@ if (isModEnabled('categorie')) {
$moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
//$moreforfilter.=$langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock?' checked':'').'>'; $moreforfilter.='<label for="search_subjecttolotserial">'.$langs->trans("SubjectToLotSerialOnly").' </label><input type="checkbox" id="search_subjecttolotserial" name="search_subjecttolotserial" value="1"'.($search_subjecttolotserial?' checked':'').'>';
if (!empty($moreforfilter)) { if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">'; print '<div class="liste_titre liste_titre_bydiv centpercent">';

View File

@ -217,7 +217,13 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb
if ($urllogo) { if ($urllogo) {
print '<div class="backgreypublicpayment">'; print '<div class="backgreypublicpayment">';
print '<div class="logopublicpayment">'; print '<div class="logopublicpayment">';
if (!empty($mysoc->url)) {
print '<a href="'.$mysoc->url.'" target="_blank" rel="noopener">';
}
print '<img id="dolpaymentlogo" src="'.$urllogo.'">'; print '<img id="dolpaymentlogo" src="'.$urllogo.'">';
if (!empty($mysoc->url)) {
print '</a>';
}
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';

View File

@ -22,9 +22,10 @@
* \brief Display public form to add new ticket * \brief Display public form to add new ticket
*/ */
/* We need object $user->default_values
if (!defined('NOREQUIREUSER')) { if (!defined('NOREQUIREUSER')) {
define('NOREQUIREUSER', '1'); define('NOREQUIREUSER', '1');
} }*/
if (!defined('NOTOKENRENEWAL')) { if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', '1'); define('NOTOKENRENEWAL', '1');
} }
@ -37,9 +38,6 @@ if (!defined('NOREQUIREHTML')) {
if (!defined('NOLOGIN')) { if (!defined('NOLOGIN')) {
define("NOLOGIN", 1); // This means this output page does not require to be logged. define("NOLOGIN", 1); // This means this output page does not require to be logged.
} }
if (!defined('NOCSRFCHECK')) {
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
}
if (!defined('NOIPCHECK')) { if (!defined('NOIPCHECK')) {
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
} }
@ -73,6 +71,9 @@ $id = GETPOST('id', 'int');
$msg_id = GETPOST('msg_id', 'int'); $msg_id = GETPOST('msg_id', 'int');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = '';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('publicnewticketcard', 'globalcard')); $hookmanager->initHooks(array('publicnewticketcard', 'globalcard'));
@ -105,7 +106,15 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
} }
// Add file in email form // Add file in email form
if (empty($reshook) && GETPOST('addfile', 'alpha') && !GETPOST('save', 'alpha')) { if (empty($reshook)) {
if ($cancel) {
$backtopage = DOL_URL_ROOT.'/public/ticket/index.php';
header("Location: ".$backtopage);
exit;
}
if (GETPOST('addfile', 'alpha') && !GETPOST('save', 'alpha')) {
////$res = $object->fetch('','',GETPOST('track_id')); ////$res = $object->fetch('','',GETPOST('track_id'));
////if($res > 0) ////if($res > 0)
////{ ////{
@ -124,7 +133,7 @@ if (empty($reshook) && GETPOST('addfile', 'alpha') && !GETPOST('save', 'alpha'))
} }
// Remove file // Remove file
if (empty($reshook) && GETPOST('removedfile', 'alpha') && !GETPOST('save', 'alpha')) { if (GETPOST('removedfile', 'alpha') && !GETPOST('save', 'alpha')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp directory // Set tmp directory
@ -136,7 +145,7 @@ if (empty($reshook) && GETPOST('removedfile', 'alpha') && !GETPOST('save', 'alph
$action = 'create_ticket'; $action = 'create_ticket';
} }
if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { if ($action == 'create_ticket' && GETPOST('save', 'alpha')) {
$error = 0; $error = 0;
$origin_email = GETPOST('email', 'alpha'); $origin_email = GETPOST('email', 'alpha');
if (empty($origin_email)) { if (empty($origin_email)) {
@ -425,6 +434,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) {
$messagetoshow = str_replace(array('{s1}', '{s2}'), array('<strong>'.$object->track_id.'</strong>', '<strong>'.$object->ref.'</strong>'), $messagetoshow); $messagetoshow = str_replace(array('{s1}', '{s2}'), array('<strong>'.$object->track_id.'</strong>', '<strong>'.$object->ref.'</strong>'), $messagetoshow);
setEventMessages($messagetoshow, null, 'warnings'); setEventMessages($messagetoshow, null, 'warnings');
setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
header("Location: index.php".(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'')); header("Location: index.php".(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:''));
exit; exit;
} }
@ -432,7 +442,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
}
/* /*
@ -466,6 +476,7 @@ if ($action != "infos_success") {
$formticket->ispublic = 1; $formticket->ispublic = 1;
$formticket->withfile = 2; $formticket->withfile = 2;
$formticket->action = 'create_ticket'; $formticket->action = 'create_ticket';
$formticket->withcancel = 1;
$formticket->param = array('returnurl' => $_SERVER['PHP_SELF'].($conf->entity > 1 ? '?entity='.$conf->entity : '')); $formticket->param = array('returnurl' => $_SERVER['PHP_SELF'].($conf->entity > 1 ? '?entity='.$conf->entity : ''));
@ -478,7 +489,7 @@ if ($action != "infos_success") {
print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket")); print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket"));
print '</div>'; print '</div>';
} else { } else {
print '<div class="info marginleftonly marginrightonly">'.$langs->trans('TicketPublicInfoCreateTicket').'</div>'; //print '<div class="info marginleftonly marginrightonly">'.$langs->trans('TicketPublicInfoCreateTicket').'</div>';
$formticket->showForm(0, 'edit', 1, $with_contact); $formticket->showForm(0, 'edit', 1, $with_contact);
} }
} }

View File

@ -22,9 +22,6 @@
* \brief Public page to add and manage ticket * \brief Public page to add and manage ticket
*/ */
if (!defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', '1');
}
if (!defined('NOREQUIREMENU')) { if (!defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', '1'); define('NOREQUIREMENU', '1');
} }
@ -82,11 +79,12 @@ $arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
print '<div class="ticketpublicarea">'; print '<div class="ticketpublicarea">';
print '<p style="text-align: center">'.($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")).'</p>'; print '<p style="text-align: center">'.(!empty($conf->global->TICKET_PUBLIC_TEXT_HOME) ? $conf->global->TICKET_PUBLIC_TEXT_HOME : '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc")).'</span></p>';
print '<br>';
print '<div class="ticketform">'; print '<div class="ticketform">';
print '<a href="create_ticket.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_create bigrounded"><span class="fa fa-15x fa-plus-circle valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("CreateTicket")).'</div></a>'; print '<a href="create_ticket.php?action=create'.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_create bigrounded"><span class="fa fa-15 fa-plus-circle valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("CreateTicket")).'</div></a>';
print '<a href="list.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded"><span class="fa fa-15x fa-list-alt valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'</div></a>'; print '<a href="list.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded"><span class="fa fa-15 fa-list-alt valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'</div></a>';
print '<a href="view.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded">'.img_picto('', 'ticket', 'class="fa-15x"').'<br>'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'</div></a>'; print '<a href="view.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded">'.img_picto('', 'ticket', 'class="fa-15"').'<br>'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'</div></a>';
print '<div style="clear:both;"></div>'; print '<div style="clear:both;"></div>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';

View File

@ -21,10 +21,6 @@
* \brief Public file to list tickets * \brief Public file to list tickets
*/ */
if (!defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', '1');
}
// Do not check anti CSRF attack test
if (!defined('NOREQUIREMENU')) { if (!defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', '1'); define('NOREQUIREMENU', '1');
} }
@ -60,8 +56,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->loadLangs(array("companies", "other", "ticket")); $langs->loadLangs(array("companies", "other", "ticket"));
// Get parameters // Get parameters
$track_id = GETPOST('track_id', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$track_id = GETPOST('track_id', 'alpha');
$email = strtolower(GETPOST('email', 'alpha')); $email = strtolower(GETPOST('email', 'alpha'));
if (GETPOST('btn_view_ticket_list')) { if (GETPOST('btn_view_ticket_list')) {
@ -90,6 +88,13 @@ if (empty($conf->ticket->enabled)) {
* Actions * Actions
*/ */
if ($cancel) {
$backtopage = DOL_URL_ROOT.'/public/ticket/index.php';
header("Location: ".$backtopage);
exit;
}
if ($action == "view_ticketlist") { if ($action == "view_ticketlist") {
$error = 0; $error = 0;
$display_ticket_list = false; $display_ticket_list = false;
@ -185,9 +190,10 @@ $arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
print '<div class="ticketpublicarealist">';
if ($action == "view_ticketlist") { if ($action == "view_ticketlist") {
print '<div class="ticketpublicarealist">';
print '<br>'; print '<br>';
if ($display_ticket_list) { if ($display_ticket_list) {
// Filters // Filters
@ -363,10 +369,10 @@ if ($action == "view_ticketlist") {
$sql .= " WHERE t.entity IN (".getEntity('ticket').")"; $sql .= " WHERE t.entity IN (".getEntity('ticket').")";
$sql .= " AND ((tc.source = 'external'"; $sql .= " AND ((tc.source = 'external'";
$sql .= " AND tc.element='".$db->escape($object->element)."'"; $sql .= " AND tc.element='".$db->escape($object->element)."'";
$sql .= " AND tc.active=1)"; $sql .= " AND tc.active=1";
$sql .= " OR (sp.email='".$db->escape($_SESSION['email_customer'])."'"; $sql .= " AND sp.email='".$db->escape($_SESSION['email_customer'])."')"; // email found into an external contact
$sql .= " OR s.email='".$db->escape($_SESSION['email_customer'])."'"; $sql .= " OR s.email='".$db->escape($_SESSION['email_customer'])."'"; // or email of the linked company
$sql .= " OR t.origin_email='".$db->escape($_SESSION['email_customer'])."'))"; $sql .= " OR t.origin_email='".$db->escape($_SESSION['email_customer'])."')"; // or email of the requester
// Manage filter // Manage filter
if (!empty($filter)) { if (!empty($filter)) {
foreach ($filter as $key => $value) { foreach ($filter as $key => $value) {
@ -704,12 +710,18 @@ if ($action == "view_ticketlist") {
} }
</script>'; </script>';
} }
} else {
dol_print_error($db);
} }
} else { } else {
print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'">'.$langs->trans('Back').'</a></div>'; print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'">'.$langs->trans('Back').'</a></div>';
} }
print '</div>';
} else { } else {
print '<p class="center">'.$langs->trans("TicketPublicMsgViewLogIn").'</p>'; print '<div class="ticketpublicarea">';
print '<p class="center opacitymedium">'.$langs->trans("TicketPublicMsgViewLogIn").'</p>';
print '<br>'; print '<br>';
print '<div id="form_view_ticket">'; print '<div id="form_view_ticket">';
@ -728,13 +740,15 @@ if ($action == "view_ticketlist") {
print '<p style="text-align: center; margin-top: 1.5em;">'; print '<p style="text-align: center; margin-top: 1.5em;">';
print '<input type="submit" class="button" name="btn_view_ticket_list" value="'.$langs->trans('ViewMyTicketList').'" />'; print '<input type="submit" class="button" name="btn_view_ticket_list" value="'.$langs->trans('ViewMyTicketList').'" />';
print ' &nbsp; ';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print "</p>\n"; print "</p>\n";
print "</form>\n"; print "</form>\n";
print "</div>\n"; print "</div>\n";
}
print "</div>"; print "</div>";
}
// End of page // End of page
htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object); htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object);

View File

@ -22,10 +22,6 @@
* \brief Public file to show one ticket * \brief Public file to show one ticket
*/ */
if (!defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', '1');
}
// Do not check anti CSRF attack test
if (!defined('NOREQUIREMENU')) { if (!defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', '1'); define('NOREQUIREMENU', '1');
} }
@ -61,9 +57,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->loadLangs(array("companies", "other", "ticket")); $langs->loadLangs(array("companies", "other", "ticket"));
// Get parameters // Get parameters
$track_id = GETPOST('track_id', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$track_id = GETPOST('track_id', 'alpha');
$email = GETPOST('email', 'email'); $email = GETPOST('email', 'email');
if (GETPOST('btn_view_ticket')) { if (GETPOST('btn_view_ticket')) {
@ -85,6 +82,8 @@ if (empty($conf->ticket->enabled)) {
*/ */
if ($cancel) { if ($cancel) {
$backtopage = DOL_URL_ROOT.'/public/ticket/index.php';
if (!empty($backtopage)) { if (!empty($backtopage)) {
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
@ -406,6 +405,8 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
print '<p style="text-align: center; margin-top: 1.5em;">'; print '<p style="text-align: center; margin-top: 1.5em;">';
print '<input type="submit" class="button" name="btn_view_ticket" value="'.$langs->trans('ViewTicket').'" />'; print '<input type="submit" class="button" name="btn_view_ticket" value="'.$langs->trans('ViewTicket').'" />';
print ' &nbsp; ';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print "</p>\n"; print "</p>\n";
print "</form>\n"; print "</form>\n";

View File

@ -18,10 +18,6 @@
/* font-size: <?php echo $topMenuFontSize; ?>; */ /* font-size: <?php echo $topMenuFontSize; ?>; */
} }
.fa-15x {
font-size: 1.5em;
}
div.mainmenu.menu { div.mainmenu.menu {
background-image: none; background-image: none;
} }

View File

@ -18,10 +18,6 @@
color: var(--colortextbackhmenu); color: var(--colortextbackhmenu);
} }
.fa-15x {
font-size: 1.5em;
}
div.mainmenu.menu { div.mainmenu.menu {
background-image: none; background-image: none;
} }

View File

@ -316,7 +316,9 @@ class User extends CommonObject
* @var stdClass To store personal config * @var stdClass To store personal config
*/ */
public $conf; public $conf;
public $default_values; // To store default values for user
public $default_values; // To store default values for user. Loaded by loadDefaultValues().
public $lastsearch_values_tmp; // To store current search criterias for user public $lastsearch_values_tmp; // To store current search criterias for user
public $lastsearch_values; // To store last saved search criterias for user public $lastsearch_values; // To store last saved search criterias for user
@ -2825,7 +2827,7 @@ class User extends CommonObject
$result .= (($option == 'nolink') ? '' : $linkstart); $result .= (($option == 'nolink') ? '' : $linkstart);
if ($withpictoimg) { if ($withpictoimg) {
$paddafterimage = ''; $paddafterimage = '';
if (abs($withpictoimg) == 1) { if (abs((int) $withpictoimg) == 1) {
$paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"';
} }
// Only picto // Only picto