fixed not working download via action system: needed submit via POST request instead of Ajax, add new boolean action attribute postSubmit

This commit is contained in:
Ralf Becker 2013-10-04 12:48:11 +00:00
parent b4accbbcb5
commit 6e30816758
5 changed files with 29 additions and 13 deletions

View File

@ -599,7 +599,11 @@ class addressbook_ui extends addressbook_bo
'url' => 'menuaction=importexport.importexport_export_ui.export_dialog&appname=addressbook&plugin=addressbook_export_contacts_csv&selection=$id',
'popup' => '850x440'
),
'vcard' => 'Export as VCard',
'vcard' => array(
'caption' => 'Export as VCard',
'postSubmit' => true, // download needs post submit (not Ajax) to work
'icon' => egw_vfs::mime_icon('text/vcard'),
),
),
);
}

View File

@ -879,11 +879,12 @@ class calendar_uilist extends calendar_ui
);
}
$actions['ical'] = array(
'icon' => 'filesave',
'caption' => 'Export (iCal)',
'icon' => egw_vfs::mime_icon('text/calendar'),
'caption' => 'Export iCal',
'group' => ++$group,
'hint' => 'Download this event as iCal',
'disableClass' => 'rowNoView',
'postSubmit' => true, // download needs post submit (not Ajax) to work
);
$actions['documents'] = calendar_merge::document_action(
$this->bo->cal_prefs['document_dir'], ++$group, 'Insert in document', 'document_',

View File

@ -5,7 +5,7 @@
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package addressbook
* @copyright (c) 2007-11 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2007-13 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
@ -1668,6 +1668,7 @@ abstract class bo_merge
'icon' => egw_vfs::mime_icon($file['mime']),
'caption' => egw_vfs::decodePath(egw_vfs::basename($default_doc)),
'group' => 1,
'postSubmit' => true, // download needs post submit (not Ajax) to work
);
}
@ -1737,6 +1738,7 @@ abstract class bo_merge
'icon' => egw_vfs::mime_icon($file['mime']),
'caption' => egw_vfs::decodePath($name_arr[$count]),
'group' => 2,
'postSubmit' => true, // download needs post submit (not Ajax) to work
);
if ($file['mime'] == 'message/rfc822')
{
@ -1788,6 +1790,7 @@ abstract class bo_merge
'icon' => egw_vfs::mime_icon($file['mime']),
'caption' => egw_vfs::decodePath($file['name']),
'group' => 2,
'postSubmit' => true, // download needs post submit (not Ajax) to work
);
if ($file['mime'] == 'message/rfc822')
{

View File

@ -151,16 +151,23 @@ function nm_action(_action, _senders, _target, _ids)
{
// Force nextmatch to re-load affected rows
nextmatch.refresh(idsArr);
}
nextmatch.getInstanceManager().submit();
// Reset action in case there's another one
nextmatch.getValue = old_value;
// downloads need a regular submit via POST (no Ajax)
if (_action.data.postSubmit)
{
nextmatch.getInstanceManager().postSubmit();
}
else
{
nextmatch.getInstanceManager().submit();
}
if(_action.data.nm_action == 'open_popup')
{
// Reset action in case there's another one
nextmatch.getValue = old_value;
}
}
else
{

View File

@ -1117,8 +1117,9 @@ class infolog_ui
$this->prefs['default_document']
);
$actions['ical'] = array(
'icon' => 'calendar/navbar',
'icon' => egw_vfs::mime_icon('text/calendar'),
'caption' => 'Export iCal',
'postSubmit' => true, // download needs post submit to work
'group' => $group,
'allowOnMultiple' => true,
);