<?php
 refreshReportStatus('extractMainDataFromDb', 'updateTaskDetails', 0); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addCaseStructureColumn("task_statusName", "task_statusCode", (Array)$_LANG['tasks']['statusName']); $reportCopyInfo->populate(); if (in_array('task_statusReasonName', $availableTableColumns)) { \Entity\Task::loadCFG(); $CFG = \Engine\Loader_Cfg::getInstance()->getGlobal(); foreach ($CFG['globalEntity']['::Task']['_special']['statusReasonsList'] as $status=>$reason) { $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addCaseStructureColumn("task_statusReasonName", "task_statusReasonCode", (Array)$_LANG['tasks']['reasonForStatus'][$status]); $reportCopyInfo->addFilter("rep.task_statusCode", "=", $status); $reportCopyInfo->populate(); } } $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_taskOperationTypes, 'task_operationTypeName', 'task_idOperationType', 'description'); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_taskCategories, 'task_categoryName', 'task_idCategory', 'category'); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addCaseStructureColumn("task_priorityName", "task_priorityCode", (Array)$_LANG['tasks']['priorities']); $reportCopyInfo->populate(); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_offices, 'task_officeName', 'task_idOffice', "name"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_departments, 'task_departmentName', 'task_idDepartment', "name"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'task_userName', 'task_idUser', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'task_assignorUserName', 'task_assignorIdUser', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'task_addUserName', 'task_idAddUser', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); $reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $availableTableColumns); $reportCopyInfo->populateSimple($DBTRd_users, 'task_updateUserName', 'task_idUpdateUser', "CONCAT(joinTable.lastName, ' ', joinTable.firstName)"); refreshReportStatus('extractMainDataFromDb', 'updatePivotDetails', 0); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addCaseStructureColumn("pivot_name", "pivot_code", (Array)$_LANG['tasks']['pivotsArr']); $reportCopyInfo->populate(); if (in_array('pivot_clientName', $availableTableColumns)) { $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addJoinTable($DBTRd_corporates, 'corp', 'rep.pivot_id=corp.id', 'LEFT'); $reportCopyInfo->addStructureColumn("pivot_clientName", "corp.alias", "corp"); $reportCopyInfo->addFilter("rep.pivot_code", "=", "corporate"); $reportCopyInfo->populate(); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addJoinTable($DBTRd_clientInvoices, 'inv', 'rep.pivot_id=inv.id', 'LEFT'); $reportCopyInfo->addJoinTable($DBTRd_corporates, 'corp', 'inv.idCorporate=corp.id', 'LEFT'); $reportCopyInfo->addStructureColumn("pivot_clientName", "corp.alias", "corp"); $reportCopyInfo->addFilter("rep.pivot_code", "=", "invoice"); $reportCopyInfo->addFilter("inv.idCorporate", "!=", "0"); $reportCopyInfo->populate(); $reportCopyInfo = new \App\Reports\Db\ManageRecords\Update($reportTable, 'rep', $availableTableColumns); $reportCopyInfo->addJoinTable($DBTRd_clientInvoices, 'inv', 'rep.pivot_id=inv.id', 'LEFT'); $reportCopyInfo->addJoinTable($DBTRd_customers, 'cust', 'inv.idCustomer=cust.id', 'LEFT'); $reportCopyInfo->addStructureColumn("pivot_clientName", "CONCAT(cust.lastNameStd, ' ', cust.firstNameStd)", "cust"); $reportCopyInfo->addFilter("rep.pivot_code", "=", "invoice"); $reportCopyInfo->addFilter("inv.idCustomer", "!=", "0"); $reportCopyInfo->populate(); } 