diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 3d380e11344..66b1ac1988a 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -3,7 +3,7 @@ * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -193,37 +193,37 @@ $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : ""); // Show message $message = ''; -$urlvcal = ''; +$urlvcal = ''; $urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : 'KEYNOTDEFINED').''; $message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, ''.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').''); $message .= ''; $message .= ajax_autoselect('onlinepaymenturl1'); $message .= '
'; -$urlical = ''; +$urlical = ''; $urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : 'KEYNOTDEFINED').''; $message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, ''.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').''); $message .= ''; $message .= ajax_autoselect('onlinepaymenturl2'); $message .= '
'; -$urlrss = ''; +$urlrss = ''; $urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : 'KEYNOTDEFINED').''; $message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, ''.$langs->trans("WebCalUrlForVCalExport", 'rss', '').''); $message .= ''; $message .= ajax_autoselect('onlinepaymenturl3'); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index f76c9a71b9e..af2a587f21c 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; * @var Societe $mysoc * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_url_root */ // Load translation files required by the page diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 2aff61e40ca..dbde06b0615 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -54,6 +54,10 @@ $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions $scandir = GETPOST('scan_dir', 'alpha'); $type = 'myobject'; +if (empty($action)) { + $action = 'edit'; +} + $arrayofparameters = array( 'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea','enabled' => 1, 'css' => ''), 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1, 'css' => ''), @@ -66,9 +70,8 @@ $arrayofparameters = array( 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT' => array('type' => 'emailtemplate:conferenceorbooth', 'enabled' => 1, 'css' => ''), //'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1, 'css' => ''), //'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1, 'css' => ''), - 'SERVICE_BOOTH_LOCATION' => array('type' => 'product', 'enabled' => 1, 'css' => ''), - 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION' => array('type' => 'product', 'enabled' => 1, 'css' => ''), - 'EVENTORGANIZATION_SECUREKEY' => array('type' => 'securekey', 'enabled' => 1, 'css' => ''), + 'SERVICE_BOOTH_LOCATION' => array('type' => 'product', 'enabled' => 1, 'css' => 'maxwidth500'), + 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION' => array('type' => 'product', 'enabled' => 1, 'css' => 'maxwidth500'), ); $error = 0; @@ -130,31 +133,7 @@ if ($action == 'updateMask') { } } } -}/* elseif ($action == 'setdoc') { - // Set or unset default model - $tmpobjectkey = GETPOST('object', 'aZ09'); - if (!empty($tmpobjectkey)) { - $constforval = 'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; - if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) { - // The constant that was read before the new set - // We therefore requires a variable to have a coherent view - $conf->global->$constforval = $value; - } - - // We disable/enable the document template (into llx_document_model table) - $ret = delDocumentModel($value, $type); - if ($ret > 0) { - $ret = addDocumentModel($value, $type, $label, $scandir); - } - } -} elseif ($action == 'unsetdoc') { - $tmpobjectkey = GETPOST('object', 'aZ09'); - if (!empty($tmpobjectkey)) { - $constforval = 'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; - dolibarr_del_const($db, $constforval, $conf->entity); - } -}*/ - +} /* @@ -177,7 +156,8 @@ $head = eventorganizationAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, 'eventorganization'); // Setup page goes here -echo ''.$langs->trans("EventOrganizationSetupPage").'

