diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php
index d51dd8ef730..64197636d0e 100644
--- a/htdocs/adherents/admin/member.php
+++ b/htdocs/adherents/admin/member.php
@@ -64,7 +64,7 @@ if ($action == 'set_default') {
} elseif ($action == 'del_default') {
$ret = delDocumentModel($value, $type);
if ($ret > 0) {
- if ($conf->global->MEMBER_ADDON_PDF_ODT == "$value") {
+ if (getDolGlobalString('MEMBER_ADDON_PDF_ODT') == "$value") {
dolibarr_del_const($db, 'MEMBER_ADDON_PDF_ODT', $conf->entity);
}
}
diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php
index ed09c206abf..6199991f29c 100644
--- a/htdocs/adherents/admin/website.php
+++ b/htdocs/adherents/admin/website.php
@@ -95,12 +95,13 @@ if ($action == 'update') {
$form = new Form($db);
+$title = $langs->trans("MembersSetup");
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
-llxHeader('', $langs->trans("MembersSetup"), $help_url);
+llxHeader('', $title, $help_url);
$linkback = ''.$langs->trans("BackToModuleList").'';
-print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
+print load_fiche_titre($title, $linkback, 'title_setup');
$head = member_admin_prepare_head();
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index d85ad51946a..0befd4820ff 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -772,16 +772,6 @@ class Contrat extends CommonObject
$now = dol_now();
- /*
- if (!is_object($extrafields)) {
- require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
- $extrafields = new ExtraFields($this->db);
- }
-
- $line = new ContratLigne($this->db);
- $extrafields->fetch_name_optionals_label(ContratLigne::$table_element, true);
- */
-
$this->lines = array();
$pos = 0;
@@ -875,7 +865,7 @@ class Contrat extends CommonObject
$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite);
$line->date_fin_reel = $this->db->jdate($objp->date_cloture);
- // Retrieve all extrafields for contract
+ // Retrieve all extrafields for contract line
// fetch optionals attributes and labels
$line->fetch_optionals();
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index e1ed8855378..6466754f241 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7805,7 +7805,7 @@ abstract class CommonObject
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $onetrtd All fields in same tr td. Used by objectline_create.tpl.php for example.
* @param string $display_type "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...)
- * @return string
+ * @return string String with html content to show
*/
public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0, $display_type = 'card')
{
@@ -7814,13 +7814,20 @@ abstract class CommonObject
if (!is_object($form)) {
$form = new Form($db);
}
+ if (!is_object($extrafields)) {
+ dol_syslog('Bad parameter extrafields for showOptionals', LOG_ERR);
+ return 'Bad parameter extrafields for showOptionals';
+ }
+ if (!is_array($extrafields->attributes[$this->table_element])) {
+ dol_syslog("extrafields->attributes was not loaded with extrafields->fetch_name_optionals_label(table_element);", LOG_WARNING);
+ }
$out = '';
$parameters = array();
$reshook = $hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
- if (key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
+ if (is_array($extrafields->attributes[$this->table_element]) && key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) {
$out .= "\n";
$out .= ' ';
$out .= "\n";
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 244da59b5ff..19ea745c8e1 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -1533,10 +1533,12 @@ class FormMail extends Form
if (!is_object($extrafields)) {
$extrafields = new ExtraFields($this->db);
}
- $extrafields->fetch_name_optionals_label('product', true);
$product = new Product($this->db);
$product->fetch($line->fk_product, '', '', 1);
$product->fetch_optionals();
+
+ $extrafields->fetch_name_optionals_label($product->table_element, true);
+
if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) {
foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) {
$substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key];
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 15162c8b273..68e76e85ca3 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -509,14 +509,12 @@ function project_admin_prepare_head()
$head[$h][2] = 'attributes_task';
$h++;
- if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
- $langs->load("members");
+ $langs->load("members");
- $head[$h][0] = DOL_URL_ROOT.'/projet/admin/website.php';
- $head[$h][1] = $langs->trans("BlankSubscriptionForm");
- $head[$h][2] = 'website';
- $h++;
- }
+ $head[$h][0] = DOL_URL_ROOT.'/projet/admin/website.php';
+ $head[$h][1] = $langs->trans("BlankSubscriptionForm");
+ $head[$h][2] = 'website';
+ $h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'project_admin', 'remove');
@@ -2819,7 +2817,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$out .= ' ';
} else {
// bad
- $out .= '
';
+ $out .= '
';
$out .= ' ';
$out .= '
';
}
diff --git a/htdocs/core/tpl/extrafields_add.tpl.php b/htdocs/core/tpl/extrafields_add.tpl.php
index 2f44bbe9c48..fa150d6a27b 100644
--- a/htdocs/core/tpl/extrafields_add.tpl.php
+++ b/htdocs/core/tpl/extrafields_add.tpl.php
@@ -41,6 +41,7 @@ if (!isset($parameters)) {
}
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+
print $hookmanager->resPrint;
if (empty($reshook)) {
$params = array();
@@ -48,6 +49,7 @@ if (empty($reshook)) {
$params['tpl_context'] = $tpl_context;
}
$params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : '';
+
print $object->showOptionals($extrafields, 'create', $params);
}
diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php
index b6bfd45c91a..1478dbea83f 100644
--- a/htdocs/intracommreport/list.php
+++ b/htdocs/intracommreport/list.php
@@ -82,7 +82,7 @@ $form = new Form($db);
/*
// fetch optionals attributes and labels
-$extralabels = $extrafields->fetch_name_optionals_label('intracommreport');
+$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
*/
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 3a0e96d58da..8dcd1f9f93d 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2253,4 +2253,5 @@ HashForPing=Hash used for ping
ReadOnlyMode=Is instance in "Read Only" mode
DEBUGBAR_USE_LOG_FILE=Use the dolibarr.log file to trap Logs
UsingLogFileShowAllRecordOfSubrequestButIsSlower=Use the dolibarr.log file to trap Logs instead of live memory catching. It allows to catch all logs instead of only log of current process (so including the one of ajax subrequests pages) but will make your instance very very slow. Not recommended.
-FixedOrPercent=Fixed (use keyword 'fixed') or percent (use keyword 'percent')
\ No newline at end of file
+FixedOrPercent=Fixed (use keyword 'fixed') or percent (use keyword 'percent')
+DefaultOpportunityStatus=Default opportunity status (first status when lead is created)
\ No newline at end of file
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 530f3b6af0e..97111df74cd 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1174,3 +1174,5 @@ ConfirmAllocateCommercial=Assign sales representative confirmation
ConfirmAllocateCommercialQuestion=Are you sure you want to assign the %s selected record(s)?
CommercialsAffected=Sales representatives affected
CommercialAffected=Sales representative affected
+YourMessage=Votre message
+YourMessageHasBeenReceived=Your message has been received. We will answer or contact you as soon as possible.
\ No newline at end of file
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 1e0ed42d3e3..739a35dcebf 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -289,3 +289,8 @@ FormForNewLeadDesc=Thanks to fill the following form to contact us. You can also
ProjectsHavingThisContact=Projects having this contact
StartDateCannotBeAfterEndDate=End date cannot be before start date
ErrorPROJECTLEADERRoleMissingRestoreIt=The "PROJECTLEADER" role is missing or has been de-activited, please restore in the dictionary of contact types
+LeadPublicFormDesc=You can enable here a public page to allow your prospects to make a first contact to you from a public online form
+EnablePublicLeadForm=Enable the public form for contact
+NewLeadbyWeb=Your message or request has been recorded. We will answer or contact your soon.
+NewLeadForm=New contact form
+LeadFromPublicForm=Online lead from public form
\ No newline at end of file
diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php
index 9bd986a3c73..764ff919cc7 100644
--- a/htdocs/product/dynamic_price/class/price_parser.class.php
+++ b/htdocs/product/dynamic_price/class/price_parser.class.php
@@ -154,7 +154,6 @@ class PriceParser
//Retrieve all extrafield for product and add it to values
$extrafields = new ExtraFields($this->db);
- $extrafields->fetch_name_optionals_label('product', true);
$product->fetch_optionals();
if (is_array($extrafields->attributes[$product->table_element]['label'])) {
foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) {
diff --git a/htdocs/projet/admin/website.php b/htdocs/projet/admin/website.php
index 25497fef436..37b858757ca 100644
--- a/htdocs/projet/admin/website.php
+++ b/htdocs/projet/admin/website.php
@@ -28,6 +28,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page
@@ -35,10 +36,14 @@ $langs->loadLangs(array("admin", "members"));
$action = GETPOST('action', 'aZ09');
+$defaultoppstatus = getDolGlobalInt('PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD');
+
if (!$user->admin) {
accessforbidden();
}
+$error = 0;
+
/*
* Actions
@@ -54,8 +59,10 @@ if ($action == 'setPROJECT_ENABLE_PUBLIC') {
if ($action == 'update') {
$public = GETPOST('PROJECT_ENABLE_PUBLIC');
+ $defaultoppstatus = GETPOST('PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD', 'int');
$res = dolibarr_set_const($db, "PROJECT_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD", $defaultoppstatus, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
@@ -74,13 +81,15 @@ if ($action == 'update') {
*/
$form = new Form($db);
+$formproject = new FormProjets($db);
+$title = $langs->trans("ProjectsSetup");
$help_url = '';
-llxHeader('', $langs->trans("ProjectsSetup"), $help_url);
+llxHeader('', $title, $help_url);
$linkback = ''.$langs->trans("BackToModuleList").'';
-print load_fiche_titre($langs->trans("ProjectsSetup"), $linkback, 'title_setup');
+print load_fiche_titre($title, $linkback, 'title_setup');
$head = project_admin_prepare_head();
@@ -90,11 +99,12 @@ print '';
if (!empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
print ' ';
//print $langs->trans('FollowingLinksArePublic').' ';
- print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').': ';
- if ($conf->multicompany->enabled) {
+ print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').' ';
+ if (!empty($conf->multicompany->enabled)) {
$entity_qr = '?entity='.$conf->entity;
} else {
$entity_qr = '';
@@ -132,7 +169,11 @@ if (!empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
$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 ''.$urlwithroot.'/public/project/new.php'.$entity_qr.'';
+ print '
';
+ print ajax_autoselect('publicurlmember');
}
// End of page
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 4fd6c3976fe..cadeb278ae7 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -159,7 +159,9 @@ class Project extends CommonObject
public $statuts_long;
public $statut; // 0=draft, 1=opened, 2=closed
+
public $opp_status; // opportunity status, into table llx_c_lead_status
+ public $fk_opp_status; // opportunity status, into table llx_c_lead_status
public $opp_percent; // opportunity probability
public $email_msgid;
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 1ba9d6be483..0e6df96a8ed 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -932,7 +932,7 @@ if (!empty($arrayfields['p.public']['checked'])) {
// Opp status
if (!empty($arrayfields['p.fk_opp_status']['checked'])) {
print '
';
}
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 055ffec56f9..7a27ae14b62 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -57,7 +57,6 @@ if (!defined('NOIPCHECK')) {
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
-// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
if (is_numeric($entity)) {
define("DOLENTITY", $entity);
@@ -430,7 +429,7 @@ if (empty($reshook) && $action == 'added') {
llxHeaderVierge($langs->trans("NewMemberForm"));
// Si on a pas ete redirige
- print ' ';
+ print '
';
print '
';
print $langs->trans("NewMemberbyWeb");
print '
';
@@ -448,7 +447,7 @@ if (empty($reshook) && $action == 'added') {
$form = new Form($db);
$formcompany = new FormCompany($db);
$adht = new AdherentType($db);
-$extrafields->fetch_name_optionals_label('adherent'); // fetch optionals attributes and labels
+$extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels
llxHeaderVierge($langs->trans("NewSubscription"));
diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php
index cbc1b849115..f6f0efc4fb2 100644
--- a/htdocs/public/partnership/new.php
+++ b/htdocs/public/partnership/new.php
@@ -419,7 +419,7 @@ if (empty($reshook) && $action == 'added') {
llxHeaderVierge($langs->trans("NewPartnershipForm"));
// Si on a pas ete redirige
- print ' ';
+ print '
';
@@ -437,7 +437,7 @@ if (empty($reshook) && $action == 'added') {
$form = new Form($db);
$formcompany = new FormCompany($db);
-$extrafields->fetch_name_optionals_label('partnership'); // fetch optionals attributes and labels
+$extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels
llxHeaderVierge($langs->trans("NewPartnershipRequest"));
diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php
index 971031e7a80..85106ce51de 100644
--- a/htdocs/public/project/new.php
+++ b/htdocs/public/project/new.php
@@ -45,7 +45,6 @@ if (!defined('NOIPCHECK')) {
// For MultiCompany module.
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
-// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
if (is_numeric($entity)) {
define("DOLENTITY", $entity);
@@ -132,9 +131,9 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '
';
}
- if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) {
- print '
'."\n";
+
// Other attributes
$tpl_context = 'public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
print '
';
-print '
'.$langs->trans("Comments").'
';
-print '
';
+print '
'.$langs->trans("Message").' *
';
+print '
';
print '
'."\n";
print "
\n";
diff --git a/htdocs/theme/eldy/progress.inc.php b/htdocs/theme/eldy/progress.inc.php
index e74c84cf89e..1bc40e2f2fc 100644
--- a/htdocs/theme/eldy/progress.inc.php
+++ b/htdocs/theme/eldy/progress.inc.php
@@ -194,4 +194,8 @@ body[class*="colorblind-"] .progress-bar-red, body[class*="colorblind-"] .progre
}
.progress-bar-consumed {
background-color: rgb(0, 0, 0, 0.15);
-}
\ No newline at end of file
+}
+.progress-bar-consumed-late {
+ background-color: ;
+}
+