Skip spreadsheets shown in other selectbox

This commit is contained in:
Nathan Gray 2011-05-16 18:42:49 +00:00
parent 5101ac5c03
commit 06626b4cfc
2 changed files with 13 additions and 2 deletions

View File

@ -778,7 +778,18 @@ function load_cal(url,id) {
if ($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir']) if ($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'])
{ {
$options = ''; $options = '';
foreach(calendar_merge::get_documents($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir']) as $key => $value) $documents = calendar_merge::get_documents($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir']);
// Skip spreadsheets that are in the other selectbox
$spreadsheets = importexport_admin_prefs_sidebox_hooks::get_spreadsheet_list('calendar');
foreach($spreadsheets as $file_info)
{
if($key = array_search($file_info['name'], $documents))
{
unset($documents[$key]);
}
}
foreach($documents as $key => $value)
{ {
$options .= '<option value="'.$key.'">'.html::htmlspecialchars($value)."</option>\n"; $options .= '<option value="'.$key.'">'.html::htmlspecialchars($value)."</option>\n";
} }

View File

@ -159,7 +159,7 @@ class importexport_admin_prefs_sidebox_hooks
/** /**
* Get a list of spreadsheets, in the user's preference folder, and / or a system provided template folder * Get a list of spreadsheets, in the user's preference folder, and / or a system provided template folder
*/ */
protected static function get_spreadsheet_list($app) { public static function get_spreadsheet_list($app) {
$config = config::read('importexport'); $config = config::read('importexport');
$config_dirs = $config['export_spreadsheet_folder'] ? explode(',',$config['export_spreadsheet_folder']) : array('user','stylite'); $config_dirs = $config['export_spreadsheet_folder'] ? explode(',',$config['export_spreadsheet_folder']) : array('user','stylite');
$appname = $_GET['app'] ? $_GET['app'] : $app; $appname = $_GET['app'] ? $_GET['app'] : $app;