Commit 8e204e1f authored by sylvieg's avatar sylvieg

[FIX]tracker export: the function addEmptyDir does not exist on Debian Etch

parent e59c93cf
......@@ -3937,18 +3937,18 @@ class TrackerLib extends TikiLib
function export_attachment($itemId, $archive) {
global $prefs;
$files = $this->list_item_attachments( $itemId, 0, -1, 'attId_asc' );
if (!empty($files['cant'])) {
$archive->addEmptyDir($itemId);
}
foreach( $files['data'] as $file ) {
$localZip = "item_$itemId/".$file['filename'];
$complete = $this->get_item_attachment( $file['attId'] );
if (!empty($complete['path']) && file_exists($prefs['t_use_dir'].$complete['path'])) {
$archive->addFile($prefs['t_use_dir'].$complete['path'], $localZip);
} else {
$archive->addFromString($localZip, $complete['data']);
if (!$archive->addFile($prefs['t_use_dir'].$complete['path'], $localZip))
return false;
} elseif (!empty($complete['data'])) {
if (!$archive->addFromString($localZip, $complete['data']))
return false;
}
}
return true;
}
}
......
......@@ -234,7 +234,11 @@ while (($items = $trklib->list_items($_REQUEST['trackerId'], $offset, $maxRecord
}
if ($tracker_info['useAttachments'] == 'y' && !empty($_REQUEST['zip'])) {
foreach ($items['data'] as $v) {
$trklib->export_attachment($v['itemId'], $archive);
if (!$trklib->export_attachment($v['itemId'], $archive)) {
$smarty->assign('msg', tra('Problem zip'));
$smarty->display('error.tpl');
die;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment