PDF PREVIEW ISSUES #1
This commit is contained in:
parent
78942fa049
commit
9dc4a08c6e
@ -8086,9 +8086,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$this->load->helper('SYMLINKS');
|
|
||||||
SYMLINKS::createSymLinks();
|
|
||||||
die();
|
|
||||||
$pdid = $this->uri->segment(3);
|
$pdid = $this->uri->segment(3);
|
||||||
log_message('DEBUG',"getPDReportPDFpreview_post called ");//die();
|
log_message('DEBUG',"getPDReportPDFpreview_post called ");//die();
|
||||||
$random_string = $this->uri->segment(2);
|
$random_string = $this->uri->segment(2);
|
||||||
@ -8150,12 +8148,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
$pdf_doc = $this->pdfgenerator->generate($report_data, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
|
$pdf_doc = $this->pdfgenerator->generate($report_data, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
|
||||||
//End of PDF Gen using DOM PDF
|
//End of PDF Gen using DOM PDF
|
||||||
$output_file2 = $this->external_path ."/pd_reports/" . $pdid . "/sample.pdf";
|
$output_file2 = $this->external_path ."/pd_reports/" . $pdid . "/sample.pdf";
|
||||||
$link = 'https://'. $this->config->item('full_server_name').'/ssa_external_data/'. ENVIRONMENT.'/pd_reports/'. $pdid . "/sample.pdf";
|
$link_to_send = 'https://'. $this->config->item('full_server_name').'/ssa_external_data/'. ENVIRONMENT.'/pd_reports/'. $pdid . "/sample.pdf";
|
||||||
|
|
||||||
|
//$link_to_be_create = '/var/www/html/ssa_external_data/'. ENVIRONMENT.'/pd_reports/'. $pdid . "/sample.pdf";
|
||||||
|
|
||||||
file_put_contents($output_file2, $pdf_doc);
|
file_put_contents($output_file2, $pdf_doc);
|
||||||
//header("Access-Control-Allow-Methods: GET, OPTIONS");
|
$this->load->helper('SYMLINKS');
|
||||||
header('Access-Control-Allow-Origin: *');
|
SYMLINKS::createSymLinks($pdid,$output_file2);
|
||||||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
echo json_encode(array('link'=>$link_to_send));
|
||||||
echo json_encode(array('link'=>$link));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,10 +6,17 @@ class EXTERNAL_DIR_CHECK
|
|||||||
|
|
||||||
|
|
||||||
// Create the logger
|
// Create the logger
|
||||||
public static function checkExternalDirectory($pd_id = null) //$msg,$data,$log_type
|
public static function checkExternalDirectory($pd_id = null,$path_to_check = null)
|
||||||
{
|
{
|
||||||
//echo 'EXTERNAL_DIR_CHECK called';
|
//echo 'EXTERNAL_DIR_CHECK called';
|
||||||
$path = XLPATH;
|
if($path_to_check == null)
|
||||||
|
{
|
||||||
|
$path = XLPATH;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$path = $path_to_check;
|
||||||
|
}
|
||||||
if(!file_exists($path))
|
if(!file_exists($path))
|
||||||
{
|
{
|
||||||
mkdir($path,0777);
|
mkdir($path,0777);
|
||||||
|
|||||||
@ -6,13 +6,19 @@ class SYMLINKS
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function createSymLinks($pd_id = null)
|
public static function createSymLinks($pd_id = null,$output_file2 = null)
|
||||||
{
|
{
|
||||||
//echo SELF::checkOS();
|
//echo SELF::checkOS();
|
||||||
//check os
|
//check os
|
||||||
if(SELF::checkOS() == 'LINUX')
|
if(SELF::checkOS() === 'LINUX')
|
||||||
{
|
{
|
||||||
|
$symbalic_path = $_SERVER['DOCUMENT_ROOT'].'/ssa_external_data/'.ENVIRONMENT;
|
||||||
|
$link_to_be_create = '/var/www/html/ssa_external_data/'. ENVIRONMENT.'/pd_reports/'. $pd_id . "/sample.pdf";
|
||||||
|
EXTERNAL_DIR_CHECK::checkExternalDirectory($pd_id,$symbalic_path);
|
||||||
|
if(!file_exists($link_to_be_create))
|
||||||
|
{
|
||||||
|
symlink($output_file2,$link_to_be_create);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user