mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 19:40:44 +01:00
Copia dei file per gli interventi pianificati
This commit is contained in:
parent
1e3baacd58
commit
4db0a858f4
@ -248,8 +248,10 @@ echo '
|
||||
$("#idtipointervento_").change(function(){
|
||||
if (($(this).val()!="")){
|
||||
$("#add_form .panel-primary .panel-primary").show();
|
||||
$("#bs-popup .btn-primary").show();
|
||||
}else{
|
||||
$("#add_form .panel-primary .panel-primary").hide();
|
||||
$("#bs-popup .btn-primary").hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -276,17 +276,18 @@ switch (post('op')) {
|
||||
$rs_allegati = $dbo->fetchArray('SELECT filename FROM zz_files WHERE id_record = '.$id_record.' AND id_module = '.$id_module);
|
||||
foreach ($rs_allegati as $rs_allegato) {
|
||||
|
||||
$from_dir = '/'.Uploads::getUploadDirectory(Modules::get('Contratti')['id'], Plugins::get('Pianificazione interventi')['id']);
|
||||
$to_dir = '/'.Uploads::getUploadDirectory(Modules::get('Interventi')['id']);
|
||||
$from_dir = DOCROOT.'\/'.Uploads::getUploadDirectory(Modules::get('Contratti')['id'], Plugins::get('Pianificazione interventi')['id']);
|
||||
$to_dir = DOCROOT.'\/'.Uploads::getUploadDirectory(Modules::get('Interventi')['id']);
|
||||
|
||||
if (move_uploaded_file($from_dir.'/'.$rs_allegato['filename'] , $to_dir.'/'.$rs_allegato['filename'])) {
|
||||
|
||||
} else {
|
||||
$_SESSION['warnings'][] = tr('Errore durante la copia del file da _FROM_ a _TO_ per il file _FILE_.', [
|
||||
'_FROM_' => $from_dir,
|
||||
'_TO_' => $to_dir,
|
||||
'_FILE_' => $rs_allegato['filename'],
|
||||
]);
|
||||
if (!@copy($from_dir.'\/'.$rs_allegato['filename'], $to_dir.'\/'.$rs_allegato['filename'])) {
|
||||
$errors= error_get_last();
|
||||
$_SESSION['warnings'][] = tr('OK durante la copia del file da _FROM_ a _TO_ per il file _FILE_. _ERROR_: _MESSAGE_', [
|
||||
'_FROM_' => $from_dir,
|
||||
'_TO_' => $to_dir,
|
||||
'_FILE_' => $rs_allegato['filename'],
|
||||
'_ERROR_' => $errors['type'],
|
||||
'_MESSAGE_' => $errors['message'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user