| Línea 11... |
Línea 11... |
| 11 |
use Laminas\View\Model\JsonModel;
|
11 |
use Laminas\View\Model\JsonModel;
|
| 12 |
use LeadersLinked\Form\ExtendUserMicrolearningForm;
|
12 |
use LeadersLinked\Form\ExtendUserMicrolearningForm;
|
| 13 |
use LeadersLinked\Mapper\QueryMapper;
|
13 |
use LeadersLinked\Mapper\QueryMapper;
|
| 14 |
use LeadersLinked\Mapper\UserMapper;
|
14 |
use LeadersLinked\Mapper\UserMapper;
|
| 15 |
use Laminas\Db\Sql\Expression;
|
15 |
use Laminas\Db\Sql\Expression;
|
| 16 |
use LeadersLinked\Mapper\CompanyMicrolearningCapsuleUserMapper;
|
16 |
use LeadersLinked\Mapper\MicrolearningCapsuleUserMapper;
|
| 17 |
use LeadersLinked\Model\CompanyMicrolearningCapsuleUser;
|
17 |
use LeadersLinked\Model\MicrolearningCapsuleUser;
|
| 18 |
use LeadersLinked\Mapper\CompanyMicrolearningCapsuleMapper;
|
18 |
use LeadersLinked\Mapper\MicrolearningCapsuleMapper;
|
| 19 |
use LeadersLinked\Mapper\CompanyMicrolearningUserProgressMapper;
|
19 |
use LeadersLinked\Mapper\MicrolearningUserProgressMapper;
|
| 20 |
use LeadersLinked\Mapper\CompanyMicrolearningSlideMapper;
|
20 |
use LeadersLinked\Mapper\MicrolearningSlideMapper;
|
| 21 |
use LeadersLinked\Mapper\CompanyMicrolearningUserLogMapper;
|
21 |
use LeadersLinked\Mapper\MicrolearningUserLogMapper;
|
| 22 |
use Google\Service\Classroom\Student;
|
22 |
use Google\Service\Classroom\Student;
|
| 23 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserCompanyMapper;
|
23 |
use LeadersLinked\Mapper\MicrolearningExtendUserCompanyMapper;
|
| 24 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserFunctionMapper;
|
24 |
use LeadersLinked\Mapper\MicrolearningExtendUserFunctionMapper;
|
| 25 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserGroupMapper;
|
25 |
use LeadersLinked\Mapper\MicrolearningExtendUserGroupMapper;
|
| 26 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserInstitutionMapper;
|
26 |
use LeadersLinked\Mapper\MicrolearningExtendUserInstitutionMapper;
|
| 27 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserProgramMapper;
|
27 |
use LeadersLinked\Mapper\MicrolearningExtendUserProgramMapper;
|
| 28 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserPartnerMapper;
|
28 |
use LeadersLinked\Mapper\MicrolearningExtendUserPartnerMapper;
|
| 29 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserSectorMapper;
|
29 |
use LeadersLinked\Mapper\MicrolearningExtendUserSectorMapper;
|
| 30 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserStudentTypeMapper;
|
30 |
use LeadersLinked\Mapper\MicrolearningExtendUserStudentTypeMapper;
|
| 31 |
use LeadersLinked\Mapper\CompanyMicrolearningExtendUserMapper;
|
31 |
use LeadersLinked\Mapper\MicrolearningExtendUserMapper;
|
| 32 |
use LeadersLinked\Mapper\CompanyMicrolearningTopicMapper;
|
32 |
use LeadersLinked\Mapper\MicrolearningTopicMapper;
|
| 33 |
use LeadersLinked\Mapper\DeviceMapper;
|
33 |
use LeadersLinked\Mapper\DeviceMapper;
|
| 34 |
use LeadersLinked\Model\Application;
|
34 |
use LeadersLinked\Model\Application;
|
| 35 |
use LeadersLinked\Mapper\CompanyMicrolearningUserMapper;
|
35 |
use LeadersLinked\Mapper\MicrolearningUserMapper;
|
| 36 |
use LeadersLinked\Model\CompanyMicrolearningExtendUser;
|
36 |
use LeadersLinked\Model\MicrolearningExtendUser;
|
| 37 |
use LeadersLinked\Form\TopicCapsuleForm;
|
37 |
use LeadersLinked\Form\TopicCapsuleForm;
|
| 38 |
use LeadersLinked\Mapper\CompanyMicrolearningCapsuleCommentMapper;
|
38 |
use LeadersLinked\Mapper\MicrolearningCapsuleCommentMapper;
|
| 39 |
use Laminas\Hydrator\ArraySerializableHydrator;
|
39 |
use Laminas\Hydrator\ArraySerializableHydrator;
|
| 40 |
use Laminas\Db\ResultSet\HydratingResultSet;
|
40 |
use Laminas\Db\ResultSet\HydratingResultSet;
|
| 41 |
use Laminas\Paginator\Adapter\DbSelect;
|
41 |
use Laminas\Paginator\Adapter\DbSelect;
|
| 42 |
use Laminas\Paginator\Paginator;
|
42 |
use Laminas\Paginator\Paginator;
|
| 43 |
use LeadersLinked\Model\CompanyMicrolearningUserProgress;
|
43 |
use LeadersLinked\Model\MicrolearningUserProgress;
|
| 44 |
use PhpOffice\PhpSpreadsheet\IOFactory;
|
44 |
use PhpOffice\PhpSpreadsheet\IOFactory;
|
| 45 |
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
45 |
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
| 46 |
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
46 |
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
| 47 |
use PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace;
|
47 |
use PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace;
|
| 48 |
use LeadersLinked\Form\TopicReportForm;
|
48 |
use LeadersLinked\Form\TopicReportForm;
|
| Línea 130... |
Línea 130... |
| 130 |
if($request->isGet()) {
|
130 |
if($request->isGet()) {
|
| 131 |
$reportsLastWeek = [];
|
131 |
$reportsLastWeek = [];
|
| 132 |
$reportsCapsuleResume = [];
|
132 |
$reportsCapsuleResume = [];
|
| 133 |
$reportsStudentsTotal = [];
|
133 |
$reportsStudentsTotal = [];
|
| Línea 134... |
Línea 134... |
| 134 |
|
134 |
|
| 135 |
$companyMicrolearningExtendUserCompanyMapper = CompanyMicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
135 |
$microlearningExtendUserCompanyMapper = MicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
| Línea 136... |
Línea 136... |
| 136 |
$extendCompanies = $companyMicrolearningExtendUserCompanyMapper->fetchAllByCompanyId($currentCompany->id);
|
136 |
$extendCompanies = $microlearningExtendUserCompanyMapper->fetchAllByCompanyId($currentCompany->id);
|
| 137 |
|
137 |
|
| 138 |
foreach($extendCompanies as $extendCompany)
|
138 |
foreach($extendCompanies as $extendCompany)
|
| 139 |
{
|
139 |
{
|
| Línea 154... |
Línea 154... |
| 154 |
'total' => 0,
|
154 |
'total' => 0,
|
| 155 |
] ;
|
155 |
] ;
|
| 156 |
}
|
156 |
}
|
| Línea 157... |
Línea 157... |
| 157 |
|
157 |
|
| 158 |
|
158 |
|
| Línea 159... |
Línea 159... |
| 159 |
$companyMicrolearningExtendUserFunctionMapper = CompanyMicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
159 |
$microlearningExtendUserFunctionMapper = MicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
| 160 |
$extendFunctions = $companyMicrolearningExtendUserFunctionMapper->fetchAllByCompanyId($currentCompany->id);
|
160 |
$extendFunctions = $microlearningExtendUserFunctionMapper->fetchAllByCompanyId($currentCompany->id);
|
| 161 |
|
161 |
|
| 162 |
foreach($extendFunctions as $extendFunction)
|
162 |
foreach($extendFunctions as $extendFunction)
|
| Línea 177... |
Línea 177... |
| 177 |
'name' => $extendFunction->name,
|
177 |
'name' => $extendFunction->name,
|
| 178 |
'total' => 0,
|
178 |
'total' => 0,
|
| 179 |
] ;
|
179 |
] ;
|
| 180 |
}
|
180 |
}
|
| Línea 181... |
Línea 181... |
| 181 |
|
181 |
|
| 182 |
$companyMicrolearningExtendUserGroupMapper = CompanyMicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
182 |
$microlearningExtendUserGroupMapper = MicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
| Línea 183... |
Línea 183... |
| 183 |
$extendGroups = $companyMicrolearningExtendUserGroupMapper->fetchAllByCompanyId($currentCompany->id);
|
183 |
$extendGroups = $microlearningExtendUserGroupMapper->fetchAllByCompanyId($currentCompany->id);
|
| 184 |
|
184 |
|
| 185 |
foreach($extendGroups as $extendGroup)
|
185 |
foreach($extendGroups as $extendGroup)
|
| 186 |
{
|
186 |
{
|
| Línea 203... |
Línea 203... |
| 203 |
|
203 |
|
| Línea 204... |
Línea 204... |
| 204 |
|
204 |
|
| 205 |
}
|
205 |
}
|
| Línea 206... |
Línea 206... |
| 206 |
|
206 |
|
| 207 |
|
207 |
|
| 208 |
$companyMicrolearningExtendUserInstitutionMapper = CompanyMicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
208 |
$microlearningExtendUserInstitutionMapper = MicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
| 209 |
$extendInstitutions = $companyMicrolearningExtendUserInstitutionMapper->fetchAllByCompanyId($currentCompany->id);
|
209 |
$extendInstitutions = $microlearningExtendUserInstitutionMapper->fetchAllByCompanyId($currentCompany->id);
|
| Línea 227... |
Línea 227... |
| 227 |
'total' => 0,
|
227 |
'total' => 0,
|
| 228 |
] ;
|
228 |
] ;
|
| 229 |
}
|
229 |
}
|
| Línea 230... |
Línea 230... |
| 230 |
|
230 |
|
| 231 |
|
231 |
|
| Línea 232... |
Línea 232... |
| 232 |
$companyMicrolearningExtendUserProgramMapper = CompanyMicrolearningExtendUserProgramMapper::getInstance($this->adapter);
|
232 |
$microlearningExtendUserProgramMapper = MicrolearningExtendUserProgramMapper::getInstance($this->adapter);
|
| 233 |
$extendPrograms = $companyMicrolearningExtendUserProgramMapper->fetchAllByCompanyId($currentCompany->id);
|
233 |
$extendPrograms = $microlearningExtendUserProgramMapper->fetchAllByCompanyId($currentCompany->id);
|
| 234 |
|
234 |
|
| 235 |
foreach($extendPrograms as $extendProgram)
|
235 |
foreach($extendPrograms as $extendProgram)
|
| Línea 252... |
Línea 252... |
| 252 |
|
252 |
|
| 253 |
] ;
|
253 |
] ;
|
| Línea 254... |
Línea 254... |
| 254 |
}
|
254 |
}
|
| 255 |
|
255 |
|
| Línea 256... |
Línea 256... |
| 256 |
|
256 |
|
| 257 |
$companyMicrolearningExtendUserPartnerMapper = CompanyMicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
257 |
$microlearningExtendUserPartnerMapper = MicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
| 258 |
$extendPartners = $companyMicrolearningExtendUserPartnerMapper->fetchAllByCompanyId($currentCompany->id);
|
258 |
$extendPartners = $microlearningExtendUserPartnerMapper->fetchAllByCompanyId($currentCompany->id);
|
| 259 |
|
259 |
|
| Línea 276... |
Línea 276... |
| 276 |
'total' => 0,
|
276 |
'total' => 0,
|
| 277 |
] ;
|
277 |
] ;
|
| 278 |
}
|
278 |
}
|
| Línea 279... |
Línea 279... |
| 279 |
|
279 |
|
| 280 |
|
280 |
|
| Línea 281... |
Línea 281... |
| 281 |
$companyMicrolearningExtendUserSectorMapper = CompanyMicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
281 |
$microlearningExtendUserSectorMapper = MicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
| 282 |
$extendSectors = $companyMicrolearningExtendUserSectorMapper->fetchAllByCompanyId($currentCompany->id);
|
282 |
$extendSectors = $microlearningExtendUserSectorMapper->fetchAllByCompanyId($currentCompany->id);
|
| 283 |
|
283 |
|
| 284 |
foreach($extendSectors as $extendSector)
|
284 |
foreach($extendSectors as $extendSector)
|
| Línea 299... |
Línea 299... |
| 299 |
'name' => $extendSector->name,
|
299 |
'name' => $extendSector->name,
|
| 300 |
'total' => 0,
|
300 |
'total' => 0,
|
| 301 |
] ;
|
301 |
] ;
|
| 302 |
}
|
302 |
}
|
| Línea 303... |
Línea 303... |
| 303 |
|
303 |
|
| 304 |
$companyMicrolearningExtendUserStudentTypeMapper = CompanyMicrolearningExtendUserStudentTypeMapper::getInstance($this->adapter);
|
304 |
$microlearningExtendUserStudentTypeMapper = MicrolearningExtendUserStudentTypeMapper::getInstance($this->adapter);
|
| Línea 305... |
Línea 305... |
| 305 |
$extendStudentTypes = $companyMicrolearningExtendUserStudentTypeMapper->fetchAllByCompanyId($currentCompany->id);
|
305 |
$extendStudentTypes = $microlearningExtendUserStudentTypeMapper->fetchAllByCompanyId($currentCompany->id);
|
| 306 |
|
306 |
|
| 307 |
foreach($extendStudentTypes as $extendStudentType)
|
307 |
foreach($extendStudentTypes as $extendStudentType)
|
| 308 |
{
|
308 |
{
|
| Línea 322... |
Línea 322... |
| 322 |
'name' => $extendStudentType->name,
|
322 |
'name' => $extendStudentType->name,
|
| 323 |
'total' => 0,
|
323 |
'total' => 0,
|
| 324 |
] ;
|
324 |
] ;
|
| 325 |
}
|
325 |
}
|
| Línea 326... |
Línea 326... |
| 326 |
|
326 |
|
| Línea 327... |
Línea 327... |
| 327 |
$companyMicrolearningUserProgressMapper = CompanyMicrolearningUserProgressMapper::getInstance($this->adapter);
|
327 |
$microlearningUserProgressMapper = MicrolearningUserProgressMapper::getInstance($this->adapter);
|
| 328 |
|
328 |
|
| 329 |
$minLastWeek = date('Y-m-d', strtotime(' -180 days'));
|
329 |
$minLastWeek = date('Y-m-d', strtotime(' -180 days'));
|
| 330 |
$maxLastWeek = date('Y-m-d');
|
330 |
$maxLastWeek = date('Y-m-d');
|
| Línea 331... |
Línea -... |
| 331 |
$companyMicrolearningUserLogMapper = CompanyMicrolearningUserLogMapper::getInstance($this->adapter);
|
- |
|
| 332 |
$companyUsersLogWithActivityLastWeek = $companyMicrolearningUserLogMapper->fetchAllUserIdsLastWeekByCompanyId($currentCompany->id, $minLastWeek, $maxLastWeek);
|
- |
|
| 333 |
|
- |
|
| 334 |
//header('Content-type: text/plain');
|
- |
|
| 335 |
// print_r($companyUsersLogWithActivityLastWeek);
|
- |
|
| Línea 336... |
Línea 331... |
| 336 |
|
331 |
$microlearningUserLogMapper = MicrolearningUserLogMapper::getInstance($this->adapter);
|
| Línea 337... |
Línea 332... |
| 337 |
|
332 |
$companyUsersLogWithActivityLastWeek = $microlearningUserLogMapper->fetchAllUserIdsLastWeekByCompanyId($currentCompany->id, $minLastWeek, $maxLastWeek);
|
| 338 |
|
333 |
|
| Línea 339... |
Línea 334... |
| 339 |
|
334 |
|
| 340 |
$date = date('Y-m-d');
|
335 |
$date = date('Y-m-d');
|
| Línea 341... |
Línea 336... |
| 341 |
|
336 |
|
| Línea 342... |
Línea 337... |
| 342 |
$companyMicrolearningCapsuleUserMapper = CompanyMicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
337 |
$microlearningCapsuleUserMapper = MicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
| 343 |
$user_ids = $companyMicrolearningCapsuleUserMapper->fetchAllDistinctUserIdActiveByCompanyIdAndDate($currentCompany->id, $date);
|
338 |
$user_ids = $microlearningCapsuleUserMapper->fetchAllDistinctUserIdActiveByCompanyIdAndDate($currentCompany->id, $date);
|
| 344 |
|
339 |
|
| 345 |
$studentsTotal = count($user_ids);
|
340 |
$studentsTotal = count($user_ids);
|
| 346 |
$studentsStarted = 0;
|
341 |
$studentsStarted = 0;
|
| 347 |
|
342 |
|
| Línea 348... |
Línea 343... |
| 348 |
|
343 |
|
| Línea 349... |
Línea 344... |
| 349 |
$userIdsWithAllCapsulesCompleted = [];
|
344 |
$userIdsWithAllCapsulesCompleted = [];
|
| 350 |
|
345 |
|
| 351 |
|
346 |
|
| 352 |
foreach($user_ids as $user_id)
|
347 |
foreach($user_ids as $user_id)
|
| 353 |
{
|
348 |
{
|
| 354 |
$countSlides = $companyMicrolearningUserProgressMapper->fetchCountAllSlideCompletedByCompanyIdAndUserId($currentCompany->id, $user_id);
|
349 |
$countSlides = $microlearningUserProgressMapper->fetchCountAllSlideCompletedByCompanyIdAndUserId($currentCompany->id, $user_id);
|
| 355 |
if($countSlides) {
|
350 |
if($countSlides) {
|
| 356 |
$studentsStarted++;
|
351 |
$studentsStarted++;
|
| 357 |
}
|
352 |
}
|
| Línea 386... |
Línea 381... |
| 386 |
$reportsLastWeek['general'] = ['total' => $studentsTotal, 'value' => count($companyUsersLogWithActivityLastWeek) ];
|
381 |
$reportsLastWeek['general'] = ['total' => $studentsTotal, 'value' => count($companyUsersLogWithActivityLastWeek) ];
|
| Línea 387... |
Línea 382... |
| 387 |
|
382 |
|
| Línea 388... |
Línea 383... |
| 388 |
$reportsCapsuleResume['general'] = ['total' => $studentsTotal, 'value' => count($userIdsWithAllCapsulesCompleted) ];
|
383 |
$reportsCapsuleResume['general'] = ['total' => $studentsTotal, 'value' => count($userIdsWithAllCapsulesCompleted) ];
|
| 389 |
|
384 |
|
| 390 |
|
385 |
|
| 391 |
$companyMicrolearningExtendUserMapper = CompanyMicrolearningExtendUserMapper::getInstance($this->adapter);
|
386 |
$microlearningExtendUserMapper = MicrolearningExtendUserMapper::getInstance($this->adapter);
|
| Línea 392... |
Línea 387... |
| 392 |
$records = $companyMicrolearningExtendUserMapper->fetchAllByCompanyId($currentCompany->id);
|
387 |
$records = $microlearningExtendUserMapper->fetchAllByCompanyId($currentCompany->id);
|
| 393 |
foreach($records as $record)
|
388 |
foreach($records as $record)
|
| Línea 501... |
Línea 496... |
| 501 |
}
|
496 |
}
|
| 502 |
}
|
497 |
}
|
| 503 |
}
|
498 |
}
|
| Línea 504... |
Línea -... |
| 504 |
|
- |
|
| 505 |
|
- |
|
| 506 |
/*
|
- |
|
| 507 |
header('Content-type: text/plain');
|
- |
|
| Línea 508... |
Línea 499... |
| 508 |
print_r($reportsStudentsTotal); exit;
|
499 |
|
| 509 |
*/
|
500 |
|
| 510 |
|
501 |
|
| Línea 571... |
Línea 562... |
| 571 |
|
562 |
|
| Línea 572... |
Línea 563... |
| 572 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
563 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 573 |
|
564 |
|
| 574 |
$selectUsers = $queryMapper->getSql()->select();
|
565 |
$selectUsers = $queryMapper->getSql()->select();
|
| 575 |
$selectUsers->columns(['user_id' => new Expression('DISTINCT(user_id)')]);
|
566 |
$selectUsers->columns(['user_id' => new Expression('DISTINCT(user_id)')]);
|
| Línea 594... |
Línea 585... |
| 594 |
// echo $select->getSqlString($this->adapter->platform); exit;
|
585 |
// echo $select->getSqlString($this->adapter->platform); exit;
|
| Línea 595... |
Línea 586... |
| 595 |
|
586 |
|
| 596 |
|
587 |
|
| Línea 597... |
Línea 588... |
| 597 |
|
588 |
|
| Línea 598... |
Línea 589... |
| 598 |
|
589 |
|
| Línea 599... |
Línea 590... |
| 599 |
$companyMicrolearningProgressMapper = CompanyMicrolearningUserProgressMapper::getInstance($this->adapter);
|
590 |
$microlearningProgressMapper = MicrolearningUserProgressMapper::getInstance($this->adapter);
|
| Línea 612... |
Línea 603... |
| 612 |
|
603 |
|
| 613 |
foreach($records as $record)
|
604 |
foreach($records as $record)
|
| Línea 614... |
Línea 605... |
| 614 |
{
|
605 |
{
|
| Línea 615... |
Línea 606... |
| 615 |
|
606 |
|
| 616 |
|
607 |
|
| Línea 628... |
Línea 619... |
| 628 |
|
619 |
|
| 629 |
|
620 |
|
| 630 |
|
621 |
|
| Línea 631... |
Línea 622... |
| 631 |
foreach($capsules as $capsule)
|
622 |
foreach($capsules as $capsule)
|
| 632 |
{
|
623 |
{
|
| 633 |
$userProgress = $companyMicrolearningProgressMapper->fetchOneByUseridAndCapsuleId($capsule->user_id, $capsule->capsule_id);
|
624 |
$userProgress = $microlearningProgressMapper->fetchOneByUseridAndCapsuleId($capsule->user_id, $capsule->capsule_id);
|
| Línea 671... |
Línea 662... |
| 671 |
'first_time' => '',
|
662 |
'first_time' => '',
|
| 672 |
'last_date' => '',
|
663 |
'last_date' => '',
|
| 673 |
'last_time' => '',
|
664 |
'last_time' => '',
|
| 674 |
];
|
665 |
];
|
| Línea 675... |
Línea 666... |
| 675 |
|
666 |
|
| 676 |
$first_added_on = $companyMicrolearningUserLogMapper->fetchFirstDateByCompanyIdAndUserId($currentCompany->id, $record['id']);
|
667 |
$first_added_on = $microlearningUserLogMapper->fetchFirstDateByCompanyIdAndUserId($currentCompany->id, $record['id']);
|
| 677 |
if($first_added_on) {
|
668 |
if($first_added_on) {
|
| 678 |
$dt = \DateTime::createFromFormat('Y-m-d H:i:s', $first_added_on);
|
669 |
$dt = \DateTime::createFromFormat('Y-m-d H:i:s', $first_added_on);
|
| 679 |
if($dt) {
|
670 |
if($dt) {
|
| 680 |
$student['first_date'] = $dt->format('d/m/Y');
|
671 |
$student['first_date'] = $dt->format('d/m/Y');
|
| 681 |
$student['first_time'] = $dt->format('h:i a');
|
672 |
$student['first_time'] = $dt->format('h:i a');
|
| 682 |
}
|
673 |
}
|
| Línea 683... |
Línea 674... |
| 683 |
}
|
674 |
}
|
| 684 |
|
675 |
|
| 685 |
$last_added_on = $companyMicrolearningUserLogMapper->fetchLastDateByCompanyIdAndUserId($currentCompany->id, $record['id']);
|
676 |
$last_added_on = $microlearningUserLogMapper->fetchLastDateByCompanyIdAndUserId($currentCompany->id, $record['id']);
|
| 686 |
if($last_added_on) {
|
677 |
if($last_added_on) {
|
| 687 |
$dt = \DateTime::createFromFormat('Y-m-d H:i:s', $last_added_on);
|
678 |
$dt = \DateTime::createFromFormat('Y-m-d H:i:s', $last_added_on);
|
| 688 |
if($dt) {
|
679 |
if($dt) {
|
| Línea 694... |
Línea 685... |
| 694 |
array_push($students, $student);
|
685 |
array_push($students, $student);
|
| Línea 695... |
Línea 686... |
| 695 |
|
686 |
|
| 696 |
|
- |
|
| 697 |
|
687 |
|
| 698 |
}
|
- |
|
| 699 |
|
- |
|
| 700 |
|
- |
|
| 701 |
//print_r($students);
|
- |
|
| 702 |
|
688 |
|
| 703 |
|
689 |
}
|
| 704 |
|
690 |
|
| Línea 705... |
Línea 691... |
| 705 |
return new JsonModel([
|
691 |
return new JsonModel([
|
| Línea 777... |
Línea 763... |
| 777 |
$sector_id = Functions::sanitizeFilterString($this->params()->fromQuery('sector_id', ''));
|
763 |
$sector_id = Functions::sanitizeFilterString($this->params()->fromQuery('sector_id', ''));
|
| 778 |
$student_type_id = Functions::sanitizeFilterString($this->params()->fromQuery('student_type_id', ''));
|
764 |
$student_type_id = Functions::sanitizeFilterString($this->params()->fromQuery('student_type_id', ''));
|
| Línea 779... |
Línea 765... |
| 779 |
|
765 |
|
| 780 |
|
766 |
|
| 781 |
if($company_id) {
|
767 |
if($company_id) {
|
| Línea 782... |
Línea 768... |
| 782 |
$extendUserCompanyMapper = CompanyMicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
768 |
$extendUserCompanyMapper = MicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
| 783 |
$extendUserCompany = $extendUserCompanyMapper->fetchOneByUuid($company_id);
|
769 |
$extendUserCompany = $extendUserCompanyMapper->fetchOneByUuid($company_id);
|
| 784 |
|
770 |
|
| 785 |
if($extendUserCompany) {
|
771 |
if($extendUserCompany) {
|
| 786 |
$company_id = $extendUserCompany->id;
|
772 |
$company_id = $extendUserCompany->id;
|
| 787 |
} else {
|
773 |
} else {
|
| Línea 788... |
Línea 774... |
| 788 |
$company_id = 0;
|
774 |
$company_id = 0;
|
| 789 |
}
|
775 |
}
|
| 790 |
}
|
776 |
}
|
| Línea 791... |
Línea 777... |
| 791 |
|
777 |
|
| 792 |
if($function_id) {
|
778 |
if($function_id) {
|
| 793 |
$extendUserFunctionMapper = CompanyMicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
779 |
$extendUserFunctionMapper = MicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
| 794 |
$extendUserFunction = $extendUserFunctionMapper->fetchOneByUuid($function_id);
|
780 |
$extendUserFunction = $extendUserFunctionMapper->fetchOneByUuid($function_id);
|
| 795 |
|
781 |
|
| 796 |
if($extendUserFunction) {
|
782 |
if($extendUserFunction) {
|
| Línea 797... |
Línea 783... |
| 797 |
$function_id = $extendUserFunction->id;
|
783 |
$function_id = $extendUserFunction->id;
|
| 798 |
} else {
|
784 |
} else {
|
| 799 |
$function_id = 0;
|
785 |
$function_id = 0;
|
| Línea 800... |
Línea 786... |
| 800 |
}
|
786 |
}
|
| 801 |
}
|
787 |
}
|
| 802 |
|
788 |
|
| 803 |
if($group_id) {
|
789 |
if($group_id) {
|
| 804 |
$extendUserGroupMapper = CompanyMicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
790 |
$extendUserGroupMapper = MicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
| 805 |
$extendUserGroup = $extendUserGroupMapper->fetchOneByUuid($group_id);
|
791 |
$extendUserGroup = $extendUserGroupMapper->fetchOneByUuid($group_id);
|
| Línea 806... |
Línea 792... |
| 806 |
|
792 |
|
| 807 |
if($extendUserGroup) {
|
793 |
if($extendUserGroup) {
|
| 808 |
$group_id = $extendUserGroup->id;
|
794 |
$group_id = $extendUserGroup->id;
|
| 809 |
} else {
|
795 |
} else {
|
| 810 |
$group_id = 0;
|
796 |
$group_id = 0;
|
| 811 |
}
|
797 |
}
|
| 812 |
}
|
798 |
}
|
| 813 |
|
799 |
|
| 814 |
if($institution_id) {
|
800 |
if($institution_id) {
|
| Línea 815... |
Línea 801... |
| 815 |
$extendUserInstitutionMapper = CompanyMicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
801 |
$extendUserInstitutionMapper = MicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
| 816 |
$extendUserInstitution = $extendUserInstitutionMapper->fetchOneByUuid($institution_id);
|
802 |
$extendUserInstitution = $extendUserInstitutionMapper->fetchOneByUuid($institution_id);
|
| 817 |
if($extendUserInstitution) {
|
803 |
if($extendUserInstitution) {
|
| Línea 818... |
Línea 804... |
| 818 |
$institution_id = $extendUserInstitution->id;
|
804 |
$institution_id = $extendUserInstitution->id;
|
| 819 |
} else {
|
805 |
} else {
|
| 820 |
$institution_id = 0;
|
806 |
$institution_id = 0;
|
| Línea 833... |
Línea 819... |
| 833 |
|
819 |
|
| Línea 834... |
Línea 820... |
| 834 |
|
820 |
|
| 835 |
}
|
821 |
}
|
| 836 |
|
822 |
|
| 837 |
if($partner_id) {
|
823 |
if($partner_id) {
|
| 838 |
$extendUserPartnerMapper = CompanyMicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
824 |
$extendUserPartnerMapper = MicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
| 839 |
$extendUserPartner = $extendUserPartnerMapper->fetchOneByUuid($partner_id);
|
825 |
$extendUserPartner = $extendUserPartnerMapper->fetchOneByUuid($partner_id);
|
| 840 |
if($extendUserPartner) {
|
826 |
if($extendUserPartner) {
|
| 841 |
$partner_id = $extendUserPartner;
|
827 |
$partner_id = $extendUserPartner;
|
| 842 |
} else {
|
828 |
} else {
|
| Línea 843... |
Línea 829... |
| 843 |
$partner_id = 0;
|
829 |
$partner_id = 0;
|
| 844 |
}
|
830 |
}
|
| 845 |
}
|
831 |
}
|
| 846 |
|
832 |
|
| 847 |
if($sector_id) {
|
833 |
if($sector_id) {
|
| 848 |
$extendUserSectorMapper = CompanyMicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
834 |
$extendUserSectorMapper = MicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
| 849 |
$extendUserSector = $extendUserSectorMapper->fetchOneByUuid($sector_id);
|
835 |
$extendUserSector = $extendUserSectorMapper->fetchOneByUuid($sector_id);
|
| 850 |
if($extendUserSector) {
|
836 |
if($extendUserSector) {
|
| 851 |
$sector_id = $extendUserSector->id;
|
837 |
$sector_id = $extendUserSector->id;
|
| Línea 852... |
Línea 838... |
| 852 |
} else {
|
838 |
} else {
|
| 853 |
$sector_id = 0;
|
839 |
$sector_id = 0;
|
| 854 |
}
|
840 |
}
|
| Línea 855... |
Línea 841... |
| 855 |
}
|
841 |
}
|
| 856 |
|
842 |
|
| 857 |
if($student_type_id) {
|
843 |
if($student_type_id) {
|
| Línea 898... |
Línea 884... |
| 898 |
|
884 |
|
| Línea 899... |
Línea 885... |
| 899 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
885 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 900 |
|
886 |
|
| 901 |
$selectCapsuleUser = $queryMapper->getSql()->select();
|
887 |
$selectCapsuleUser = $queryMapper->getSql()->select();
|
| 902 |
$selectCapsuleUser->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
888 |
$selectCapsuleUser->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
| 903 |
$selectCapsuleUser->from(CompanyMicrolearningCapsuleUserMapper::_TABLE);
|
889 |
$selectCapsuleUser->from(MicrolearningCapsuleUserMapper::_TABLE);
|
| 904 |
$selectCapsuleUser->where->equalTo('company_id', $currentCompany->id);
|
890 |
$selectCapsuleUser->where->equalTo('company_id', $currentCompany->id);
|
| 905 |
$selectCapsuleUser->where->nest->equalTo('access', CompanyMicrolearningCapsuleUser::ACCESS_UNLIMITED)->or->nest()
|
891 |
$selectCapsuleUser->where->nest->equalTo('access', MicrolearningCapsuleUser::ACCESS_UNLIMITED)->or->nest()
|
| 906 |
->equalTo('access', CompanyMicrolearningCapsuleUser::ACCESS_PAY_PERIOD)
|
892 |
->equalTo('access', MicrolearningCapsuleUser::ACCESS_PAY_PERIOD)
|
| Línea 907... |
Línea 893... |
| 907 |
->and->lessThanOrEqualTo(new Expression('DATE(paid_from)'), $date)
|
893 |
->and->lessThanOrEqualTo(new Expression('DATE(paid_from)'), $date)
|
| Línea 908... |
Línea 894... |
| 908 |
->and->greaterThanOrEqualTo(new Expression('DATE(paid_to)'), $date )->unnest()->unnest();
|
894 |
->and->greaterThanOrEqualTo(new Expression('DATE(paid_to)'), $date )->unnest()->unnest();
|
| 909 |
|
895 |
|
| 910 |
//echo $selectCapsuleUser->getSqlString($this->adapter->platform); exit;
|
896 |
//echo $selectCapsuleUser->getSqlString($this->adapter->platform); exit;
|
| 911 |
|
897 |
|
| Línea 912... |
Línea 898... |
| 912 |
$select = $queryMapper->getSql()->select();
|
898 |
$select = $queryMapper->getSql()->select();
|
| Línea 913... |
Línea 899... |
| 913 |
$select->columns(['id' , 'uuid', 'first_name', 'last_name', 'email']);
|
899 |
$select->columns(['id' , 'uuid', 'first_name', 'last_name', 'email']);
|
| Línea 914... |
Línea 900... |
| 914 |
$select->from([ 'u' => UserMapper::_TABLE]);
|
900 |
$select->from([ 'u' => UserMapper::_TABLE]);
|
| 915 |
if( $company_id || $function_id || $group_id || $institution_id || $program_id || $partner_id || $sector_id || $student_type_id ) {
|
901 |
if( $company_id || $function_id || $group_id || $institution_id || $program_id || $partner_id || $sector_id || $student_type_id ) {
|
| Línea 1059... |
Línea 1045... |
| 1059 |
$sector_id = Functions::sanitizeFilterString($this->params()->fromQuery('sector_id', ''));
|
1045 |
$sector_id = Functions::sanitizeFilterString($this->params()->fromQuery('sector_id', ''));
|
| 1060 |
$student_type_id = Functions::sanitizeFilterString($this->params()->fromQuery('student_type_id', ''));
|
1046 |
$student_type_id = Functions::sanitizeFilterString($this->params()->fromQuery('student_type_id', ''));
|
| Línea 1061... |
Línea 1047... |
| 1061 |
|
1047 |
|
| 1062 |
|
1048 |
|
| 1063 |
if($company_id) {
|
1049 |
if($company_id) {
|
| Línea 1064... |
Línea 1050... |
| 1064 |
$extendUserCompanyMapper = CompanyMicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
1050 |
$extendUserCompanyMapper = MicrolearningExtendUserCompanyMapper::getInstance($this->adapter);
|
| 1065 |
$extendUserCompany = $extendUserCompanyMapper->fetchOneByUuid($company_id);
|
1051 |
$extendUserCompany = $extendUserCompanyMapper->fetchOneByUuid($company_id);
|
| 1066 |
|
1052 |
|
| 1067 |
if($extendUserCompany) {
|
1053 |
if($extendUserCompany) {
|
| 1068 |
$company_id = $extendUserCompany->id;
|
1054 |
$company_id = $extendUserCompany->id;
|
| 1069 |
} else {
|
1055 |
} else {
|
| Línea 1070... |
Línea 1056... |
| 1070 |
$company_id = 0;
|
1056 |
$company_id = 0;
|
| 1071 |
}
|
1057 |
}
|
| 1072 |
}
|
1058 |
}
|
| Línea 1073... |
Línea 1059... |
| 1073 |
|
1059 |
|
| 1074 |
if($function_id) {
|
1060 |
if($function_id) {
|
| 1075 |
$extendUserFunctionMapper = CompanyMicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
1061 |
$extendUserFunctionMapper = MicrolearningExtendUserFunctionMapper::getInstance($this->adapter);
|
| 1076 |
$extendUserFunction = $extendUserFunctionMapper->fetchOneByUuid($function_id);
|
1062 |
$extendUserFunction = $extendUserFunctionMapper->fetchOneByUuid($function_id);
|
| 1077 |
|
1063 |
|
| 1078 |
if($extendUserFunction) {
|
1064 |
if($extendUserFunction) {
|
| Línea 1079... |
Línea 1065... |
| 1079 |
$function_id = $extendUserFunction->id;
|
1065 |
$function_id = $extendUserFunction->id;
|
| 1080 |
} else {
|
1066 |
} else {
|
| 1081 |
$function_id = 0;
|
1067 |
$function_id = 0;
|
| Línea 1082... |
Línea 1068... |
| 1082 |
}
|
1068 |
}
|
| 1083 |
}
|
1069 |
}
|
| 1084 |
|
1070 |
|
| 1085 |
if($group_id) {
|
1071 |
if($group_id) {
|
| 1086 |
$extendUserGroupMapper = CompanyMicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
1072 |
$extendUserGroupMapper = MicrolearningExtendUserGroupMapper::getInstance($this->adapter);
|
| 1087 |
$extendUserGroup = $extendUserGroupMapper->fetchOneByUuid($group_id);
|
1073 |
$extendUserGroup = $extendUserGroupMapper->fetchOneByUuid($group_id);
|
| Línea 1088... |
Línea 1074... |
| 1088 |
|
1074 |
|
| 1089 |
if($extendUserGroup) {
|
1075 |
if($extendUserGroup) {
|
| 1090 |
$group_id = $extendUserGroup->id;
|
1076 |
$group_id = $extendUserGroup->id;
|
| 1091 |
} else {
|
1077 |
} else {
|
| 1092 |
$group_id = 0;
|
1078 |
$group_id = 0;
|
| 1093 |
}
|
1079 |
}
|
| 1094 |
}
|
1080 |
}
|
| 1095 |
|
1081 |
|
| 1096 |
if($institution_id) {
|
1082 |
if($institution_id) {
|
| Línea 1097... |
Línea 1083... |
| 1097 |
$extendUserInstitutionMapper = CompanyMicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
1083 |
$extendUserInstitutionMapper = MicrolearningExtendUserInstitutionMapper::getInstance($this->adapter);
|
| 1098 |
$extendUserInstitution = $extendUserInstitutionMapper->fetchOneByUuid($institution_id);
|
1084 |
$extendUserInstitution = $extendUserInstitutionMapper->fetchOneByUuid($institution_id);
|
| 1099 |
if($extendUserInstitution) {
|
1085 |
if($extendUserInstitution) {
|
| Línea 1100... |
Línea 1086... |
| 1100 |
$institution_id = $extendUserInstitution->id;
|
1086 |
$institution_id = $extendUserInstitution->id;
|
| 1101 |
} else {
|
1087 |
} else {
|
| 1102 |
$institution_id = 0;
|
1088 |
$institution_id = 0;
|
| Línea 1115... |
Línea 1101... |
| 1115 |
|
1101 |
|
| Línea 1116... |
Línea 1102... |
| 1116 |
|
1102 |
|
| 1117 |
}
|
1103 |
}
|
| 1118 |
|
1104 |
|
| 1119 |
if($partner_id) {
|
1105 |
if($partner_id) {
|
| 1120 |
$extendUserPartnerMapper = CompanyMicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
1106 |
$extendUserPartnerMapper = MicrolearningExtendUserPartnerMapper::getInstance($this->adapter);
|
| 1121 |
$extendUserPartner = $extendUserPartnerMapper->fetchOneByUuid($partner_id);
|
1107 |
$extendUserPartner = $extendUserPartnerMapper->fetchOneByUuid($partner_id);
|
| 1122 |
if($extendUserPartner) {
|
1108 |
if($extendUserPartner) {
|
| 1123 |
$partner_id = $extendUserPartner;
|
1109 |
$partner_id = $extendUserPartner;
|
| 1124 |
} else {
|
1110 |
} else {
|
| Línea 1125... |
Línea 1111... |
| 1125 |
$partner_id = 0;
|
1111 |
$partner_id = 0;
|
| 1126 |
}
|
1112 |
}
|
| 1127 |
}
|
1113 |
}
|
| 1128 |
|
1114 |
|
| 1129 |
if($sector_id) {
|
1115 |
if($sector_id) {
|
| 1130 |
$extendUserSectorMapper = CompanyMicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
1116 |
$extendUserSectorMapper = MicrolearningExtendUserSectorMapper::getInstance($this->adapter);
|
| 1131 |
$extendUserSector = $extendUserSectorMapper->fetchOneByUuid($sector_id);
|
1117 |
$extendUserSector = $extendUserSectorMapper->fetchOneByUuid($sector_id);
|
| 1132 |
if($extendUserSector) {
|
1118 |
if($extendUserSector) {
|
| 1133 |
$sector_id = $extendUserSector->id;
|
1119 |
$sector_id = $extendUserSector->id;
|
| Línea 1134... |
Línea 1120... |
| 1134 |
} else {
|
1120 |
} else {
|
| 1135 |
$sector_id = 0;
|
1121 |
$sector_id = 0;
|
| 1136 |
}
|
1122 |
}
|
| Línea 1137... |
Línea 1123... |
| 1137 |
}
|
1123 |
}
|
| 1138 |
|
1124 |
|
| 1139 |
if($student_type_id) {
|
1125 |
if($student_type_id) {
|
| Línea 1180... |
Línea 1166... |
| 1180 |
|
1166 |
|
| Línea 1181... |
Línea 1167... |
| 1181 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
1167 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 1182 |
|
1168 |
|
| 1183 |
$selectCapsuleUser = $queryMapper->getSql()->select();
|
1169 |
$selectCapsuleUser = $queryMapper->getSql()->select();
|
| 1184 |
$selectCapsuleUser->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
1170 |
$selectCapsuleUser->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
| 1185 |
$selectCapsuleUser->from(CompanyMicrolearningCapsuleUserMapper::_TABLE);
|
1171 |
$selectCapsuleUser->from(MicrolearningCapsuleUserMapper::_TABLE);
|
| 1186 |
$selectCapsuleUser->where->equalTo('company_id', $currentCompany->id);
|
1172 |
$selectCapsuleUser->where->equalTo('company_id', $currentCompany->id);
|
| 1187 |
$selectCapsuleUser->where->nest->equalTo('access', CompanyMicrolearningCapsuleUser::ACCESS_UNLIMITED)->or->nest()
|
1173 |
$selectCapsuleUser->where->nest->equalTo('access', MicrolearningCapsuleUser::ACCESS_UNLIMITED)->or->nest()
|
| 1188 |
->equalTo('access', CompanyMicrolearningCapsuleUser::ACCESS_PAY_PERIOD)
|
1174 |
->equalTo('access', MicrolearningCapsuleUser::ACCESS_PAY_PERIOD)
|
| Línea 1189... |
Línea 1175... |
| 1189 |
->and->lessThanOrEqualTo(new Expression('DATE(paid_from)'), $date)
|
1175 |
->and->lessThanOrEqualTo(new Expression('DATE(paid_from)'), $date)
|
| Línea 1190... |
Línea 1176... |
| 1190 |
->and->greaterThanOrEqualTo(new Expression('DATE(paid_to)'), $date )->unnest()->unnest();
|
1176 |
->and->greaterThanOrEqualTo(new Expression('DATE(paid_to)'), $date )->unnest()->unnest();
|
| 1191 |
|
1177 |
|
| 1192 |
//echo $selectCapsuleUser->getSqlString($this->adapter->platform); exit;
|
1178 |
//echo $selectCapsuleUser->getSqlString($this->adapter->platform); exit;
|
| 1193 |
|
1179 |
|
| Línea 1194... |
Línea 1180... |
| 1194 |
$select = $queryMapper->getSql()->select();
|
1180 |
$select = $queryMapper->getSql()->select();
|
| Línea 1195... |
Línea 1181... |
| 1195 |
$select->columns(['id' , 'uuid', 'first_name', 'last_name', 'email']);
|
1181 |
$select->columns(['id' , 'uuid', 'first_name', 'last_name', 'email']);
|
| Línea 1196... |
Línea 1182... |
| 1196 |
$select->from([ 'u' => UserMapper::_TABLE]);
|
1182 |
$select->from([ 'u' => UserMapper::_TABLE]);
|
| 1197 |
if( $company_id || $function_id || $group_id || $institution_id || $program_id || $partner_id || $sector_id || $student_type_id ) {
|
1183 |
if( $company_id || $function_id || $group_id || $institution_id || $program_id || $partner_id || $sector_id || $student_type_id ) {
|
| Línea 1399... |
Línea 1385... |
| 1399 |
]);
|
1385 |
]);
|
| Línea 1400... |
Línea 1386... |
| 1400 |
|
1386 |
|
| Línea 1401... |
Línea 1387... |
| 1401 |
}
|
1387 |
}
|
| 1402 |
|
1388 |
|
| 1403 |
|
1389 |
|
| 1404 |
$topicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
1390 |
$topicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
| 1405 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
1391 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
| 1406 |
if(!$topic) {
|
1392 |
if(!$topic) {
|
| Línea 1418... |
Línea 1404... |
| 1418 |
}
|
1404 |
}
|
| Línea 1419... |
Línea 1405... |
| 1419 |
|
1405 |
|
| 1420 |
|
1406 |
|
| 1421 |
|
1407 |
|
| Línea 1422... |
Línea 1408... |
| 1422 |
if(!$capsule_uuid) {
|
1408 |
if(!$capsule_uuid) {
|
| 1423 |
$capsuleMapper = CompanyMicrolearningCapsuleMapper::getInstance($this->adapter);
|
1409 |
$capsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
|
| 1424 |
$records = $capsuleMapper->fetchAllByCompanyIdAndTopicId($topic->company_id, $topic->id);
|
1410 |
$records = $capsuleMapper->fetchAllByCompanyIdAndTopicId($topic->company_id, $topic->id);
|
| Línea 1442... |
Línea 1428... |
| 1442 |
'data' => $data
|
1428 |
'data' => $data
|
| 1443 |
]);
|
1429 |
]);
|
| Línea 1444... |
Línea 1430... |
| 1444 |
|
1430 |
|
| Línea 1445... |
Línea 1431... |
| 1445 |
}
|
1431 |
}
|
| 1446 |
|
1432 |
|
| Línea 1447... |
Línea 1433... |
| 1447 |
$capsuleMapper = CompanyMicrolearningCapsuleMapper::getInstance($this->adapter);
|
1433 |
$capsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
|
| Línea 1483... |
Línea 1469... |
| 1483 |
|
1469 |
|
| 1484 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
1470 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 1485 |
$sql = $queryMapper->getSql();
|
1471 |
$sql = $queryMapper->getSql();
|
| 1486 |
$select = $sql->select();
|
1472 |
$select = $sql->select();
|
| 1487 |
$select->columns(['access', 'paid_from', 'paid_to', 'added_on', 'updated_on']);
|
1473 |
$select->columns(['access', 'paid_from', 'paid_to', 'added_on', 'updated_on']);
|
| 1488 |
$select->from(['tb1' => CompanyMicrolearningCapsuleCommentMapper::_TABLE] );
|
1474 |
$select->from(['tb1' => MicrolearningCapsuleCommentMapper::_TABLE] );
|
| 1489 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
1475 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
| 1490 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
1476 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
| 1491 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
1477 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
| Línea 1546... |
Línea 1532... |
| 1546 |
return new JsonModel([
|
1532 |
return new JsonModel([
|
| 1547 |
'success' => true,
|
1533 |
'success' => true,
|
| 1548 |
'data' => $data
|
1534 |
'data' => $data
|
| 1549 |
]);
|
1535 |
]);
|
| 1550 |
} else {
|
1536 |
} else {
|
| 1551 |
$topicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
1537 |
$topicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
| 1552 |
$topics = $topicMapper->fetchAllByCompanyId($currentCompany->id);
|
1538 |
$topics = $topicMapper->fetchAllByCompanyId($currentCompany->id);
|
| Línea 1553... |
Línea 1539... |
| 1553 |
|
1539 |
|
| 1554 |
if($topics) {
|
1540 |
if($topics) {
|
| 1555 |
$topic_id = $topics[0]->id;
|
1541 |
$topic_id = $topics[0]->id;
|
| Línea 1617... |
Línea 1603... |
| 1617 |
$allowDownload = $acl->isAllowed($currentUser->usertype_id, 'microlearning/reports/progress-for-capsule/excel');
|
1603 |
$allowDownload = $acl->isAllowed($currentUser->usertype_id, 'microlearning/reports/progress-for-capsule/excel');
|
| Línea 1618... |
Línea 1604... |
| 1618 |
|
1604 |
|
| 1619 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
1605 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
| Línea 1620... |
Línea 1606... |
| 1620 |
$capsule_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('capsule_uuid'));
|
1606 |
$capsule_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('capsule_uuid'));
|
| 1621 |
|
1607 |
|
| 1622 |
$topicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
1608 |
$topicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
| 1623 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
1609 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
| 1624 |
if(!$topic) {
|
1610 |
if(!$topic) {
|
| 1625 |
return new JsonModel([
|
1611 |
return new JsonModel([
|
| Línea 1645... |
Línea 1631... |
| 1645 |
|
1631 |
|
| Línea 1646... |
Línea 1632... |
| 1646 |
if(!$capsule_uuid) {
|
1632 |
if(!$capsule_uuid) {
|
| Línea 1647... |
Línea 1633... |
| 1647 |
|
1633 |
|
| 1648 |
$data['capsules'] = [];
|
1634 |
$data['capsules'] = [];
|
| Línea 1649... |
Línea 1635... |
| 1649 |
|
1635 |
|
| 1650 |
$capsuleMapper = CompanyMicrolearningCapsuleMapper::getInstance($this->adapter);
|
1636 |
$capsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
|
| Línea 1665... |
Línea 1651... |
| 1665 |
|
1651 |
|
| Línea 1666... |
Línea 1652... |
| 1666 |
}
|
1652 |
}
|
| 1667 |
|
1653 |
|
| Línea 1668... |
Línea 1654... |
| 1668 |
|
1654 |
|
| Línea 1692... |
Línea 1678... |
| 1692 |
|
1678 |
|
| 1693 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
1679 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 1694 |
$sql = $queryMapper->getSql();
|
1680 |
$sql = $queryMapper->getSql();
|
| 1695 |
$select = $sql->select();
|
1681 |
$select = $sql->select();
|
| 1696 |
$select->columns(['user_id']);
|
1682 |
$select->columns(['user_id']);
|
| 1697 |
$select->from(['tb1' => CompanyMicrolearningCapsuleUserMapper::_TABLE] );
|
1683 |
$select->from(['tb1' => MicrolearningCapsuleUserMapper::_TABLE] );
|
| 1698 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
1684 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
| 1699 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
1685 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
| 1700 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
1686 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
| 1701 |
$select->where->equalTo('tb1.capsule_id', $capsule->id);
|
1687 |
$select->where->equalTo('tb1.capsule_id', $capsule->id);
|
| Línea 1733... |
Línea 1719... |
| 1733 |
$items[ $user_id ] = $item;
|
1719 |
$items[ $user_id ] = $item;
|
| 1734 |
}
|
1720 |
}
|
| Línea 1735... |
Línea 1721... |
| 1735 |
|
1721 |
|
| 1736 |
|
1722 |
|
| 1737 |
$select->columns(['user_id', 'progress', 'total_slides', 'view_slides', 'completed', 'returning_after_completed', 'added_on', 'updated_on']);
|
1723 |
$select->columns(['user_id', 'progress', 'total_slides', 'view_slides', 'completed', 'returning_after_completed', 'added_on', 'updated_on']);
|
| 1738 |
$select->from(['tb1' => CompanyMicrolearningUserProgressMapper::_TABLE] );
|
1724 |
$select->from(['tb1' => MicrolearningUserProgressMapper::_TABLE] );
|
| 1739 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
1725 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
| 1740 |
$select->where->equalTo('tb1.type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
1726 |
$select->where->equalTo('tb1.type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| 1741 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
1727 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
| Línea 1779... |
Línea 1765... |
| 1779 |
return new JsonModel([
|
1765 |
return new JsonModel([
|
| 1780 |
'success' => true,
|
1766 |
'success' => true,
|
| 1781 |
'data' => $data
|
1767 |
'data' => $data
|
| 1782 |
]);
|
1768 |
]);
|
| 1783 |
} else {
|
1769 |
} else {
|
| 1784 |
$topicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
1770 |
$topicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
| 1785 |
$topics = $topicMapper->fetchAllByCompanyId($currentCompany->id);
|
1771 |
$topics = $topicMapper->fetchAllByCompanyId($currentCompany->id);
|
| Línea 1786... |
Línea 1772... |
| 1786 |
|
1772 |
|
| 1787 |
if($topics) {
|
1773 |
if($topics) {
|
| 1788 |
$topic_id = $topics[0]->id;
|
1774 |
$topic_id = $topics[0]->id;
|
| Línea 1826... |
Línea 1812... |
| 1826 |
|
1812 |
|
| 1827 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
1813 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
| Línea 1828... |
Línea 1814... |
| 1828 |
$capsule_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('capsule_uuid'));
|
1814 |
$capsule_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('capsule_uuid'));
|
| 1829 |
|
1815 |
|
| 1830 |
|
1816 |
|
| 1831 |
$topicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
1817 |
$topicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
| 1832 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
1818 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
| 1833 |
if(!$topic) {
|
1819 |
if(!$topic) {
|
| Línea 1842... |
Línea 1828... |
| 1842 |
'success' => false,
|
1828 |
'success' => false,
|
| 1843 |
'data' => 'ERROR_UNAUTHORIZED'
|
1829 |
'data' => 'ERROR_UNAUTHORIZED'
|
| 1844 |
]);
|
1830 |
]);
|
| 1845 |
}
|
1831 |
}
|
| Línea 1846... |
Línea 1832... |
| 1846 |
|
1832 |
|
| 1847 |
$capsuleMapper = CompanyMicrolearningCapsuleMapper::getInstance($this->adapter);
|
1833 |
$capsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
|
| Línea 1848... |
Línea 1834... |
| 1848 |
$capsule = $capsuleMapper->fetchOneByUuid($capsule_uuid);
|
1834 |
$capsule = $capsuleMapper->fetchOneByUuid($capsule_uuid);
|
| Línea 1868... |
Línea 1854... |
| 1868 |
|
1854 |
|
| 1869 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
1855 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 1870 |
$sql = $queryMapper->getSql();
|
1856 |
$sql = $queryMapper->getSql();
|
| 1871 |
$select = $sql->select();
|
1857 |
$select = $sql->select();
|
| 1872 |
$select->columns(['user_id']);
|
1858 |
$select->columns(['user_id']);
|
| 1873 |
$select->from(['tb1' => CompanyMicrolearningCapsuleUserMapper::_TABLE] );
|
1859 |
$select->from(['tb1' => MicrolearningCapsuleUserMapper::_TABLE] );
|
| 1874 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
1860 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
| 1875 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
1861 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
| 1876 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
1862 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
| 1877 |
$select->where->equalTo('tb1.capsule_id', $capsule->id);
|
1863 |
$select->where->equalTo('tb1.capsule_id', $capsule->id);
|
| Línea 1908... |
Línea 1894... |
| 1908 |
$items[ $user_id ] = $item;
|
1894 |
$items[ $user_id ] = $item;
|
| 1909 |
}
|
1895 |
}
|
| Línea 1910... |
Línea 1896... |
| 1910 |
|
1896 |
|
| 1911 |
|
1897 |
|
| 1912 |
$select->columns(['user_id', 'progress', 'total_slides', 'view_slides', 'completed', 'returning_after_completed', 'added_on', 'updated_on']);
|
1898 |
$select->columns(['user_id', 'progress', 'total_slides', 'view_slides', 'completed', 'returning_after_completed', 'added_on', 'updated_on']);
|
| 1913 |
$select->from(['tb1' => CompanyMicrolearningUserProgressMapper::_TABLE] );
|
1899 |
$select->from(['tb1' => MicrolearningUserProgressMapper::_TABLE] );
|
| 1914 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
1900 |
$select->where->equalTo('tb1.company_id', $capsule->company_id);
|
| 1915 |
$select->where->equalTo('tb1.type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
1901 |
$select->where->equalTo('tb1.type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| 1916 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
1902 |
$select->where->equalTo('tb1.topic_id', $capsule->topic_id);
|
| Línea 2056... |
Línea 2042... |
| 2056 |
$acl = $this->getEvent()->getViewModel()->getVariable('acl');
|
2042 |
$acl = $this->getEvent()->getViewModel()->getVariable('acl');
|
| 2057 |
$allowDownload = $acl->isAllowed($currentUser->usertype_id, 'microlearning/reports/progress-for-topic/excel');
|
2043 |
$allowDownload = $acl->isAllowed($currentUser->usertype_id, 'microlearning/reports/progress-for-topic/excel');
|
| Línea 2058... |
Línea 2044... |
| 2058 |
|
2044 |
|
| Línea 2059... |
Línea 2045... |
| 2059 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
2045 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
| 2060 |
|
2046 |
|
| 2061 |
$topicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
2047 |
$topicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
| 2062 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
2048 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
| 2063 |
if(!$topic) {
|
2049 |
if(!$topic) {
|
| 2064 |
return new JsonModel([
|
2050 |
return new JsonModel([
|
| Línea 2086... |
Línea 2072... |
| 2086 |
|
2072 |
|
| 2087 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
2073 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 2088 |
$sql = $queryMapper->getSql();
|
2074 |
$sql = $queryMapper->getSql();
|
| 2089 |
$select = $sql->select();
|
2075 |
$select = $sql->select();
|
| 2090 |
$select->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
2076 |
$select->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
| 2091 |
$select->from(['tb1' => CompanyMicrolearningCapsuleUserMapper::_TABLE] );
|
2077 |
$select->from(['tb1' => MicrolearningCapsuleUserMapper::_TABLE] );
|
| 2092 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
2078 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
| 2093 |
$select->where->equalTo('tb1.company_id', $topic->company_id);
|
2079 |
$select->where->equalTo('tb1.company_id', $topic->company_id);
|
| 2094 |
$select->where->equalTo('tb1.topic_id', $topic->id);
|
2080 |
$select->where->equalTo('tb1.topic_id', $topic->id);
|
| 2095 |
$select->where->equalTo('tb2.status', User::STATUS_ACTIVE);
|
2081 |
$select->where->equalTo('tb2.status', User::STATUS_ACTIVE);
|
| Línea 2126... |
Línea 2112... |
| 2126 |
$items[ $user_id ] = $item;
|
2112 |
$items[ $user_id ] = $item;
|
| 2127 |
}
|
2113 |
}
|
| Línea 2128... |
Línea 2114... |
| 2128 |
|
2114 |
|
| 2129 |
$select = $sql->select();
|
2115 |
$select = $sql->select();
|
| 2130 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
2116 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
| 2131 |
$select->from(CompanyMicrolearningCapsuleUserMapper::_TABLE);
|
2117 |
$select->from(MicrolearningCapsuleUserMapper::_TABLE);
|
| 2132 |
$select->where->equalTo('company_id', $topic->company_id);
|
2118 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2133 |
$select->where->equalTo('topic_id', $topic->id);
|
2119 |
$select->where->equalTo('topic_id', $topic->id);
|
| 2134 |
$select->where->in('user_id', $user_ids);
|
2120 |
$select->where->in('user_id', $user_ids);
|
| Línea 2146... |
Línea 2132... |
| 2146 |
}
|
2132 |
}
|
| Línea 2147... |
Línea 2133... |
| 2147 |
|
2133 |
|
| 2148 |
|
2134 |
|
| 2149 |
$select = $sql->select();
|
2135 |
$select = $sql->select();
|
| 2150 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
2136 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
| 2151 |
$select->from(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2137 |
$select->from(MicrolearningUserProgressMapper::_TABLE);
|
| 2152 |
$select->where->equalTo('company_id', $topic->company_id);
|
2138 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2153 |
$select->where->equalTo('topic_id', $topic->id);
|
2139 |
$select->where->equalTo('topic_id', $topic->id);
|
| 2154 |
$select->where->equalTo('type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
2140 |
$select->where->equalTo('type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| 2155 |
$select->where->greaterThanOrEqualTo('progress', 100);
|
2141 |
$select->where->greaterThanOrEqualTo('progress', 100);
|
| 2156 |
$select->where->equalTo('completed', 1);
|
2142 |
$select->where->equalTo('completed', 1);
|
| Línea 2171... |
Línea 2157... |
| 2171 |
}
|
2157 |
}
|
| Línea 2172... |
Línea 2158... |
| 2172 |
|
2158 |
|
| 2173 |
|
2159 |
|
| 2174 |
$select = $sql->select();
|
2160 |
$select = $sql->select();
|
| 2175 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
2161 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
| 2176 |
$select->from(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2162 |
$select->from(MicrolearningUserProgressMapper::_TABLE);
|
| 2177 |
$select->where->equalTo('company_id', $topic->company_id);
|
2163 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2178 |
$select->where->equalTo('topic_id', $topic->id);
|
2164 |
$select->where->equalTo('topic_id', $topic->id);
|
| 2179 |
$select->where->equalTo('type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
2165 |
$select->where->equalTo('type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| 2180 |
$select->where->lessThan('progress', 100);
|
2166 |
$select->where->lessThan('progress', 100);
|
| 2181 |
$select->where->equalTo('completed', 0);
|
2167 |
$select->where->equalTo('completed', 0);
|
| Línea 2194... |
Línea 2180... |
| 2194 |
|
2180 |
|
| Línea 2195... |
Línea 2181... |
| 2195 |
}
|
2181 |
}
|
| 2196 |
|
2182 |
|
| 2197 |
$select = $sql->select();
|
2183 |
$select = $sql->select();
|
| 2198 |
$select->columns(['added_on' => new Expression('MIN(added_on)'), 'updated_on' => new Expression('MAX(updated_on)'), 'user_id']);
|
2184 |
$select->columns(['added_on' => new Expression('MIN(added_on)'), 'updated_on' => new Expression('MAX(updated_on)'), 'user_id']);
|
| 2199 |
$select->from(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2185 |
$select->from(MicrolearningUserProgressMapper::_TABLE);
|
| 2200 |
$select->where->equalTo('company_id', $topic->company_id);
|
2186 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2201 |
$select->where->equalTo('topic_id', $topic->id);
|
2187 |
$select->where->equalTo('topic_id', $topic->id);
|
| 2202 |
$select->where->equalTo('type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
2188 |
$select->where->equalTo('type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| Línea 2203... |
Línea 2189... |
| 2203 |
$select->where->in('user_id', $user_ids);
|
2189 |
$select->where->in('user_id', $user_ids);
|
| Línea 2279... |
Línea 2265... |
| 2279 |
if($request->isGet())
|
2265 |
if($request->isGet())
|
| 2280 |
{
|
2266 |
{
|
| Línea 2281... |
Línea 2267... |
| 2281 |
|
2267 |
|
| Línea 2282... |
Línea 2268... |
| 2282 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
2268 |
$topic_uuid = Functions::sanitizeFilterString($this->params()->fromQuery('topic_uuid'));
|
| 2283 |
|
2269 |
|
| 2284 |
$topicMapper = CompanyMicrolearningTopicMapper::getInstance($this->adapter);
|
2270 |
$topicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
|
| 2285 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
2271 |
$topic = $topicMapper->fetchOneByUuid($topic_uuid);
|
| 2286 |
if(!$topic) {
|
2272 |
if(!$topic) {
|
| 2287 |
return new JsonModel([
|
2273 |
return new JsonModel([
|
| Línea 2299... |
Línea 2285... |
| 2299 |
|
2285 |
|
| 2300 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
2286 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 2301 |
$sql = $queryMapper->getSql();
|
2287 |
$sql = $queryMapper->getSql();
|
| 2302 |
$select = $sql->select();
|
2288 |
$select = $sql->select();
|
| 2303 |
$select->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
2289 |
$select->columns(['user_id' => new Expression('DISTINCT(user_id)') ]);
|
| 2304 |
$select->from(['tb1' => CompanyMicrolearningCapsuleUserMapper::_TABLE] );
|
2290 |
$select->from(['tb1' => MicrolearningCapsuleUserMapper::_TABLE] );
|
| 2305 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
2291 |
$select->join(['tb2' => UserMapper::_TABLE], 'tb1.user_id = tb2.id', ['uuid', 'first_name', 'last_name', 'email']);
|
| 2306 |
$select->where->equalTo('tb1.company_id', $topic->company_id);
|
2292 |
$select->where->equalTo('tb1.company_id', $topic->company_id);
|
| 2307 |
$select->where->equalTo('tb1.topic_id', $topic->id);
|
2293 |
$select->where->equalTo('tb1.topic_id', $topic->id);
|
| 2308 |
$select->where->equalTo('tb2.status', User::STATUS_ACTIVE);
|
2294 |
$select->where->equalTo('tb2.status', User::STATUS_ACTIVE);
|
| Línea 2339... |
Línea 2325... |
| 2339 |
$items[ $user_id ] = $item;
|
2325 |
$items[ $user_id ] = $item;
|
| 2340 |
}
|
2326 |
}
|
| Línea 2341... |
Línea 2327... |
| 2341 |
|
2327 |
|
| 2342 |
$select = $sql->select();
|
2328 |
$select = $sql->select();
|
| 2343 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
2329 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
| 2344 |
$select->from(CompanyMicrolearningCapsuleUserMapper::_TABLE);
|
2330 |
$select->from(MicrolearningCapsuleUserMapper::_TABLE);
|
| 2345 |
$select->where->equalTo('company_id', $topic->company_id);
|
2331 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2346 |
$select->where->equalTo('topic_id', $topic->id);
|
2332 |
$select->where->equalTo('topic_id', $topic->id);
|
| Línea 2347... |
Línea 2333... |
| 2347 |
$select->group('user_id');
|
2333 |
$select->group('user_id');
|
| Línea 2356... |
Línea 2342... |
| 2356 |
}
|
2342 |
}
|
| Línea 2357... |
Línea 2343... |
| 2357 |
|
2343 |
|
| 2358 |
|
2344 |
|
| 2359 |
$select = $sql->select();
|
2345 |
$select = $sql->select();
|
| 2360 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
2346 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
| 2361 |
$select->from(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2347 |
$select->from(MicrolearningUserProgressMapper::_TABLE);
|
| 2362 |
$select->where->equalTo('company_id', $topic->company_id);
|
2348 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2363 |
$select->where->equalTo('topic_id', $topic->id);
|
2349 |
$select->where->equalTo('topic_id', $topic->id);
|
| 2364 |
$select->where->equalTo('type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
2350 |
$select->where->equalTo('type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| 2365 |
$select->where->greaterThanOrEqualTo('progress', 100);
|
2351 |
$select->where->greaterThanOrEqualTo('progress', 100);
|
| Línea 2366... |
Línea 2352... |
| 2366 |
$select->where->equalTo('completed', 1);
|
2352 |
$select->where->equalTo('completed', 1);
|
| Línea 2379... |
Línea 2365... |
| 2379 |
}
|
2365 |
}
|
| Línea 2380... |
Línea 2366... |
| 2380 |
|
2366 |
|
| 2381 |
|
2367 |
|
| 2382 |
$select = $sql->select();
|
2368 |
$select = $sql->select();
|
| 2383 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
2369 |
$select->columns(['total' => new Expression('COUNT(*)'), 'user_id']);
|
| 2384 |
$select->from(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2370 |
$select->from(MicrolearningUserProgressMapper::_TABLE);
|
| 2385 |
$select->where->equalTo('company_id', $topic->company_id);
|
2371 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2386 |
$select->where->equalTo('topic_id', $topic->id);
|
2372 |
$select->where->equalTo('topic_id', $topic->id);
|
| 2387 |
$select->where->equalTo('type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
2373 |
$select->where->equalTo('type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| 2388 |
$select->where->lessThan('progress', 100);
|
2374 |
$select->where->lessThan('progress', 100);
|
| Línea 2399... |
Línea 2385... |
| 2399 |
|
2385 |
|
| Línea 2400... |
Línea 2386... |
| 2400 |
}
|
2386 |
}
|
| 2401 |
|
2387 |
|
| 2402 |
$select = $sql->select();
|
2388 |
$select = $sql->select();
|
| 2403 |
$select->columns(['added_on' => new Expression('MIN(added_on)'), 'updated_on' => new Expression('MAX(updated_on)'), 'user_id']);
|
2389 |
$select->columns(['added_on' => new Expression('MIN(added_on)'), 'updated_on' => new Expression('MAX(updated_on)'), 'user_id']);
|
| 2404 |
$select->from(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2390 |
$select->from(MicrolearningUserProgressMapper::_TABLE);
|
| 2405 |
$select->where->equalTo('company_id', $topic->company_id);
|
2391 |
$select->where->equalTo('company_id', $topic->company_id);
|
| 2406 |
$select->where->equalTo('topic_id', $topic->id);
|
2392 |
$select->where->equalTo('topic_id', $topic->id);
|
| Línea 2407... |
Línea 2393... |
| 2407 |
$select->where->equalTo('type', CompanyMicrolearningUserProgress::TYPE_CAPSULE);
|
2393 |
$select->where->equalTo('type', MicrolearningUserProgress::TYPE_CAPSULE);
|
| 2408 |
$select->group('user_id');
|
2394 |
$select->group('user_id');
|
| Línea 2562... |
Línea 2548... |
| 2562 |
'data' => 'ERROR_USER_NOT_FOUND'
|
2548 |
'data' => 'ERROR_USER_NOT_FOUND'
|
| 2563 |
]);
|
2549 |
]);
|
| 2564 |
}
|
2550 |
}
|
| Línea 2565... |
Línea 2551... |
| 2565 |
|
2551 |
|
| 2566 |
|
2552 |
|
| Línea 2567... |
Línea 2553... |
| 2567 |
$companyMicrolearningCapsuleUserMapper = CompanyMicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
2553 |
$microlearningCapsuleUserMapper = MicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
| 2568 |
$count = $companyMicrolearningCapsuleUserMapper->fetchCountByCompanyIdAndUserId($currentCompany->id, $user->id);
|
2554 |
$count = $microlearningCapsuleUserMapper->fetchCountByCompanyIdAndUserId($currentCompany->id, $user->id);
|
| 2569 |
|
2555 |
|
| Línea 2583... |
Línea 2569... |
| 2583 |
|
2569 |
|
| 2584 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
2570 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 2585 |
$sql = $queryMapper->getSql();
|
2571 |
$sql = $queryMapper->getSql();
|
| 2586 |
$select = $sql->select();
|
2572 |
$select = $sql->select();
|
| 2587 |
$select->columns(['capsule_id', 'access', 'paid_from', 'paid_to' ]);
|
2573 |
$select->columns(['capsule_id', 'access', 'paid_from', 'paid_to' ]);
|
| 2588 |
$select->from(['tb1' => CompanyMicrolearningCapsuleUserMapper::_TABLE] );
|
2574 |
$select->from(['tb1' => MicrolearningCapsuleUserMapper::_TABLE] );
|
| 2589 |
$select->join(['tb2' => CompanyMicrolearningTopicMapper::_TABLE], 'tb1.company_id = tb2.company_id AND tb1.topic_id = tb2.id', ['topic' => 'name']);
|
2575 |
$select->join(['tb2' => MicrolearningTopicMapper::_TABLE], 'tb1.company_id = tb2.company_id AND tb1.topic_id = tb2.id', ['topic' => 'name']);
|
| 2590 |
$select->join(['tb3' => CompanyMicrolearningCapsuleMapper::_TABLE], 'tb1.company_id = tb3.company_id AND tb1.topic_id = tb3.topic_id AND tb1.capsule_id = tb3.id', ['capsule' => 'name']);
|
2576 |
$select->join(['tb3' => MicrolearningCapsuleMapper::_TABLE], 'tb1.company_id = tb3.company_id AND tb1.topic_id = tb3.topic_id AND tb1.capsule_id = tb3.id', ['capsule' => 'name']);
|
| 2591 |
$select->where->equalTo('tb1.company_id', $currentCompany->id);
|
2577 |
$select->where->equalTo('tb1.company_id', $currentCompany->id);
|
| 2592 |
$select->where->equalTo('tb1.user_id', $user->id);
|
2578 |
$select->where->equalTo('tb1.user_id', $user->id);
|
| Línea 2617... |
Línea 2603... |
| 2617 |
|
2603 |
|
| 2618 |
|
2604 |
|
| 2619 |
|
2605 |
|
| 2620 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
2606 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 2621 |
$sql = $queryMapper->getSql();
|
2607 |
$sql = $queryMapper->getSql();
|
| 2622 |
$select = $sql->select(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2608 |
$select = $sql->select(MicrolearningUserProgressMapper::_TABLE);
|
| 2623 |
$select->columns(['capsule_id', 'progress', 'total_slides' , 'view_slides', 'completed', 'added_on','updated_on']);
|
2609 |
$select->columns(['capsule_id', 'progress', 'total_slides' , 'view_slides', 'completed', 'added_on','updated_on']);
|
| Línea 2624... |
Línea 2610... |
| 2624 |
$select->where->equalTo('company_id', $currentCompany->id);
|
2610 |
$select->where->equalTo('company_id', $currentCompany->id);
|
| Línea 2710... |
Línea 2696... |
| 2710 |
'success' => false,
|
2696 |
'success' => false,
|
| 2711 |
'data' => 'ERROR_USER_NOT_FOUND'
|
2697 |
'data' => 'ERROR_USER_NOT_FOUND'
|
| 2712 |
]);
|
2698 |
]);
|
| 2713 |
}
|
2699 |
}
|
| Línea 2714... |
Línea 2700... |
| 2714 |
|
2700 |
|
| 2715 |
$companyMicrolearningCapsuleUserMapper = CompanyMicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
2701 |
$microlearningCapsuleUserMapper = MicrolearningCapsuleUserMapper::getInstance($this->adapter);
|
| Línea 2716... |
Línea 2702... |
| 2716 |
$count = $companyMicrolearningCapsuleUserMapper->fetchCountByCompanyIdAndUserId($currentCompany->id, $user->id);
|
2702 |
$count = $microlearningCapsuleUserMapper->fetchCountByCompanyIdAndUserId($currentCompany->id, $user->id);
|
| 2717 |
|
2703 |
|
| 2718 |
|
2704 |
|
| Línea 2728... |
Línea 2714... |
| 2728 |
|
2714 |
|
| 2729 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
2715 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 2730 |
$sql = $queryMapper->getSql();
|
2716 |
$sql = $queryMapper->getSql();
|
| 2731 |
$select = $sql->select();
|
2717 |
$select = $sql->select();
|
| 2732 |
$select->columns(['capsule_id', 'access', 'paid_from', 'paid_to' ]);
|
2718 |
$select->columns(['capsule_id', 'access', 'paid_from', 'paid_to' ]);
|
| 2733 |
$select->from(['tb1' => CompanyMicrolearningCapsuleUserMapper::_TABLE] );
|
2719 |
$select->from(['tb1' => MicrolearningCapsuleUserMapper::_TABLE] );
|
| 2734 |
$select->join(['tb2' => CompanyMicrolearningTopicMapper::_TABLE], 'tb1.company_id = tb2.company_id AND tb1.topic_id = tb2.id', ['topic' => 'name']);
|
2720 |
$select->join(['tb2' => MicrolearningTopicMapper::_TABLE], 'tb1.company_id = tb2.company_id AND tb1.topic_id = tb2.id', ['topic' => 'name']);
|
| 2735 |
$select->join(['tb3' => CompanyMicrolearningCapsuleMapper::_TABLE], 'tb1.company_id = tb3.company_id AND tb1.topic_id = tb3.topic_id AND tb1.capsule_id = tb3.id', ['capsule' => 'name']);
|
2721 |
$select->join(['tb3' => MicrolearningCapsuleMapper::_TABLE], 'tb1.company_id = tb3.company_id AND tb1.topic_id = tb3.topic_id AND tb1.capsule_id = tb3.id', ['capsule' => 'name']);
|
| 2736 |
$select->where->equalTo('tb1.company_id', $currentCompany->id);
|
2722 |
$select->where->equalTo('tb1.company_id', $currentCompany->id);
|
| 2737 |
$select->where->equalTo('tb1.user_id', $user->id);
|
2723 |
$select->where->equalTo('tb1.user_id', $user->id);
|
| Línea 2762... |
Línea 2748... |
| 2762 |
|
2748 |
|
| 2763 |
|
2749 |
|
| 2764 |
|
2750 |
|
| 2765 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
2751 |
$queryMapper = QueryMapper::getInstance($this->adapter);
|
| 2766 |
$sql = $queryMapper->getSql();
|
2752 |
$sql = $queryMapper->getSql();
|
| 2767 |
$select = $sql->select(CompanyMicrolearningUserProgressMapper::_TABLE);
|
2753 |
$select = $sql->select(MicrolearningUserProgressMapper::_TABLE);
|
| 2768 |
$select->columns(['capsule_id', 'progress', 'total_slides' , 'view_slides', 'completed', 'added_on','updated_on']);
|
2754 |
$select->columns(['capsule_id', 'progress', 'total_slides' , 'view_slides', 'completed', 'added_on','updated_on']);
|
| Línea 2769... |
Línea 2755... |
| 2769 |
$select->where->equalTo('company_id', $currentCompany->id);
|
2755 |
$select->where->equalTo('company_id', $currentCompany->id);
|