diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 2407d4b2d86..6d2f67ee675 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -125,7 +125,8 @@ ValidateProject=Validate projet
ConfirmValidateProject=Are you sure you want to validate this project?
CloseAProject=Close project
ConfirmCloseAProject=Are you sure you want to close this project?
-AlsoCloseAProject=Also close project (keep it open if you still need to follow production tasks on it)
+AlsoCloseAProject=Also close project
+AlsoCloseAProjectTooltip=Keep it open if you still need to follow production tasks on it
ReOpenAProject=Open project
ConfirmReOpenAProject=Are you sure you want to re-open this project?
ProjectContact=Contacts of project
@@ -168,7 +169,7 @@ OpportunityProbability=Lead probability
OpportunityProbabilityShort=Lead probab.
OpportunityAmount=Lead amount
OpportunityAmountShort=Lead amount
-OpportunityWeightedAmount=Opportunity weighted amount
+OpportunityWeightedAmount=Amount of opportunity, weighted by probability
OpportunityWeightedAmountShort=Opp. weighted amount
OpportunityAmountAverageShort=Average lead amount
OpportunityAmountWeigthedShort=Weighted lead amount
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 1bdcccbaecf..78dd11c9fd0 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -567,7 +567,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '';
// Label
- print '
'.$langs->trans("ProjectLabel").' ';
+ print ''.$langs->trans("Label").' ';
// Usage (opp, task, bill time, ...)
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
@@ -602,12 +602,46 @@ if ($action == 'create' && $user->rights->projet->creer) {
print ' ';
$htmltext = $langs->trans("ProjectFollowTasks");
print ''.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).' ';
+ print '';
print ' ';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
print ' ';
$htmltext = $langs->trans("ProjectBillTimeDescription");
print ''.$form->textwithpicto($langs->trans("BillTime"), $htmltext).' ';
+ print '';
print ' ';
}
if (isModEnabled('eventorganization')) {
@@ -706,24 +740,26 @@ if ($action == 'create' && $user->rights->projet->creer) {
print ''.$langs->trans("OpportunityStatus").' ';
print '';
print $formproject->selectOpportunityStatus('opp_status', GETPOSTISSET('opp_status') ? GETPOST('opp_status') : $object->opp_status, 1, 0, 0, 0, '', 0, 1);
- print ' ';
// Opportunity probability
- print ''.$langs->trans("OpportunityProbability").' ';
- print ' % ';
+ print ' % ';
print ' ';
print ' ';
print ' ';
// Opportunity amount
print ''.$langs->trans("OpportunityAmount").' ';
- print ' ';
+ print ' ';
+ print ' '.$langs->getCurrencySymbol($conf->currency);
+ print ' ';
print ' ';
}
// Budget
- print ''.$langs->trans("Budget").' ';
- print ' ';
+ print ''.$langs->trans("Budget").' ';
+ print ' ';
+ print ' '.$langs->getCurrencySymbol($conf->currency);
+ print ' ';
print ' ';
// Date project
@@ -780,6 +816,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '';
// Change probability from status or role of project
+ // Set also dependencies between use taks and bill time
print '';
print ' ';
@@ -930,12 +972,52 @@ if ($action == 'create' && $user->rights->projet->creer) {
print ' usage_task ? ' checked="checked"' : '')) . '"> ';
$htmltext = $langs->trans("ProjectFollowTasks");
print ''.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).' ';
+ print '';
print ' ';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
print ' usage_bill_time ? ' checked="checked"' : '')) . '"> ';
$htmltext = $langs->trans("ProjectBillTimeDescription");
print ''.$form->textwithpicto($langs->trans("BillTime"), $htmltext).' ';
+ print '';
print ' ';
}
if (isModEnabled('eventorganization')) {
@@ -944,7 +1026,14 @@ if ($action == 'create' && $user->rights->projet->creer) {
print ''.$form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext).' ';
print '';
}
@@ -1013,32 +1100,34 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Opportunity status
print ''.$langs->trans("OpportunityStatus").' ';
print '';
- print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 0, 1);
- print ' ';
- print ' ';
- print ''.$langs->trans("AlsoCloseAProject").' ';
- print '
';
- print ' ';
- print ' ';
+ print '';
+ print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 1, 1);
// Opportunity probability
- print '
'.$langs->trans("OpportunityProbability").' ';
- print ' %';
- print ' ';
+ print ' %';
+ print ' ';
+ print '';
+
+ print '';
+ print ' ';
+ print '';
+ print $form->textwithpicto($langs->trans("AlsoCloseAProject"), $langs->trans("AlsoCloseAProjectTooltip")).' ';
+ print '
';
+
print ' ';
print '';
// Opportunity amount
print '
'.$langs->trans("OpportunityAmount").' ';
- print ' ';
+ print ' ';
print $langs->getCurrencySymbol($conf->currency);
print ' ';
print '';
}
// Budget
- print '
'.$langs->trans("Budget").' ';
- print ' ';
+ print ''.$langs->trans("Budget").' ';
+ print ' ';
print $langs->getCurrencySymbol($conf->currency);
print ' ';
print '';
@@ -1180,14 +1269,13 @@ if ($action == 'create' && $user->rights->projet->creer) {
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, 0, $langs, 1, 0).' %';
}
- print ' ';
+ print '';
// Opportunity Amount
print '
'.$langs->trans("OpportunityAmount").' ';
@@ -1268,6 +1356,25 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '';
+ // Set also dependencies between use taks and bill time
+ print '';
+
// Change probability from status
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
// Default value to close or not when we set opp to 'WON'.
@@ -1308,19 +1415,23 @@ if ($action == 'create' && $user->rights->projet->creer) {
}
/* Change percent with default percent (defaultpercent) if new status (defaultpercent) is higher than current (jQuery("#opp_percent").val()) */
- console.log("oldpercent="+oldpercent);
if (oldpercent != \'\' && (parseFloat(defaultpercent) < parseFloat(oldpercent)))
{
- if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+oldpercent+\' %\');
- if (parseFloat(oldpercent) != 100) { jQuery("#opp_percent").val(oldpercent); }
- else { jQuery("#opp_percent").val(defaultpercent); }
+ console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent+" def < old");
+ if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
+ jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+price2numjs(oldpercent)+\' %\');
+ }
+
+ if (parseFloat(oldpercent) != 100 && elemcode != \'LOST\') { jQuery("#opp_percent").val(oldpercent); }
+ else { jQuery("#opp_percent").val(price2numjs(defaultpercent)); }
}
else
{
+ console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent);
if ((parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent)));
{
- if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+oldpercent+\' %\');
- jQuery("#opp_percent").val(defaultpercent);
+ if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+price2numjs(oldpercent)+\' %\');
+ jQuery("#opp_percent").val(price2numjs(defaultpercent));
}
}
}