public function compileRequired() { $check_privacy_policy = Get::sett('request_mandatory_fields_compilation', 'off') != 'off'; $id_user = Docebo::user()->getIdSt(); $policy_checked = $this->getAcceptingPolicy($id_user); require_once _adm_ . '/lib/lib.field.php'; $fieldlist = new FieldList(); $fields_checked = $fieldlist->checkUserMandatoryFields($id_user); return !$policy_checked && $check_privacy_policy || !$fields_checked; }
/** * Set the new fields and policy acceptance, than jump to the proper page */ public function set() { $id_user = Docebo::user()->getIdst(); require_once _adm_ . '/lib/lib.field.php'; $fl = new FieldList(); $fl->storeFieldsForUser($id_user); $accept_policy = Get::req('accept_policy', DOTY_INT, 0) > 0; $this->model->setAcceptingPolicy($id_user, $accept_policy); $policy_checked = $this->model->getAcceptingPolicy($id_user); $fields_checked = $fl->checkUserMandatoryFields($id_user); if ($fields_checked && $policy_checked) { //send alert Util::jump_to($this->jump_url); } else { //send alert Util::jump_to('index.php?r=precompile/show&res=err'); } }