diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 266ee77b7d9..04704ba2ff4 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -130,21 +130,10 @@ if ($object->id > 0) print ''; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - } - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->propal->creer,50,$object); - - - // List of document - $formfile->list_of_documents($filearray,$object,'propal'); + $modulepart = 'propal'; + $permission = $user->rights->propal->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; } else { diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 32e666d1a7b..9ba0827e7e1 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -119,23 +119,10 @@ if ($id > 0 || ! empty($ref)) print "\n"; print "\n"; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - - } - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/commande/document.php?id='.$object->id,'',0,0,$user->rights->commande->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'commande',$param); + $modulepart = 'commande'; + $permission = $user->rights->commande->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; } else { diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 93258ab2297..0177891491d 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -120,23 +120,10 @@ if ($object->id) print ''; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - - } - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id,'',0,0,$user->rights->deplacement->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'deplacement',$param); + $modulepart = 'deplacement'; + $permission = $user->rights->deplacement->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; } else diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 92292375ac4..5bce75e363c 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -147,24 +147,10 @@ if ($id > 0 || ! empty($ref)) print "\n"; print "\n"; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - - } - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id,'',0,0,$user->rights->facture->creer,50,$object); - - - // List of document - $param='&facid='.$object->id; - $formfile->list_of_documents($filearray,$object,'facture',$param); + $modulepart = 'facture'; + $permission = $user->rights->facture->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; } else diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index b63679cc1de..83d9870b0db 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -122,24 +122,10 @@ if ($object->id) print ''; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - - } - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->contrat->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'contract',$param); + $modulepart = 'contract'; + $permission = $user->rights->contrat->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; } else diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 2dc8f7aedea..1505facbab5 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -120,23 +120,10 @@ if ($object->id) print ''; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - - } - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id,'',0,0,$user->rights->ficheinter->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'ficheinter',$param); + $modulepart = 'ficheinter'; + $permission = $user->rights->ficheinter->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; } else diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 581fac2df66..303e505c18b 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -158,23 +158,11 @@ if ($object->id > 0) print "\n"; - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - - } + $modulepart = 'commande_fournisseur'; + $permission = $user->rights->fournisseur->commande->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id,'',0,0,$user->rights->fournisseur->commande->creer,50,$object); - - - // List of document - $param='&id='.$object->id; - $formfile->list_of_documents($filearray,$object,'commande_fournisseur',$param); } else { diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 287708da211..7779b58d220 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -177,17 +177,10 @@ if ($object->id > 0) print ''; print ''; - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?facid='.$object->id, '', 0, 0, $user->rights->fournisseur->facture->creer, 50, $object, '', 0, dol_sanitizeFileName($object->ref.'_'.$object->ref_supplier.'___file__')); - - - // List of document - $param='&facid='.$object->id; - $ref=dol_sanitizeFileName($object->ref); - $formfile->list_of_documents($filearray,$object,'facture_fournisseur',$param,0,get_exdir($object->id,2,0).$ref.'/'); - + $modulepart = 'facture_fournisseur'; + $permission = $user->rights->fournisseur->facture->creer; + $param = '&facid=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php'; } else { diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 84c9f1e109c..7644ef5486c 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -104,11 +104,6 @@ if ($object->id > 0) $totalsize+=$file['size']; } - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&urlfile=".urlencode(GETPOST("urlfile")),$langs->trans("DeleteAFile"),$langs->trans("ConfirmDeleteAFile"),"confirm_delete",'','',1); - } - print '