customFields[$fieldKey] ?? ''; ob_start(); ?>
'form-control', 'rows' => 3, 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
getCustomFieldSelectOptions($fieldKey), ['class' => 'form-control', 'prompt' => Yii::t('AnimalManagementModule.base', 'Select...'), 'id' => "animalprogressupdateform-customfields-$fieldKey"] ) ?>
'form-control', 'step' => 'any', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
'form-control', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
'form-control', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
'form-control', 'id' => "animalprogressupdateform-customfields-$fieldKey"]) ?>
getCustomFieldDefinitions(); $knownProgressKeys = ['progress_notes', 'routine_updates', 'media_reference']; $otherCustomDefinitions = []; foreach ($customDefinitions as $fieldKey => $definition) { if (in_array($fieldKey, $knownProgressKeys, true)) { continue; } $otherCustomDefinitions[$fieldKey] = $definition; } $currentMediaReference = trim((string)($model->customFields['media_reference'] ?? '')); $progressFormId = 'edit-progress-update-form'; $this->registerCss(<< .panel-heading { color: #eef5fb; background: rgba(10, 18, 28, 0.42); border-color: rgba(255, 255, 255, 0.2); } .inline-editor-shell > .panel-body { background: rgba(10, 18, 28, 0.2); } .inline-editor-shell .panel.panel-default { border-color: rgba(255, 255, 255, 0.2); background: rgba(10, 18, 28, 0.34); } .inline-editor-shell .panel.panel-default > .panel-heading { color: #eef5fb; background: rgba(10, 18, 28, 0.42); border-color: rgba(255, 255, 255, 0.2); } .inline-editor-shell, .inline-editor-shell .panel-body, .inline-editor-shell .control-label, .inline-editor-shell .checkbox label, .inline-editor-shell .radio label, .inline-editor-shell .help-block { color: #eef5fb; } .inline-editor-shell .text-muted { color: rgba(233, 242, 250, 0.78) !important; } .inline-editor-shell .form-control { background: rgba(10, 18, 28, 0.56); border-color: rgba(255, 255, 255, 0.44); color: #f3f8ff; } .inline-editor-shell .form-control::placeholder { color: rgba(243, 248, 255, 0.72); } .inline-editor-shell .form-control[readonly], .inline-editor-shell .form-control[disabled] { background: rgba(10, 18, 28, 0.42); color: rgba(243, 248, 255, 0.72); } .inline-editor-shell select.form-control option { color: #0f1b2a; } CSS ); if ($isInline) { $this->registerCss(<< .panel:first-child { margin-top: 0 !important; } CSS ); } ?>
Edit Progress Update') ?> ', [ 'class' => 'btn btn-default btn-sm', 'title' => Yii::t('AnimalManagementModule.base', 'Save Progress Update'), 'form' => $progressFormId, ]) ?> ', [ 'type' => 'button', 'class' => 'btn btn-default btn-sm', 'id' => 'progress-inline-cancel-icon', 'title' => Yii::t('AnimalManagementModule.base', 'Cancel'), ]) ?>
$progressFormId, 'enctype' => 'multipart/form-data']; if (!$isInline) { $formOptions['target'] = '_top'; } $form = ActiveForm::begin(['options' => $formOptions]); ?> errorSummary($model, ['showAllErrors' => true]) ?>
field($model, 'weight') ?>
field($model, 'vitals')->textInput(['maxlength' => 255]) ?>
field($model, 'behavior_notes')->textarea(['rows' => 2]) ?>
field($model, 'medical_concerns')->textarea(['rows' => 2]) ?>
field($model, 'meal_plan_changes')->textarea(['rows' => 2]) ?>
field($model, 'housing_changes')->textarea(['rows' => 2]) ?>
$definition): ?>
<?= Yii::t('AnimalManagementModule.base', 'Selected media') ?>
field($model, 'post_to_space_feed')->checkbox() ?> field($model, 'post_to_animal_feed')->checkbox() ?>
submit() ?> 'button', 'class' => 'btn btn-default', 'id' => 'progress-inline-cancel', ]) ?> link(($returnTo ?? 'view') === 'progress-updates' ? $space->createUrl('/animal_management/animals/progress-updates', ['id' => $animal->id]) : $space->createUrl('/animal_management/animals/view', ['id' => $animal->id])) ?>
registerCss(<<registerJs(<<'); } else { preview.html(''); } } function markSelectedMediaThumb(value) { $('.progress-media-select-thumb').removeClass('is-selected'); if (!value) { return; } $('.progress-media-select-thumb').each(function() { if (($(this).attr('data-media-url') || '') === value) { $(this).addClass('is-selected'); } }); } $(document).off('click.editProgressMediaSelect', '.progress-media-select-thumb').on('click.editProgressMediaSelect', '.progress-media-select-thumb', function() { var mediaUrl = $(this).attr('data-media-url') || ''; $('#progress-media-gallery-path').val(mediaUrl); markSelectedMediaThumb(mediaUrl); $('#progressMediaUpload').val(''); $('input[name="removeProgressMedia"]').prop('checked', false); if (mediaUrl) { renderProgressPreview(mediaUrl); } $('#progress-media-modal').modal('hide'); }); $(document).off('change.editProgressMediaUpload', '#progressMediaUpload').on('change.editProgressMediaUpload', '#progressMediaUpload', function() { var file = this.files && this.files[0] ? this.files[0] : null; if (!file) { return; } $('#progress-media-gallery-path').val(''); markSelectedMediaThumb(''); $('input[name="removeProgressMedia"]').prop('checked', false); var reader = new FileReader(); reader.onload = function(e) { renderProgressPreview(e.target.result); $('#progress-media-modal').modal('hide'); }; reader.readAsDataURL(file); }); $(document).off('shown.bs.modal.editProgressMediaModal', '#progress-media-modal').on('shown.bs.modal.editProgressMediaModal', '#progress-media-modal', function() { markSelectedMediaThumb($('#progress-media-gallery-path').val()); }); })(); JS , \yii\web\View::POS_END); if ($isInline) { $cancelPayload = Json::htmlEncode([ 'source' => 'animal-inline-editor', 'type' => 'cancel', 'collapseId' => 'progress-edit-inline-' . (int)$progressUpdate->id, ]); $this->registerJs(<<