mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 12:51:52 +02:00
Add save all attachments as zip to mail display popup
This commit is contained in:
parent
0de1db26bd
commit
99e28b96b3
@ -2098,6 +2098,10 @@ class mail_ui
|
|||||||
$rowID = $_requesteddata['id'];
|
$rowID = $_requesteddata['id'];
|
||||||
//unset($_REQUEST);
|
//unset($_REQUEST);
|
||||||
}
|
}
|
||||||
|
if($_requesteddata['mail_displayattachments'][0]['save_zip'])
|
||||||
|
{
|
||||||
|
$this->download_zip($_requesteddata['mail_id']);
|
||||||
|
}
|
||||||
$preventRedirect=false;
|
$preventRedirect=false;
|
||||||
if(isset($_GET['id'])) $rowID = $_GET['id'];
|
if(isset($_GET['id'])) $rowID = $_GET['id'];
|
||||||
if(isset($_GET['part'])) $partID = $_GET['part'];
|
if(isset($_GET['part'])) $partID = $_GET['part'];
|
||||||
@ -2829,6 +2833,17 @@ class mail_ui
|
|||||||
function download_zip($message_id)
|
function download_zip($message_id)
|
||||||
{
|
{
|
||||||
// First, get all attachment IDs
|
// First, get all attachment IDs
|
||||||
|
if(!is_numeric($message_id))
|
||||||
|
{
|
||||||
|
$hA = self::splitRowID($message_id);
|
||||||
|
$message_id = $hA['msgUID'];
|
||||||
|
$mailbox = $hA['folder'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mailbox = $this->mail_bo->sessionData['mailbox'];
|
||||||
|
}
|
||||||
|
|
||||||
$attachments = $this->mail_bo->getMessageAttachments($message_id);
|
$attachments = $this->mail_bo->getMessageAttachments($message_id);
|
||||||
|
|
||||||
// put them in VFS so they can be zipped
|
// put them in VFS so they can be zipped
|
||||||
@ -2845,9 +2860,9 @@ class mail_ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
$file_list = array();
|
$file_list = array();
|
||||||
|
$this->mail_bo->reopen($mailbox);
|
||||||
foreach($attachments as $file)
|
foreach($attachments as $file)
|
||||||
{
|
{
|
||||||
$this->mail_bo->reopen($this->mail_bo->sessionData['mailbox']);
|
|
||||||
$attachment = $this->mail_bo->getAttachment($message_id,$file['partID'],$file['is_winmail'],false);
|
$attachment = $this->mail_bo->getAttachment($message_id,$file['partID'],$file['is_winmail'],false);
|
||||||
|
|
||||||
if (!($fp = egw_vfs::fopen($path.$file['filename'],'wb')) ||
|
if (!($fp = egw_vfs::fopen($path.$file['filename'],'wb')) ||
|
||||||
|
@ -78,6 +78,7 @@
|
|||||||
<buttononly id="${row}[save]" value="save" image="fileexport" onclick="app.mail.saveAttachment"/>
|
<buttononly id="${row}[save]" value="save" image="fileexport" onclick="app.mail.saveAttachment"/>
|
||||||
<buttononly id="${row}[saveAsVFS]" value="save" image="filemanager/navbar" onclick="app.mail.saveAttachmentToVFS"/>
|
<buttononly id="${row}[saveAsVFS]" value="save" image="filemanager/navbar" onclick="app.mail.saveAttachmentToVFS"/>
|
||||||
<buttononly class="$row_cont[classSaveAllPossiblyDisabled]" id="${row}[save_all]" value="save_all" image="mail/save_all" onclick="app.mail.saveAllAttachmentsToVFS"/>
|
<buttononly class="$row_cont[classSaveAllPossiblyDisabled]" id="${row}[save_all]" value="save_all" image="mail/save_all" onclick="app.mail.saveAllAttachmentsToVFS"/>
|
||||||
|
<buttononly class="$row_cont[classSaveAllPossiblyDisabled]" id="${row}[save_zip]" value="save_zip" image="mail/save_all" onclick="widget.getInstanceManager().postSubmit();" label="Save as Zip"/>
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
<buttononly id="${row}[save]" value="save" image="fileexport" onclick="app.mail.saveAttachment"/>
|
<buttononly id="${row}[save]" value="save" image="fileexport" onclick="app.mail.saveAttachment"/>
|
||||||
<buttononly id="${row}[saveAsVFS]" value="save" image="filemanager/navbar" onclick="app.mail.saveAttachmentToVFS"/>
|
<buttononly id="${row}[saveAsVFS]" value="save" image="filemanager/navbar" onclick="app.mail.saveAttachmentToVFS"/>
|
||||||
<buttononly class="$row_cont[classSaveAllPossiblyDisabled]" id="${row}[save_all]" value="save_all" image="mail/save_all" onclick="app.mail.saveAllAttachmentsToVFS"/>
|
<buttononly class="$row_cont[classSaveAllPossiblyDisabled]" id="${row}[save_all]" value="save_all" image="mail/save_all" onclick="app.mail.saveAllAttachmentsToVFS"/>
|
||||||
<buttononly class="$row_cont[classSaveAllPossiblyDisabled]" id="${row}[save_zip]" value="save_zip" image="mail/save_all" onclick="widget.getInstanceManager().postSubmit();" label="Save as Zip/>
|
<buttononly class="$row_cont[classSaveAllPossiblyDisabled]" id="${row}[save_zip]" value="save_zip" image="mail/save_all" onclick="widget.getInstanceManager().postSubmit();" label="Save as Zip"/>
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user