Skip to content
Snippets Groups Projects
Commit c96b2d3b authored by Cédric Salvador's avatar Cédric Salvador Committed by Raphaël Doursenaud
Browse files

factorized form attach, documents list and links list for the document pages

parent 3529f523
No related branches found
No related tags found
No related merge requests found
......@@ -41,8 +41,9 @@ $langs->load("commercial");
$langs->load("other");
$langs->load("bills");
$objectid = GETPOST('id','int');
$action=GETPOST('action','alpha');
$objectid = GETPOST('id', 'int');
$action=GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
// Security check
$socid = GETPOST('socid','int');
......@@ -252,15 +253,10 @@ if ($act->id > 0)
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act);
// List of document
$param='&id='.$act->id;
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
$modulepart = 'actions';
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
$param = '&id=' . $act->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php';
}
else
{
......
......@@ -41,6 +41,7 @@ $langs->load("bills");
$id = GETPOST('id','int');
$action = GETPOST("action");
$confirm = GETPOST('confirm', 'alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
......@@ -159,16 +160,10 @@ if ($object->id)
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object);
// List of document
//$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'tax',$param);
$modulepart = 'tax';
$permission = $user->rights->tax->charges->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php';
}
else
{
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
<?php
/*
* Confirm suppression
*/
if ($action == 'delete') {
$ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'),
$langs->trans('DeleteFile'),
$langs->trans('ConfirmDeleteFile'),
'confirm_deletefile',
'',
0,
1
);
if ($ret == 'html') print '<br>';
}
$formfile=new FormFile($db);
// Show upload form
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id,
'',
0,
0,
$permission,
50,
$object
);
// List of document
$formfile->list_of_documents($filearray,
$object,
$modulepart,
$param,
0,
'',
$permission
);
print "<br>";
//List of links
$formfile->list_of_links($object, $permission);
print "<br>";
......@@ -5,6 +5,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -3,6 +3,7 @@
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -140,15 +140,10 @@ if ($object->id)
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/product/document.php?id='.$object->id,'',0,0,($user->rights->produit->creer||$user->rights->service->creer),50,$object);
// List of document
$formfile->list_of_documents($filearray,$object,'produit');
$modulepart = 'produit';
$permission = $user->rights->produit->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/doc2.tpl.php';
}
else
{
......
......@@ -229,15 +229,18 @@ if ($object->id > 0)
print '<br>';
// Affiche formulaire upload
$modulepart = 'projet';
$permission = $user->rights->projet->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.'/projet/tasks/document.php?id='.$object->id.($withproject?'&withproject=1':''),'',0,0,$user->rights->projet->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'projet',$param,0,dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/');
$formfile->list_of_documents($filearray,$object,'projet',$param,0,dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/');*/
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment