48require_once
'../main.inc.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
52 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
55$langs->loadLangs(array(
"main",
"other"));
57$action =
GETPOST(
'action',
'aZ09');
79if (empty($dolibarr_nocache) &&
GETPOSTINT(
'cache')) {
80 header(
'Cache-Control: max-age='.
GETPOSTINT(
'cache').
', public');
82 header(
'Expires: '.gmdate(
'D, d M Y H:i:s',
dol_now(
'gmt') +
GETPOSTINT(
'cache')).
' GMT');
84 header(
'Pragma: token=public');
87 header(
'Cache-Control: no-cache');
90$title = $langs->trans(
"UploadFile");
94$head =
'<!-- Upload file -->'.
"\n";
98llxHeader(
'', $title, $help_url,
'', 0, 0, $arrayofjs, $arrayofcss,
'',
'mod-upload page-card');
105$hookmanager->initHooks(array(
'uploadform'));
111$uploadform =
'<div class="display-flex">';
113$langs->load(
"bills");
115<div id="supplierinvoice" class="flex-item flex-item-uploadfile">'.img_picto(
'',
'bill',
'class="fa-2x"').
'<br>
116<div>'.$langs->trans(
"SupplierInvoice").
'<br><br>';
118$uploadform .=
img_picto(
'',
'company',
'class="pictofixedwidth"');
119$uploadform .= $form->select_company(
GETPOSTINT(
'socid'),
'socid',
'statut=0', $langs->transnoentitiesnoconv(
"Supplier"));
121$uploadform .=
'<br><br>
122<small>('.$langs->trans(
"OrClickToSelectAFile").
')</small>
126$langs->load(
"salaries");
128<div id="userpayroll" class="flex-item flex-item-uploadfile">'.img_picto(
'',
'salary',
'class="fa-2x"').
'<br>
129<div>'.$langs->trans(
"UserPaySlip").
'<br>
130<small>('.$langs->trans(
"OrClickToSelectAFile").
')</small>
134$uploadform .=
'</div>';
138$parameters = array(
'uploadform' => $uploadform);
139$reshook = $hookmanager->executeHooks(
'printUploadForm', $parameters);
140if (empty($reshook)) {
141 $uploadform .= $hookmanager->resPrint;
143 $uploadform = $hookmanager->resPrint;
146$uploadform .=
'<br>';
151print
"<!-- Begin UploadForm -->\n";
152print
'<form id="uploadform" enctype="multipart/form-data" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
153print
'<input type="hidden" name="token" value="'.newToken().
'">';
154print
'<input type="hidden" name="action" value="uploadfile">';
156print
'<div class="center"><div class="center" style="padding: 30px;">';
157print
'<style>.menu_titre { padding-top: 7px; }</style>';
158print
'<div id="blockupload" class="center">'.
"\n";
162print
'<input type="file" id="fileInput" class="hideobject" accept=".pdf, image/*">';
165$(document).ready(function() {
166 jQuery('#supplierinvoice').on('click', function(event) {
167 console.log('Click on link to open input file');
169 $('#fileInput').click();
172 jQuery('#search_socid').on('click', function(event) {
173 event.stopPropagation();
174 console.log('Avoid to open the input select');
177 jQuery('#fileInput').on('change', function() {
178 console.log('A file was selected, we submit the form');
179 $('#uploadform').submit();
188print
"\n<!-- End UploadForm -->\n";
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_now($mode='auto')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.