FIX Project was lost when creating invoice from a template

Can set project on invoice during creation of invoice from a template
Replace duplicated code to show lines with mutualized code
This commit is contained in:
Laurent Destailleur
2016-04-24 18:55:19 +02:00
parent ccdbf69cd5
commit c73f4e5d7b
7 changed files with 482 additions and 123 deletions

View File

@@ -3236,7 +3236,7 @@ abstract class CommonObject
*/
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0)
{
global $conf, $hookmanager, $inputalsopricewithtax, $usemargins, $langs, $user;
global $conf, $hookmanager, $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $langs, $user;
// Define usemargins
$usemargins=0;
@@ -3365,7 +3365,8 @@ abstract class CommonObject
function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0)
{
global $conf,$langs,$user,$object,$hookmanager;
global $form,$bc,$bcdd, $object_rights;
global $form,$bc,$bcdd;
global $object_rights, $disableedit, $disablemove; // TODO We should not use global var for this !
$object_rights = $this->getRights();
@@ -4458,7 +4459,10 @@ abstract class CommonObject
{
global $user;
return $user->rights->{$this->element};
$element = $this->element;
if ($element == 'facturerec') $element='facture';
return $user->rights->{$element};
}
/**