public function actionSubmitEsign($id_app_task) { $model = AppTask::findOne($id_app_task); $application = $model->application; $appFormModel = $application->appForm; $appFormModel->load(Yii::$app->request->get()); $appFormModel->save(false); $appFormModel->setScenario('disclosures'); $status = $appFormModel->validate(true); AppFormStatus::changeStatus($application->id_application, 4, $status); //检查AppForm所有项是否正确填写 $result = $application->checkAppForm(); if (Yii::$app->request->post()) { // docusign $result_docusign = SendDocuSign::appForm($application->id_application); // Finish Task AppTask::taskFinish($id_app_task); //active log. client submit app-form Active::operationLog($application->id_application, [Yii::$app->user->getIdentity()->first_name, Yii::$app->user->getIdentity()->last_name, 'submitted', DictTask::$taskType[DictTask::TYPE_APPLICATION_FORM]], DictActive::USER_FINISH_TASK, Yii::$app->user->getIdentity()->id); //find user $res = SendEmail::findUserByApplication($application->id_application); //active log. system create task sing-app-form and assign to client/advisor Active::operationLog($application->id_application, [DictTask::$taskType[DictTask::TYPE_SIGN_APPLICATION_FORM], $res['advisor']->first_name, $res['advisor']->last_name], DictActive::SYSTEM_CREATE_TASK_TO_USER, 0); //system assign to advisor Active::operationLog($application->id_application, [DictTask::$taskType[DictTask::TYPE_SIGN_APPLICATION_FORM], $res['applicant']->first_name, $res['applicant']->last_name], DictActive::SYSTEM_CREATE_TASK_TO_USER, 0); //system assign to client if (!is_null($res['co_applicant'])) { Active::operationLog($application->id_application, [DictTask::$taskType[DictTask::TYPE_SIGN_APPLICATION_FORM], $res['co_applicant']->first_name, $res['co_applicant']->last_name], DictActive::SYSTEM_CREATE_TASK_TO_USER, 0); //system assign to co_client } //active log. system send docusign task email to user Active::operationLog($application->id_application, [DictTask::$taskType[DictTask::TYPE_APPLICATION_FORM], $res['advisor']->first_name, $res['advisor']->last_name], DictActive::SYSTEM_SEND_DOCUSIGN_EMAIL, 0); //system send docusign email to advisor Active::operationLog($application->id_application, [DictTask::$taskType[DictTask::TYPE_APPLICATION_FORM], $res['applicant']->first_name, $res['applicant']->last_name], DictActive::SYSTEM_SEND_DOCUSIGN_EMAIL, 0); //system send docusign email to client //active log. system create task supplemental-materials and assign to advisor Active::operationLog($application->id_application, [DictTask::$taskType[DictTask::TYPE_SUPPLEMENTAL_MATERIALS], $res['advisor']->first_name, $res['advisor']->last_name], DictActive::SYSTEM_CREATE_TASK_TO_USER, 0); //System send email new task “Supplemental materials Notification” to client SendEmail::email(DictEmail::EMAIL_TASK_NOTIFICATION, [DictTask::TYPE_SUPPLEMENTAL_MATERIALS, $application->id_application, $id_app_task + 2]); //id_app_task_type:1(app-form);0:表示没有传递id_app_task if ($this->user->id_user_role == Dict::USER_ROLE_CLIENT) { return $this->redirect(['/loan/application']); } else { return $this->redirect(['/application/view', 'id' => $application->id_application]); } } return $this->renderAjax('submit_esign', ['model' => $model, 'result' => $result]); }
use yii\helpers\Url; use common\models\AppFormStatus; $models = AppFormStatus::find()->andWhere(['id_application' => $id_application])->all(); ?> <div class=""> <ul class="nav nav-pills pt20"> <?php foreach ($models as $model) { ?> <li role="presentation" class="<?php echo '/' . Yii::$app->requestedRoute == AppFormStatus::getSectionsUrl($model->section_number) ? 'active' : ''; ?> "><a href="<?php echo Url::to([AppFormStatus::getSectionsUrl($model->section_number), 'id_application' => $id_application]); ?> "><?php echo $model->table_name; if ($model->status) { ?> <i class="glyphicon"></i><?php } ?> </a></li> <?php } ?> </ul> </div>
echo Url::to([AppFormStatus::getSectionsUrl(4), 'id_application' => $this->context->actionParams['id_application']]); ?> " class="btn btn-default fonm-radius-01 btn-loading" type="submit">Save and Next</a> </span> </div> </div> <?php } else { ?> <div class="form-button-box clearfix"> <span class="fr"> <a href="<?php echo Url::to([AppFormStatus::getSectionsUrl(2), 'id_application' => $this->context->actionParams['id_application']]); ?> "class="btn btn-default fonm-radius-03 btn-loading" type="submit">Previous</a><a href="<?php echo Url::to([AppFormStatus::getSectionsUrl(4), 'id_application' => $this->context->actionParams['id_application']]); ?> " class="btn btn-default fonm-radius-01 btn-loading" type="submit">Next</a> </span> </div> </div> <?php } ?> </div> </div> </main> <aside class="col-md-3 sidebar"> <?php echo AppFormStatusBar::widget(['id_application' => $this->context->actionParams['id_application']]); ?>
public function afterSave($insert, $changedAttributes) { //如果为新建,则同时创建AppFormStatus if ($insert) { AppFormStatus::createSections($this->id_application); } //生成app_form.pdf AppDocument::createPdfByApplication($this->application, DictDocument::TYPE_APPLICATION_FORM); }