mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-23 05:41:02 +01:00
found a lot more calls to get_rows missing to set csv_export flag and fixed code in nextmatch dealing with situation if num_rows=-1 got stored in prefs anyway
This commit is contained in:
parent
f609efbdd8
commit
aba3c0250b
@ -54,6 +54,7 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi
|
|||||||
// uicontacts selection with checkbox 'use_all'
|
// uicontacts selection with checkbox 'use_all'
|
||||||
$query = $GLOBALS['egw']->session->appsession('index','addressbook');
|
$query = $GLOBALS['egw']->session->appsession('index','addressbook');
|
||||||
$query['num_rows'] = -1; // all
|
$query['num_rows'] = -1; // all
|
||||||
|
$query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
|
||||||
$uicontacts->get_rows($query,$selection,$readonlys, true); // only return the ids
|
$uicontacts->get_rows($query,$selection,$readonlys, true); // only return the ids
|
||||||
}
|
}
|
||||||
elseif ( $options['selection'] == 'all_contacts' ) {
|
elseif ( $options['selection'] == 'all_contacts' ) {
|
||||||
@ -268,11 +269,11 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert some internal data to something with more meaning
|
* Convert some internal data to something with more meaning
|
||||||
*
|
*
|
||||||
* Dates, times, user IDs, category IDs
|
* Dates, times, user IDs, category IDs
|
||||||
*/
|
*/
|
||||||
public static function convert(addressbook_egw_record &$record, $options) {
|
public static function convert(addressbook_egw_record &$record, $options) {
|
||||||
|
|
||||||
if ($record->tel_prefer) {
|
if ($record->tel_prefer) {
|
||||||
$field = $record->tel_prefer;
|
$field = $record->tel_prefer;
|
||||||
$record->tel_prefer = $record->$field;
|
$record->tel_prefer = $record->$field;
|
||||||
|
@ -53,6 +53,7 @@ class calendar_export_csv implements importexport_iface_export_plugin {
|
|||||||
if($states['view'] == 'listview') {
|
if($states['view'] == 'listview') {
|
||||||
$query = $GLOBALS['egw']->session->appsession('calendar_list','calendar');
|
$query = $GLOBALS['egw']->session->appsession('calendar_list','calendar');
|
||||||
$query['num_rows'] = -1; // all
|
$query['num_rows'] = -1; // all
|
||||||
|
$query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
|
||||||
$query['start'] = 0;
|
$query['start'] = 0;
|
||||||
$query['cfs'] = $cfs;
|
$query['cfs'] = $cfs;
|
||||||
|
|
||||||
@ -114,7 +115,7 @@ class calendar_export_csv implements importexport_iface_export_plugin {
|
|||||||
$record = new calendar_egw_record();
|
$record = new calendar_egw_record();
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
// the condition below (2 lines) may only work on enum_recuring=false and using the iterator to test an recurring event on the given timerange
|
// the condition below (2 lines) may only work on enum_recuring=false and using the iterator to test an recurring event on the given timerange
|
||||||
// Get rid of yearly recurring events that don't belong
|
// Get rid of yearly recurring events that don't belong
|
||||||
//if($options['selection']['select'] == 'criteria' && ($event['start'] > $query['end'] || $event['end'] < $query['start'])) continue;
|
//if($options['selection']['select'] == 'criteria' && ($event['start'] > $query['end'] || $event['end'] < $query['start'])) continue;
|
||||||
// Add in participants
|
// Add in participants
|
||||||
if($options['mapping']['participants']) {
|
if($options['mapping']['participants']) {
|
||||||
@ -201,6 +202,7 @@ class calendar_export_csv implements importexport_iface_export_plugin {
|
|||||||
|
|
||||||
// Use UI to get dates
|
// Use UI to get dates
|
||||||
$ui = new calendar_uilist();
|
$ui = new calendar_uilist();
|
||||||
|
$list['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
|
||||||
$ui->get_rows($list);
|
$ui->get_rows($list);
|
||||||
if($ui->first) $start = $ui->first;
|
if($ui->first) $start = $ui->first;
|
||||||
if($ui->last) $end = $ui->last;
|
if($ui->last) $end = $ui->last;
|
||||||
|
@ -292,6 +292,10 @@ class nextmatch_widget
|
|||||||
if ($n-5 <= $max && $max <= $n+5) $n = $max;
|
if ($n-5 <= $max && $max <= $n+5) $n = $max;
|
||||||
$row_options[$n] = $n;
|
$row_options[$n] = $n;
|
||||||
}
|
}
|
||||||
|
if (!isset($value['num_rows']) || $value['num_rows'] <= 0) // can be -1 if importexport crashes
|
||||||
|
{
|
||||||
|
$extension_data['num_rows'] = $value['num_rows'] = $max;
|
||||||
|
}
|
||||||
if (!isset($row_options[$max]) || !isset($row_options[$value['num_rows']]))
|
if (!isset($row_options[$max]) || !isset($row_options[$value['num_rows']]))
|
||||||
{
|
{
|
||||||
$row_options[$max] = $max;
|
$row_options[$max] = $max;
|
||||||
@ -300,8 +304,7 @@ class nextmatch_widget
|
|||||||
}
|
}
|
||||||
$value['options-num_rows'] =& $row_options;
|
$value['options-num_rows'] =& $row_options;
|
||||||
|
|
||||||
if (!isset($value['num_rows'])) $extension_data['num_rows'] = $value['num_rows'] = $max;
|
if ($value['num_rows'] != $max)
|
||||||
if ($value['num_rows'] != $max || $value['num_rows'] <= 0) // can be -1 if importexport crashes
|
|
||||||
{
|
{
|
||||||
$GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs'] = $max = (int)$value['num_rows'];
|
$GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs'] = $max = (int)$value['num_rows'];
|
||||||
}
|
}
|
||||||
|
@ -31,11 +31,13 @@ class resources_export_csv implements importexport_iface_export_plugin {
|
|||||||
$query = egw_cache::getSession('resources', 'get_rows');
|
$query = egw_cache::getSession('resources', 'get_rows');
|
||||||
$query['num_rows'] = -1; // all
|
$query['num_rows'] = -1; // all
|
||||||
unset($query['store_state']);
|
unset($query['store_state']);
|
||||||
|
$query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
|
||||||
$bo->get_rows($query,$selection,$readonlys);
|
$bo->get_rows($query,$selection,$readonlys);
|
||||||
}
|
}
|
||||||
elseif ( $options['selection'] == 'all' ) {
|
elseif ( $options['selection'] == 'all' ) {
|
||||||
$query = array(
|
$query = array(
|
||||||
'num_rows' => -1,
|
'num_rows' => -1,
|
||||||
|
'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session
|
||||||
); // all
|
); // all
|
||||||
$bo->get_rows($query,$selection,$readonlys);
|
$bo->get_rows($query,$selection,$readonlys);
|
||||||
} else {
|
} else {
|
||||||
|
@ -30,11 +30,15 @@ class timesheet_export_csv implements importexport_iface_export_plugin {
|
|||||||
if($options['selection'] == 'selected') {
|
if($options['selection'] == 'selected') {
|
||||||
$query = $GLOBALS['egw']->session->appsession('index',TIMESHEET_APP);
|
$query = $GLOBALS['egw']->session->appsession('index',TIMESHEET_APP);
|
||||||
$query['num_rows'] = -1; // all records
|
$query['num_rows'] = -1; // all records
|
||||||
|
$query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
|
||||||
$uitimesheet->get_rows($query,$selection,$readonlys,true); // true = only return the id's
|
$uitimesheet->get_rows($query,$selection,$readonlys,true); // true = only return the id's
|
||||||
} elseif($options['selection'] == 'all') {
|
} elseif($options['selection'] == 'all') {
|
||||||
$query = array('num_rows' => -1);
|
$query = array(
|
||||||
|
'num_rows' => -1,
|
||||||
|
'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session
|
||||||
|
);
|
||||||
$uitimesheet->get_rows($query,$selection,$readonlys,true); // true = only return the id's
|
$uitimesheet->get_rows($query,$selection,$readonlys,true); // true = only return the id's
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$options['begin_with_fieldnames'] = true;
|
$options['begin_with_fieldnames'] = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user