Fix: Translation of proposal status in combo list

This commit is contained in:
eldy 2011-08-12 23:31:11 +02:00
parent 97cbc0c01b
commit 7640752fee
2 changed files with 20 additions and 4 deletions

View File

@ -1873,7 +1873,7 @@ else
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
$html->select_propal_statut($viewstatut);
$html->select_propal_statut($viewstatut,1);
print '</td>';
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';

View File

@ -1730,6 +1730,7 @@ class Form
if ($user->admin && ! $noadmininfo) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
/**
* \brief Selection HT ou TTC
* \param selected Id pre-selectionne
@ -1740,6 +1741,7 @@ class Form
print $this->load_PriceBaseType($selected,$htmlname);
}
/**
* \brief Selection HT ou TTC
* \param selected Id pre-selectionne
@ -1773,12 +1775,15 @@ class Form
return $return;
}
/**
* Return combo list of differents status of a proposal
* Values are id of table c_propalst
* @param selected etat pre-selectionne
*
* @param selected etat pre-selectionne
* @param short Use short labels
*/
function select_propal_statut($selected='')
function select_propal_statut($selected='',$short=0)
{
global $langs;
@ -1806,7 +1811,17 @@ class Form
{
print '<option value="'.$obj->id.'">';
}
print ($langs->trans("PropalStatus".$obj->code)!="PropalStatus".$obj->code)?$langs->trans("PropalStatus".$obj->code):$obj->label;
$key=$obj->code;
if ($langs->trans("PropalStatus".$key.($short?'Short':'')) != "PropalStatus".$key.($short?'Short':''))
{
print $langs->trans("PropalStatus".$key.($short?'Short':''));
}
else
{
$conv_to_new_code=array('PR_DRAFT'=>'Draft','PR_OPEN'=>'Opened','PR_CLOSED'=>'Closed','PR_SIGNED'=>'Signed','PR_NOTSIGNED'=>'NotSigned','PR_FAC'=>'Billed');
if (! empty($conv_to_new_code[$obj->code])) $key=$conv_to_new_code[$obj->code];
print ($langs->trans("PropalStatus".$key.($short?'Short':''))!="PropalStatus".$key.($short?'Short':''))?$langs->trans("PropalStatus".$key.($short?'Short':'')):$obj->label;
}
print '</option>';
$i++;
}
@ -1822,6 +1837,7 @@ class Form
/**
* Return a HTML select list of bank accounts
*
* @param selected Id account pre-selected
* @param htmlname Name of select zone
* @param statut Status of searched accounts (0=open, 1=closed)