diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 78969a8df14..66b1324f39b 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1730,8 +1730,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 3c368c05c9a..701a6e74760 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 7b1c81af59c..d97982c3db8 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1483,8 +1483,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 1e54db9d449..493236b5ddf 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 7fb13234a94..006f0a439e3 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2355,8 +2355,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 92bb80d9655..480ad7f4fda 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1031,7 +1031,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 5daf56eaeca..5c830c7c4e1 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2576,8 +2576,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 1efd428159a..86a5f463840 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1452,7 +1452,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 9c0aff43abf..6276f75e7b6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1378,7 +1378,7 @@ if (empty($reshook)) $object->situation_counter = $object->situation_counter + 1; $id = $object->createFromCurrent($user); - if ($id <= 0) + if ($id <= 0) { $mesg = $object->error; } @@ -4291,8 +4291,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 67ef9c96973..8563572da7c 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1332,7 +1332,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 ce3915cf2ee..d618a7c4b1e 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2112,17 +2112,17 @@ 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; print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); print '