22define(
'NOTOKENRENEWAL', 1);
25require
'../../../../main.inc.php';
33<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
35 * FCKeditor - The text editor
for Internet - http:
36 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
40 * Licensed under the terms of any of the following licenses at your
43 * - GNU General Public License Version 2 or later (the
"GPL")
46 * - GNU Lesser General Public License Version 2.1 or later (the
"LGPL")
49 * - Mozilla Public License Version 1.1 or later (the
"MPL")
54 * Page used to upload
new files in the current folder.
58 <title>File Upload</title>
59 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
61print
'<!-- Includes CSS for Dolibarr theme -->'.
"\n";
65if (!empty(
$conf->modules_parts[
'theme'])) {
66 foreach (
$conf->modules_parts[
'theme'] as $reldir) {
69 $themesubdir = $reldir;
76print
'<link rel="stylesheet" type="text/css" href="'.$themepath.
'">'.
"\n";
78 <link href=
"browser.css" type=
"text/css" rel=
"stylesheet" >
79 <script
type=
"text/javascript" src=
"js/common.js"></script>
80 <script
type=
"text/javascript">
82function SetCurrentFolder( resourceType, folderPath )
84 var sUrl = oConnector.ConnectorUrl +
'Command=FileUpload' ;
85 sUrl +=
'&Type=' + resourceType ;
86 sUrl +=
'&CurrentFolder=' + encodeURIComponent( folderPath );
88 document.getElementById(
'frmUpload').action = sUrl ;
93 console.log(
"Click on OnSubmit");
94 if ( document.getElementById(
'NewFile').value.length == 0 )
96 alert(
'Please select a file from your computer' );
101 document.getElementById(
'eUploadMessage').innerHTML =
'Upload a new file in this folder (Upload in progress, please wait...)' ;
102 document.getElementById(
'btnUpload').disabled = true ;
107function OnUploadCompleted( errorNumber, data )
109 console.log(
"errorNumber = "+errorNumber);
112 window.parent.frames[
'frmUploadWorker'].location =
'javascript:void(0)' ;
116 document.getElementById(
'NewFile').outerHTML =
'<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;
118 document.getElementById(
'frmUpload').reset();
121 document.getElementById(
'eUploadMessage').innerHTML =
'Upload a new file in this folder' ;
122 document.getElementById(
'btnUpload').disabled = false ;
124 switch ( errorNumber )
127 window.parent.frames[
'frmResourcesList'].Refresh();
133 window.parent.frames[
'frmResourcesList'].Refresh();
134 alert(
'A file with the same name is already available. The uploaded file has been renamed to "' + data +
'"' );
137 alert(
'Invalid file (Bad extension)' );
140 alert(
'Error on file upload. Error number: ' + errorNumber );
145window.onload =
function()
147 window.top.IsLoadedUpload = true ;
152 <form
id=
"frmUpload" action=
"" target=
"frmUploadWorker" method=
"post" enctype=
"multipart/form-data" onsubmit=
"return OnSubmit();">
153 <input
type=
"hidden" name=
"token" value=
"<?php echo newToken(); ?>" />
154 <
table class=
"fullHeight" cellspacing=
"0" cellpadding=
"0" width=
"100%" border=
"0">
156 <td
class=
"nowrap valignmiddle">
157 <
table width=
"100%" class=
"inline-block valignmiddle">
159 <td><input
id=
"NewFile" name=
"NewFile" type=
"file"></td>
160 <td
class=
"nowrap"> <input
id=
"btnUpload" type=
"submit" value=
"Upload" class=
"flat button"></td>
163 <!-- Section
for upload result message -->
164 <span
id=
"eUploadMessage"></span><br>
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
treeview li table
No Email.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.