|
7 | 7 |
|
8 | 8 | $request = \Bitrix\Main\Application::getInstance()->getContext()->getRequest();
|
9 | 9 | $apply = false;
|
10 |
| - |
| 10 | +$timeFormatter = new \WS\ReduceMigrations\TimeFormatter($localization->getDataByPath('timeLang')); |
11 | 11 | if ($request->get('rollback')) {
|
12 | 12 | $module->rollbackLastBatch();
|
13 | 13 | $apply = true;
|
|
37 | 37 |
|
38 | 38 | foreach ($lastSetupLog->getAppliedLogs() as $appliedLog) {
|
39 | 39 | $appliedLog->isFailed() && $errorFixes[] = $appliedLog;
|
40 |
| - !$appliedLog->isFailed() && $appliedFixes[$appliedLog->getName()]++; |
| 40 | + if (!$appliedLog->isFailed()) { |
| 41 | + if (isset($appliedFixes[$appliedLog->getName()])) { |
| 42 | + $appliedFixes[$appliedLog->getName()] = array( |
| 43 | + 'time' => $appliedFixes[$appliedLog->getName()]['time'] + $appliedLog->getTime(), |
| 44 | + 'count' => $appliedFixes[$appliedLog->getName()]['count'] + 1 |
| 45 | + ); |
| 46 | + } else { |
| 47 | + $appliedFixes[$appliedLog->getName()] = array( |
| 48 | + 'time' => $appliedLog->getTime(), |
| 49 | + 'count' => 1 |
| 50 | + ); |
| 51 | + } |
| 52 | + } |
41 | 53 | }
|
42 | 54 | }
|
43 | 55 | //--------------------------------------------------------------------------
|
|
103 | 115 | if (isset($scenarios[\WS\ReduceMigrations\Scenario\ScriptScenario::PRIORITY_OPTIONAL])) {
|
104 | 116 | $form->AddCheckBoxField('skipOptional', $localization->message('skipOptional'), false, 'Y', false);
|
105 | 117 | }
|
106 |
| - $form->AddViewField('time', $localization->message('approximatelyTime'), $localization->message('time', array( |
107 |
| - '#time#' => $notAppliedScenarios->getApproximateTime() |
108 |
| - ))); |
| 118 | + $form->AddViewField('time', $localization->message('approximatelyTime'), $timeFormatter->format($notAppliedScenarios->getApproximateTime())); |
109 | 119 | }
|
110 | 120 | //--------------------
|
111 | 121 | if ($lastSetupLog) {
|
|
120 | 130 | <td width="30%" valign="top"><b><?= $localization->getDataByPath('appliedList') ?>:</b></td>
|
121 | 131 | <td width="70%">
|
122 | 132 | <ol style="list-style-type: none; padding-left: 0px; margin-top: 0px;">
|
123 |
| - <? foreach ($appliedFixes as $fixName => $fixCount): |
| 133 | + <? foreach ($appliedFixes as $fixName => $item): |
| 134 | + $fixCount = $item['count']; |
| 135 | + $time = $item['time']; |
124 | 136 | ?>
|
125 |
| - <li><?= $fixName ?> <?= $fixCount > 1 ? '['.$fixCount.']' : '' ?></li> |
| 137 | + <li><?= $fixName ?> <?= $fixCount > 1 ? '['.$fixCount.']' : '' ?> (<?=$timeFormatter->format($time)?>)</li> |
126 | 138 | <?endforeach; ?>
|
127 | 139 | </ol>
|
128 | 140 | </tr>
|
|
0 commit comments