factorization
This commit is contained in:
parent
c3108f452c
commit
6c22af00e1
@ -130,21 +130,10 @@ if ($object->id > 0)
|
||||
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* 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
|
||||
{
|
||||
|
||||
@ -119,23 +119,10 @@ if ($id > 0 || ! empty($ref))
|
||||
print "</table>\n";
|
||||
print "</div>\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
|
||||
{
|
||||
|
||||
@ -120,23 +120,10 @@ if ($object->id)
|
||||
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
@ -147,24 +147,10 @@ if ($id > 0 || ! empty($ref))
|
||||
print "</table>\n";
|
||||
print "</div>\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
|
||||
|
||||
@ -122,24 +122,10 @@ if ($object->id)
|
||||
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
@ -120,23 +120,10 @@ if ($object->id)
|
||||
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
@ -158,23 +158,11 @@ if ($object->id > 0)
|
||||
|
||||
print "</div>\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
|
||||
{
|
||||
|
||||
@ -177,17 +177,10 @@ if ($object->id > 0)
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
// 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
|
||||
{
|
||||
|
||||
@ -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 '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/liste.php">'.$langs->trans("BackToList").'</a>';
|
||||
@ -149,14 +144,10 @@ if ($object->id > 0)
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/document.php?id='.$object->id,'',0,0,($userWrite>0),50,$object);
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&id='.$object->id;
|
||||
$formfile->list_of_documents($filearray,$object,'projet',$param,0,'',($userWrite>0));
|
||||
$modulepart = 'projet';
|
||||
$permission = ($userWrite > 0);
|
||||
$param = '&id=' . $object->id;
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php';
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@ -152,7 +152,7 @@ if ($object->id)
|
||||
$modulepart = 'societe';
|
||||
$permission = $user->rights->societe->creer;
|
||||
$param = '&id=' . $object->id;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user