Здравствуйте,
Не получается сделать проверку статуса отчета.
Во вьюшке _status есть статусы: Подготовить, Не подготовлен, Подготовлен, Принять, Не принятый, Принятый
PHP код:
array(
'header' => 'Статус',
'cssClassExpression' => '$data["ready"]?"ready":"notready"',
'class' => 'CButtonColumn',
'htmlOptions' => array(
'class' => 'statusColumn',
'style' => 'text-align: center; width: 101px;',
'onmouseover' => 'appendStatusChangeButton(this)',
),
'template' => '{notready}{ready}{accepted}{set}{accept}{notaccepted}{declined}{acceptableDeclined}',
'buttons' => array(
'notready' => array(
'label' => 'Не подготовлен',
'options' => array(
'class' => 'redFontColor',
),
'visible'=>'!$data["declined"] && !$data["ready"] && $data["id"]=='.$id.'&& BpsUser::$bpsUser->userID != '.$id,
),
'ready' => array(
'label' => 'Подготовлен',
'options' => array(
'class' => 'greenFontColor',
),
'visible'=>'!$data["declined"] && $data["ready"]&&$data["id"]=='.$id,
),
'accepted' => array(
'label' => 'Принят',
'options' => array(
'class' => 'greenFontColor accepted',
),
'visible' => '!$data["declined"] && $data["ready"]&&$data["id"]!='.$id,
),
'set' => array(
'label' => 'Подготовить',
'url' => '"javascript:;"',
'options' => array(
'class' => 'small button green',
'style' => 'margin-bottom: 0px;',
// 'onclick' => 'if (testSubmit('.$dialog.')) {accept();}',
'onclick' => '{accept();}',
),
'visible' => '!$data["declined"] && !$data["ready"]&&$data["id"]=='.BpsUser::$bpsUser->userID.'&&$data["id"]=='.$id,
),
Во вьюшке _report столбец грида "Actual" хотела бы сделать проверку при изменении поля, что б аллерт выходил об изменении, и что б статус с Подготовлен менялся на Не подготовлен.
PHP код:
array(
'class' => 'editable.EditableColumn',
'name' => 'actual',
'headerHtmlOptions' => array(
'style' => 'width: 35px; white-space: nowrap;',
),
'editable' => $editable+array(
'onSave' => 'js: function(e, params) {
if(typeof(updateSums) == "function")
updateSums(params.response);
/*вот здесь проверка*/if($ready) {cancel();}
}',
'onShown' => 'function(e){
currentLink = jQuery(this);
setTimeout(function(){jQuery("input.input-medium").select()}, 10);
}',)+(
$dialog?array():
array(
'success' => 'function(response, newValue){
setTooltipTime(parseFloat(jQuery(this).text().replace(",",".")),
parseFloat(newValue.replace(",",".")));
}'
)
),
'footerHtmlOptions' => array(
'style' => 'width: 25%;','vertical-align: center;',
'id' => 'columnFooterActual'
),
'footer' => $ready ? '' : '<input type="text" step="0.5" style="width: 100%"
name="WorktimeReport[actual]" id="WorktimeReport[actual]">',
),