* Used for loading the data using the jquery datatable server side proceesing modal * Gets the module name as a GET and gets the list query for the module * The fileds information is stored in the memmber array list_view_field_information of the object * @see view/related_listview.php * @author Abhik Chakraborty */ include_once "config.php"; $m = $_GET["m"]; $related_method = $_GET["related_method"]; $object = ''; $mid = $_SESSION["do_module"]->get_idmodule_by_name($m, $_SESSION["do_module"]); //Get the module from which the request is comming and use this object to other operation $module = $_GET["module"]; $sqcrmid = (int) $_GET["sqcrmid"]; $do_crm_list_view = new CRMListView(); $related_object = $do_crm_list_view->get_list_view_object($m, "related"); $entity_table_name = $related_object->getTable(); $fields_info = $related_object->list_view_field_information; $primary_key = $related_object->primary_key; $object = new $module(); $object->{$related_method}($sqcrmid); /** * FIXME * For some reason when the array index starts with 0 the text box search works well but the asc/desc on the header does not * So $aColumns array is used for text search and adding a new array $ahColumns for header sort */ $aColumns = array(); $col_count = 0; foreach ($fields_info as $field_name => $info) { $aColumns[$col_count++] = $field_name; }
$do_data_display->set_ds_show_delete_link(false); $do_data_display->set_ds_show_record_selector(false); if ($method_param != '') { $method_param = json_decode($method_param, true); if (is_array($method_param) && count($method_param) > 0) { call_user_func_array(array($object, $method), $method_param); $method_param_used = true; } else { $object->{$method}(); } } else { $object->{$method}(); } } else { $do_crm_list_view = new CRMListView(); $object = $do_crm_list_view->get_list_view_object($m, "list"); $object->get_list_query(); //check if the custom view is on and get the date filter and advanced filter query if (isset($_REQUEST["custom_view_id"]) && (int) $_REQUEST["custom_view_id"] > 0) { $do_custom_view_filter = new CustomViewFilter(); $additional_where_condition = ''; $custom_view_date_filter_qry = $do_custom_view_filter->parse_custom_view_date_filter((int) $_REQUEST["custom_view_id"]); $custom_view_adv_filter_qry = $do_custom_view_filter->parse_custom_view_advanced_filter((int) $_REQUEST["custom_view_id"]); $additional_where_condition .= ' ' . $custom_view_date_filter_qry; //print_r($custom_view_adv_filter_qry); if (false !== $custom_view_adv_filter_qry) { $additional_where_condition = ' ' . $custom_view_adv_filter_qry["where"]; $do_data_display->set_ds_additional_query_param($custom_view_adv_filter_qry["bind_params"]); } $do_data_display->set_ds_additional_where($additional_where_condition); }
<?php // Copyright SQCRM. For licensing, reuse, modification and distribution see license.txt /** * Used for loading the data using the jquery datatable server side proceesing modal * Gets the module name as a GET and gets the list query for the module * The fileds information is stored in the memmber array list_view_field_information of the object * @see popups/listdata_popup_modal */ include_once "config.php"; $m = $_GET["m"]; $object = ''; $mid = $_SESSION["do_module"]->get_idmodule_by_name($m, $_SESSION["do_module"]); $do_crm_list_view = new CRMListView(); $object = $do_crm_list_view->get_list_view_object($m, "popup"); //--handle FieldType142 if ($_REQUEST["org_dependent"] == 'yes' && (int) $_REQUEST["idorganization"] > 0) { $do_organization = new Organization(); $do_organization->get_contacts((int) $_REQUEST["idorganization"]); $object->setSqlQuery($do_organization->getSqlQuery()); } else { $object->get_list_query(); } $entity_table_name = $object->getTable(); $fields_info = $object->list_view_field_information; /** * FIXME * For some reason when the array index starts with 0 the text box search works well but the asc/desc on the header does not * So $aColumns array is used for text search and adding a new array $ahColumns for header sort */ $aColumns = array();