';
// 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 '| '.$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 ' |
';
- */
}
// 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 '| '.$langs->trans("OpportunityStatus").' | ';
$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
if ($code) {
print $langs->trans("OppStatus".$code);
}
- print ' |
';
// Opportunity percent
- 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 ' |
';
+ print '';
// Opportunity Amount
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 ' |
';
@@ -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 ''.$langs->trans("Description").' | ';
- print nl2br($object->description);
+ print dol_htmlentitiesbr($object->description);
print ' | ';
// Categories