Línea 8... |
Línea 8... |
8 |
use Laminas\Mvc\Controller\AbstractActionController;
|
8 |
use Laminas\Mvc\Controller\AbstractActionController;
|
9 |
use Laminas\Log\LoggerInterface;
|
9 |
use Laminas\Log\LoggerInterface;
|
10 |
use Laminas\View\Model\ViewModel;
|
10 |
use Laminas\View\Model\ViewModel;
|
11 |
use Laminas\View\Model\JsonModel;
|
11 |
use Laminas\View\Model\JsonModel;
|
12 |
use LeadersLinked\Library\Functions;
|
12 |
use LeadersLinked\Library\Functions;
|
13 |
use LeadersLinked\Mapper\CompanyMicrolearningTopicMapper;
|
13 |
use LeadersLinked\Mapper\MicrolearningTopicMapper;
|
14 |
use LeadersLinked\Mapper\CompanyMicrolearningCapsuleMapper;
|
14 |
use LeadersLinked\Mapper\MicrolearningCapsuleMapper;
|
15 |
use LeadersLinked\Form\PushMicrolearningNotificationForm;
|
15 |
use LeadersLinked\Form\PushMicrolearningNotificationForm;
|
16 |
use LeadersLinked\Mapper\CompanyMicrolearningCapsuleUserMapper;
|
16 |
use LeadersLinked\Mapper\MicrolearningCapsuleUserMapper;
|
17 |
use LeadersLinked\Mapper\UserMapper;
|
17 |
use LeadersLinked\Mapper\UserMapper;
|
Línea 18... |
Línea 18... |
18 |
|
18 |
|
Línea 19... |
Línea 19... |
19 |
use LeadersLinked\Model\User;
|
19 |
use LeadersLinked\Model\User;
|
20 |
|
20 |
|
21 |
use LeadersLinked\Mapper\CompanyMicrolearningUserLogMapper;
|
21 |
use LeadersLinked\Mapper\MicrolearningUserLogMapper;
|
22 |
use LeadersLinked\Mapper\CompanyMicrolearningSlideMapper;
|
22 |
use LeadersLinked\Mapper\MicrolearningSlideMapper;
|
23 |
use LeadersLinked\Form\ExtendUserMicrolearningForm;
|
23 |
use LeadersLinked\Form\ExtendUserMicrolearningForm;
|
24 |
use LeadersLinked\Form\ChangePasswordForm;
|
24 |
use LeadersLinked\Form\ChangePasswordForm;
|
25 |
use LeadersLinked\Mapper\CompanyMicrolearningUserProgressMapper;
|
25 |
use LeadersLinked\Mapper\MicrolearningUserProgressMapper;
|
26 |
use LeadersLinked\Model\CompanyMicrolearningExtendUser;
|
26 |
use LeadersLinked\Model\MicrolearningExtendUser;
|
27 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserMapper;
|
27 |
use LeadersLinked\Mapper\MicrolearningExtendUserMapper;
|
28 |
|
28 |
|
29 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserCompanyMapper;
|
29 |
use LeadersLinked\Mapper\MicrolearningExtendUserCompanyMapper;
|
30 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserFunctionMapper;
|
30 |
use LeadersLinked\Mapper\MicrolearningExtendUserFunctionMapper;
|
31 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserGroupMapper;
|
31 |
use LeadersLinked\Mapper\MicrolearningExtendUserGroupMapper;
|
32 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserInstitutionMapper;
|
32 |
use LeadersLinked\Mapper\MicrolearningExtendUserInstitutionMapper;
|
33 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserProgramMapper;
|
33 |
use LeadersLinked\Mapper\MicrolearningExtendUserProgramMapper;
|
34 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserPartnerMapper;
|
34 |
use LeadersLinked\Mapper\MicrolearningExtendUserPartnerMapper;
|
35 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserSectorMapper;
|
35 |
use LeadersLinked\Mapper\MicrolearningExtendUserSectorMapper;
|
36 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserStudentTypeMapper;
|
36 |
use LeadersLinked\Mapper\MicrolearningExtendUserStudentTypeMapper;
|
Línea 37... |
Línea 37... |
37 |
use LeadersLinked\Mapper\CompanyUserMapper;
|
37 |
use LeadersLinked\Mapper\CompanyUserMapper;
|
Línea 135... |
Línea 135... |
135 |
|
135 |
|
136 |
if(!in_array($order_direction, ['ASC', 'DESC'])) {
|
136 |
if(!in_array($order_direction, ['ASC', 'DESC'])) {
|
137 |
$order_direction = 'ASC';
|
137 |
$order_direction = 'ASC';
|
Línea 138... |
Línea 138... |
138 |
}
|
138 |
}
|
139 |
|
139 |
|
140 |
//$companyMicrolearningCapsuleMapper = CompanyMicrolearningCapsuleMapper::getInstance($this->adapter);
|
140 |
//$microlearningCapsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
|
141 |
$companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
|
141 |
$companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
|
Línea 142... |
Línea 142... |
142 |
$companyMicrolearningCapsulUserMapper = CompanyMicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
142 |
$microlearningCapsulUserMapper = MicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
143 |
$companyMicrolearningUserProgressMapper = CompanyMicrolearningUserProgressMapper::getInstance($this->adapter);
|
143 |
$microlearningUserProgressMapper = MicrolearningUserProgressMapper::getInstance($this->adapter);
|
Línea 144... |
Línea 144... |
144 |
|
144 |
|
Línea 160... |
Línea 160... |
160 |
|
160 |
|
161 |
foreach($records as $record)
|
161 |
foreach($records as $record)
|
Línea 162... |
Línea 162... |
162 |
{
|
162 |
{
|
Línea 163... |
Línea 163... |
163 |
|
163 |
|
164 |
|
164 |
|
165 |
$userCapsules = $companyMicrolearningCapsulUserMapper->fetchAllActiveByUserId($record['id']);
|
165 |
$userCapsules = $microlearningCapsulUserMapper->fetchAllActiveByUserId($record['id']);
|
166 |
|
166 |
|
Línea 167... |
Línea 167... |
167 |
$total_asigned = count($userCapsules);
|
167 |
$total_asigned = count($userCapsules);
|
168 |
$total_without_starting = 0;
|
168 |
$total_without_starting = 0;
|
169 |
$total_started = 0;
|
169 |
$total_started = 0;
|
170 |
$total_completed = 0;
|
170 |
$total_completed = 0;
|
Línea 171... |
Línea 171... |
171 |
|
171 |
|
172 |
foreach($userCapsules as $userCapsule)
|
172 |
foreach($userCapsules as $userCapsule)
|
173 |
{
|
173 |
{
|
Línea 282... |
Línea 282... |
282 |
'success' => false,
|
282 |
'success' => false,
|
283 |
'data' => 'ERROR_USER_NOT_FOUND'
|
283 |
'data' => 'ERROR_USER_NOT_FOUND'
|
284 |
]);
|
284 |
]);
|
285 |
}
|
285 |
}
|
Línea 286... |
Línea 286... |
286 |
|
286 |
|
287 |
$companyMicrolearningCapsuleUserMapper = CompanyMicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
287 |
$microlearningCapsuleUserMapper = MicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
Línea 288... |
Línea 288... |
288 |
$total = $companyMicrolearningCapsuleUserMapper->fetchCountByCompanyIdAndUserId($currentCompany->id, $user->id);
|
288 |
$total = $microlearningCapsuleUserMapper->fetchCountByCompanyIdAndUserId($currentCompany->id, $user->id);
|
289 |
|
289 |
|
290 |
if(!$total) {
|
290 |
if(!$total) {
|
291 |
return new JsonModel([
|
291 |
return new JsonModel([
|
Línea 311... |
Línea 311... |
311 |
'sector_id' => '',
|
311 |
'sector_id' => '',
|
312 |
'student_type_id' => '',
|
312 |
'student_type_id' => '',
|
Línea 313... |
Línea 313... |
313 |
|
313 |
|
Línea 314... |
Línea 314... |
314 |
];
|
314 |
];
|
315 |
|
315 |
|
Línea 316... |
Línea 316... |
316 |
$companyMicrolearningExtendUserMapper = CompanyMicrolearningExtendUserMapper::getInstance($this->adapter);
|
316 |
$microlearningExtendUserMapper = MicrolearningExtendUserMapper::getInstance($this->adapter);
|
317 |
$companyMicrolearningExtendUser = $companyMicrolearningExtendUserMapper->fetchOneByCompanyIdAndUserId($currentCompany->id, $user->id);
|
317 |
$microlearningExtendUser = $microlearningExtendUserMapper->fetchOneByCompanyIdAndUserId($currentCompany->id, $user->id);
|
318 |
|
318 |
|
319 |
if($companyMicrolearningExtendUser) {
|
319 |
if($microlearningExtendUser) {
|
320 |
if($companyMicrolearningExtendUser->extend_company_id) {
|
320 |
if($microlearningExtendUser->extend_company_id) {
|
321 |
$companyMicrolearningExtendUserCompanyMapper = CompanyMicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
321 |
$microlearningExtendUserCompanyMapper = MicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
322 |
$companyMicrolearningExtendUserCompany = $companyMicrolearningExtendUserCompanyMapper->fetchOne($companyMicrolearningExtendUser->extend_company_id);
|
322 |
$microlearningExtendUserCompany = $microlearningExtendUserCompanyMapper->fetchOne($microlearningExtendUser->extend_company_id);
|
323 |
if($companyMicrolearningExtendUserCompany) {
|
323 |
if($microlearningExtendUserCompany) {
|
Línea 324... |
Línea 324... |
324 |
$data['company_id'] = $companyMicrolearningExtendUserCompany->uuid;
|
324 |
$data['company_id'] = $microlearningExtendUserCompany->uuid;
|
Línea 325... |
Línea 325... |
325 |
}
|
325 |
}
|
326 |
}
|
326 |
}
|
327 |
|
327 |
|
328 |
}
|
328 |
}
|
329 |
|
329 |
|
330 |
if($companyMicrolearningExtendUser) {
|
330 |
if($microlearningExtendUser) {
|
331 |
if($companyMicrolearningExtendUser->extend_function_id) {
|
331 |
if($microlearningExtendUser->extend_function_id) {
|
332 |
$companyMicrolearningExtendUserFunctionMapper = CompanyMicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
332 |
$microlearningExtendUserFunctionMapper = MicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
333 |
$companyMicrolearningExtendUserFunction = $companyMicrolearningExtendUserFunctionMapper->fetchOne($companyMicrolearningExtendUser->extend_function_id);
|
333 |
$microlearningExtendUserFunction = $microlearningExtendUserFunctionMapper->fetchOne($microlearningExtendUser->extend_function_id);
|
Línea 334... |
Línea 334... |
334 |
if($companyMicrolearningExtendUserFunction) {
|
334 |
if($microlearningExtendUserFunction) {
|
335 |
$data['function_id'] = $companyMicrolearningExtendUserFunction->uuid;
|
335 |
$data['function_id'] = $microlearningExtendUserFunction->uuid;
|
336 |
}
|
336 |
}
|
337 |
}
|
337 |
}
|
338 |
}
|
338 |
}
|
339 |
|
339 |
|
340 |
if($companyMicrolearningExtendUser) {
|
340 |
if($microlearningExtendUser) {
|
341 |
if($companyMicrolearningExtendUser->extend_group_id) {
|
341 |
if($microlearningExtendUser->extend_group_id) {
|
342 |
$companyMicrolearningExtendUserGroupMapper = CompanyMicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
342 |
$microlearningExtendUserGroupMapper = MicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
Línea 343... |
Línea 343... |
343 |
$companyMicrolearningExtendUserGroup = $companyMicrolearningExtendUserGroupMapper->fetchOne($companyMicrolearningExtendUser->extend_group_id);
|
343 |
$microlearningExtendUserGroup = $microlearningExtendUserGroupMapper->fetchOne($microlearningExtendUser->extend_group_id);
|
344 |
if($companyMicrolearningExtendUserGroup) {
|
344 |
if($microlearningExtendUserGroup) {
|
345 |
$data['group_id'] = $companyMicrolearningExtendUserGroup->uuid;
|
345 |
$data['group_id'] = $microlearningExtendUserGroup->uuid;
|
346 |
}
|
346 |
}
|
347 |
}
|
347 |
}
|
348 |
}
|
348 |
}
|
349 |
|
349 |
|
350 |
if($companyMicrolearningExtendUser) {
|
350 |
if($microlearningExtendUser) {
|
351 |
if($companyMicrolearningExtendUser->extend_institution_id) {
|
351 |
if($microlearningExtendUser->extend_institution_id) {
|
Línea 352... |
Línea 352... |
352 |
$companyMicrolearningExtendUserInstitutionMapper = CompanyMicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
352 |
$microlearningExtendUserInstitutionMapper = MicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
353 |
$companyMicrolearningExtendUserInstitution = $companyMicrolearningExtendUserInstitutionMapper->fetchOne($companyMicrolearningExtendUser->extend_institution_id);
|
353 |
$microlearningExtendUserInstitution = $microlearningExtendUserInstitutionMapper->fetchOne($microlearningExtendUser->extend_institution_id);
|
354 |
if($companyMicrolearningExtendUserInstitution) {
|
354 |
if($microlearningExtendUserInstitution) {
|
355 |
$data['institution_id'] = $companyMicrolearningExtendUserInstitution->uuid;
|
355 |
$data['institution_id'] = $microlearningExtendUserInstitution->uuid;
|
356 |
}
|
356 |
}
|
357 |
}
|
357 |
}
|
358 |
}
|
358 |
}
|
359 |
|
359 |
|
360 |
if($companyMicrolearningExtendUser) {
|
360 |
if($microlearningExtendUser) {
|
Línea 361... |
Línea 361... |
361 |
if($companyMicrolearningExtendUser->extend_partner_id) {
|
361 |
if($microlearningExtendUser->extend_partner_id) {
|
362 |
$companyMicrolearningExtendUserPartnerMapper = CompanyMicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
362 |
$microlearningExtendUserPartnerMapper = MicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
363 |
$companyMicrolearningExtendUserPartner = $companyMicrolearningExtendUserPartnerMapper->fetchOne($companyMicrolearningExtendUser->extend_partner_id);
|
363 |
$microlearningExtendUserPartner = $microlearningExtendUserPartnerMapper->fetchOne($microlearningExtendUser->extend_partner_id);
|
364 |
if($companyMicrolearningExtendUserPartner) {
|
364 |
if($microlearningExtendUserPartner) {
|
365 |
$data['partner_id'] = $companyMicrolearningExtendUserPartner->uuid;
|
365 |
$data['partner_id'] = $microlearningExtendUserPartner->uuid;
|
366 |
}
|
366 |
}
|
367 |
}
|
367 |
}
|
368 |
}
|
368 |
}
|
369 |
|
369 |
|
Línea 370... |
Línea 370... |
370 |
if($companyMicrolearningExtendUser) {
|
370 |
if($microlearningExtendUser) {
|
371 |
if($companyMicrolearningExtendUser->extend_program_id) {
|
371 |
if($microlearningExtendUser->extend_program_id) {
|
372 |
$companyMicrolearningExtendUserProgramMapper = CompanyMicrolearningExtendUserProgramMapper::getInstance($this->adapter);
|
372 |
$microlearningExtendUserProgramMapper = MicrolearningExtendUserProgramMapper::getInstance($this->adapter);
|
373 |
$companyMicrolearningExtendUserProgram = $companyMicrolearningExtendUserProgramMapper->fetchOne($companyMicrolearningExtendUser->extend_program_id);
|
373 |
$microlearningExtendUserProgram = $microlearningExtendUserProgramMapper->fetchOne($microlearningExtendUser->extend_program_id);
|
374 |
if($companyMicrolearningExtendUserProgram) {
|
374 |
if($microlearningExtendUserProgram) {
|
375 |
$data['program_id'] = $companyMicrolearningExtendUserProgram->uuid;
|
375 |
$data['program_id'] = $microlearningExtendUserProgram->uuid;
|
376 |
}
|
376 |
}
|
377 |
}
|
377 |
}
|
378 |
}
|
378 |
}
|
Línea 379... |
Línea 379... |
379 |
|
379 |
|
380 |
if($companyMicrolearningExtendUser) {
|
380 |
if($microlearningExtendUser) {
|
381 |
if($companyMicrolearningExtendUser->extend_sector_id) {
|
381 |
if($microlearningExtendUser->extend_sector_id) {
|
382 |
$companyMicrolearningExtendUserSectorMapper = CompanyMicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
382 |
$microlearningExtendUserSectorMapper = MicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
383 |
$companyMicrolearningExtendUserSector = $companyMicrolearningExtendUserSectorMapper->fetchOne($companyMicrolearningExtendUser->extend_sector_id);
|
383 |
$microlearningExtendUserSector = $microlearningExtendUserSectorMapper->fetchOne($microlearningExtendUser->extend_sector_id);
|
384 |
if($companyMicrolearningExtendUserSector) {
|
384 |
if($microlearningExtendUserSector) {
|
385 |
$data['sector_id'] = $companyMicrolearningExtendUserSector->uuid;
|
385 |
$data['sector_id'] = $microlearningExtendUserSector->uuid;
|
386 |
}
|
386 |
}
|
387 |
}
|
387 |
}
|
Línea 413... |
Línea 413... |
413 |
$form->setData($dataPost);
|
413 |
$form->setData($dataPost);
|
Línea 414... |
Línea 414... |
414 |
|
414 |
|
415 |
if($form->isValid()) {
|
415 |
if($form->isValid()) {
|
Línea 416... |
Línea 416... |
416 |
$dataPost = (array) $form->getData();
|
416 |
$dataPost = (array) $form->getData();
|
417 |
|
417 |
|
418 |
$companyMicrolearningExtendUserMapper = CompanyMicrolearningExtendUserMapper::getInstance($this->adapter);
|
418 |
$microlearningExtendUserMapper = MicrolearningExtendUserMapper::getInstance($this->adapter);
|
419 |
$companyMicrolearningExtendUser = $companyMicrolearningExtendUserMapper->fetchOneByCompanyIdAndUserId($currentCompany->id, $user->id);
|
419 |
$microlearningExtendUser = $microlearningExtendUserMapper->fetchOneByCompanyIdAndUserId($currentCompany->id, $user->id);
|
420 |
if(!$companyMicrolearningExtendUser) {
|
420 |
if(!$microlearningExtendUser) {
|
421 |
$companyMicrolearningExtendUser = new CompanyMicrolearningExtendUser();
|
421 |
$microlearningExtendUser = new MicrolearningExtendUser();
|
422 |
$companyMicrolearningExtendUser->company_id = $currentCompany->id;
|
422 |
$microlearningExtendUser->company_id = $currentCompany->id;
|
Línea 423... |
Línea 423... |
423 |
$companyMicrolearningExtendUser->user_id = $user->id;
|
423 |
$microlearningExtendUser->user_id = $user->id;
|
424 |
}
|
424 |
}
|
Línea 433... |
Línea 433... |
433 |
$extend_sector_uuid = Functions::sanitizeFilterString($this->params()->fromPost('sector_id'));
|
433 |
$extend_sector_uuid = Functions::sanitizeFilterString($this->params()->fromPost('sector_id'));
|
434 |
$extend_student_type_uuid = Functions::sanitizeFilterString($this->params()->fromPost('student_type_id'));
|
434 |
$extend_student_type_uuid = Functions::sanitizeFilterString($this->params()->fromPost('student_type_id'));
|
Línea 435... |
Línea 435... |
435 |
|
435 |
|
436 |
|
436 |
|
437 |
if($extend_company_uuid) {
|
437 |
if($extend_company_uuid) {
|
438 |
$companyMicrolearningExtendUserCompanyMapper = CompanyMicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
438 |
$microlearningExtendUserCompanyMapper = MicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
439 |
$companyMicrolearningExtendUserCompany = $companyMicrolearningExtendUserCompanyMapper->fetchOneByUuid($extend_company_uuid);
|
439 |
$microlearningExtendUserCompany = $microlearningExtendUserCompanyMapper->fetchOneByUuid($extend_company_uuid);
|
440 |
if($companyMicrolearningExtendUserCompany && $companyMicrolearningExtendUserCompany->company_id = $currentCompany->id) {
|
440 |
if($microlearningExtendUserCompany && $microlearningExtendUserCompany->company_id = $currentCompany->id) {
|
441 |
$companyMicrolearningExtendUser->extend_company_id = $companyMicrolearningExtendUserCompany->id;
|
441 |
$microlearningExtendUser->extend_company_id = $microlearningExtendUserCompany->id;
|
442 |
} else {
|
442 |
} else {
|
Línea 443... |
Línea 443... |
443 |
$companyMicrolearningExtendUser->extend_company_id = null;
|
443 |
$microlearningExtendUser->extend_company_id = null;
|
444 |
}
|
444 |
}
|
445 |
|
445 |
|
Línea 446... |
Línea 446... |
446 |
} else {
|
446 |
} else {
|
447 |
$companyMicrolearningExtendUser->extend_company_id = null;
|
447 |
$microlearningExtendUser->extend_company_id = null;
|
448 |
}
|
448 |
}
|
449 |
|
449 |
|
450 |
|
450 |
|
451 |
if($extend_function_uuid) {
|
451 |
if($extend_function_uuid) {
|
452 |
$companyMicrolearningExtendUserFunctionMapper = CompanyMicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
452 |
$microlearningExtendUserFunctionMapper = MicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
453 |
$companyMicrolearningExtendUserFunction = $companyMicrolearningExtendUserFunctionMapper->fetchOneByUuid($extend_function_uuid);
|
453 |
$microlearningExtendUserFunction = $microlearningExtendUserFunctionMapper->fetchOneByUuid($extend_function_uuid);
|
Línea 454... |
Línea 454... |
454 |
if($companyMicrolearningExtendUserFunction && $companyMicrolearningExtendUserFunction->company_id = $currentCompany->id) {
|
454 |
if($microlearningExtendUserFunction && $microlearningExtendUserFunction->company_id = $currentCompany->id) {
|
455 |
$companyMicrolearningExtendUser->extend_function_id = $companyMicrolearningExtendUserFunction->id;
|
455 |
$microlearningExtendUser->extend_function_id = $microlearningExtendUserFunction->id;
|
456 |
} else {
|
456 |
} else {
|
Línea 457... |
Línea 457... |
457 |
$companyMicrolearningExtendUser->extend_function_id = null;
|
457 |
$microlearningExtendUser->extend_function_id = null;
|
458 |
}
|
458 |
}
|
459 |
|
459 |
|
460 |
} else {
|
460 |
} else {
|
461 |
$companyMicrolearningExtendUser->extend_function_id = null;
|
461 |
$microlearningExtendUser->extend_function_id = null;
|
462 |
}
|
462 |
}
|
463 |
|
463 |
|
464 |
if($extend_group_uuid) {
|
464 |
if($extend_group_uuid) {
|
Línea 465... |
Línea 465... |
465 |
$companyMicrolearningExtendUserGroupMapper = CompanyMicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
465 |
$microlearningExtendUserGroupMapper = MicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
466 |
$companyMicrolearningExtendUserGroup = $companyMicrolearningExtendUserGroupMapper->fetchOneByUuid($extend_group_uuid);
|
466 |
$microlearningExtendUserGroup = $microlearningExtendUserGroupMapper->fetchOneByUuid($extend_group_uuid);
|
467 |
if($companyMicrolearningExtendUserGroup && $companyMicrolearningExtendUserGroup->company_id = $currentCompany->id) {
|
467 |
if($microlearningExtendUserGroup && $microlearningExtendUserGroup->company_id = $currentCompany->id) {
|
Línea 468... |
Línea 468... |
468 |
$companyMicrolearningExtendUser->extend_group_id = $companyMicrolearningExtendUserGroup->id;
|
468 |
$microlearningExtendUser->extend_group_id = $microlearningExtendUserGroup->id;
|
469 |
} else {
|
469 |
} else {
|
470 |
$companyMicrolearningExtendUser->extend_group_id = null;
|
470 |
$microlearningExtendUser->extend_group_id = null;
|
471 |
}
|
471 |
}
|
472 |
|
472 |
|
473 |
} else {
|
473 |
} else {
|
474 |
$companyMicrolearningExtendUser->extend_group_id = null;
|
474 |
$microlearningExtendUser->extend_group_id = null;
|
475 |
}
|
475 |
}
|
Línea 476... |
Línea 476... |
476 |
|
476 |
|
477 |
if($extend_institution_uuid) {
|
477 |
if($extend_institution_uuid) {
|
478 |
$companyMicrolearningExtendUserInstitutionMapper = CompanyMicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
478 |
$microlearningExtendUserInstitutionMapper = MicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
Línea 479... |
Línea 479... |
479 |
$companyMicrolearningExtendUserInstitution = $companyMicrolearningExtendUserInstitutionMapper->fetchOneByUuid($extend_institution_uuid);
|
479 |
$microlearningExtendUserInstitution = $microlearningExtendUserInstitutionMapper->fetchOneByUuid($extend_institution_uuid);
|
480 |
if($companyMicrolearningExtendUserInstitution && $companyMicrolearningExtendUserInstitution->company_id = $currentCompany->id) {
|
480 |
if($microlearningExtendUserInstitution && $microlearningExtendUserInstitution->company_id = $currentCompany->id) {
|
481 |
$companyMicrolearningExtendUser->extend_institution_id = $companyMicrolearningExtendUserInstitution->id;
|
481 |
$microlearningExtendUser->extend_institution_id = $microlearningExtendUserInstitution->id;
|
482 |
} else {
|
482 |
} else {
|
483 |
$companyMicrolearningExtendUser->extend_institution_id = null;
|
483 |
$microlearningExtendUser->extend_institution_id = null;
|
484 |
}
|
484 |
}
|
485 |
|
485 |
|
486 |
} else {
|
486 |
} else {
|
Línea 487... |
Línea 487... |
487 |
$companyMicrolearningExtendUser->extend_institution_id = null;
|
487 |
$microlearningExtendUser->extend_institution_id = null;
|
488 |
}
|
488 |
}
|
489 |
|
489 |
|
Línea 490... |
Línea 490... |
490 |
if($extend_program_uuid) {
|
490 |
if($extend_program_uuid) {
|
491 |
$companyMicrolearningExtendUserProgramMapper = CompanyMicrolearningExtendUserProgramMapper::getInstance($this->adapter);
|
491 |
$microlearningExtendUserProgramMapper = MicrolearningExtendUserProgramMapper::getInstance($this->adapter);
|
492 |
$companyMicrolearningExtendUserProgram = $companyMicrolearningExtendUserProgramMapper->fetchOneByUuid($extend_program_uuid);
|
492 |
$microlearningExtendUserProgram = $microlearningExtendUserProgramMapper->fetchOneByUuid($extend_program_uuid);
|
493 |
if($companyMicrolearningExtendUserProgram && $companyMicrolearningExtendUserProgram->company_id = $currentCompany->id) {
|
493 |
if($microlearningExtendUserProgram && $microlearningExtendUserProgram->company_id = $currentCompany->id) {
|
494 |
$companyMicrolearningExtendUser->extend_program_id = $companyMicrolearningExtendUserProgram->id;
|
494 |
$microlearningExtendUser->extend_program_id = $microlearningExtendUserProgram->id;
|
495 |
} else {
|
495 |
} else {
|
496 |
$companyMicrolearningExtendUser->extend_program_id = null;
|
496 |
$microlearningExtendUser->extend_program_id = null;
|
497 |
}
|
497 |
}
|
Línea 498... |
Línea 498... |
498 |
|
498 |
|
499 |
} else {
|
499 |
} else {
|
500 |
$companyMicrolearningExtendUser->extend_program_id = null;
|
500 |
$microlearningExtendUser->extend_program_id = null;
|
Línea 501... |
Línea 501... |
501 |
}
|
501 |
}
|
502 |
|
502 |
|
503 |
if($extend_partner_uuid) {
|
503 |
if($extend_partner_uuid) {
|
504 |
$companyMicrolearningExtendUserPartnerMapper = CompanyMicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
504 |
$microlearningExtendUserPartnerMapper = MicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
505 |
$companyMicrolearningExtendUserPartner = $companyMicrolearningExtendUserPartnerMapper->fetchOneByUuid($extend_partner_uuid);
|
505 |
$microlearningExtendUserPartner = $microlearningExtendUserPartnerMapper->fetchOneByUuid($extend_partner_uuid);
|
506 |
if($companyMicrolearningExtendUserPartner && $companyMicrolearningExtendUserPartner->company_id = $currentCompany->id) {
|
506 |
if($microlearningExtendUserPartner && $microlearningExtendUserPartner->company_id = $currentCompany->id) {
|
507 |
$companyMicrolearningExtendUser->extend_partner_id = $companyMicrolearningExtendUserPartner->id;
|
507 |
$microlearningExtendUser->extend_partner_id = $microlearningExtendUserPartner->id;
|
508 |
} else {
|
508 |
} else {
|
Línea 509... |
Línea 509... |
509 |
$companyMicrolearningExtendUser->extend_partner_id = null;
|
509 |
$microlearningExtendUser->extend_partner_id = null;
|
510 |
}
|
510 |
}
|
511 |
|
511 |
|
Línea 512... |
Línea 512... |
512 |
} else {
|
512 |
} else {
|
513 |
$companyMicrolearningExtendUser->extend_partner_id = null;
|
513 |
$microlearningExtendUser->extend_partner_id = null;
|
514 |
}
|
514 |
}
|
515 |
|
515 |
|
516 |
if($extend_sector_uuid) {
|
516 |
if($extend_sector_uuid) {
|
517 |
$companyMicrolearningExtendUserSectorMapper = CompanyMicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
517 |
$microlearningExtendUserSectorMapper = MicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
518 |
$companyMicrolearningExtendUserSector = $companyMicrolearningExtendUserSectorMapper->fetchOneByUuid($extend_sector_uuid);
|
518 |
$microlearningExtendUserSector = $microlearningExtendUserSectorMapper->fetchOneByUuid($extend_sector_uuid);
|
519 |
if($companyMicrolearningExtendUserSector && $companyMicrolearningExtendUserSector->company_id = $currentCompany->id) {
|
519 |
if($microlearningExtendUserSector && $microlearningExtendUserSector->company_id = $currentCompany->id) {
|
Línea 520... |
Línea 520... |
520 |
$companyMicrolearningExtendUser->extend_sector_id = $companyMicrolearningExtendUserSector->id;
|
520 |
$microlearningExtendUser->extend_sector_id = $microlearningExtendUserSector->id;
|
521 |
} else {
|
521 |
} else {
|
522 |
$companyMicrolearningExtendUser->extend_sector_id = null;
|
522 |
$microlearningExtendUser->extend_sector_id = null;
|
Línea 523... |
Línea 523... |
523 |
}
|
523 |
}
|
524 |
|
524 |
|
525 |
} else {
|
525 |
} else {
|
526 |
$companyMicrolearningExtendUser->extend_sector_id = null;
|
526 |
$microlearningExtendUser->extend_sector_id = null;
|
Línea 527... |
Línea 527... |
527 |
}
|
527 |
}
|
528 |
|
528 |
|
529 |
if($extend_student_type_uuid) {
|
529 |
if($extend_student_type_uuid) {
|
530 |
$companyMicrolearningExtendUserStudentTypeMapper = CompanyMicrolearningExtendUserStudentTypeMapper::getInstance($this->adapter);
|
530 |
$microlearningExtendUserStudentTypeMapper = MicrolearningExtendUserStudentTypeMapper::getInstance($this->adapter);
|
531 |
$companyMicrolearningExtendUserStudentType = $companyMicrolearningExtendUserStudentTypeMapper->fetchOneByUuid($extend_student_type_uuid);
|
531 |
$microlearningExtendUserStudentType = $microlearningExtendUserStudentTypeMapper->fetchOneByUuid($extend_student_type_uuid);
|
532 |
if($companyMicrolearningExtendUserStudentType && $companyMicrolearningExtendUserStudentType->company_id = $currentCompany->id) {
|
532 |
if($microlearningExtendUserStudentType && $microlearningExtendUserStudentType->company_id = $currentCompany->id) {
|
533 |
$companyMicrolearningExtendUser->extend_student_type_id = $companyMicrolearningExtendUserStudentType->id;
|
533 |
$microlearningExtendUser->extend_student_type_id = $microlearningExtendUserStudentType->id;
|
534 |
} else {
|
534 |
} else {
|
535 |
$companyMicrolearningExtendUser->extend_student_type_id = null;
|
535 |
$microlearningExtendUser->extend_student_type_id = null;
|
Línea 536... |
Línea 536... |
536 |
}
|
536 |
}
|
537 |
|
537 |
|
538 |
} else {
|
538 |
} else {
|
539 |
$companyMicrolearningExtendUser->extend_student_type_id = null;
|
539 |
$microlearningExtendUser->extend_student_type_id = null;
|
540 |
}
|
540 |
}
|
Línea 541... |
Línea 541... |
541 |
|
541 |
|
542 |
|
542 |
|
543 |
|
543 |
|
544 |
if($companyMicrolearningExtendUser->id) {
|
544 |
if($microlearningExtendUser->id) {
|
545 |
$result = $companyMicrolearningExtendUserMapper->update($companyMicrolearningExtendUser);
|
545 |
$result = $microlearningExtendUserMapper->update($microlearningExtendUser);
|
546 |
if($result) {
|
546 |
if($result) {
|
547 |
$this->logger->info('Se actualizo la información extendida de micro aprendizaje del usuario ' . $user->email, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
|
547 |
$this->logger->info('Se actualizo la información extendida de micro aprendizaje del usuario ' . $user->email, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
|
548 |
|
548 |
|
549 |
$data = [
|
549 |
$data = [
|
Línea 550... |
Línea 550... |
550 |
'success' => true,
|
550 |
'success' => true,
|
551 |
'data' => 'LABEL_RECORD_ADDED'
|
551 |
'data' => 'LABEL_RECORD_ADDED'
|
Línea 636... |
Línea 636... |
636 |
if(!$page) {
|
636 |
if(!$page) {
|
637 |
$page = 1;
|
637 |
$page = 1;
|
638 |
}
|
638 |
}
|
639 |
$records_x_page = 10;
|
639 |
$records_x_page = 10;
|
Línea 640... |
Línea 640... |
640 |
|
640 |
|
641 |
$companyMicrolearningTopicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
641 |
$microlearningTopicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
642 |
$companyMicrolearningCapsuleMapper = CompanyMicrolearningCapsuleMapper::getInstance($this->adapter);
|
642 |
$microlearningCapsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
|
Línea 643... |
Línea 643... |
643 |
$companyMicrolearningSlideMapper = CompanyMicrolearningSlideMapper::getInstance($this->adapter);
|
643 |
$microlearningSlideMapper = MicrolearningSlideMapper::getInstance($this->adapter);
|
644 |
|
644 |
|
645 |
$topics = [];
|
645 |
$topics = [];
|
Línea 646... |
Línea 646... |
646 |
$capsules = [];
|
646 |
$capsules = [];
|
Línea 647... |
Línea 647... |
647 |
$slides = [] ;
|
647 |
$slides = [] ;
|
Línea 648... |
Línea 648... |
648 |
|
648 |
|
649 |
|
649 |
|
650 |
$companyMicrolearningUserLogMapper = CompanyMicrolearningUserLogMapper::getInstance($this->adapter);
|
650 |
$microlearningUserLogMapper = MicrolearningUserLogMapper::getInstance($this->adapter);
|
651 |
|
651 |
|
Línea 664... |
Línea 664... |
664 |
if($record->topic_id) {
|
664 |
if($record->topic_id) {
|
Línea 665... |
Línea 665... |
665 |
|
665 |
|
666 |
if(isset($topics[$record->topic_id])) {
|
666 |
if(isset($topics[$record->topic_id])) {
|
667 |
$topic = $topics[ $record->topic_id ];
|
667 |
$topic = $topics[ $record->topic_id ];
|
668 |
} else {
|
668 |
} else {
|
669 |
$topic = $companyMicrolearningTopicMapper->fetchOne( $record->topic_id );
|
669 |
$topic = $microlearningTopicMapper->fetchOne( $record->topic_id );
|
Línea 670... |
Línea 670... |
670 |
}
|
670 |
}
|
671 |
|
671 |
|
672 |
if($topic) {
|
672 |
if($topic) {
|
Línea 673... |
Línea 673... |
673 |
$item['topic'] = $topic->name;
|
673 |
$item['topic'] = $topic->name;
|
674 |
}
|
674 |
}
|
675 |
|
675 |
|
676 |
if(isset($capsules[$record->capsule_id])) {
|
676 |
if(isset($capsules[$record->capsule_id])) {
|
677 |
$capsule = $capsules[ $record->capsule_id ];
|
677 |
$capsule = $capsules[ $record->capsule_id ];
|
Línea 678... |
Línea 678... |
678 |
} else {
|
678 |
} else {
|
679 |
$capsule = $companyMicrolearningCapsuleMapper->fetchOne( $record->capsule_id );
|
679 |
$capsule = $microlearningCapsuleMapper->fetchOne( $record->capsule_id );
|
680 |
}
|
680 |
}
|
Línea 681... |
Línea 681... |
681 |
|
681 |
|
682 |
if($capsule) {
|
682 |
if($capsule) {
|
683 |
$item['capsule'] = $capsule->name;
|
683 |
$item['capsule'] = $capsule->name;
|
684 |
}
|
684 |
}
|
685 |
|
685 |
|
Línea 686... |
Línea 686... |
686 |
if(isset($slides[$record->slide_id])) {
|
686 |
if(isset($slides[$record->slide_id])) {
|
687 |
$slide = $slides[ $record->slide_id ];
|
687 |
$slide = $slides[ $record->slide_id ];
|
688 |
} else {
|
688 |
} else {
|