Don't try to select all if the current search filters give no results, give an alert to select something

This commit is contained in:
Nathan Gray 2011-06-27 17:23:59 +00:00
parent 1500c4f739
commit 203fb83f0d

View File

@ -134,7 +134,7 @@ class importexport_admin_prefs_sidebox_hooks
'text' => in_array($appname, array('calendar', 'sitemgr')) ? 'Export' : 'Export CSV'
);
if($GLOBALS['egw_info']['flags']['disable_importexport']['export']) {
unset($file['Export CSV']['link']);
$file['Export CSV']['link'] = '';
}
}
if(($file_list = bo_merge::get_documents($GLOBALS['egw_info']['user']['preferences'][$appname]['document_dir'], '', array(
@ -161,8 +161,14 @@ if(actionMgr && objectMgr && win.egwAction) {
if(objectMgr.selectedChildren.length == 0) {
// Be nice and select all, if they forgot to select any
if(actionMgr.getActionById(\'select_all\')) {
var total = parseInt($(\'span#total\',actionMgr.etemplate_form).text());
if(total > 0) {
actionMgr.getActionById(\'select_all\').set_checked(true);
toggle_select = true;
} else {
alert(\''.lang('You need to select some entries first!').'\');
return false;
}
}
}
win.nm_action(action, objectMgr.selectedChildren);