Fix edition of status were loosing old percent. We show it to allow user
to keep it if required.
This commit is contained in:
parent
03dbf6e747
commit
a258663175
@ -569,7 +569,7 @@ class FormProjets
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$sellist .='<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'"';
|
||||
$sellist .='<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"';
|
||||
if ($obj->rowid == $preselected) $sellist .= ' selected="selected"';
|
||||
$sellist .= '>';
|
||||
if ($useshortlabel)
|
||||
|
||||
@ -488,6 +488,7 @@ ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
|
||||
|
||||
UPDATE llx_projet set fk_opp_status = NULL where fk_opp_status = -1;
|
||||
UPDATE llx_c_lead_status set code = 'WON' where code = 'WIN';
|
||||
UPDATE llx_c_lead_status set percent = 100 where code = 'WON';
|
||||
|
||||
|
||||
CREATE TABLE llx_oauth_token (
|
||||
|
||||
@ -84,6 +84,7 @@ SeeAbove=See above
|
||||
HomeArea=Home area
|
||||
LastConnexion=Last connection
|
||||
PreviousConnexion=Previous connection
|
||||
PreviousValue=Previous value
|
||||
ConnectedOnMultiCompany=Connected on environment
|
||||
ConnectedSince=Connected since
|
||||
AuthenticationMode=Authentification mode
|
||||
|
||||
@ -710,7 +710,9 @@ else
|
||||
|
||||
// Opportunity probability
|
||||
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td>';
|
||||
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.(isset($_POST['opp_percent'])?GETPOST('opp_percent'):(strcmp($object->opp_percent,'')?price($object->opp_percent,0,$langs,1,0):'')).'"> %</td>';
|
||||
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.(isset($_POST['opp_percent'])?GETPOST('opp_percent'):(strcmp($object->opp_percent,'')?price($object->opp_percent,0,$langs,1,0):'')).'"> %';
|
||||
print '<span id="oldopppercent"></span>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Opportunity amount
|
||||
@ -837,14 +839,23 @@ else
|
||||
print '</form>';
|
||||
|
||||
// Change probability from status
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function change_percent()
|
||||
{
|
||||
var element = jQuery("#opp_status option:selected");
|
||||
var defaultpercent = element.attr("defaultpercent");
|
||||
/*if (jQuery("#opp_percent_not_set").val() == "") */
|
||||
jQuery("#opp_percent").val(defaultpercent);
|
||||
var elemcode = element.attr("elemcode");
|
||||
/* Change percent of default percent of new status is higher */
|
||||
if (parseFloat(jQuery("#opp_percent").val()) != parseFloat(defaultpercent)
|
||||
)
|
||||
{
|
||||
if (! jQuery("#oldopppercent").text()) jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->trans("PreviousValue")).': \'+jQuery("#opp_percent").val()+\' %\');
|
||||
jQuery("#opp_percent").val(defaultpercent);
|
||||
|
||||
}
|
||||
}
|
||||
/*init_myfunc();*/
|
||||
jQuery("#opp_status").change(function() {
|
||||
@ -852,7 +863,7 @@ else
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Boutons actions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user