Spostato il caricamento della lista allegati ajax all'interno del file ajax.php

This commit is contained in:
Luca 2018-05-16 14:55:19 +02:00
parent 976af57fe1
commit 45ec3917ff
3 changed files with 13 additions and 8 deletions

View File

@ -46,4 +46,15 @@ switch (get('op')) {
}
break;
case 'list_attachments':
$id_module = get('id_module');
$id_record = get('id_record');
$id_plugin = get('id_plugin');
echo '{( "name": "filelist_and_upload", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "id_plugin": "'.$id_plugin.'", "ajax": "true" )}';
break;
}

View File

@ -418,7 +418,7 @@ if (!empty($fatture)) {
?>
{( "name": "filelist_and_upload", "id_module": "<?php echo $id_module; ?>", "id_record": "<?php echo $id_record; ?>" )}
{( "name": "filelist_and_upload", "id_module": "<?php echo $id_module; ?>", "id_record": "<?php echo $id_record; ?>", "ajax":"true" )}
<a class="btn btn-danger ask" data-backto="record-list">
<i class="fa fa-trash"></i> <?php echo tr('Elimina'); ?>

View File

@ -1,12 +1,6 @@
<?php
namespace HTMLBuilder\Manager;
include_once __DIR__.'/../../../core.php';
if ($_GET['ajax']) {
echo '{( "name": "filelist_and_upload", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "id_plugin": "'.$id_plugin.'", "ajax": "true" )}';
}
/**
* @since 2.3
@ -130,7 +124,7 @@ $result .= '
btn.prop("disabled", false);';
if (($options['ajax'])) {
$result .= '$("#attachments_'.$options['id_record'].((!empty($options['id_plugin'])) ? '_'.$options['id_plugin'] : '').'").load( globals.rootdir + "/src/HTMLBuilder/Manager/FileManager.php?id_module='.$options['id_module'].'&id_record='.$options['id_record'].((!empty($options['id_plugin'])) ? '&id_plugin='.$options['id_plugin'] : '').((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : '').'&ajax=true" );';
$result .= '$("#attachments_'.$options['id_record'].((!empty($options['id_plugin'])) ? '_'.$options['id_plugin'] : '').'").load( globals.rootdir + "/ajax.php?op=list_attachments&id_module='.$options['id_module'].'&id_record='.$options['id_record'].((!empty($options['id_plugin'])) ? '&id_plugin='.$options['id_plugin'].'#tab_'.$options['id_plugin'] : '').'" );';
}else{
$result .= 'location.href = globals.rootdir + "/editor.php?id_module='.$options['id_module'].'&id_record='.$options['id_record'].((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : '').'";';
}