Fix: The delete button into ecm module does not work when ajax disabled.
This commit is contained in:
parent
5b40eff0fa
commit
2d8214a940
@ -218,18 +218,30 @@ if ($type == 'directory')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
|
|
||||||
{
|
|
||||||
if ($section)
|
if ($section)
|
||||||
{
|
{
|
||||||
|
$useajax=1;
|
||||||
|
if (! empty($conf->dol_use_jmobile)) $useajax=0;
|
||||||
|
if (empty($conf->use_javascript_ajax)) $useajax=0;
|
||||||
|
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
|
||||||
|
|
||||||
$param.=($param?'?':'').(preg_replace('/^&/','',$param));
|
$param.=($param?'?':'').(preg_replace('/^&/','',$param));
|
||||||
|
|
||||||
|
if ($useajax || $action == 'delete')
|
||||||
|
{
|
||||||
|
$urlfile='';
|
||||||
|
if ($action == 'delete') $urlfile=GETPOST('urlfile');
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||||
$useglobalvars=1;
|
$useglobalvars=1;
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formquestion=array('urlfile'=>array('type'=>'hidden','value'=>'','name'=>'urlfile'));
|
$formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile'));
|
||||||
print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",'deletefile');
|
print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($useajax)
|
||||||
|
{
|
||||||
// Enable jquery handlers on new generated HTML objects
|
// Enable jquery handlers on new generated HTML objects
|
||||||
print '<script type="text/javascript">'."\n";
|
print '<script type="text/javascript">'."\n";
|
||||||
print 'jQuery(document).ready(function() {'."\n";
|
print 'jQuery(document).ready(function() {'."\n";
|
||||||
|
|||||||
@ -813,7 +813,12 @@ class FormFile
|
|||||||
else
|
else
|
||||||
$filepath=$file['name'];
|
$filepath=$file['name'];
|
||||||
*/
|
*/
|
||||||
print '<a href="'.(($useinecm && ! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
$useajax=1;
|
||||||
|
if (! empty($conf->dol_use_jmobile)) $useajax=0;
|
||||||
|
if (empty($conf->use_javascript_ajax)) $useajax=0;
|
||||||
|
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
|
||||||
|
|
||||||
|
print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user