25if (!defined(
'NOREQUIREMENU')) {
26 define(
'NOREQUIREMENU',
'1');
28if (!defined(
'NOREQUIREHTML')) {
29 define(
'NOREQUIREHTML',
'1');
31if (!defined(
'NOREQUIREAJAX')) {
32 define(
'NOREQUIREAJAX',
'1');
34if (!defined(
'NOREQUIRESOC')) {
35 define(
'NOREQUIRESOC',
'1');
39require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/fileupload.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/genericobject.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
53$element =
GETPOST(
'element',
'alpha');
54$elementupload = $element;
62$usesublevelpermission = ($module != $element ? $element :
'');
63if ($usesublevelpermission && !$user->hasRight($module, $element)) {
64 $usesublevelpermission =
'';
70if (!empty($user->socid)) {
71 $socid = $user->socid;
89header(
'Pragma: no-cache');
90header(
'Cache-Control: no-store, no-cache, must-revalidate');
91header(
'Content-Disposition: inline; filename="files.json"');
92header(
'X-Content-Type-Options: nosniff');
94header(
'Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');
95header(
'Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
97switch ($_SERVER[
'REQUEST_METHOD']) {
106 $upload_handler =
new FileUpload(
null, $id, $elementupload);
112 $upload_handler->post();
121 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.