|
52 | 52 | print "<table width='100%' cellpadding='5' class='lightlyBoxed'>"; |
53 | 53 |
|
54 | 54 | print "<tr>" . |
55 | | - "<td class='dataLabel'>Status</td><td class='dataValue'>" . $jobInfo->getState() . "</td>" . |
56 | | - "<td class='dataLabel'>Records Processed</td><td class='dataValue'>" . $jobInfo->getNumberRecordsProcessed() . "</td>" . |
57 | | - "<td class='dataLabel'>Batches Queued</td><td class='dataValue'>" . $jobInfo->getNumberBatchesQueued() . "</td>" . |
| 55 | + "<td class='dataLabel'>Status</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getState()) . "</td>" . |
| 56 | + "<td class='dataLabel'>Records Processed</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getNumberRecordsProcessed()) . "</td>" . |
| 57 | + "<td class='dataLabel'>Batches Queued</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getNumberBatchesQueued()) . "</td>" . |
58 | 58 | "</tr>"; |
59 | 59 |
|
60 | 60 | print "<tr>" . |
61 | | - "<td class='dataLabel'>Object</td><td class='dataValue'>" . $jobInfo->getObject() . "</td>" . |
| 61 | + "<td class='dataLabel'>Object</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getObject()) . "</td>" . |
62 | 62 | (WorkbenchContext::get()->isApiVersionAtLeast(19.0) |
63 | | - ? "<td class='dataLabel'>Records Failed</td><td class='dataValue'>" . $jobInfo->getNumberRecordsFailed() . "</td>" |
64 | | - : "<td class='dataLabel'>Content Type</td><td class='dataValue'>" . $jobInfo->getContentType() . "</td>" |
| 63 | + ? "<td class='dataLabel'>Records Failed</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getNumberRecordsFailed()) . "</td>" |
| 64 | + : "<td class='dataLabel'>Content Type</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getContentType()) . "</td>" |
65 | 65 | ) . |
66 | | - "<td class='dataLabel'>Batches In Progress</td><td class='dataValue'>" . $jobInfo->getNumberBatchesInProgress() . "</td>" . |
| 66 | + "<td class='dataLabel'>Batches In Progress</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getNumberBatchesInProgress()) . "</td>" . |
67 | 67 | "</tr>"; |
68 | 68 |
|
69 | 69 | print "<tr>" . |
70 | | - "<td class='dataLabel'>Operation</td><td class='dataValue'>" . ucwords($jobInfo->getOpertion()). "</td>" . |
71 | | - "<td class='dataLabel'>Concurrency Mode</td><td class='dataValue'>" . $jobInfo->getConcurrencyMode() . "</td>" . |
72 | | - "<td class='dataLabel'>Batches Completed</td><td class='dataValue'>" . $jobInfo->getNumberBatchesCompleted() . "</td>" . |
| 70 | + "<td class='dataLabel'>Operation</td><td class='dataValue'>" . ucwords(htmlspecialchars($jobInfo->getOpertion()). "</td>" . |
| 71 | + "<td class='dataLabel'>Concurrency Mode</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getConcurrencyMode()) . "</td>" . |
| 72 | + "<td class='dataLabel'>Batches Completed</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getNumberBatchesCompleted()) . "</td>" . |
73 | 73 | "</tr>"; |
74 | 74 |
|
75 | 75 | print "<tr>" . |
76 | | - "<td class='dataLabel'>External Id</td><td class='dataValue'>" . $jobInfo->getExternalIdFieldName(). "</td>" . |
77 | | - "<td class='dataLabel'>API Version</td><td class='dataValue'>" . $jobInfo->getApiVersion() . "</td>" . |
78 | | - "<td class='dataLabel'>Batches Failed</td><td class='dataValue'>" . $jobInfo->getNumberBatchesFailed() . "</td>" . |
| 76 | + "<td class='dataLabel'>External Id</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getExternalIdFieldName()) . "</td>" . |
| 77 | + "<td class='dataLabel'>API Version</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getApiVersion()) . "</td>" . |
| 78 | + "<td class='dataLabel'>Batches Failed</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getNumberBatchesFailed()) . "</td>" . |
79 | 79 | "</tr>"; |
80 | 80 |
|
81 | 81 | if (WorkbenchContext::get()->isApiVersionAtLeast(19.0)) { |
82 | 82 | print "<tr>" . |
83 | | - "<td class='dataLabel'>API Processing</td><td class='dataValue'>" . $jobInfo->getApiActiveProcessingTime(). " ms</td>" . |
84 | | - "<td class='dataLabel'>Apex Processing</td><td class='dataValue'>" . $jobInfo->getApexProcessingTime() . " ms</td>" . |
85 | | - "<td class='dataLabel'>Total Processing</td><td class='dataValue'>" . $jobInfo->getTotalProcessingTime() . " ms</td>" . |
| 83 | + "<td class='dataLabel'>API Processing</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getApiActiveProcessingTime()) . " ms</td>" . |
| 84 | + "<td class='dataLabel'>Apex Processing</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getApexProcessingTime()) . " ms</td>" . |
| 85 | + "<td class='dataLabel'>Total Processing</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getTotalProcessingTime()) . " ms</td>" . |
86 | 86 | "</tr>"; |
87 | 87 | } |
88 | 88 |
|
89 | 89 | print "<tr>" . |
90 | | - "<td class='dataLabel'>Created</td><td class='dataValue'>" . localizeDateTimes($jobInfo->getCreatedDate(),$timeOnlyFormat) . "</td>" . |
91 | | - "<td class='dataLabel'>Last Modified</td><td class='dataValue'>" . localizeDateTimes($jobInfo->getSystemModstamp(),$timeOnlyFormat) . "</td>" . |
92 | | - "<td class='dataLabel'>Retries</td><td class='dataValue'>" . $jobInfo->getNumberRetries() . "</td>" . |
| 90 | + "<td class='dataLabel'>Created</td><td class='dataValue'>" . localizeDateTimes(htmlspecialchars($jobInfo->getCreatedDate()), $timeOnlyFormat) . "</td>" . |
| 91 | + "<td class='dataLabel'>Last Modified</td><td class='dataValue'>" . localizeDateTimes(htmlspecialchars($jobInfo->getSystemModstamp()) ,$timeOnlyFormat) . "</td>" . |
| 92 | + "<td class='dataLabel'>Retries</td><td class='dataValue'>" . htmlspecialchars($jobInfo->getNumberRetries()) . "</td>" . |
93 | 93 | "</tr>"; |
94 | 94 |
|
95 | 95 | print "</table>"; |
|
118 | 118 | $batchResultList = $asyncConnection->getBatchResultList($jobInfo->getId(), $batchInfo->getId()); |
119 | 119 | } |
120 | 120 | foreach($batchResultList as $resultId) { |
121 | | - print "<a href='downloadAsyncBatch.php?op=result&jobId=" . $jobInfo->getId() . "&batchId=" . $batchInfo->getId() . "&resultId=" . $resultId . "'>" . |
122 | | - "<img src='" . getPathToStaticResource('/images/downloadIcon' . $batchInfo->getState() . '.gif') . "' border='0' onmouseover=\"Tip('Download " . $batchInfo->getState() . " Batch Results')\"/>" . |
| 121 | + print "<a href='downloadAsyncBatch.php?op=result&jobId=" . htmlspecialchars($jobInfo->getId()) . "&batchId=" . htmlspecialchars($batchInfo->getId()) . "&resultId=" . $resultId . "'>" . |
| 122 | + "<img src='" . getPathToStaticResource('/images/downloadIcon' . htmlspecialchars($batchInfo->getState()) . '.gif') . "' border='0' onmouseover=\"Tip('Download " . htmlspecialchars($batchInfo->getState()) . " Batch Results')\"/>" . |
123 | 123 | "</a><br/>"; |
124 | 124 | } |
125 | 125 | } else { |
126 | 126 | print " "; |
127 | 127 | } |
128 | 128 | print "</td>"; |
129 | 129 |
|
130 | | - $processingTimeDetails = "API Processing: " . $batchInfo->getApiActiveProcessingTime() . " ms<br/>" . |
131 | | - "Apex Processing: " . $batchInfo->getApexProcessingTime() . " ms<br/>" . |
132 | | - "Total Processing: " . $batchInfo->getTotalProcessingTime() . " ms<br/>"; |
| 130 | + $processingTimeDetails = "API Processing: " . htmlspecialchars($batchInfo->getApiActiveProcessingTime()) . " ms<br/>" . |
| 131 | + "Apex Processing: " . htmlspecialchars($batchInfo->getApexProcessingTime()) . " ms<br/>" . |
| 132 | + "Total Processing: " . htmlspecialchars($batchInfo->getTotalProcessingTime()) . " ms<br/>"; |
133 | 133 |
|
134 | 134 | print "<td class='dataValue'>" . |
135 | 135 | (WorkbenchContext::get()->isApiVersionAtLeast(19.0) |
136 | | - ? "<a href='downloadAsyncBatch.php?op=request&jobId=" . $jobInfo->getId() . "&batchId=" . $batchInfo->getId() . |
137 | | - "' onmouseover=\"Tip('Download Batch Request')\"/>" . $batchInfo->getId() . "</a>" |
138 | | - : $batchInfo->getId()) . |
| 136 | + ? "<a href='downloadAsyncBatch.php?op=request&jobId=" . htmlspecialchars($jobInfo->getId()) . "&batchId=" . htmlspecialchars($batchInfo->getId()) . |
| 137 | + "' onmouseover=\"Tip('Download Batch Request')\"/>" . htmlspecialchars($batchInfo->getId()) . "</a>" |
| 138 | + : htmlspecialchars($batchInfo->getId())) . |
139 | 139 | "</td>" . |
140 | | - "<td class='dataValue'>" . $batchInfo->getState() . (($batchInfo->getStateMessage() != "") ? (": " . $batchInfo->getStateMessage()) : "") . "</td>" . |
| 140 | + "<td class='dataValue'>" . htmlspecialchars($batchInfo->getState()) . (($batchInfo->getStateMessage() != "") ? (": " . htmlspecialchars($batchInfo->getStateMessage())) : "") . "</td>" . |
141 | 141 | (WorkbenchContext::get()->isApiVersionAtLeast(19.0) |
142 | 142 | ? "<td class='dataValue pseudoLink' style='cursor: default' onmouseover=\"Tip('$processingTimeDetails')\"/>" |
143 | 143 | : "<td class='dataValue'>") . |
144 | | - $batchInfo->getNumberRecordsProcessed() . ($batchInfo->getNumberRecordsProcessed() == "1" ? " record" : " records") . |
| 144 | + htmlspecialchars($batchInfo->getNumberRecordsProcessed()) . (htmlspecialchars($batchInfo->getNumberRecordsProcessed()) == "1" ? " record" : " records") . |
145 | 145 | "</td>" . |
146 | 146 | (WorkbenchContext::get()->isApiVersionAtLeast(19.0) |
147 | | - ? "<td class='dataValue'>" . $batchInfo->getNumberRecordsFailed() . |
| 147 | + ? "<td class='dataValue'>" . htmlspecialchars($batchInfo->getNumberRecordsFailed()) . |
148 | 148 | ($batchInfo->getNumberRecordsFailed() == "1" |
149 | 149 | ? " record" |
150 | 150 | : " records") . "</td>" |
151 | 151 | : ""). |
152 | | - "<td class='dataValue'>" . localizeDateTimes($batchInfo->getCreatedDate(),$timeOnlyFormat) . "</td>" . |
153 | | - "<td class='dataValue'>" . localizeDateTimes($batchInfo->getSystemModstamp(),$timeOnlyFormat) . "</td>"; |
| 152 | + "<td class='dataValue'>" . localizeDateTimes(htmlspecialchars($batchInfo->getCreatedDate()), $timeOnlyFormat) . "</td>" . |
| 153 | + "<td class='dataValue'>" . localizeDateTimes(htmlspecialchars($batchInfo->getSystemModstamp()), $timeOnlyFormat) . "</td>"; |
154 | 154 |
|
155 | 155 | print "</tr>"; |
156 | 156 | } |
|
0 commit comments