* merge_print/calendar: control the availability of mergeprint and csv export, if the export_limit is set to ->no<- and the user in question is not exempted from export_limit restrictions

This commit is contained in:
Klaus Leithoff 2011-09-14 13:09:13 +00:00
parent 36e3a1b8ce
commit 70a7026915
3 changed files with 10 additions and 5 deletions

View File

@ -163,6 +163,11 @@ class calendar_ui
// calendar does not work with hidden sidebox atm.
unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']);
$this->config =& $GLOBALS['egw_info']['server'];
// check if a contact specific export limit is set, if yes use it also for etemplate's csv export
$this->config['export_limit'] = $this->config['calendar_export_limit'] = bo_merge::getExportLimit($this->config['calendar_export_limit']);
}
/**

View File

@ -1172,7 +1172,7 @@ abstract class bo_merge
*/
public static function get_documents($dirs, $prefix='document_', $mime_filter=null)
{
if (!$dirs) return array();
if (!$dirs || (!self::hasExportLimit('','ISALLOWED') && !self::is_export_limit_excepted())) return array();
// split multiple comma or whitespace separated directories
// to still allow space or comma in dirnames, we also use the trailing slash of all pathes to split

View File

@ -760,7 +760,7 @@ class nextmatch_widget
/**
* Action with submenu for categories
*
* Automatic switch to hierarchical display, if more then $max_cats_flat=14 cats found.
* Automatic switch to hierarchical display, if more than $max_cats_flat=14 cats found.
*
* @param string $app
* @param int $group=0 see self::egw_actions
@ -777,7 +777,7 @@ class nextmatch_widget
$cat = new categories(null,$app);
$cats = $cat->return_sorted_array($start=0, $limit=false, $query='', $sort='ASC', $order='cat_name', $globals, $parent_id, $unserialize_data=true);
// if more then max_length cats, switch automatically to hierarchical display
// if more than max_length cats, switch automatically to hierarchical display
if (count($cats) > $max_cats_flat)
{
$cat_actions = self::category_hierarchy($cats, $prefix, $parent_id);
@ -1069,7 +1069,7 @@ class nextmatch_widget
unset($header);
}
}
// do we have more then 5 cf's to display --> limit header height to 5 lines plus vertical scrollbar
// do we have more than 5 cf's to display --> limit header height to 5 lines plus vertical scrollbar
$num = !$allowed ? count($this->cfs) : count($allowed);
if ($num > 5)
{
@ -1475,7 +1475,7 @@ class nextmatch_widget
}
if ($export_limit && (!is_numeric($export_limit) || $export_limit < $total))
{
etemplate::set_validation_error($name,lang('You are not allowed to export more then %1 entries!',$export_limit));
etemplate::set_validation_error($name,lang('You are not allowed to export more than %1 entries!',$export_limit));
return false;
}
if (!isset($value['no_csv_support'])) $value['no_csv_support'] = !is_array($value['csv_fields']);