mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
'Disable' Export & merge spreadsheet in sidebox for addressbook view
This commit is contained in:
parent
4b81bb8e75
commit
039e351d8b
@ -2001,6 +2001,10 @@ class addressbook_ui extends addressbook_bo
|
|||||||
if (!empty($content['id'])) list(,$dates) = each($this->read_calendar(array($content['id']),false));
|
if (!empty($content['id'])) list(,$dates) = each($this->read_calendar(array($content['id']),false));
|
||||||
if(is_array($dates)) $content += $dates;
|
if(is_array($dates)) $content += $dates;
|
||||||
|
|
||||||
|
// Disable importexport
|
||||||
|
$GLOBALS['egw_info']['flags']['disable_importexport']['export'] = true;
|
||||||
|
$GLOBALS['egw_info']['flags']['disable_importexport']['merge'] = true;
|
||||||
|
|
||||||
// set id for automatic linking via quick add
|
// set id for automatic linking via quick add
|
||||||
$GLOBALS['egw_info']['flags']['currentid'] = $content['id'];
|
$GLOBALS['egw_info']['flags']['currentid'] = $content['id'];
|
||||||
// Load JS for infolog actions
|
// Load JS for infolog actions
|
||||||
|
@ -93,6 +93,7 @@ class importexport_admin_prefs_sidebox_hooks
|
|||||||
*/
|
*/
|
||||||
public static function other_apps() {
|
public static function other_apps() {
|
||||||
if(!$GLOBALS['egw_info']['user']['apps']['importexport']) return array();
|
if(!$GLOBALS['egw_info']['user']['apps']['importexport']) return array();
|
||||||
|
if($GLOBALS['egw_info']['flags']['no_importexport'] === true) return array();
|
||||||
|
|
||||||
$appname = $GLOBALS['egw_info']['flags']['currentapp'];
|
$appname = $GLOBALS['egw_info']['flags']['currentapp'];
|
||||||
$cache = egw_cache::getCache(egw_cache::SESSION, 'importexport', 'sidebox_links');
|
$cache = egw_cache::getCache(egw_cache::SESSION, 'importexport', 'sidebox_links');
|
||||||
@ -116,6 +117,9 @@ class importexport_admin_prefs_sidebox_hooks
|
|||||||
'app' => 'importexport',
|
'app' => 'importexport',
|
||||||
'text' => in_array($appname, array('calendar', 'sitemgr')) ? 'Import' : 'Import CSV'
|
'text' => in_array($appname, array('calendar', 'sitemgr')) ? 'Import' : 'Import CSV'
|
||||||
);
|
);
|
||||||
|
if($GLOBALS['egw_info']['flags']['disable_importexport']['import']) {
|
||||||
|
$file['Import CSV']['link'] = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$config = config::read('phpgwapi');
|
$config = config::read('phpgwapi');
|
||||||
if (($GLOBALS['egw_info']['user']['apps']['admin'] || !$config['export_limit'] || $config['export_limit'] > 0) && $cache[$appname]['export'])
|
if (($GLOBALS['egw_info']['user']['apps']['admin'] || !$config['export_limit'] || $config['export_limit'] > 0) && $cache[$appname]['export'])
|
||||||
@ -129,6 +133,9 @@ class importexport_admin_prefs_sidebox_hooks
|
|||||||
'app' => 'importexport',
|
'app' => 'importexport',
|
||||||
'text' => in_array($appname, array('calendar', 'sitemgr')) ? 'Export' : 'Export CSV'
|
'text' => in_array($appname, array('calendar', 'sitemgr')) ? 'Export' : 'Export CSV'
|
||||||
);
|
);
|
||||||
|
if($GLOBALS['egw_info']['flags']['disable_importexport']['export']) {
|
||||||
|
unset($file['Export CSV']['link']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(($file_list = bo_merge::get_documents($GLOBALS['egw_info']['user']['preferences'][$appname]['document_dir'], '', array(
|
if(($file_list = bo_merge::get_documents($GLOBALS['egw_info']['user']['preferences'][$appname]['document_dir'], '', array(
|
||||||
'application/vnd.oasis.opendocument.spreadsheet',
|
'application/vnd.oasis.opendocument.spreadsheet',
|
||||||
@ -137,9 +144,9 @@ class importexport_admin_prefs_sidebox_hooks
|
|||||||
{
|
{
|
||||||
$prefix = 'document_';
|
$prefix = 'document_';
|
||||||
|
|
||||||
$options = 'style="max-width:175px;" onchange="var window = egw_appWindow(\''.$appname.'\');
|
$options = 'style="max-width:175px;" onchange="var win= egw_appWindow(\''.$appname.'\');
|
||||||
if(window.egw_getActionManager) {
|
if(win.egw_getActionManager) {
|
||||||
var actionMgrs = window.egw_getActionManager(\''.$appname.'\').getActionsByAttr(\'type\', \'actionManager\');
|
var actionMgrs = win.egw_getActionManager(\''.$appname.'\').getActionsByAttr(\'type\', \'actionManager\');
|
||||||
var actionMgr = null;
|
var actionMgr = null;
|
||||||
for(var i = 0; i < actionMgrs.length; i++) {
|
for(var i = 0; i < actionMgrs.length; i++) {
|
||||||
if(typeof actionMgrs[i].etemplate_var_prefix != \'undefined\') {
|
if(typeof actionMgrs[i].etemplate_var_prefix != \'undefined\') {
|
||||||
@ -147,9 +154,9 @@ for(var i = 0; i < actionMgrs.length; i++) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var objectMgr = window.egw_getObjectManager(actionMgr.id);
|
var objectMgr = win.egw_getObjectManager(actionMgr.id);
|
||||||
if(actionMgr && objectMgr && window.egwAction) {
|
if(actionMgr && objectMgr && win.egwAction) {
|
||||||
var action = new window.egwAction(actionMgr,\''.$prefix.'\'+this.value);
|
var action = new win.egwAction(actionMgr,\''.$prefix.'\'+this.value);
|
||||||
var toggle_select = false;
|
var toggle_select = false;
|
||||||
if(objectMgr.selectedChildren.length == 0) {
|
if(objectMgr.selectedChildren.length == 0) {
|
||||||
// Be nice and select all, if they forgot to select any
|
// Be nice and select all, if they forgot to select any
|
||||||
@ -158,7 +165,7 @@ if(actionMgr && objectMgr && window.egwAction) {
|
|||||||
toggle_select = true;
|
toggle_select = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.nm_action(action, objectMgr.selectedChildren);
|
win.nm_action(action, objectMgr.selectedChildren);
|
||||||
if(toggle_select) {
|
if(toggle_select) {
|
||||||
// Turn it back off again
|
// Turn it back off again
|
||||||
actionMgr.getActionById(\'select_all\').set_checked(false);
|
actionMgr.getActionById(\'select_all\').set_checked(false);
|
||||||
@ -173,6 +180,9 @@ var win=egw_appWindow('calendar'); win.location=win.location+(win.location.searc
|
|||||||
$options .= '
|
$options .= '
|
||||||
}
|
}
|
||||||
this.value = \'\'"';
|
this.value = \'\'"';
|
||||||
|
if($GLOBALS['egw_info']['flags']['disable_importexport']['merge']) {
|
||||||
|
$options = 'disabled="disabled"';
|
||||||
|
}
|
||||||
$file[] = array(
|
$file[] = array(
|
||||||
'text' => html::select('merge',false,array('' => lang('Export Spreadsheet')) + $file_list, true,$options),
|
'text' => html::select('merge',false,array('' => lang('Export Spreadsheet')) + $file_list, true,$options),
|
||||||
'noLang' => true,
|
'noLang' => true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user