Skip to content

Instantly share code, notes, and snippets.

@cgsmith
Created July 26, 2015 23:49
Show Gist options
  • Select an option

  • Save cgsmith/80d17d1b5d80583ac826 to your computer and use it in GitHub Desktop.

Select an option

Save cgsmith/80d17d1b5d80583ac826 to your computer and use it in GitHub Desktop.
<?php
if ( count($apsBatchResults) > 0 ) {
foreach ( $apsBatchResults AS $orderID=>$resultsSet ) {
extract($resultsSet);
$imageFilePathInfo = pathinfo($imagePath);
$manifestFilePathInfo = pathinfo($manifestPath);
$encryptedImagePath = "$imagePath.gpg";
$encryptedManifestPath = "$manifestPath.gpg";
/*
$GLOBALS['logger']->log("$orderID : Encrypting $imagePath");
rms_encryptFile ($imagePath, $encryptedImagePath);
$GLOBALS['logger']->log("$orderID : Encrypting $manifestPath");
rms_encryptFile ($manifestPath, $encryptedManifestPath);
*/
/**
* 2013-10-09: Shaheeb R.
* If the file is >=101 pages, then these should be sent to customer and not GWL.
**/
if ( $pageCount >= 101 ) {
$GLOBALS['logger']->log("$orderID : PageCount: $pageCount >= 101. Sending to customer");
if ( is_file($imagePath) ) {
$GLOBALS['logger']->log("$orderID : Transferring the documents to $transferDest");
$transferStatus = TransferHandler::secftpUWPackage($imagePath);
if ( $transferStatus === true ) {
$noteComment = "Transfer of $imagePath to Synodex due to pagecount: $pageCount successful";
}else {
$noteComment = "Transfer of $imagePath to Synodex due to pagecount: $pageCount failed";
}
$GLOBALS['logger']->log("$orderID: $noteComment");
create_note($noteComment, "YES", 6, $orderID);
/**
* Email on Synodex Transfer
* Removed email from recipient list on 12/18/2013 per request in SW Ticket#8863
**/
$emailLogParms = array(
"recipientAddress"=>"email@email.com",
"emailSubject"=>"MRS Transfer to customer on MRS Case#: $orderID",
"senderName"=>"**MRS Script**",
"emailBody"=>$noteComment
);
GWLTransferHandler::phpEmail($emailLogParms);
}else {
$GLOBALS['logger']->log("$orderID : Problem encrypting $encryptedManifestPath and/or $encryptedImagePath");
}
}else {
if ( is_file($imagePath) && is_file($manifestPath) ) {
$GLOBALS['logger']->log("$orderID : Transferring the documents to $transferDest");
system ("syncPayloads $manifestPath $transferDest");
system ("syncPayloads $imagePath $transferDest");
}else {
$GLOBALS['logger']->log("$orderID : Problem encrypting $encryptedManifestPath and/or $encryptedImagePath");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment