update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
@@ -96,44 +96,52 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
$json = getJSONobj();
|
||||
require_once("modules/EcmInvoiceOuts/EcmInvoiceOut.php");
|
||||
require_once('include/formbase.php');
|
||||
$focus = new EcmInvoiceOut();
|
||||
$json = getJSONobj();
|
||||
require_once("modules/EcmInvoiceOuts/EcmInvoiceOut.php");
|
||||
require_once('include/formbase.php');
|
||||
$focus = new EcmInvoiceOut();
|
||||
|
||||
|
||||
|
||||
if(isset($_POST['record']) && $_POST['record'] != '') {
|
||||
$focus->retrieve($_POST['record']);
|
||||
if (isset($_POST['record']) && $_POST['record'] != '') {
|
||||
$focus->retrieve($_POST['record']);
|
||||
}
|
||||
|
||||
|
||||
$check_notify = FALSE;
|
||||
|
||||
foreach ($focus->column_fields as $field) {
|
||||
if (isset($_POST[$field])) {
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$focus->ACLAccess('Save')){
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
foreach ($focus->additional_column_fields as $field) {
|
||||
if (isset($_POST[$field])) {
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
$check_notify = FALSE;
|
||||
}
|
||||
|
||||
foreach($focus->column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
$focus->position_list = $json->decode(htmlspecialchars_decode($_POST['position_list']));
|
||||
// die(var_dump( $focus->position_list));
|
||||
$focus->save($check_notify);
|
||||
|
||||
foreach($focus->additional_column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
$return_id = $focus->id;
|
||||
|
||||
$focus->position_list = $json->decode(htmlspecialchars_decode($_POST['position_list']));
|
||||
// die(var_dump( $focus->position_list));
|
||||
$focus->save($check_notify);
|
||||
// create document in twinpol crm
|
||||
if ($focus->parent_id == '1b9643ca-5b1a-8f9b-b809-586b5619b068') {
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
|
||||
curl_setopt($curl, CURLOPT_VERBOSE, 1);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($curl, CURLOPT_URL, "https://crm.twinpol.com/REST/index.php?key=d68dac4c-f784-4e1b-8267-9ffcfa0eda4c&action=createCostDocumentFromInvoice&record=" . $return_id);
|
||||
$res = curl_exec($curl);
|
||||
}
|
||||
|
||||
$return_id = $focus->id;
|
||||
echo $return_id;
|
||||
|
||||
echo $return_id;
|
||||
|
||||
handleRedirect($return_id,'EcmInvoiceOuts');
|
||||
?>
|
||||
handleRedirect($return_id, 'EcmInvoiceOuts');
|
||||
|
||||
Reference in New Issue
Block a user