diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 95cfd729fe5..05c1358ddee 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1778,8 +1778,8 @@ else
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
- $genallowed = $user->rights->adherent->creer;
- $delallowed = $user->rights->adherent->supprimer;
+ $genallowed = $user->rights->adherent->lire;
+ $delallowed = $user->rights->adherent->creer;
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
$somethingshown = $formfile->numoffiles;
diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php
index 3fddfadefb4..f905225a396 100644
--- a/htdocs/adherents/subscription/card.php
+++ b/htdocs/adherents/subscription/card.php
@@ -390,8 +390,8 @@ if ($rowid && $action != 'edit')
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
- $genallowed = $user->rights->facture->creer;
- $delallowed = $user->rights->facture->supprimer;
+ $genallowed = $user->rights->facture->lire;
+ $delallowed = $user->rights->facture->creer;
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
$somethingshown = $formfile->numoffiles;
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 0cfa31e12c8..15218406a94 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -577,7 +577,7 @@ if ($action == 'mupdate')
// Actions to delete doc
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
-$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
+$permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read));
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
@@ -1478,8 +1478,8 @@ if ($id > 0)
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed=$user->rights->agenda->myactions->create;
- $delallowed=$user->rights->agenda->myactions->delete;
+ $genallowed=$user->rights->agenda->myactions->read;
+ $delallowed=$user->rights->agenda->myactions->create;
$var=true;
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 68a36844e39..981ae1025cf 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -75,7 +75,7 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
-$modulepart='contract';
+$modulepart='actions';
/*
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 7de5c0e25ce..31dc02c5d19 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2351,8 +2351,8 @@ if ($action == 'create')
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->propal->creer;
- $delallowed = $user->rights->propal->supprimer;
+ $genallowed = $user->rights->propal->lire;
+ $delallowed = $user->rights->propal->creer;
$var = true;
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index bb8e0d880b9..ebca22f8114 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -947,7 +947,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->propal->lire;
- $delallowed=$user->rights->propal->lire;
+ $delallowed=$user->rights->propal->creer;
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
}
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 6d7b0c19e3f..1402cc75870 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2573,8 +2573,8 @@ if ($action == 'create' && $user->rights->commande->creer)
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->commande->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->commande->creer;
- $delallowed = $user->rights->commande->supprimer;
+ $genallowed = $user->rights->commande->lire;
+ $delallowed = $user->rights->commande->creer;
print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 10c1459a087..c792f42f00e 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1397,7 +1397,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->commande->lire;
- $delallowed=$user->rights->commande->supprimer;
+ $delallowed=$user->rights->commande->creer;
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 53b3cc8880d..f38387db3ed 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4364,8 +4364,8 @@ else if ($id > 0 || ! empty($ref))
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
- $genallowed = $user->rights->facture->creer;
- $delallowed = $user->rights->facture->supprimer;
+ $genallowed = $user->rights->facture->lire;
+ $delallowed = $user->rights->facture->creer;
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
$somethingshown = $formfile->numoffiles;
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 9241726aaec..c0bf0233f89 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -1247,7 +1247,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire;
- $delallowed=$user->rights->facture->lire;
+ $delallowed=$user->rights->facture->creer;
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 2122c958e34..fd5898879ae 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -2124,8 +2124,8 @@ else
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->contrat->creer;
- $delallowed = $user->rights->contrat->supprimer;
+ $genallowed = $user->rights->contrat->lire;
+ $delallowed = $user->rights->contrat->creer;
$var = true;
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 6998b7bdb52..9628f8ce52d 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -761,8 +761,8 @@ if (! empty($id) && $action != 'edit')
$filename = dol_sanitizeFileName($object->id);
$filedir = $conf->don->dir_output . "/" . dol_sanitizeFileName($object->id);
$urlsource = $_SERVER['PHP_SELF'].'?rowid='.$object->id;
- $genallowed = ($object->statut == 2 && ($object->paid == 0 || $user->admin) && $user->rights->don->creer);
- $delallowed = $user->rights->don->supprimer;
+ $genallowed = ($object->statut == 2 && ($object->paid == 0 || $user->admin) && $user->rights->don->lire);
+ $delallowed = $user->rights->don->creer;
print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 9fa609d9d76..8cecd906529 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -2122,7 +2122,7 @@ else if ($id || $ref)
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed=$user->rights->expedition->lire;
- $delallowed=$user->rights->expedition->supprimer;
+ $delallowed=$user->rights->expedition->creer;
print $formfile->showdocuments('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 16dd8dbf8b1..3af4709ee6c 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -2396,8 +2396,8 @@ if ($action != 'presend')
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = 1;
- $delallowed = 1;
+ $genallowed = $user->rights->expensereport->export;
+ $delallowed = $user->rights->expensereport->export;
$var = true;
print $formfile->showdocuments('expensereport',$filename,$filedir,$urlsource,$genallowed,$delallowed);
$somethingshown = $formfile->numoffiles;
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index 0c34ff43ef0..5f0e2f863d1 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -752,7 +752,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->expensereport->lire;
- $delallowed=$user->rights->expensereport->lire;
+ $delallowed=$user->rights->expensereport->creer;
print $formfile->showdocuments('massfilesarea_expensereport','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index bc6fb9d3014..d2e6dd26765 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -1719,8 +1719,8 @@ else if ($id > 0 || ! empty($ref))
$filename=dol_sanitizeFileName($object->ref);
$filedir=$conf->ficheinter->dir_output . "/".$filename;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed=$user->rights->ficheinter->creer;
- $delallowed=$user->rights->ficheinter->supprimer;
+ $genallowed=$user->rights->ficheinter->lire;
+ $delallowed=$user->rights->ficheinter->creer;
print $formfile->showdocuments('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
// Show links to link elements
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index d806923a241..1398cef1a24 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -633,7 +633,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->ficheinter->lire;
- $delallowed=$user->rights->ficheinter->supprimer;
+ $delallowed=$user->rights->ficheinter->creer;
print $formfile->showdocuments('massfilesarea_interventions','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 31a40658251..3c301a3de90 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -2386,6 +2386,7 @@ elseif (! empty($object->id))
// Set status to ordered (action=commande)
print ''."\n";
print '
';
print "
";
}
@@ -2423,8 +2425,8 @@ elseif (! empty($object->id))
$relativepath = $comfournref.'/'.$comfournref.'.pdf';
$filedir = $conf->fournisseur->dir_output . '/commande/' . $comfournref;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed=$user->rights->fournisseur->commande->creer;
- $delallowed=$user->rights->fournisseur->commande->supprimer;
+ $genallowed=$user->rights->fournisseur->commande->lire;
+ $delallowed=$user->rights->fournisseur->commande->creer;
print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang);
$somethingshown=$formfile->numoffiles;
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 3894cf28cc4..f1bd5738cc8 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -1233,7 +1233,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->fournisseur->commande->lire;
- $delallowed=$user->rights->fournisseur->commande->lire;
+ $delallowed=$user->rights->fournisseur->commande->creer;
print $formfile->showdocuments('massfilesarea_supplier_order','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 99fe95d0ec0..b39c4a1899e 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1439,11 +1439,11 @@ if ($action == 'create')
$dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp);
$datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
$datedue=($datetmp==''?-1:$datetmp);
-
+
// Replicate extrafields
$objectsrc->fetch_optionals($originid);
$object->array_options = $objectsrc->array_options;
-
+
}
}
else
@@ -2810,8 +2810,8 @@ else
$subdir = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$ref;
$filedir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
$urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id;
- $genallowed=$user->rights->fournisseur->facture->creer;
- $delallowed=$user->rights->fournisseur->facture->supprimer;
+ $genallowed=$user->rights->fournisseur->facture->lire;
+ $delallowed=$user->rights->fournisseur->facture->creer;
$modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF));
print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index e6c8023496c..94df346aae4 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -1166,7 +1166,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire;
- $delallowed=$user->rights->facture->lire;
+ $delallowed=$user->rights->facture->creer;
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php
index 36749977927..14eca2c58d0 100644
--- a/htdocs/fourn/paiement/card.php
+++ b/htdocs/fourn/paiement/card.php
@@ -374,8 +374,8 @@ if ($result > 0)
$ref=dol_sanitizeFileName($object->ref);
$filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id;
- $genallowed=$user->rights->fournisseur->facture->creer;
- $delallowed=$user->rights->fournisseur->facture->supprimer;
+ $genallowed=$user->rights->fournisseur->facture->lire;
+ $delallowed=$user->rights->fournisseur->facture->creer;
$modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->SUPPLIER_PAYMENT_ADDON_PDF)?'':$conf->global->SUPPLIER_PAYMENT_ADDON_PDF));
print $formfile->showdocuments('supplier_payment',$ref,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index 84cd7c8899d..8cff2b885b0 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -741,8 +741,8 @@ else
$filedir = $conf->expedition->dir_output . "/receipt/" . $objectref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed=$user->rights->expedition->livraison->creer;
- $delallowed=$user->rights->expedition->livraison->supprimer;
+ $genallowed=$user->rights->expedition->livraison->lire;
+ $delallowed=$user->rights->expedition->livraison->creer;
print $formfile->showdocuments('livraison',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 144cde98c64..cbacc7554a1 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -585,8 +585,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->mymodule->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->mymodule->creer;
- $delallowed = $user->rights->mymodule->supprimer;
+ $genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
+ $delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('mymodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index b40f96f669a..ed5d82c5301 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -648,7 +648,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb
$filedir=$diroutputmassaction;
$genallowed=$user->rights->mymodule->read;
- $delallowed=$user->rights->mymodule->read;
+ $delallowed=$user->rights->mymodule->create;
print $formfile->showdocuments('massfilesarea_mymodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index cdf903639c5..88a9d0fbc10 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -2030,8 +2030,8 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete')
$relativepath = $comref . '/' . $objectref . '.pdf';
$filedir = $conf->produit->dir_output . '/' . $objectref;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed=$user->rights->produit->creer;
- $delallowed=$user->rights->produit->supprimer;
+ $genallowed=$user->rights->produit->lire;
+ $delallowed=$user->rights->produit->creer;
$var=true;
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index ad46fd037ad..6fb8b223007 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -442,8 +442,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->product->dir_output . '/inventory/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->inventory->creer;
- $delallowed = $user->rights->inventory->supprimer;
+ $genallowed = $user->rights->inventory->read;
+ $delallowed = $user->rights->inventory->create;
print $formfile->showdocuments('inventory', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 4861fe83ff6..3985af45699 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -595,7 +595,7 @@ if ($nbtotalofrecords === '' || $nbtotalofrecords)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->inventory->read;
- $delallowed=$user->rights->inventory->read;
+ $delallowed=$user->rights->inventory->create;
print $formfile->showdocuments('massfilesarea_inventory','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index 7880c262d04..bc98b7ef12f 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -604,7 +604,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire;
- $delallowed=$user->rights->facture->lire;
+ $delallowed=$user->rights->facture->creer;
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
diff --git a/htdocs/projet/ganttchart.inc.php b/htdocs/projet/ganttchart.inc.php
index f38f01d644e..6aa92e0f3c6 100644
--- a/htdocs/projet/ganttchart.inc.php
+++ b/htdocs/projet/ganttchart.inc.php
@@ -131,7 +131,7 @@ else
/**
* Add a gant chart line
*
- * @param string $tarr tarr
+ * @param array $tarr Array of all tasks
* @param array $task Array with properties of one task
* @param Project $project_dependencies Project object
* @param int $level Level
@@ -208,7 +208,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
$s = "\n// Add taks id=".$task["task_id"]." level = ".$level."\n";
// $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."', '".$note."'));";
// For JSGanttImproved
- $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".dol_escape_js($task['note'])."'));";
+ $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".dol_escape_js($resources)."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".dol_escape_js($task['note'])."'));";
echo $s;
@@ -217,7 +217,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
/**
* Find child Gantt line
*
- * @param string $tarr tarr
+ * @param array $tarr tarr
* @param int $parent Parent
* @param Project $project_dependencies Project object
* @param int $level Level
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index 16f719a3a8f..eb24c58a211 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$id=GETPOST('id','int');
@@ -65,6 +67,7 @@ $form=new Form($db);
$formother=new FormOther($db);
$userstatic=new User($db);
$companystatic=new Societe($db);
+$contactstatic=new Contact($db);
$task = new Task($db);
$arrayofcss=array('/includes/jsgantt/jsgantt.css');
@@ -239,6 +242,7 @@ if (count($tasksarray)>0)
foreach($tasksarray as $key => $val)
{
$task->fetch($val->id);
+
$tasks[$taskcursor]['task_id']=$val->id;
$tasks[$taskcursor]['task_parent']=$val->fk_parent;
$tasks[$taskcursor]['task_is_group'] = 0;
@@ -261,7 +265,7 @@ if (count($tasksarray)>0)
$tasks[$taskcursor]['task_end_date']=$val->date_end;
$tasks[$taskcursor]['task_color']='b4d1ea';
$idofusers=$task->getListContactId('internal');
- $idofthirdparty=$task->getListContactId('external');
+ $idofcontacts=$task->getListContactId('external');
$s='';
if (count($idofusers)>0)
{
@@ -275,18 +279,26 @@ if (count($tasksarray)>0)
$i++;
}
}
- //if (count($idofusers)>0 && (count($idofthirdparty)>0)) $s.=' - ';
- if (count($idofthirdparty)>0)
+ //if (count($idofusers)>0 && (count($idofcontacts)>0)) $s.=' - ';
+ if (count($idofcontacts)>0)
{
if ($s) $s.=' - ';
$s.=$langs->trans("Externals").': ';
$i=0;
- foreach($idofthirdparty as $valid)
+ $contactidfound=array();
+ foreach($idofcontacts as $valid)
{
- $companystatic->fetch($valid);
- if ($i) $s.=',';
- $s.=$companystatic->name;
- $i++;
+ if (empty($contactidfound[$valid]))
+ {
+ $res = $contactstatic->fetch($valid);
+ if ($res > 0)
+ {
+ if ($i) $s.=', ';
+ $s.=$contactstatic->getFullName($langs);
+ $contactidfound[$valid]=1;
+ $i++;
+ }
+ }
}
}
//if ($s) $tasks[$taskcursor]['task_resources']=''.$langs->trans("List").'';
diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
index c6e80e87a91..21645f14d00 100644
--- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
@@ -257,8 +257,8 @@ for ($i=1; $i<=4; $i++) {
*/
$filedir=$conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid;
-$genallowed=$user->rights->societe->creer;
-$delallowed=$user->rights->societe->supprimer;
+$genallowed=$user->rights->societe->lire;
+$delallowed=$user->rights->societe->creer;
print $formfile->showdocuments('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang);
?>
diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
index 21f0cafcbb1..10136048ae6 100644
--- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
@@ -201,8 +201,8 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
*/
$filedir=$conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid;
-$genallowed=$user->rights->societe->creer;
-$delallowed=$user->rights->societe->supprimer;
+$genallowed=$user->rights->societe->lire;
+$delallowed=$user->rights->societe->creer;
print $formfile->showdocuments('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang);
?>
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index b08a8b7db1b..ef6e10757d1 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2516,8 +2516,8 @@ else
*/
$filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
- $genallowed=$user->rights->societe->creer;
- $delallowed=$user->rights->societe->supprimer;
+ $genallowed=$user->rights->societe->lire;
+ $delallowed=$user->rights->societe->creer;
$var=true;
diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php
index 2affb8057e1..914683d87d2 100644
--- a/htdocs/societe/rib.php
+++ b/htdocs/societe/rib.php
@@ -683,8 +683,8 @@ if ($socid && $action != 'edit' && $action != "create")
*/
$filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
- $genallowed=$user->rights->societe->creer;
- $delallowed=$user->rights->societe->supprimer;
+ $genallowed=$user->rights->societe->lire;
+ $delallowed=$user->rights->societe->creer;
$var=true;
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 145d16ef8b8..cfdb94c42bb 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1763,8 +1763,8 @@ if ($action == 'create')
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->supplier_proposal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->supplier_proposal->creer;
- $delallowed = $user->rights->supplier_proposal->supprimer;
+ $genallowed = $user->rights->supplier_proposal->lire;
+ $delallowed = $user->rights->supplier_proposal->creer;
print $formfile->showdocuments('supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 85798a8a80f..9471e7efadc 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -939,7 +939,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->supplier_proposal->lire;
- $delallowed=$user->rights->supplier_proposal->lire;
+ $delallowed=$user->rights->supplier_proposal->creer;
print $formfile->showdocuments('massfilesarea_supplier_proposal','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
}
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 5dae2933c0d..9e189bff434 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -3534,6 +3534,12 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
/* Gantt
/* ============================================================================== */
+div.gTaskInfo {
+ background: #f0f0f0 !important;
+}
+.gtaskblue {
+ background: rgb(108,152,185) !important;
+}
td.gtaskname {
overflow: hidden;
text-overflow: ellipsis;
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 41c62ced1b8..106fa322cf1 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -2560,8 +2560,8 @@ else
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->user->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->user->user->creer;
- $delallowed = $user->rights->user->user->supprimer;
+ $genallowed = $user->rights->user->user->lire;
+ $delallowed = $user->rights->user->user->creer;
print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
$somethingshown = $formfile->numoffiles;