93 lines
2.8 KiB
PHP
Executable File
93 lines
2.8 KiB
PHP
Executable File
<?php
|
|
|
|
$json = getJSONobj();
|
|
$pll = array(); $i=0; while(isset($_POST['p_'.$i])) { $pll[] = $json->decode(htmlspecialchars_decode($_POST['p_'.$i])); $_POST['p_'.$i] = ''; $i++;}
|
|
$_POST = $json->decode(htmlspecialchars_decode($_POST['otherFormData']));
|
|
$_POST['position_list'] = $pll;
|
|
|
|
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $_REQUEST['cache'] != "fromJava") {
|
|
|
|
if(isset($_REQUEST['newWindow']) && $_REQUEST['newWindow'] == '1') {
|
|
$_REQUEST['newWindow'] = 0;
|
|
echo '<style type="text/css">html,body,div,table,p,ul,li,a,form,input,label{margin:0px; padding:0px;}</style>';
|
|
echo "<iframe style='border:none;width:100%;height:100%;' frameborder='no' src='index.php?module=EcmStockDocIns&action=previewPDF&to_pdf=1&method=I&record=".$_GET['record']."#toolbar=0&zoom=80%'>Yours browser not accept iframes!</iframe>";
|
|
} else {
|
|
require_once("modules/EcmStockDocIns/EcmStockDocIn.php");
|
|
$focus = new EcmStockDocIn();
|
|
$method = (isset($_REQUEST['method']) && $_REQUEST['method'] != '') ? $_REQUEST['method'] : 'D';
|
|
$focus->getPDF($_REQUEST['record'],$method);
|
|
|
|
}
|
|
} else
|
|
|
|
if($_REQUEST['cache'] == "fromJava" && $_GET['from']!="EcmStockDocIns") {
|
|
|
|
$_SESSION['PDF_ECMSTOCKDOCINS'] = $_POST;
|
|
|
|
} else
|
|
|
|
if($_GET['from']=="EcmStockDocIns") {
|
|
|
|
|
|
|
|
require_once("modules/EcmStockDocIns/EcmStockDocIn.php");
|
|
|
|
$focus = new EcmStockDocIn();
|
|
|
|
if(isset($_SESSION['PDF_ECMSTOCKDOCINS']['record']) && $_SESSION['PDF_ECMSTOCKDOCINS']['record'] != '') {
|
|
|
|
$focus->retrieve($_SESSION['PDF_ECMSTOCKDOCINS']['record']);
|
|
|
|
}
|
|
|
|
if(!$focus->ACLAccess('Save')){
|
|
|
|
ACLController::displayNoAccess(true);
|
|
|
|
sugar_cleanup(true);
|
|
|
|
}
|
|
|
|
foreach($focus->column_fields as $field){
|
|
|
|
if(isset($_SESSION['PDF_ECMSTOCKDOCINS'][$field])){
|
|
|
|
$value = $_SESSION['PDF_ECMSTOCKDOCINS'][$field];
|
|
|
|
$focus->$field = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
foreach($focus->additional_column_fields as $field){
|
|
|
|
if(isset($_SESSION['PDF_ECMSTOCKDOCINS'][$field])){
|
|
|
|
$value = $_SESSION['PDF_ECMSTOCKDOCINS'][$field];
|
|
|
|
$focus->$field = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(isset($_SESSION['PDF_ECMSTOCKDOCINS']['to_is_vat_free']) && $_SESSION['PDF_ECMSTOCKDOCINS']['to_is_vat_free']) $focus->to_is_vat_free = 1; else $focus->to_is_vat_free = 0;
|
|
|
|
$json = getJSONobj();
|
|
|
|
$pl = $_SESSION['PDF_ECMSTOCKDOCINS']['position_list'];
|
|
|
|
$focus->position_list = $pl;
|
|
|
|
$focus->document_no = $_SESSION['PDF_ECMSTOCKDOCINS']['document_no'];
|
|
|
|
$focus->ecmpaymentcondition_text = EcmStockDocIn::getTranslation('EcmPaymentConditions',$focus->ecmpaymentcondition_id,$focus->ecmlanguage);
|
|
|
|
$focus->ecmdeliverycondition_text = EcmStockDocIn::getTranslation('EcmDeliveryConditions',$focus->ecmdeliverycondition_id,$focus->ecmlanguage);
|
|
|
|
$focus->getPDF();
|
|
|
|
}
|
|
|
|
?>
|