-
Notifications
You must be signed in to change notification settings - Fork 988
/
browseallrow_view.php
89 lines (88 loc) · 4.35 KB
/
browseallrow_view.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<tr class='<?php echo $bgcc; ?>' valign='top'>
<td align='center'><input type='checkbox' class='cbResponseMarker' value='<?php echo $dtrow['id']; ?>' name='markedresponses[]' /></td>
<td align='center'>
<a href='<?php echo $this->createUrl("admin/responses/view/surveyid/$surveyid/id/{$dtrow['id']}"); ?>'><img src='<?php echo $sImageURL; ?>/token_viewanswer.png' alt='<?php $clang->eT('View response details'); ?>'/></a>
<?php if (hasSurveyPermission($surveyid, 'responses', 'update'))
{ ?>
<a href='<?php echo $this->createUrl("admin/dataentry/editdata/subaction/edit/surveyid/{$surveyid}/id/{$dtrow['id']}"); ?>'><img src='<?php echo $sImageURL; ?>/edit_16.png' alt='<?php $clang->eT('Edit this response'); ?>'/></a>
<?php }
if (hasFileUploadQuestion($surveyid))
{ ?>
<a><img id='downloadfile_<?php echo $dtrow['id']; ?>' src='<?php echo $sImageURL; ?>down.png' alt='<?php $clang->eT('Download all files in this response as a zip file'); ?>' class='downloadfile'/></a>
<?php }
if (hasSurveyPermission($surveyid, 'responses', 'delete'))
{ ?>
<a><img id='deleteresponse_<?php echo $dtrow['id']; ?>' src='<?php echo $sImageURL; ?>token_delete.png' alt='<?php $clang->eT('Delete this response'); ?>' class='deleteresponse'/></a>
<?php } ?>
</td>
<?php
$i = 0;
$browsedatafield="";
if ($surveyinfo['anonymized'] == "N" && $dtrow['token'])
{
if (isset($dtrow['tid']) && !empty($dtrow['tid']))
{
//If we have a token, create a link to edit it
$browsedatafield .= "<a href='" . $this->createUrl("admin/tokens/edit/surveyid/$surveyid/tokenid/{$dtrow['tid']}/") . "' title='" . $clang->gT("Edit this token") . "'>";
$browsedatafield .= "{$dtrow['token']}";
$browsedatafield .= "</a>";
}
else
{
//No corresponding token in the token tabel, just didsplay the token
$browsedatafield .= "{$dtrow['token']}";
}
?>
<td align='center'><?php echo $browsedatafield; ?></td>
<?php
$i++; //We skip the first record (=token) as we just outputted that one
}
for ($i; $i < $fncount; $i++)
{
if (isset($fnames[$i]['type']) && $fnames[$i]['type'] == "|")
{
$index = $fnames[$i]['index'];
$metadata = $fnames[$i]['metadata'];
$phparray = json_decode_ls($dtrow[$fnames[$i][0]], true);
if (isset($phparray[$index]))
{
if ($metadata === "size")
{
?>
<td align='center'><?php echo rawurldecode(((int) ($phparray[$index][$metadata])) . " KB"); ?></td>
<?php }
else if ($metadata === "name")
{ ?>
<td><a href='#' onclick=" <?php echo convertGETtoPOST('?action=browse&subaction=all&downloadindividualfile=' . $phparray[$index][$metadata] . '&fieldname=' . $fnames[$i][0] . '&id=' . $dtrow['id'] . '&sid=' . $surveyid); ?>" ><?php echo rawurldecode($phparray[$index][$metadata]); ?></a></td>
<?php }
else
{ ?>
<td><?php echo rawurldecode($phparray[$index][$metadata]); ?></td>
<?php
}
}
else
{
?>
<td> </td>
<?php
}
}
else
{
if (isset($fnames[$i][4]) && $fnames[$i][4] == 'D' && $fnames[$i][0] != '')
{
if ($dtrow[$fnames[$i][0]] == NULL)
$browsedatafield = "N";
else
$browsedatafield = "Y";
}
else
{
$browsedatafield = htmlspecialchars(strip_tags(stripJavaScript(getExtendedAnswer($surveyid, $fnames[$i][0], $dtrow[$fnames[$i][0]], $oBrowseLanguage))), ENT_QUOTES);
}
echo "<td><span>$browsedatafield</span></td>\n";
}
}
?>
</tr>