getMessage(); } try{ // Verifying security $bitmask=SecurityControler::getActions($_SESSION['user']['UserId'],$_REQUEST['mr_aggregation_id']); if(check_right($bitmask,ADD_RECORD)){ // Instanciating new record $mr_record=new mr_res_record_multi(); foreach($_REQUEST as $key=>$value){ if(substr_compare($key,"new_",0,4)==0 && strpos($key,"parent")===false){ // Property to add, without new_record_mr_parent_aggregation_id $property=substr($key,4,strlen($key)-4); $mr_record->$property=$value; } } mr_res_record_multi_controler::save($mr_record); echo _RECORD_CAPTURED; $mr_record_classification=new classification_mr_res_record_multi_mr_aggregation(); $mr_record_classification->classified_mr_res_record_multi_id = $mr_record->mr_res_record_multi_id; $mr_record_classification->parent_mr_aggregation_id = $_REQUEST["new_record_parent_mr_aggregation_id"]; classification_mr_res_record_multi_mr_aggregation_controler::save($mr_record_classification); echo _AND._RECORD_CLASSIFIED; } else { echo _NOT_ALLOWED; } } catch(Exception $e){ include("modules/moreq/failure.php"); }