HOR-1533 "Classic: PHP Notice in outputDocuments" SOLVED
Issue:
Classic: PHP Notice in outputDocuments
Cause:
Falta validacion para comprobar la existencia de los datos
Solution:
Se agrega validacion
This commit is contained in:
@@ -264,7 +264,16 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
$iResult = $oOutputDocument->save();
|
$iResult = $oOutputDocument->save();
|
||||||
$oConnection->commit();
|
$oConnection->commit();
|
||||||
//Add Audit Log
|
//Add Audit Log
|
||||||
$description = "Output Document Name: ".$aData['OUT_DOC_TITLE'].", Output Document Uid: ".$aData['OUT_DOC_UID'].", Filename generated: ".$aData['OUT_DOC_FILENAME'];
|
$description = 'Output Document Uid: ' . $aData['OUT_DOC_UID'];
|
||||||
|
|
||||||
|
if (array_key_exists('OUT_DOC_TITLE', $aData) && (string)($aData['OUT_DOC_TITLE']) != '') {
|
||||||
|
$description .= ', Output Document Name: ' . $aData['OUT_DOC_TITLE'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists('OUT_DOC_FILENAME', $aData) && (string)($aData['OUT_DOC_FILENAME']) != '') {
|
||||||
|
$description .= ', Filename generated: ' . $aData['OUT_DOC_FILENAME'];
|
||||||
|
}
|
||||||
|
|
||||||
if(!empty($aData['OUT_DOC_DESCRIPTION'])){
|
if(!empty($aData['OUT_DOC_DESCRIPTION'])){
|
||||||
$description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION'];
|
$description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION'];
|
||||||
}
|
}
|
||||||
@@ -274,12 +283,11 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){
|
if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){
|
||||||
$description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE'];
|
$description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE'];
|
||||||
}
|
}
|
||||||
if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){
|
|
||||||
$pdfSecurity = 'Disabled';
|
if (array_key_exists('OUT_DOC_PDF_SECURITY_ENABLED', $aData) && (string)($aData['OUT_DOC_PDF_SECURITY_ENABLED']) != '') {
|
||||||
}else{
|
$description .= ', PDF Security: ' . (((int)($aData['OUT_DOC_PDF_SECURITY_ENABLED']) != 0)? 'Enabled' : 'Disabled');
|
||||||
$pdfSecurity = 'Enabled';
|
|
||||||
}
|
}
|
||||||
$description .= ", PDF Security: ".$pdfSecurity;
|
|
||||||
if(!empty($aData['OUT_DOC_VERSIONING'])){
|
if(!empty($aData['OUT_DOC_VERSIONING'])){
|
||||||
$description .= ", Enable Versioning: Yes";
|
$description .= ", Enable Versioning: Yes";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,12 +49,15 @@ try {
|
|||||||
//refresh dbarray with the last change in outputDocument
|
//refresh dbarray with the last change in outputDocument
|
||||||
$oMap = new processMap();
|
$oMap = new processMap();
|
||||||
$oCriteria = $oMap->getOutputDocumentsCriteria( $fields['PRO_UID'] );
|
$oCriteria = $oMap->getOutputDocumentsCriteria( $fields['PRO_UID'] );
|
||||||
|
|
||||||
|
$result = new stdClass();
|
||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->msg = G::LoadTranslation( 'ID_OUTPUTDOCUMENT_REMOVED' );
|
$result->msg = G::LoadTranslation( 'ID_OUTPUTDOCUMENT_REMOVED' );
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
$result = new stdClass();
|
||||||
$result->success = false;
|
$result->success = false;
|
||||||
$result->msg = $e->getMessage();
|
$result->msg = $e->getMessage();
|
||||||
//die($oException->getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print G::json_encode( $result );
|
print G::json_encode( $result );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user