From 39fa93486d98764fb1f21ca17c06d9f5c7f93b06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Apr 2023 01:56:44 +0200 Subject: [PATCH] Debug v17 --- htdocs/projet/card.php | 13 ++----------- htdocs/projet/contact.php | 38 ++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 8e6a9fd6881..7fddc12b7c9 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1213,8 +1213,8 @@ if ($action == 'create' && $user->rights->projet->creer) { $morehtmlref = '
'; // Title $morehtmlref .= dol_escape_htmltag($object->title); - // Thirdparty $morehtmlref .= '
'; + // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); } @@ -1232,7 +1232,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print '
'; print '
'; - print ''; + print '
'; // Usage if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) { @@ -1302,15 +1302,6 @@ if ($action == 'create' && $user->rights->projet->creer) { } } print ''; - - // Opportunity Weighted Amount - /* - print ''; - */ } // Budget diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 2174a02c347..21b71b53ac9 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -240,6 +240,10 @@ if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->pr * View */ +$form = new Form($db); +$contactstatic = new Contact($db); +$userstatic = new User($db); + $title = $langs->trans('ProjectContact').' - '.$object->ref.' '.$object->name; if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->ref.' '.$object->name.' - '.$langs->trans('ProjectContact'); @@ -249,18 +253,12 @@ $help_url = 'EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE: llxHeader('', $title, $help_url); -$form = new Form($db); -$contactstatic = new Contact($db); -$userstatic = new User($db); -/* *************************************************************************** */ -/* */ -/* Edition and view mode */ -/* */ -/* *************************************************************************** */ - if ($id > 0 || !empty($ref)) { + /* + * View + */ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } @@ -293,10 +291,11 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
'; // Title - $morehtmlref .= $object->title; + $morehtmlref .= dol_escape_htmltag($object->title); + $morehtmlref .= '
'; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
'; @@ -358,26 +357,25 @@ if ($id > 0 || !empty($ref)) { } print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $object->opp_status) { + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) { // Opportunity status print ''; // Opportunity percent - print ''; + print ''; // Opportunity Amount print ''; @@ -397,7 +395,7 @@ if ($id > 0 || !empty($ref)) { $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); - print ' - '; + print ' - '; print ($end ? $end : '?'); if ($object->hasDelay()) { print img_warning("Late"); @@ -418,7 +416,7 @@ if ($id > 0 || !empty($ref)) { // Description print ''; // Categories
'.$langs->trans('OpportunityWeightedAmount').''; - if (strcmp($object->opp_amount, '') && strcmp($object->opp_percent, '')) { - print ''.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).''; - } - print '
'.$langs->trans("OpportunityStatus").''; $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) { print $langs->trans("OppStatus".$code); } - print '
'.$langs->trans("OpportunityProbability").''; + print ' / '; if (strcmp($object->opp_percent, '')) { - print price($object->opp_percent, '', $langs, 1, 0).' %'; + print price($object->opp_percent, 0, $langs, 1, 0).' %'; } - print '
'.$langs->trans("OpportunityAmount").''; if (strcmp($object->opp_amount, '')) { - print ''.price($object->opp_amount, '', $langs, 0, 0, 0, $conf->currency).''; + print ''.price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).''; if (strcmp($object->opp_percent, '')) { print '       '.$langs->trans("Weighted").': '.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).''; } @@ -388,7 +386,7 @@ if ($id > 0 || !empty($ref)) { // Budget print '
'.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 0, 0, 0, $conf->currency).''; + print ''.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print '
'.$langs->trans("Description").''; - print nl2br($object->description); + print dol_htmlentitiesbr($object->description); print '