-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcdp.csv.php
44 lines (38 loc) · 1.2 KB
/
cdp.csv.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// miri_cdp.bash
// exports a bash file to download the CDP files
header ( "Content-Type: text/plain" );
header ( "Content-Disposition: attachment; filename=\"cdp" . $_GET ['release'] . ".csv\"" );
$release = $_GET ['release'];
miri_cdp ( $release );
function miri_cdp($release) {
$loginErrorCode = "";
$loginErrorText = "";
require_once 'common/entryexit/preludes.php';
global $objCdp, $objMetadata;
// We first print the header
print "Filename|DELIVERY";
$externalKeywords = $objMetadata->getExternalKeywords ();
foreach ( $externalKeywords as $key => $value ) {
if ($value ['id'] != "DELIVERY") {
print "|" . $value ['id'];
}
}
print "\n";
// Here, we add all files which belong to the given CDP release.
$items = $objCdp->getFilesForCdpDelivery ( $release );
foreach ( $items as $key ) {
print $key ['filename'] . "|" . $release;
foreach ( $externalKeywords as $key2 => $value ) {
if ($value ['id'] != "DELIVERY") {
print "|";
$property = $objCdp->getProperty($key['filename'], str_replace(' ', '_', $value ['id']));
if (!empty($property)) {
print $property[0][2];
}
}
}
print "\n";
}
}
?>