<?php
    $label = '';
    $type = '';
    $htmlOptions = array();
    
    switch ($data->status){
        case Job::Inserted:
            $label= __('JOB_STATUS_INSERTED');
            $type = 'warning';
        break;
        case Job::Triggered:
            $label= __('JOB_STATUS_TRIGGERED');
            $type = 'warning';
        break;
        case Job::Running:
            $label= __('JOB_STATUS_RUNNING');
            $type = 'success';
        break;
        case Job::Finished:
            $label=__('JOB_STATUS_FINNISHED');
            $type = 'success';
        break;
        case Job::NeedToTriggerAgain:
            $label= __('JOB_STATUS_NEED_TO_TRIGGER_AGAIN');
            $type = 'important';
        break;
        case Job::Failed:
            $label= __('JOB_STATUS_FAILED');
            $type = 'important';
            $htmlOptions["data-toggle"] = "tooltip";
            $htmlOptions["title"] = $data->errorText;
        break;
    }

    $this->widget('bootstrap.widgets.TbLabel', array(
        'type'=> $type,
        'label'=> $label,
        "htmlOptions" => $htmlOptions
    ));