PMCORE-3839

This commit is contained in:
Julio Cesar Laura Avendaño
2022-06-10 14:36:28 +00:00
committed by Mauricio Veliz
parent 3f6f6c5a30
commit 46988216f7
553 changed files with 66 additions and 95847 deletions

View File

@@ -464,6 +464,17 @@ CLI::taskArg('caseNumberFrom', true);
CLI::taskArg('caseNumberTo', true);
CLI::taskRun('migrate_case_title_to_threads');
/**
* Convert Output Documents generator from 'HTML2PDF' to 'TCPDF', because thirdparty related is obsolete and doesn't work over PHP 7.x.
*/
CLI::taskName('convert-out-docs-from-html2pdf-to-tcpdf');
CLI::taskDescription(<<<EOT
Convert Output Documents generator from 'HTML2PDF' to 'TCPDF', because thirdparty related is obsolete and doesn't work over PHP 7.x.
EOT
);
CLI::taskArg('workspace');
CLI::taskRun('convert_out_docs_from_html2pdf_to_tcpdf');
/**
* Function run_info
*
@@ -1716,3 +1727,15 @@ function migrate_case_title_to_threads($args)
$workspaceTools = new WorkspaceTools('');
$workspaceTools->migrateCaseTitleToThreads($args);
}
/**
* Convert Output Documents generator from 'HTML2PDF' to 'TCPDF', because thirdparty related is obsolete and doesn't work over PHP 7.x.
*
* @param array $args
*/
function convert_out_docs_from_html2pdf_to_tcpdf($args)
{
// The constructor requires an argument, so we send an empty value in order to use the class.
$workspaceTools = new WorkspaceTools('');
$workspaceTools->convertOutDocsHtml2Ps2Pdf($args);
}

View File

@@ -382,6 +382,11 @@ class WorkspaceTools
$start = microtime(true);
$this->migrateCaseTitleToThreads([$workspace]);
CLI::logging("* End migrating case title...(Completed on " . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start converting Output Documents from 'HTML2PDF' to 'TCPDF'...\n");
$start = microtime(true);
$this->convertOutDocsHtml2Ps2Pdf([$workspace]);
CLI::logging("* End converting Output Documents from 'HTML2PDF' to 'TCPDF...(Completed on " . (microtime(true) - $start) . " seconds)\n");
}
/**
@@ -2281,6 +2286,11 @@ class WorkspaceTools
$start = microtime(true);
$workspace->migrateCaseTitleToThreads([$workspaceName]);
CLI::logging("* End migrating case title...(Completed on " . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start converting Output Documents from 'HTML2PDF' to 'TCPDF'...\n");
$start = microtime(true);
$workspace->convertOutDocsHtml2Ps2Pdf([$workspaceName]);
CLI::logging("* End converting Output Documents from 'HTML2PDF' to 'TCPDF...(Completed on " . (microtime(true) - $start) . " seconds)\n");
}
CLI::logging("> Start To Verify License Enterprise...\n");
@@ -5325,6 +5335,38 @@ class WorkspaceTools
}
}
/**
* Convert Output Documents generator from 'HTML2PDF' to 'TCPDF', because thirdparty related is obsolete and doesn't work over PHP 7.x
* @param array $args
*/
public function convertOutDocsHtml2Ps2Pdf(array $args)
{
// Define query
$query = "
UPDATE
`OUTPUT_DOCUMENT`
SET
`OUT_DOC_REPORT_GENERATOR` = 'TCPDF'
WHERE
`OUT_DOC_REPORT_GENERATOR` = 'HTML2PDF'
";
try {
// Set workspace constants and initialize DB connection
Bootstrap::setConstantsRelatedWs($args[0]);
Propel::init(PATH_CONFIG . 'databases.php');
// Execute the query
$statement = Propel::getConnection('workflow')->createStatement();
$statement->executeQuery($query);
CLI::logging("The report generator was updated to 'TCPDF' in OUTPUT_DOCUMENT table." . PHP_EOL);
} catch (Exception $e) {
// Display the error message
CLI::logging($e->getMessage() . PHP_EOL . PHP_EOL);
}
}
/**
* Build the fields section for the insert query
*