<?php $FATTORE_ZOOM = 10; ?>
<?php $ZOOM_SPEED = 0.2; ?>
<?php $DIMENSIONE_IMMAGINI_BEH = 90; ?>
<?php $behavior = $eventBehavior->behavior; ?>
<?php $violationCodes = $behavior->violationCodes; ?>
<?php $codeModels = ViolationCode::model()->filterByBehaviorId($behavior->ID)->findAll(); ?>
<?php $codeHash = array(); ?>
<?php $codeHash['']='';; ?>
<?php if (isset($suggestedCodes) && isset($suggestedCodes[0]) && $eventBehavior->violation_code=='') $eventBehavior->violation_code = $suggestedCodes[0]->name; ?>
<?php foreach($codeModels as $codeModel) $codeHash[$codeModel->name] = $codeModel->name; ?>
<?php $redData = $event->getRedData(); ?>
<?php $meanSpeedData = $event->getMeanSpeedData(); ?>
<?php $whitelistData = $event->getWhitelistData(); ?>
<div <?php echo MtHaml\Runtime::renderAttributes(array(array('class', ('event-behaviour' . ' ' . 'row')), array('class', ($behavior->isWhitelist?"whitelist-event":"whitelist-event"))), 'html5', 'UTF-8'); ?>>
  <?php echo $form->hiddenField($eventBehavior, "[$index]ID"); ?>
  <div class="span4">
    <div class="behavior-name">
      <strong <?php echo MtHaml\Runtime::renderAttributes(array(array('title', ($eventBehavior->ID))), 'html5', 'UTF-8'); ?>>
        <?php echo htmlspecialchars(Yii::t('app', $behavior->name),ENT_QUOTES,'UTF-8'); ?>
        <?php if(user()->checkAccess('event_behavior_view')) { ?>
          <a <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'icon-eye-open'), array('href', (url('EventBehavior/view', array('id'=>$eventBehavior->ID))))), 'html5', 'UTF-8'); ?>></a>
        <?php } ?>
        <?php if(user()->checkAccess('event_behavior_update')) { ?>
          <a <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'icon-pencil'), array('href', (url('EventBehavior/update', array('id'=>$eventBehavior->ID))))), 'html5', 'UTF-8'); ?>></a>
        <?php } ?>
        <?php if(user()->checkAccess('event_behavior_delete')) { ?>
          <a <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'icon-trash'), array('href', (url('EventBehavior/delete', array('id'=>$eventBehavior->ID)))), array('onclick', ('return confirm(\'' . (t('Confirm?')) . '\');'))), 'html5', 'UTF-8'); ?>></a>
        <?php } ?>
      </strong>
    </div>
    <?php if(paramdeep('validation','viewOtherViolations')) { ?>
      <?php $otherViolations = $this->countOtherViolationsForPlate($event->Plate, $behavior->tag) - 1; ?>
      <?php if($otherViolations > 0) { ?>
        <div class="color-red"><?php echo htmlspecialchars(t_by_num($otherViolations, "Found another {0} violation of this type for this plate", "Found other {0} violations of this type for this plate", array('{0}'=>$otherViolations)),ENT_QUOTES,'UTF-8'); ?></div>
      <?php } ?>
    <?php } ?>
    <div class="behavior-detail">
      <?php if ($behavior->tag == Behavior::ILLEGAL_SPOT_SPEED || $behavior->tag == Behavior::ILLEGAL_MEAN_SPEED) { ?>
        <?php $challengedSpeed = CalculateChallengedSpeed::run($event->Speed, Yii::app()->params['spotSpeedViolation']['percentageTolerance'], Yii::app()->params['spotSpeedViolation']['fixedTolerance'], Yii::app()->params['spotSpeedViolation']['toleranceTable']);; ?>
        <div class="speeds-detail">
          <p>
            <?php echo htmlspecialchars(t('Detected Speed'),ENT_QUOTES,'UTF-8'); ?>
            <?php echo htmlspecialchars($event->Speed,ENT_QUOTES,'UTF-8'); ?>
            Km/h
          </p>
          <p>
            <strong>
              <?php echo htmlspecialchars(t('Contested Speed'),ENT_QUOTES,'UTF-8'); ?>
              <?php echo htmlspecialchars(number_format($challengedSpeed, 2),ENT_QUOTES,'UTF-8'); ?>
              Km/h
            </strong>
          </p>
          <p>
            <?php echo htmlspecialchars(t("Speed limit:"),ENT_QUOTES,'UTF-8'); ?>
            <?php echo htmlspecialchars($event->speed_limit,ENT_QUOTES,'UTF-8'); ?>
            Km/h
          </p>
        </div>
      <?php } ?>
      <?php if (paramdeep('validation','show_trafficlight_time') && $behavior->tag == Behavior::RED_VIOLATION) { ?>
        <div class="yellow-time-detail">
          <p>
            <?php echo htmlspecialchars(t('Yellow Time Set'),ENT_QUOTES,'UTF-8'); ?>
            <?php echo htmlspecialchars($event->gate->yellow_time_set,ENT_QUOTES,'UTF-8'); ?>
            sec
          </p>
          <p>
            <strong>
              <?php echo htmlspecialchars(t('Measured Yellow Time'),ENT_QUOTES,'UTF-8'); ?>
              <?php echo htmlspecialchars(number_format($redData['yellow_timegap'], 2),ENT_QUOTES,'UTF-8'); ?>
              sec
            </strong>
          </p>
        </div>
      <?php } ?>
    </div>
    <div class="behaviour-preview">
      <?php if ($behavior->isMeanSpeed) { ?>
        <?php if(Yii::app()->user->checkAccess('media_view_photo'))           { ?>
          <br />
          <table style="width: 100%; text-align: center;">
            <tr>
              <td>
                <?php if($meanSpeedData['start_bw'] != null) { ?>
                  <?php $photo = $meanSpeedData['start_bw']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
              <td>
                <?php if($meanSpeedData['end_bw'] != null) { ?>
                  <?php $photo = $meanSpeedData['end_bw']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null && !$plateRect->IsEmpty) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
            </tr>
          </table>
        <?php } ?>
      <?php } ?>
      <?php if ($behavior->isRed) { ?>
        <?php if(Yii::app()->user->checkAccess('media_view_photo')) { ?>
          <br />
          <table style="width: 100%; text-align: center;">
            <tr>
              <td>
                <?php if($redData['before_bw'] != null) { ?>
                  <?php $photo = $redData['before_bw']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
              <td>
                <?php if($redData['over_bw'] != null) { ?>
                  <?php $photo = $redData['over_bw']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null && !$plateRect->IsEmpty) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
              <td>
                <?php if($redData['before_col'] != null) { ?>
                  <?php $photo = $redData['before_col']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
              <td>
                <?php if($redData['over_col'] != null) { ?>
                  <?php $photo = $redData['over_col']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null && !$plateRect->IsEmpty) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
              <td>
                <?php if($redData['after_col'] != null) { ?>
                  <?php $photo = $redData['after_col']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null && !$plateRect->IsEmpty) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
              <td>
                <?php if($redData['afterafter_col'] != null) { ?>
                  <?php $photo = $redData['afterafter_col']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect != null && !$plateRect->IsEmpty) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
            </tr>
          </table>
        <?php } ?>
      <?php } ?>
      <?php if ($behavior->isWhitelist) { ?>
        <?php if(Yii::app()->user->checkAccess('media_view_photo')) { ?>
          <br />
          <table style="width: 100%; text-align: center;">
            <tr>
              <td>
                <?php if($whitelistData['reference_bw'] != null) { ?>
                  <?php $photo = $whitelistData['reference_bw']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
              <td>
                <?php if($whitelistData['reference_col'] != null) { ?>
                  <?php $photo = $whitelistData['reference_col']; ?>
                  <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', ($photo->UrlEnhanced)), array('data-lightbox', ('alert-preview-' . ($event->ID)))), 'html5', 'UTF-8'); ?>>
                    <?php $plateRect = $photo->getPlateRectangle(); ?>
                    <?php if($plateRect!=null && !$plateRect->IsEmpty) { ?>
                      <?php $point = $plateRect->center; ?>
                      <?php $this->printAutozoomImageScaleByHeight($photo->UrlEnhanced, $photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH, $point->X, $point->Y, $FATTORE_ZOOM, $ZOOM_SPEED); ?>
                    <?php } else { ?>
                      <?php $width_beh = ImageHelper::findScaledWidth($photo->width, $photo->height, $DIMENSIONE_IMMAGINI_BEH); ?>
                      <?php $this->renderHtml("<div style=\"margin: 1px; border: 1px solid black; width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\"><img src=\"$photo->UrlEnhanced\" style=\"width: {$width_beh}px; height: {$DIMENSIONE_IMMAGINI_BEH}px;\" alt=\"\"></div>")              ; ?>
                    <?php } ?>
                  </a>
                <?php } ?>
              </td>
            </tr>
          </table>
        <?php } ?>
      <?php } ?>
      <?php if ($eventBehavior->preview !== null) { ?>
        <?php $preview = $eventBehavior->preview; ?>
        <span>
          <i class="icon-file-alt"></i>
          <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', (Yii::app()->createAbsoluteUrl('event/violationDocumentPreview', array('violationDocumentId' => $preview->id)))), array('target', '_blank')), 'html5', 'UTF-8'); ?>><?php echo htmlspecialchars(Yii::t('app', 'Violation Preview'),ENT_QUOTES,'UTF-8'); ?></a>
        </span>
      <?php } elseif(paramdeep('validation','viewAllViolationDocuments')) { ?>
        <?php $violationDocuments = $eventBehavior->violationDocuments; ?>
        <?php foreach($violationDocuments as $vdoc) { ?>
          <span>
            <i class="icon-file-alt"></i>
            <a <?php echo MtHaml\Runtime::renderAttributes(array(array('href', (url('event/violationDocumentPreview', array('violationDocumentId' => $vdoc->id)))), array('target', '_blank')), 'html5', 'UTF-8'); ?>><?php echo htmlspecialchars(Yii::t('app', 'Violation Document'),ENT_QUOTES,'UTF-8'); ?></a>
          </span>
        <?php } ?>
      <?php } ?>
    </div>
    <p <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'violation-code-description'), array('id', ('eventBehavior-' . ($eventBehavior->ID) . '-description'))), 'html5', 'UTF-8'); ?>>
      <?php if (isset($suggestedCodes) && isset($suggestedCodes[0])) { ?>
        <?php echo htmlspecialchars("{$suggestedCodes[0]->description}",ENT_QUOTES,'UTF-8'); ?>
      <?php } ?>
    </p>
  </div>
  <div class="span4 pull-right">
    <div class="violation-code">
      <?php echo $form->dropDownList($eventBehavior, "[$index]violation_code", $codeHash, array('id' => 'eventBehavior-'.$eventBehavior->ID.'-code', 'class' => 'span4 chzn-select violation-code-select', 'data-placeholder' => Yii::t('app','Choose code'), 'data-event-behavior-id' => $eventBehavior->ID, 'data-event-tag' => $behavior->tag)); ?>
      <?php if (($error = $eventBehavior->getError('violation_code')) !== null) { ?>
        <span class="help-inline error"><?php echo htmlspecialchars($error,ENT_QUOTES,'UTF-8'); ?></span>
      <?php } ?>
      <button <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'btn'), array('type', 'button'), array('data-behavior', 'AjaxModal'), array('data-ajax-modal-target', '#modal-violation-code-suggestion'), array('data-ajax-modal-url', (Yii::app()->createAbsoluteUrl('spotSpeedArticleWizard/view', array('idEventBehavior' => $eventBehavior->ID)))), array('data-ajax-modal-form-serialize', '#event-form')), 'html5', 'UTF-8'); ?>>
        <?php echo htmlspecialchars(Yii::t('app', 'Suggest code'),ENT_QUOTES,'UTF-8'); ?>
      </button>
    </div>
    <div class="violation-comment">
      <?php if(paramdeep('validation', 'comment', 'autocomplete','enabled')) { ?>
        <?php if(paramdeep('validation', 'comment', 'autocomplete','dropdown')) { ?>
          <?php $comments = $this->getCommentSuggestions(); ?>
          <?php echo $form->dropDownList($eventBehavior, "[$index]comment", $comments, array('class' => 'span4 chzn-select', 'data-placeholder' => Yii::t('app', 'Insert comment...'))); ?>
        <?php } else { ?>
          <?php $script = $this->getCommentSuggestionsJS(); ?>
          <?php if($script != null) { ?>
            <?php echo $script; ?>
            <?php echo $form->textField($eventBehavior, "[$index]comment", array('class' => 'span4 autocomment', 'placeholder' => Yii::t('app', 'Insert comment...'))); ?>
          <?php } ?>
        <?php } ?>
      <?php } else { ?>
        <?php echo $form->textField($eventBehavior, "[$index]comment", array('class' => 'span4', 'placeholder' => Yii::t('app', 'Insert comment...'))); ?>
      <?php } ?>
    </div>
    <div class="violation-buttons btn-group" data-toggle="buttons-radio">
      <?php echo $form->hiddenField($eventBehavior, "[$index]validation_result", array('id' => 'event-behavior-status-'.$eventBehavior->ID)); ?>
      <button <?php echo MtHaml\Runtime::renderAttributes(array(array('class', ('btn-status' . ' ' . 'btn-status-approved' . ' ' . 'btn')), array('type', 'button'), array('class', ($eventBehavior->isApproved()?"active btn-success":"")), array('data-event-behavior-id', ($eventBehavior->ID)), array('data-class-color', 'btn-success'), array('data-status', (EventBehavior::STATUS_APPROVED))), 'html5', 'UTF-8'); ?>>
        <i class="icon-thumbs-up"></i>
        <?php echo htmlspecialchars(Yii::t("app", "Approved"),ENT_QUOTES,'UTF-8'); ?>
      </button>
      <button <?php echo MtHaml\Runtime::renderAttributes(array(array('class', ('btn-status' . ' ' . 'btn-status-pending' . ' ' . 'btn')), array('type', 'button'), array('class', ($eventBehavior->isPending()?"active btn-warning":"")), array('data-event-behavior-id', ($eventBehavior->ID)), array('data-class-color', 'btn-warning'), array('data-status', (EventBehavior::STATUS_PENDING))), 'html5', 'UTF-8'); ?>>
        <i class="icon-time"></i>
        <?php echo htmlspecialchars(Yii::t("app", "Pending"),ENT_QUOTES,'UTF-8'); ?>
      </button>
      <button <?php echo MtHaml\Runtime::renderAttributes(array(array('class', ('btn-status' . ' ' . 'btn-status-invalid' . ' ' . 'btn')), array('type', 'button'), array('class', ($eventBehavior->isInvalid()?"active btn-danger":"")), array('data-event-behavior-id', ($eventBehavior->ID)), array('data-class-color', 'btn-danger'), array('data-status', (EventBehavior::STATUS_INVALID))), 'html5', 'UTF-8'); ?>>
        <i class="icon-remove"></i>
        <?php echo htmlspecialchars(Yii::t("app", "Invalid"),ENT_QUOTES,'UTF-8'); ?>
      </button>
      <?php if(paramdeep('validation','voidButton','enabled')) { ?>
        <button <?php echo MtHaml\Runtime::renderAttributes(array(array('class', ('btn-status' . ' ' . 'btn-status-void' . ' ' . 'btn')), array('type', 'button'), array('class', ($eventBehavior->isVoid()?"active btn-void":"")), array('data-event-behavior-id', ($eventBehavior->ID)), array('data-class-color', 'btn-void'), array('data-status', (EventBehavior::STATUS_VOID))), 'html5', 'UTF-8'); ?>>
          <i class="icon-meh"></i>
          <?php echo htmlspecialchars(Yii::t("app", "Void"),ENT_QUOTES,'UTF-8'); ?>
        </button>
      <?php } ?>
    </div>
    <?php if (($error = $eventBehavior->getError('validation_result')) !== null) { ?>
      <span class="help-inline error"><?php echo htmlspecialchars($error,ENT_QUOTES,'UTF-8'); ?></span>
    <?php } ?>
  </div>
</div>
<div id="modal-violation-code-suggestion" class="modal hide fade"></div>
<div id="modal-whitelist-import-running" class="modal hide fade"></div>
