Add php files
This commit is contained in:
78
modules/EcmFkVatKinds/Save.php
Executable file
78
modules/EcmFkVatKinds/Save.php
Executable file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
$json = getJSONobj();
|
||||
$pll = array();
|
||||
|
||||
$exp = explode("||||", $_POST['items_list']);
|
||||
|
||||
// dump($_REQUEST);
|
||||
// exit;
|
||||
|
||||
foreach($exp as $ep){
|
||||
if($ep){
|
||||
$pll[] = $json->decode(htmlspecialchars_decode($ep));
|
||||
}
|
||||
}
|
||||
|
||||
$_POST['position_list'] = $pll;
|
||||
|
||||
require_once("modules/EcmFkVatKinds/EcmFkVatKind.php");
|
||||
require_once('include/formbase.php');
|
||||
|
||||
$focus = new EcmFkVatKind();
|
||||
|
||||
if(isset($_POST['record']) && $_POST['record'] != '') {
|
||||
$focus->retrieve($_POST['record']);
|
||||
}
|
||||
|
||||
if(!$focus->ACLAccess('Save')){
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
$check_notify = FALSE;
|
||||
|
||||
foreach($focus->column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($focus->additional_column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
$pl = $_POST['position_list'];
|
||||
|
||||
foreach($pl as $k => &$v) {
|
||||
$v['position'] = $k;
|
||||
|
||||
$v['title'] = $v['i_title'];
|
||||
$v['order'] = $v['i_order'];
|
||||
|
||||
$v['col_1'] = encodeDbData($v['i_col_1_decoded']);
|
||||
$v['col_2'] = encodeDbData($v['i_col_2_decoded']);
|
||||
|
||||
$v['col_1_translations'] = encodeDbData($v['i_col_1_translations_decoded']);
|
||||
$v['col_2_translations'] = encodeDbData($v['i_col_2_translations_decoded']);
|
||||
}
|
||||
|
||||
// dump($pl);
|
||||
// dump($pll);
|
||||
// exit;
|
||||
|
||||
// dump($focus->id);
|
||||
|
||||
$focus->position_list = $pl;
|
||||
$focus->save($check_notify);
|
||||
$return_id = $focus->id;
|
||||
|
||||
handleRedirect($return_id,'EcmFkVatKinds');
|
||||
Reference in New Issue
Block a user