'; +//print ''.$langs->trans("EventOrganizationSetupPage").'
'; +print '
'; if ($action == 'edit') { @@ -201,12 +181,6 @@ if ($action == 'edit') { print '\n"; - } elseif ($val['type'] == 'html') { - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); - $doleditor->Create(); - } elseif ($val['type'] == 'yesno') { - print $form->selectyesno($constname, getDolGlobalString($constname), 1); } elseif (preg_match('/emailtemplate:/', $val['type'])) { include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); @@ -239,15 +213,6 @@ if ($action == 'edit') { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $formcompany = new FormCompany($db); print $formcompany->selectProspectCustomerType(getDolGlobalString($constname), $constname, 'customerorprospect', 'form', '', '1'); - } elseif ($val['type'] == 'securekey') { - print ''; - if (!empty($conf->use_javascript_ajax)) { - print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); - } - - // Add button to autosuggest a key - include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); } elseif ($val['type'] == 'product') { if (isModEnabled("product") || isModEnabled("service")) { $selected = getDolGlobalInt($constname); @@ -262,101 +227,94 @@ if ($action == 'edit') { } print ''; - print $form->buttonsSaveCancel(); + print $form->buttonsSaveCancel('Save', ''); print ''; print '
'; } else { - if (!empty($arrayofparameters)) { - print ''; - print ''; + print '
'.$langs->trans("Parameter").'
'; + print ''; - foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled'] == 1) { - $setupnotempty++; - print ''; - print ''; + print ''; - - print ''; } + } elseif (preg_match('/category:/', $val['type'])) { + if (getDolGlobalInt($constname)) { + $c = new Categorie($db); + $result = $c->fetch(getDolGlobalInt($constname)); + if ($result < 0) { + setEventMessages(null, $c->errors, 'errors'); + } + $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text + $toprint = array(); + foreach ($ways as $way) { + $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; + } + print '
      ' . implode(' ', $toprint) . '
    '; + } + } elseif (preg_match('/thirdparty_type/', $val['type'])) { + if (getDolGlobalString($constname) == 2) { + print $langs->trans("Prospect"); + } elseif (getDolGlobalString($constname) == 3) { + print $langs->trans("ProspectCustomer"); + } elseif (getDolGlobalString($constname) == 1) { + print $langs->trans("Customer"); + } elseif (getDolGlobalString($constname) == 0) { + print $langs->trans("NorProspectNorCustomer"); + } + } elseif ($val['type'] == 'product') { + $product = new Product($db); + $idproduct = getDolGlobalInt($constname); + if ($idproduct > 0) { + $resprod = $product->fetch($idproduct); + if ($resprod > 0) { + print $product->getNomUrl(1); + } elseif ($resprod < 0) { + setEventMessages($product->error, $product->errors, "errors"); + } + } + } else { + print getDolGlobalString($constname); } + print ''; - print '
    '.$langs->trans("Parameter").'
    '; - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); - $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); - print $form->textwithpicto($langs->trans($constname), $tooltiphelp); - print '
    '; + foreach ($arrayofparameters as $constname => $val) { + /*if ($val['enabled'] != 1) { + continue; + }*/ + $setupnotempty++; + print '
    '; + $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); + $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); + print $form->textwithpicto($langs->trans($constname), $tooltiphelp); + print '
    '; - if ($val['type'] == 'textarea') { - print dol_nl2br(getDolGlobalString($constname)); - } elseif ($val['type'] == 'html') { - print getDolGlobalString($constname); - } elseif ($val['type'] == 'yesno') { - print ajax_constantonoff($constname); - } elseif (preg_match('/emailtemplate:/', $val['type'])) { - if (getDolGlobalString($constname)) { - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); + if ($val['type'] == 'textarea') { + print dol_nl2br(getDolGlobalString($constname)); + } elseif (preg_match('/emailtemplate:/', $val['type'])) { + if (getDolGlobalString($constname)) { + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); - $tmp = explode(':', $val['type']); - $labelemailtemplate = getDolGlobalString($constname); - if ($labelemailtemplate && $labelemailtemplate != '-1') { - $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalInt($constname)); - if (is_numeric($template) && $template < 0) { - setEventMessages($formmail->error, $formmail->errors, 'errors'); - } else { - if ($template->label != 'default') { - print $langs->trans($template->label); - } - } + $tmp = explode(':', $val['type']); + $labelemailtemplate = getDolGlobalString($constname); + if ($labelemailtemplate && $labelemailtemplate != '-1') { + $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalInt($constname)); + if (is_numeric($template) && $template < 0) { + setEventMessages($formmail->error, $formmail->errors, 'errors'); + } else { + if ($template->label != 'default') { + print $langs->trans($template->label); } } - } elseif (preg_match('/category:/', $val['type'])) { - if (getDolGlobalInt($constname)) { - $c = new Categorie($db); - $result = $c->fetch(getDolGlobalInt($constname)); - if ($result < 0) { - setEventMessages(null, $c->errors, 'errors'); - } - $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text - $toprint = array(); - foreach ($ways as $way) { - $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; - } - print '
      ' . implode(' ', $toprint) . '
    '; - } - } elseif (preg_match('/thirdparty_type/', $val['type'])) { - if (getDolGlobalString($constname) == 2) { - print $langs->trans("Prospect"); - } elseif (getDolGlobalString($constname) == 3) { - print $langs->trans("ProspectCustomer"); - } elseif (getDolGlobalString($constname) == 1) { - print $langs->trans("Customer"); - } elseif (getDolGlobalString($constname) == 0) { - print $langs->trans("NorProspectNorCustomer"); - } - } elseif ($val['type'] == 'product') { - $product = new Product($db); - $idproduct = getDolGlobalInt($constname); - if ($idproduct > 0) { - $resprod = $product->fetch($idproduct); - if ($resprod > 0) { - print $product->getNomUrl(1); - } elseif ($resprod < 0) { - setEventMessages($product->error, $product->errors, "errors"); - } - } - } else { - print getDolGlobalString($constname); } - print '
    '; - - print '
    '; - print ''.$langs->trans("Modify").''; - print '
    '; - } else { - print '
    '.$langs->trans("NothingToSetup"); + print ''; } + + print ''; + + print '
    '; + print ''.$langs->trans("Modify").''; + print '
    '; } diff --git a/htdocs/admin/eventorganization_public.php b/htdocs/admin/eventorganization_public.php new file mode 100644 index 00000000000..9e21ba6aa82 --- /dev/null +++ b/htdocs/admin/eventorganization_public.php @@ -0,0 +1,255 @@ + + * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024 Frédéric France + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/admin/eventorganization.php + * \ingroup eventorganization + * \brief EventOrganization setup page. + */ + +// Load Dolibarr environment +require '../main.inc.php'; + +// Libraries +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/eventorganization.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + * + * @var string $dolibarr_main_url_root + */ + +// Translations +$langs->loadLangs(array("admin", "eventorganization", "categories")); + +// Parameters +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + +$scandir = GETPOST('scan_dir', 'alpha'); +$type = 'myobject'; + +$arrayofparameters = array( + 'EVENTORGANIZATION_SECUREKEY' => array('type' => 'securekey', 'enabled' => 1, 'css' => ''), +); + +$error = 0; +$setupnotempty = 0; + +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); + +// Access control +if (empty($user->admin)) { + accessforbidden(); +} + +if (empty($action)) { + $action = 'edit'; +} + + +/* + * Actions + */ + +if ($cancel) { + $action = ''; +} + +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + + + +/* + * View + */ + +$form = new Form($db); + +$page_name = "EventOrganizationSetup"; + +llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-admin page-eventorganization'); + +// Subheader +$linkback = ''.$langs->trans("BackToModuleList").''; + +print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); + +// Configuration header +$head = eventorganizationAdminPrepareHead(); +print dol_get_fiche_head($head, 'public', $langs->trans($page_name), -1, 'eventorganization'); + +// Setup page goes here +// print ''.$langs->trans("EventOrganizationSetupPage").'
    '; +print '
    '; + +if ($action == 'edit') { + print '
    '; + print ''; + print ''; + + print ''; + print ''; + + foreach ($arrayofparameters as $constname => $val) { + // @phpstan-ignore-next-line + if ($val['enabled'] == 1) { + $setupnotempty++; + print ''; + } + } + print '
    '.$langs->trans("Parameter").'
    '; + $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); + $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); + print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; + print '
    '; + + /*if ($val['type'] == 'textarea') { + print '\n"; + } elseif ($val['type'] == 'html') { + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); + $doleditor->Create(); + } elseif ($val['type'] == 'yesno') { + print $form->selectyesno($constname, getDolGlobalString($constname), 1); + } elseif (preg_match('/emailtemplate:/', $val['type'])) { + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $tmp = explode(':', $val['type']); + $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, 1); // We set lang=null to get in priority record with no lang + //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, ''); + $arrayofmessagename = array(); + if (is_array($formmail->lines_model)) { + foreach ($formmail->lines_model as $modelmail) { + //var_dump($modelmail); + $moreonlabel = ''; + if (!empty($arrayofmessagename[$modelmail->label])) { + $moreonlabel = ' (' . $langs->trans("SeveralLangugeVariatFound") . ')'; + } + // The 'label' is the key that is unique if we exclude the language + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; + } + } + print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1); + } elseif (preg_match('/category:/', $val['type'])) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; + $formother = new FormOther($db); + + $tmp = explode(':', $val['type']); + print img_picto('', 'category', 'class="pictofixedwidth"'); + print $formother->select_categories($tmp[1], getDolGlobalInt($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); + } elseif (preg_match('/thirdparty_type/', $val['type'])) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + $formcompany = new FormCompany($db); + print $formcompany->selectProspectCustomerType(getDolGlobalString($constname), $constname, 'customerorprospect', 'form', '', '1'); + } elseif ($val['type'] == 'securekey') { */ + print ''; + if (!empty($conf->use_javascript_ajax)) { + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); + } + + // Add button to autosuggest a key + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); + /* } elseif ($val['type'] == 'product') { + if (isModEnabled("product") || isModEnabled("service")) { + $selected = getDolGlobalInt($constname); + print img_picto('', 'product', 'class="pictofixedwidth"'); + print $form->select_produits($selected, $constname, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', null, 1); + } + } else { + print ''; + }*/ + print '
    '; + + print $form->buttonsSaveCancel('Save', ''); + + print '
    '; + print '
    '; +} else { + print ''; + print ''; + + foreach ($arrayofparameters as $constname => $val) { + $setupnotempty++; + print ''; + print ''; + + print ''; + } + + print '
    '.$langs->trans("Parameter").'
    '; + $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); + $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); + print $form->textwithpicto($langs->trans($constname), $tooltiphelp); + print '
    '; + print getDolGlobalString($constname); + print '
    '; + + print '
    '; + print ''.$langs->trans("Modify").''; + print '
    '; +} + + +// Page end +print dol_get_fiche_end(); + + +//if (getDolGlobalString('EVENTORGANIZATION_ENABLE_PUBLIC')) { + print '
    '; + //print $langs->trans('FollowingLinksArePublic').'
    '; + print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
    '; +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 ''; + print ajax_autoselect('publicurlmember'); +//} + + +llxFooter(); +$db->close(); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 5e610c7996b..2d8598f2cc7 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1249,7 +1249,7 @@ if ($object->id > 0) { $contrat->ref_customer = $objp->refcus; $contrat->ref_supplier = $objp->refsup; $contrat->fk_project = $objp->fk_projet; - $contrat->statut = $objp->contract_status; + $contrat->statut = $objp->contract_status; // deprecated $contrat->status = $objp->contract_status; $contrat->last_main_doc = $objp->last_main_doc; $contrat->model_pdf = $objp->model_pdf; @@ -1258,7 +1258,7 @@ if ($object->id > 0) { $late = ''; foreach ($contrat->lines as $line) { if ($contrat->status == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) { - if (((!empty($line->date_end) ? $line->date_end : 0) + $conf->contrat->services->expires->warning_delay) < $now) { + if (((!empty($line->date_end) ? $line->date_end : 0) + $conf->contract->services->expires->warning_delay) < $now) { $late = img_warning($langs->trans("Late")); } } @@ -1269,7 +1269,7 @@ if ($object->id > 0) { print $contrat->getNomUrl(1, 12); if (!empty($contrat->model_pdf)) { // Preview - $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + $filedir = $conf->contract->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); @@ -1362,7 +1362,7 @@ if ($object->id > 0) { $fichinter_static->id = $objp->id; $fichinter_static->ref = $objp->ref; - $fichinter_static->statut = $objp->fk_statut; + $fichinter_static->statut = $objp->fk_statut; // deprecated $fichinter_static->status = $objp->fk_statut; $fichinter_static->fk_project = $objp->fk_projet; @@ -1599,7 +1599,7 @@ if ($object->id > 0) { print ''; print $facturestatic->getNomUrl(1); // Preview - $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + $filedir = $conf->invoice->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index c1cd5c36cb8..96511408887 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -6,7 +6,7 @@ * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Pierre Ardoin * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 266c117b90c..f6d96b28fde 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -832,7 +832,7 @@ if (empty($reshook)) { } } else { $object->status = $oldstatus; - $object->statut = $oldstatus; + $object->statut = $oldstatus; // deprecated $db->rollback(); $action = ''; @@ -851,7 +851,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } else { - $object->statut = $newstatus; + $object->statut = $newstatus; // deprecated $object->status = $newstatus; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4c8e6ea2566..de4dc3af9ad 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -638,7 +638,7 @@ class Propal extends CommonObject dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except); - if ($this->statut == self::STATUS_DRAFT) { + if ($this->status == self::STATUS_DRAFT) { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; // Clean parameters @@ -1575,6 +1575,7 @@ class Propal extends CommonObject $object->ref = ''; $object->entity = (!empty($forceentity) ? $forceentity : $object->entity); $object->statut = self::STATUS_DRAFT; + $object->status = self::STATUS_DRAFT; // Clear fields $object->user_creation_id = $user->id; @@ -2707,7 +2708,7 @@ class Propal extends CommonObject if (!$error) { $this->oldcopy = clone $this; - $this->statut = $status; + $this->statut = $status; // deprecated $this->status = $status; $this->date_signature = $date_signature; $this->note_private = $newprivatenote; @@ -2726,7 +2727,7 @@ class Propal extends CommonObject $this->db->commit(); return 1; } else { - $this->statut = $this->oldcopy->status; + $this->statut = $this->oldcopy->status; // deprecated $this->status = $this->oldcopy->status; $this->date_signature = $this->oldcopy->date_signature; $this->note_private = $this->oldcopy->note_private; @@ -2857,7 +2858,7 @@ class Propal extends CommonObject } if (!$error) { - $this->statut = self::STATUS_CANCELED; + $this->statut = self::STATUS_CANCELED; // deprecated $this->status = self::STATUS_CANCELED; $this->db->commit(); return 1; @@ -2923,7 +2924,7 @@ class Propal extends CommonObject } if (!$error) { - $this->statut = self::STATUS_DRAFT; + $this->statut = self::STATUS_DRAFT; // deprecated $this->status = self::STATUS_DRAFT; $this->db->commit(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 9facbea7b9e..589c791443e 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -15,7 +15,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019-2024 Alexandre Spangaro * Copyright (C) 2021 Anthony Berton - * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2022 Josep Lluís Amador * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 William Mead @@ -496,7 +496,7 @@ if ($action == "nosign" && $permissiontoclose) { $db->begin(); foreach ($toselect as $checked) { if ($tmpproposal->fetch($checked) > 0) { - if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED || (getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) { + if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED || (getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') && $tmpproposal->status == $tmpproposal::STATUS_DRAFT)) { $tmpproposal->status = $tmpproposal::STATUS_NOTSIGNED; if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) { setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs'); @@ -1785,7 +1785,7 @@ while ($i < $imaxinloop) { $object->ref_customer = $obj->ref_client; $object->note_public = $obj->note_public; $object->note_private = $obj->note_private; - $object->statut = $obj->status; + $object->statut = $obj->status; // deprecated $object->status = $obj->status; $companystatic->id = $obj->socid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e9e32e12e48..11c9d4b7c99 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2353,8 +2353,9 @@ class Facture extends CommonInvoice $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; // Now process extrafields - $this->array_options = array(); if ($doFetchInOneSqlRequest && $extraFieldsCheck) { + $this->array_options = array(); + foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { $type = !empty($extrafields->attributes[$this->table_element]['type'][$key]) ? $extrafields->attributes[$this->table_element]['type'][$key] diff --git a/htdocs/compta/facture/class/factureligne.class.php b/htdocs/compta/facture/class/factureligne.class.php index 4caa4c20641..e95fa0e8781 100644 --- a/htdocs/compta/facture/class/factureligne.class.php +++ b/htdocs/compta/facture/class/factureligne.class.php @@ -337,8 +337,9 @@ class FactureLigne extends CommonInvoiceLine $this->packaging = $objp->packaging; - $this->array_options = array(); if ($doFetchInOneSqlRequest && $extraFieldsCheck) { + $this->array_options = array(); + foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { $type = !empty($extrafields->attributes[$this->table_element]['type'][$key]) ? $extrafields->attributes[$this->table_element]['type'][$key] diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 41486da671d..7f577fb473f 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -209,9 +209,10 @@ if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $tmpinvoice->total_ht = $obj->total_ht; $tmpinvoice->total_tva = $obj->total_tva; $tmpinvoice->total_ttc = $obj->total_ttc; - $tmpinvoice->statut = $obj->status; + $tmpinvoice->statut = $obj->status; // deprecated $tmpinvoice->status = $obj->status; - $tmpinvoice->paye = $obj->paye; + $tmpinvoice->paye = $obj->paye; // deprecated + $tmpinvoice->paid = $obj->paye; $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite); $tmpinvoice->type = $obj->type; @@ -362,7 +363,7 @@ if ((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO $facstatic->total_ttc = $obj->total_ttc; $facstatic->statut = $obj->status; // deprecated $facstatic->status = $obj->status; - $facstatic->paye = $obj->paye; + $facstatic->paye = $obj->paye; // deprecated $facstatic->paid = $obj->paye; $facstatic->type = $obj->type; $facstatic->ref_supplier = $obj->ref_supplier; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 000f29b62c8..e6fd92291b5 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -278,7 +278,7 @@ if ($id) { if (is_object($bon) && $bon->statut == BonPrelevement::STATUS_CREDITED) { if ($lipre->statut == 2) { if ($user->hasRight('prelevement', 'bons', 'credit')) { - print ''.$langs->trans("StandingOrderReject").''; + print ''.$langs->trans("StandingOrderReject").''; } else { print ''.$langs->trans("StandingOrderReject").''; } diff --git a/htdocs/core/ajax/mailtemplate.php b/htdocs/core/ajax/mailtemplate.php index 1c5b76c1a62..078fd8c947a 100644 --- a/htdocs/core/ajax/mailtemplate.php +++ b/htdocs/core/ajax/mailtemplate.php @@ -51,6 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; * @var Societe $mysoc * @var Translate $langs * @var User $user + * @var string $dolibarr_main_url_root */ /* diff --git a/htdocs/core/lib/eventorganization.lib.php b/htdocs/core/lib/eventorganization.lib.php index 79510429856..658af8b86d6 100644 --- a/htdocs/core/lib/eventorganization.lib.php +++ b/htdocs/core/lib/eventorganization.lib.php @@ -65,6 +65,11 @@ function eventorganizationAdminPrepareHead() $head[$h][2] = 'conferenceorboothattendee_extrafields'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/admin/eventorganization_public.php'; + $head[$h][1] = $langs->trans("BlankSubscriptionForm"); + $head[$h][2] = 'public'; + $h++; + // Show more tabs from modules // Entries must be declared in modules descriptor with line //$this->tabs = array( diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 08b0254cc10..97083e95f96 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13786,6 +13786,7 @@ function getElementProperties($elementType) $classpath = 'supplier_proposal/class'; $module = 'supplier_proposal'; $classfile = 'supplier_proposal'; + $classname = 'SupplierProposalLine'; $table_element = 'supplier_proposaldet'; $parent_element = 'supplier_proposal'; } elseif ($elementType == 'contract') { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 72fce3ef423..9ed888f646a 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -278,9 +278,10 @@ class modSociete extends DolibarrModules 's.status' => "Status", 's.client' => "Customer", 's.fournisseur' => "Supplier", 's.datec' => "DateCreation", 's.tms' => "DateLastModification", 's.code_client' => "CustomerCode", 's.code_fournisseur' => "SupplierCode", 's.code_compta' => "AccountancyCode", 's.code_compta_fournisseur' => "SupplierAccountancyCode", 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", 'd.nom' => 'State', 'r.nom' => 'Region', 'c.label' => "Country", 'c.code' => "CountryCode", 's.phone' => "Phone", 's.fax' => "Fax", - 's.url' => "Url", 's.email' => "Email", 's.default_lang' => "DefaultLang", 's.canvas' => "Canvas", 's.siren' => "ProfId1", 's.siret' => "ProfId2", 's.ape' => "ProfId3", 's.idprof4' => "ProfId4", - 's.idprof5' => "ProfId5", 's.idprof6' => "ProfId6", 's.tva_intra' => "VATIntraShort", 's.capital' => "Capital", 's.note_private' => "NotePrivate", 's.note_public' => "NotePublic", - 't.code' => "ThirdPartyType", 'ce.code' => "DictionaryStaff", "cfj.libelle" => "JuridicalStatus", 's.fk_prospectlevel' => 'ProspectLevel', + 's.phone_mobile' => "PhoneMobile", 's.url' => "Url", 's.email' => "Email", 's.default_lang' => "DefaultLang", 's.canvas' => "Canvas", + 's.siren' => "ProfId1", 's.siret' => "ProfId2", 's.ape' => "ProfId3", 's.idprof4' => "ProfId4", 's.idprof5' => "ProfId5", 's.idprof6' => "ProfId6", + 's.tva_intra' => "VATIntraShort", 's.capital' => "Capital", 's.note_private' => "NotePrivate", + 's.note_public' => "NotePublic", 't.code' => "ThirdPartyType", 'ce.code' => "DictionaryStaff", "cfj.libelle" => "JuridicalStatus", 's.fk_prospectlevel' => 'ProspectLevel', 'st.code' => 'ProspectStatus', 'payterm.libelle' => 'PaymentConditions', 'paymode.libelle' => 'PaymentMode', 's.outstanding_limit' => 'OutstandingBill', 'pbacc.ref' => 'PaymentBankAccount', 'incoterm.code' => 'IncotermLabel' ); @@ -312,7 +313,7 @@ class modSociete extends DolibarrModules 's.code_client' => "Text", 's.code_fournisseur' => "Text", 's.code_compta' => "Text", 's.code_compta_fournisseur' => "Text", 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", 'd.nom' => 'Text', 'r.nom' => 'Text', 'c.label' => 'List:c_country:label:label', 'c.code' => 'Text', - 's.phone' => "Text", 's.fax' => "Text", + 's.phone' => "Text", 's.phone_mobile' => "Text", 's.fax' => "Text", 's.url' => "Text", 's.email' => "Text", 's.default_lang' => "Text", 's.canvas' => "Text", 's.siret' => "Text", 's.siren' => "Text", 's.ape' => "Text", 's.idprof4' => "Text", 's.idprof5' => "Text", 's.idprof6' => "Text", 's.tva_intra' => "Text", 's.capital' => "Numeric", @@ -567,6 +568,7 @@ class modSociete extends DolibarrModules 's.fk_departement' => "StateCode", 's.fk_pays' => "CountryCode", 's.phone' => "Phone", + 's.phone_mobile' => "PhoneMobile", 's.fax' => "Fax", 's.url' => "Url", 's.email' => "Email", @@ -737,6 +739,7 @@ class modSociete extends DolibarrModules 's.fk_departement' => 'matches field "code_departement" in table "'.MAIN_DB_PREFIX.'c_departements"', 's.fk_pays' => 'US/FR/DE etc. matches field "code" in table "'.MAIN_DB_PREFIX.'c_country"', 's.phone' => "eg: +34123456789", + 's.phone_mobile' => "eg +33601020304", 's.fax' => "eg. +34987654321", 's.url' => "e.g. https://www.mybigcompany.com", 's.email' => "e.g. test@mybigcompany.com", diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index f6b491c04ff..d9916046c2d 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -198,7 +198,7 @@ $formfile->list_of_documents( ); -print "

    "; +print "
    "; //List of links diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 47b70c2a3a3..ca571023dd7 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -129,14 +129,18 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; - $backurlforlist = dol_buildpath('/eventorganization/conferenceorbooth_list.php', 1); + if (!empty($withproject)) { + $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_list.php?withproject=1&fk_project='.((int) $object->id); + } else { + $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_list.php'; + } if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?id='.($id > 0 ? $id : '__ID__').($withproject ? '&withproject=1' : ''); + $backtopage = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?fk_project='.((int) $object->id).'&id='.($id > 0 ? $id : '__ID__').($withproject ? '&withproject=1' : ''); } } } @@ -271,17 +275,6 @@ if (!empty($withproject)) { print ''; } - // Visibility - print ''.$langs->trans("Visibility").''; - if ($projectstatic->public == 0) { - print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"'); - print $langs->trans("PrivateProject"); - } else { - print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); - print $langs->trans("SharedProject"); - } - print ''; - // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { @@ -296,7 +289,7 @@ if (!empty($withproject)) { $end = dol_print_date($projectstatic->date_end, 'day'); print ' - '; print($end ? $end : '?'); - if ($object->hasDelay()) { + if ($projectstatic->hasDelay()) { print img_warning("Late"); } print ''; @@ -308,11 +301,22 @@ if (!empty($withproject)) { $end = dol_print_date($projectstatic->date_end_event, 'day'); print ' - '; print($end ? $end : '?'); - if ($object->hasDelay()) { + if ($projectstatic->hasDelay()) { print img_warning("Late"); } print ''; + // Visibility + print ''.$langs->trans("Visibility").''; + if ($projectstatic->public == 0) { + print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"'); + print $langs->trans("PrivateProject"); + } else { + print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); + print $langs->trans("SharedProject"); + } + print ''; + // Location event print ''.$langs->trans("Location").''; print $projectstatic->location; @@ -334,11 +338,6 @@ if (!empty($withproject)) { print ''; - // Description - print ''; - // Categories if (isModEnabled('category')) { print '"; } + // Description + print ''; + print '"; + // Link to ICS for the event + print '"; + + // Link for ICS for conference or booth print ''; @@ -438,7 +456,7 @@ if (!empty($withproject)) { print '
    '; } -// Part to create +// Part to create a conference or booth if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBooth")), '', 'object_'.$object->picto); @@ -477,7 +495,7 @@ if ($action == 'create') { //dol_set_focus('input[name="ref"]'); } -// Part to edit record +// Part to edit conference or booth if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("ConferenceOrBooth"), '', 'object_'.$object->picto); @@ -514,7 +532,7 @@ if (($id || $ref) && $action == 'edit') { print ''; } -// Part to show record +// Part to show conference or booth if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $res = $object->fetch_optionals(); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 072279261a3..c7cd6cbad0b 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; @@ -60,9 +60,10 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothattendeecard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$lineid = GETPOSTINT('lineid'); $mode = GETPOST('mode', 'alpha'); +$lineid = GETPOSTINT('lineid'); + $conf_or_booth_id = GETPOSTINT('conforboothid'); $fk_project = GETPOSTINT('fk_project'); $withproject = 1; @@ -76,10 +77,9 @@ $hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); / $confOrBooth = null; - -if ($conf_or_booth_id > 0) { +if ($conf_or_booth_id > 0 || $fk_project > 0) { $confOrBooth = new ConferenceOrBooth($db); - $result = $confOrBooth->fetch($id > 0 ? $id : $conf_or_booth_id); + $result = $confOrBooth->fetch($fk_project > 0 ? $fk_project : $conf_or_booth_id); if ($result < 0) { setEventMessages(null, $confOrBooth->errors, 'errors'); } else { @@ -135,6 +135,17 @@ $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; +// Security check +if ($user->socid > 0) { + accessforbidden(); +} +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'id', $isdraft); + +if (!$permissiontoread) { + accessforbidden(); +} + /* * Actions @@ -147,20 +158,18 @@ if ($reshook < 0) { } if (empty($reshook)) { - $error = 0; - - if (!empty($withproject)) { - $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1&fk_project='.((int) $fk_project); - } else { - $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php'; - } + //if (!empty($withproject)) { + $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1&fk_project='.((int) $fk_project); + //} else { + // $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php'; + //} if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?fk_project='.((int) $fk_project).'&id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?fk_project='.((int) $fk_project).'&id='.($id > 0 ? $id : '__ID__').'&withproject=1'; } } } @@ -231,13 +240,16 @@ if (!empty($projectstatic->socid)) { $projectstatic->fetch_thirdparty(); } - +$withProjectUrl = ''; $object->project = clone $projectstatic; if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; + $withProjectUrl = "&withproject=1"; + $head = project_prepare_head($projectstatic); + print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); $param = ($mode == 'mine' ? '&mode=mine' : ''); @@ -256,7 +268,7 @@ if (!empty($withproject)) { $morehtmlref .= ''; // Define a complementary filter for search of next/prev ref. - if (!$user->hasRight('projet', 'all', 'lire')) { + if (!$user->hasRight('project', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } @@ -301,17 +313,15 @@ if (!empty($withproject)) { print ''; } - // Visibility - print ''; - // Date start - end - print ''; - // Budget - print ''; + // Visibility + print ''; + + // Location event + print ''; + // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; @@ -342,18 +373,18 @@ if (!empty($withproject)) { print '
    '.$langs->trans("Description").''; - print dol_htmlentitiesbr($projectstatic->description); - print '
    '.$langs->trans("Categories").''; @@ -346,6 +345,11 @@ if (!empty($withproject)) { print "
    '.$langs->trans("Description").''; + print dol_htmlentitiesbr($projectstatic->description); + print '
    '; $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : ''); $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp"); @@ -380,6 +384,20 @@ if (!empty($withproject)) { print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, null, '', 0, '', 'projectid'); print "
    '.$langs->trans("EventOrganizationICSLinkProject").''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'id.'&module='.urlencode('project@eventorganization').'&file='.urlencode('calendar-'.$projectstatic->ref.'.ics').'&output=file">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; + print $message; + print "
    '.$langs->trans("EventOrganizationICSLink").''; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -421,7 +439,7 @@ if (!empty($withproject)) { //print ''; //print ajax_autoselect("linkregister"); print '
    '.$langs->trans("Visibility").''; - if ($projectstatic->public) { - print $langs->trans('SharedProject'); - } else { - print $langs->trans('PrivateProject'); + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print ''.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Date start - end project + print '
    '.$langs->trans("Dates").' ('.$langs->trans("Project").')'; $start = dol_print_date($projectstatic->date_start, 'day'); print($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -322,13 +332,34 @@ if (!empty($withproject)) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + // Date start - end of event + print '
    '.$langs->trans("Dates").' ('.$langs->trans("Event").')'; + $start = dol_print_date($projectstatic->date_start_event, 'day'); + print($start ? $start : '?'); + $end = dol_print_date($projectstatic->date_end_event, 'day'); + print ' - '; + print($end ? $end : '?'); + if ($projectstatic->hasDelay()) { + print img_warning("Late"); } print '
    '.$langs->trans("Visibility").''; + if ($projectstatic->public == 0) { + print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"'); + print $langs->trans("PrivateProject"); + } else { + print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); + print $langs->trans("SharedProject"); + } + print '
    '.$langs->trans("Location").''; + print $projectstatic->location; + print '
    '; + // Categories + if (isModEnabled('category')) { + print '"; + } + // Description print ''; - // Categories - if (isModEnabled('category')) { - print '"; - } - print '"; - print '"; + + // Link to ICS for the event + print '"; + + // Link for ICS for conference or booth + print '"; @@ -400,13 +451,13 @@ if (!empty($withproject)) { print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage")); //print ''; print ''; @@ -440,8 +491,8 @@ if (!empty($withproject)) { print '
    '; } -// Part to create -if ($action == 'create' && $confOrBooth !== null) { +// Part to create an attendee +if ($action == 'create' && $confOrBooth === null) { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto); @@ -449,9 +500,6 @@ if ($action == 'create' && $confOrBooth !== null) { print ''; print ''; - if ($confOrBooth->id > 0) { - print ''; - } if ($projectstatic->id > 0) { print ''; print ''; @@ -485,7 +533,7 @@ if ($action == 'create' && $confOrBooth !== null) { //dol_set_focus('input[name="ref"]'); } -// Part to edit record +// Part to edit attendee if (($id || $ref) && $action == 'edit' && $confOrBooth !== null) { print load_fiche_titre($langs->trans("ConferenceOrBoothAttendee"), '', 'object_'.$object->picto); @@ -528,7 +576,7 @@ if (($id || $ref) && $action == 'edit' && $confOrBooth !== null) { print ''; } -// Part to show record +// Part to show attendee if ($confOrBooth !== null && $object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $object->fetch_optionals(); @@ -574,7 +622,7 @@ if ($confOrBooth !== null && $object->id > 0 && (empty($action) || ($action != ' // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
    '; diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index aa5f230782d..daae51f6c72 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -3,7 +3,7 @@ * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -214,7 +214,7 @@ if (!$error && $massaction == 'confirm_presend_attendees') { $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; $url_link = $urlwithroot . '/public/agenda/agendaexport.php?format=ical' . ($conf->entity > 1 ? "&entity=" . $conf->entity : ""); - $url_link .= '&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...'); + $url_link .= '&exportkey=' . urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...')); $url_link .= "&project=" . $listofselectedref[$email]->fk_project . '&module=' . urlencode('@eventorganization') . '&status=' . ConferenceOrBooth::STATUS_CONFIRMED; $html_link = '' . $langs->trans('DownloadICSLink') . ''; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index cd41d10a18d..5f50252fc06 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -448,7 +448,7 @@ class Fichinter extends CommonObject $sql .= ", date_valid = ".($this->datev ? "'".$this->db->idate($this->datev)."'" : "null"); } if (isset($this->datet)) { - $sql .= ", datet = '".($this->datet ? "'".$this->db->idate($this->datet)."'" : "null"); + $sql .= ", datet = ".($this->datet ? "'".$this->db->idate($this->datet)."'" : "null"); } $sql .= ", note_private = ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null"); $sql .= ", note_public = ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null"); diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index 1817272ec0d..2aae768def0 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -264,3 +264,6 @@ CREATE TABLE llx_webhook_history( ) ENGINE=innodb; ALTER TABLE llx_societe_rib ADD COLUMN cci varchar(100) after iban_prefix; -- Interbank code for some countries like Chile + +ALTER TABLE llx_eventorganization_conferenceorboothattendee DROP INDEX idx_eventorganization_conferenceorboothattendee_ref; +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_confboothattendee(ref); diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql index 9e1bbcde191..34f944934f6 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql @@ -16,7 +16,6 @@ -- BEGIN MODULEBUILDER INDEXES ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_rowid (rowid); -ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_ref (ref); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_soc (fk_soc); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_actioncomm (fk_actioncomm); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_project (fk_project); @@ -24,5 +23,6 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_evento ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status); -- END MODULEBUILDER INDEXES +-- Note if we add the entity, we want the ref numbering rule per entity, so we must add entity in constraint. +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_confboothattendee (ref); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_project, email, fk_actioncomm); - diff --git a/htdocs/install/mysql/tables/llx_webhook_history-webhook.sql b/htdocs/install/mysql/tables/llx_webhook_history-webhook.sql index 047f2eba7dd..6fcc304858a 100644 --- a/htdocs/install/mysql/tables/llx_webhook_history-webhook.sql +++ b/htdocs/install/mysql/tables/llx_webhook_history-webhook.sql @@ -18,9 +18,11 @@ CREATE TABLE llx_webhook_history( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, --ref varchar(128) NOT NULL, + trigger_code varchar(128) NOT NULL, trigger_data text NOT NULL, fk_target integer NOT NULL, url integer NOT NULL, + error_messsage text, --note_public text, note_private text, date_creation datetime NOT NULL, diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 3f7f8c20dd4..26a9834eee4 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -162,3 +162,4 @@ NoRecordUpdated=No Record updated ProfitPerValidatedAttendee=Profit per attendee Confirmed=Confirmed NotSelected=Not selected +TheLinkIsAvailableOnTheProjectEventCard=The links to suggest or vote for a conference or apply for a booth is provided into the page of the project/event diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index ee42f9a75e5..58a0a10234e 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -379,4 +379,51 @@ SecurityPolicySucesfullyAdded=Content Security Policy successfully added ErrorAddingSecurityPolicy=An error occurred when trying to add a Content Security Policy UnknowContentSecurityPolicyDirective=Unknown Content Security Policy directive syntax FillCSPDirective=Please fill Content Security Policy directive -FillCSPSource=Please fill Content Security Policy source \ No newline at end of file +FillCSPSource=Please fill Content Security Policy source +presentation=Presentation +missionVision=Mission & Vision +directory=Members Directory +newsEvents=News & Events +actionsEvents=Actions & Events +commitmentSupport=Commitment & Support +becomeMember=Become a Member +makeDonation=Make a Donation +contact=Contact +memberArea=Member Area +noCompanyInfoSlogan=No company information defined +noCompanyInfoDescription=No company %s and %s provided. Please update it in Company & Organization settings. +highlights=Highlights +volunteer=Volunteer +member=Member +fundsCollected=Funds Collected +actions=Actions +news=News +readMore=Read More +loadMore=Load more +goal=Goal +raised=Raised +donateNow=Donate Now +Participate=Participate +contactTitle=Get in touch +contactMessage=We are here to answer all your questions and help you. Feel free to contact us for any information or assistance. +submit=Submit +labelAddress=Address +mailUs=Mail Us +labelFirstName=Your First Name +labelEmail=Your Email +labelPhone=Your Phone +labelSubject=Subject +labelMessage=Your Message +contactFormSubject=New contact request from %s website +contactFormReceived = You have received a new message from %s website contact form +contactFormName = Name +contactFormEmail = Email +contactFormPhone = Phone +contactFormSubjectEntered = Subject entered +contactFormMessageLabel = Message +contactFormSuccessAlert = Thank you for your message. We will get back to you shortly. +socials=Reseau sociaux +rgpd=RGPD +joinUs=Join US +home=Home +anonymous=Anonymous diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index 185d2192114..d2e2fbc8e27 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -377,3 +377,50 @@ SecurityPolicySucesfullyRemoved=La politique de sécurité du contenu a été su ErrorRemovingSecurityPolicy=Une erreur s'est produite lors de la tentative de suppression d'une politique de sécurité du contenu SecurityPolicySucesfullyAdded=La politique de sécurité du contenu a été ajoutée avec succès ErrorAddingSecurityPolicy=Une erreur s'est produite lors de la tentative d'ajout d'une politique de sécurité du contenu +presentation=Présentation +missionVision=Mission & Vision +directory=Annuaire des membres +newsEvents=Actualités & Événements +actionsEvents=Actions & Événements +commitmentSupport=Engagement & Soutien +becomeMember=Devenir membre +makeDonation=Faire un don +contact=Contact +memberArea=Espace membre +highlights=Chiffres +volunteer=Bénévole +member=Membre +fundsCollected=Fonds collectés +actions=Actions +news=Actualités +readMore=Lire la suite +loadMore=Voir plus +actionsEvents=Événements & Actions +goal=Objectif +raised=Collecté +donateNow=Faire un don +Participate= Participer +contactTitle=Contactez-nous +contactMessage=Nous sommes là pour répondre à toutes vos questions et vous aider. N'hésitez pas à nous contacter pour toute information ou assistance. +submit=Envoyer +labelAddress=Adresse +labelEmail=E-mail +labelPhone=Téléphone +labelFirstName_fr=Votre prénom +labelEmail_fr=Votre E-mail +labelPhone_fr=Votre téléphone +labelSubject_fr=Sujet +labelMessage_fr=Votre message +contactFormSubject = Nouvelle demande de contact depuis le site %s +contactFormReceived = Vous avez reçu un nouveau message depuis le formulaire de contact du site %s. +contactFormName = Nom +contactFormEmail = Email +contactFormPhone = Téléphone +contactFormSubjectEntered = Sujet saisi +contactFormMessageLabel = Message +contactFormSuccessAlert = Merci pour votre message. Nous vous répondrons dans les plus brefs délais. +socials=Réseaux sociaux +rgpd=RGPD +joinUs = Rejoignez-nous +home=Accueil +anonymous=Inconnu diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 2eb515e1c80..872c1cda625 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -364,15 +364,7 @@ if (!empty($doactionsthenredirect)) { $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; } - if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Remove this to make only a http redirect, if the website need a js redirect to parent frame, he must do it itself. - dol_syslog("Now do a redirect in iframe mode in js to ".$ext_urlko, LOG_DEBUG, 0, '_payment'); - - // Redirect in js is not reliable - print ""; - } else { - dol_syslog("Now do a redirect using Location : ".$ext_urlko, LOG_DEBUG, 0, '_payment'); - - header("Location: ".$ext_urlko); - exit; - } + dol_syslog("Now do a redirect using Location : ".$ext_urlko, LOG_DEBUG, 0, '_payment'); + header("Location: ".$ext_urlko); + exit; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 1b7266c9797..c9f5f05f453 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -2171,17 +2171,9 @@ if (!empty($doactionsthenredirect)) { $ext_urlok = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentok&fulltag='.$FULLTAG; } - if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Remove this to make only a http redirect, if the website need a js redirect to parent frame, he must do it itself. - dol_syslog("Now do a redirect in iframe mode in js to ".$ext_urlok, LOG_DEBUG, 0, '_payment'); - - // Redirect in js is not reliable - print ""; - } else { - dol_syslog("Now do a redirect using a Location: ".$ext_urlok, LOG_DEBUG, 0, '_payment'); - - header("Location: ".$ext_urlok); - exit; - } + dol_syslog("Now do a redirect using a Location: ".$ext_urlok, LOG_DEBUG, 0, '_payment'); + header("Location: ".$ext_urlok); + exit; } else { // Redirect to an error page // Paymentko page must be created for the specific website @@ -2191,16 +2183,8 @@ if (!empty($doactionsthenredirect)) { $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; } - if (getDolGlobalInt('MARKETPLACE_PAYMENT_IN_FRAME') == 1) { // TODO Remove this to make only a http redirect, if the website need a js redirect to parent frame, he must do it itself. - dol_syslog("Now do a redirect in iframe mode in js to ".$ext_urlko, LOG_DEBUG, 0, '_payment'); - - // Redirect in js is not reliable - print ""; - } else { - dol_syslog("Now do a redirect using a Location:".$ext_urlko, LOG_DEBUG, 0, '_payment'); - - header("Location: ".$ext_urlko); - exit; - } + dol_syslog("Now do a redirect using a Location:".$ext_urlko, LOG_DEBUG, 0, '_payment'); + header("Location: ".$ext_urlko); + exit; } } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index cf1cfb715f2..759c3bb0a07 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -20,7 +20,8 @@ /** * \file htdocs/public/project/index.php * \ingroup core - * \brief File to offer a way to suggest a conference or a booth for an event + * \brief Page to offer a way to suggest a conference or a booth for a given event. + * Link of this page is given into the project card. */ if (!defined('NOLOGIN')) { @@ -54,8 +55,6 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -global $dolibarr_main_url_root; - /** * @var Conf $conf * @var DoliDB $db @@ -240,7 +239,7 @@ print ''; +print '
    '; print '
    '; @@ -251,7 +250,7 @@ print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, '', 'center' print ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").''; print '
    '; // Title -print ''.dol_escape_htmltag($project->title . ' '. $conference->label).'
    '; +print ''.dol_escape_htmltag($project->title).'
    '; print '
    '; // Help text @@ -293,16 +292,8 @@ print '
    '; print '
    '.$langs->trans("Categories").''; + print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); + print "
    '.$langs->trans("Description").''; print nl2br($projectstatic->description); print '
    '.$langs->trans("Categories").''; - print $form->showCategories($projectstatic->id, 'project', 1); - print "
    '; $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : ''); $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp"); @@ -382,14 +413,34 @@ if (!empty($withproject)) { print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, null, '', 0, '', 'projectid'); print "
    '.$langs->trans("EventOrganizationICSLink").''; + print '
    '; + print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $projectstatic, $permissiontoadd, 'integer:3', '', 0, 0, 'projectid'); + print ''; + print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, null, '', 0, '', 'projectid'); + print "
    '.$langs->trans("EventOrganizationICSLinkProject").''; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // Show message $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...'); + $message .= '&exportkey='.urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...')); + $message .= "&project=".$projectstatic->id.'&module='.urlencode('project@eventorganization').'&file='.urlencode('calendar-'.$projectstatic->ref.'.ics').'&output=file">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; + print $message; + print "
    '.$langs->trans("EventOrganizationICSLink").''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; print $message; print "
    '; - $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id; - $encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5'); + $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $projectstatic->id); + $encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.((int) $projectstatic->id), 'md5'); $linksuggest .= '&securekey='.urlencode($encodedsecurekey); //print ''; //print ajax_autoselect("linkregister"); print '
    '."\n"; -print $text; - // Output payment summary form -print '
    '; - -$found = false; -$error = 0; -$var = false; - -$object = null; +print '
    '; print "\n"; @@ -344,8 +335,9 @@ print ''."\n"; print '
    '; +$suffix = ''; -htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $project); llxFooter('', 'public'); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d46c2be4d4b..b1c74cd88cc 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -589,6 +589,7 @@ input.buttonpaymentstripe { max-height: 80px; max-width: 300px; image-rendering: -webkit-optimize-contrast; /* better rendering on public page header */ + border-radius: 4px; } a.butStatus { @@ -1021,6 +1022,11 @@ textarea.centpercent { .centerimp { text-align: center !important; } +.centergrid { + display: grid; + text-align: center; + place-items: center; +} .alignstart { text-align: start; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 60111cfc239..fb9b31187b3 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -788,6 +788,7 @@ input.buttonpaymentstripe { max-height: 80px; max-width: 300px; image-rendering: -webkit-optimize-contrast; /* better rendering on public page header */ + border-radius: 4px; } a.butStatus { padding-left: 5px; @@ -1202,6 +1203,11 @@ textarea.centpercent { .centerimp { text-align: center !important; } +.centergrid { + display: grid; + text-align: center; + place-items: center; +} .alignstart { text-align: start; } diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index ad4879eb335..14186844122 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -104,6 +104,29 @@ class FichinterTest extends CommonClassTest return $localobject; } + /** + * testFichinterUpdate + * + * Check that a intervention object can be updated. + * + * @param Object $localobject An existing intervention object to update. + * @return Intervention object with data fetched and description changed + * + * @depends testFichinterFetch + */ + public function testFichinterUpdate($localobject) + { + global $user; + + $localobject->description = "foobar"; + + $result = $localobject->update($user); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0, $localobject->errorsToString()); + + return $localobject; + } + /** * testFichinterValid *