diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 7091a3a0041..3725a9c9626 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -955,7 +955,7 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $propal_static->element, $relativepath, 0); + print $formfile->showPreview($file_list, $propal_static->element, $relativepath, 0, 'entity=' . $objp->entity); } print ''; if ($propal_static->fk_project > 0) { @@ -1076,7 +1076,7 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $commande_static->element, $relativepath, 0, $param); + print $formfile->showPreview($file_list, $commande_static->element, $relativepath, 0, 'entity=' . $objp->entity); } print ''; if ($commande_static->fk_project > 0) { @@ -1109,6 +1109,8 @@ if ($object->id > 0) { * Latest shipments */ if (isModEnabled("shipping") && $user->hasRight('expedition', 'lire')) { + $param = 'entity=' . ((int) $objp->entity); + $sql = 'SELECT e.rowid as id'; $sql .= ', e.ref, e.entity, e.fk_projet'; $sql .= ', e.date_creation'; @@ -1177,7 +1179,8 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $sendingstatic->table_element, $relativepath, 0, $param); + + print $formfile->showPreview($file_list, $sendingstatic->element, $relativepath, 0, $param); } print ''; if ($sendingstatic->fk_project > 0) { @@ -1291,7 +1294,7 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0); + print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0, 'entity=' . $objp->entity); } } // $filename = dol_sanitizeFileName($objp->ref); @@ -1392,7 +1395,7 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $fichinter_static->element, $relativepath, 0); + print $formfile->showPreview($file_list, $fichinter_static->element, $relativepath, 0, 'entity=' . $objp->entity); } print ''; if ($fichinter_static->fk_project > 0) { @@ -1623,7 +1626,7 @@ if ($object->id > 0) { } } $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; - print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0); + print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0, 'entity=' . $objp->entity); } print ''; if ($facturestatic->fk_project > 0) { diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index ad0352b7ca7..d9ee8894482 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -316,7 +316,7 @@ class modProjet extends DolibarrModules } } // End add extra fields - $this->import_fieldshidden_array[$r] = array('t.fk_user_creat'=>'user->id', 'extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'projet'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) + $this->import_fieldshidden_array[$r] = array('t.fk_user_creat'=>'user->id', 't.fk_user_modif'=>'user->id', 'extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'projet'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r] = array( 't.ref' => array( 'rule' => 'getrefifauto',