24if (!defined(
'NOREQUIREMENU')) {
25 define(
'NOREQUIREMENU',
'1');
27if (!defined(
'NOREQUIREHTML')) {
28 define(
'NOREQUIREHTML',
'1');
30if (!defined(
'NOREQUIREAJAX')) {
31 define(
'NOREQUIREAJAX',
'1');
33if (!defined(
'NOREQUIRESOC')) {
34 define(
'NOREQUIRESOC',
'1');
38require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/fileupload.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/genericobject.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
44$element =
GETPOST(
'element',
'alpha');
45$elementupload = $element;
53$usesublevelpermission = ($module != $element ? $element :
'');
54if ($usesublevelpermission && !$user->hasRight($module, $element)) {
55 $usesublevelpermission =
'';
61if (!empty($user->socid)) {
62 $socid = $user->socid;
80header(
'Pragma: no-cache');
81header(
'Cache-Control: no-store, no-cache, must-revalidate');
82header(
'Content-Disposition: inline; filename="files.json"');
83header(
'X-Content-Type-Options: nosniff');
85header(
'Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');
86header(
'Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
88switch ($_SERVER[
'REQUEST_METHOD']) {
97 $upload_handler =
new FileUpload(
null, $id, $elementupload);
103 $upload_handler->post();
112 header(
'HTTP/1.0 405 Method Not Allowed');
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
This class is used to manage file upload using ajax.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
fetchObjectByElement($element_id, $element_type, $element_ref='', $useCache=0, $maxCacheByType=10)
Fetch an object from its id and element_type Inclusion of classes is automatic.
getRootURLFromURL($url)
Function root url from a long url For example: https://www.abc.mydomain.com/dir/page....
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.