Пример #1
0
$module = $Params['Module'];
$objectID = $Params['ObjectID'];
$object = false;
if (!isset($offset)) {
    $offset = false;
}
if (is_numeric($objectID)) {
    $object = eZContentObject::fetch($objectID);
}
if (!$object) {
    return $module->handleError(EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel');
}
$collections = eZInformationCollection::fetchCollectionsList($objectID, false, false, array());
$numberOfCollections = eZInformationCollection::fetchCollectionsCount($objectID);
$objects = bccieExportUtils::getObjectsWithCollectedInformation();
$numberOfInfoCollectorObjects = bccieExportUtils::getCollectorObjectsCount();
$viewParameters = array('offset' => $offset);
$objectName = $object->attribute('name');
$tpl = eZTemplate::factory();
$tpl->setVariable('module', $module);
$tpl->setVariable('object', $object);
$tpl->setVariable('object_array', $objects);
$tpl->setVariable('object_count', $numberOfInfoCollectorObjects);
$tpl->setVariable('collection_array', $collections);
$tpl->setVariable('collection_count', $numberOfCollections);
if ($numberOfCollections >= 1) {
    $createdTimestamp = $collections[0]->attribute('created');
    $startDay = date('d', $createdTimestamp);
    $startMonth = date('m', $createdTimestamp);
    $startYear = date('Y', $createdTimestamp);
    $tpl->setVariable('start_day', $startDay);
Пример #2
0
$collections = eZPersistentObject::fetchObjectList(eZInformationCollection::definition(), null, $conditions, false, false);
// TODO: change error handler
if (!$collections) {
    return $module->handleError(EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel');
}
$counter = 0;
$attributesToExport = array();
while (true) {
    $currentattribute = $http->postVariable("field_{$counter}");
    if (!$currentattribute) {
        break;
    }
    $attributesToExport[] = $currentattribute;
    $counter++;
}
if ($http->hasPostVariable("creation_date")) {
    $exportCreationDate = true;
}
if ($http->hasPostVariable("modification_date")) {
    $exportModificationDate = true;
}
$separationCharacter = $http->postVariable("separation_char");
$exportFormat = $http->postVariable("export_type");
$filename = bccieExportUtils::getFileName($exportFormat, $object);
$parser = new Parser($objectID);
$export_string = $parser->exportInformationCollection($collections, $attributesToExport, $separationCharacter, $exportFormat, $dateConditions['days'], $exportCreationDate, $exportModificationDate);
$exportFormatOutputHandler = bccieExportFormatOutputHandler::instance();
$exportFormatOutputHandler->setOutputFileName($filename);
$exportFormatOutputHandler = $exportFormatOutputHandler->output($export_string);
flush();
eZExecution::cleanExit();