//RESULT DASHBOARD Jaykumar Patel public function result_dashboard_count($session, $module_list, $getall, $start_date = "", $end_date = "") { // $GLOBALS['log']->fatal('Begin: CustomSugarWebServiceImpl->lat_dashboard_count'); /*check whether the session is valid or not*/ $error = new SoapError(); if (!self::$helperObject->checkSessionAndModuleAccess($session, 'invalid_session', '', '', '', $error)) { return; } $dashboard_color_array = array("skipped as not detected in the next method below", "#913e98", "#3ab5e4", "#6892a4", "#49924c", "#d97a14","#716b32","#14bd7e","#c465bb","#462a36", "#ff6d00"); //array_rand($dashboard_color_array) $final_return_array = array(); // $GLOBALS['log']->fatal("module_list : " . print_r($module_list, true)); $module_name_set = array('Opportunities','Leads','Cases','Bugs','Tasks'); $m_list = array(); foreach($module_list as $module1 => $val) { array_push($m_list,$module1); } $flag = "false"; foreach ($module_name_set as $module_name) { if (in_array($module_name, $m_list)) { $value['ta_date_field'] = ""; $count_array = self::$helperObject->result_get_dashboard_count($module_name, $value['ta_date_field'], $getall, $start_date, $end_date); $count_array['color'] = next($dashboard_color_array); $return[] = $count_array; $flag = "true"; } } if($flag == "true") { $return = array(result => "Success", data => $return); return $return; } else { $return = array(result => "Fail", data => "Configured Modules are not Available for Result Dashboard"); return $return; } } public function result_scorecard_count($session, $module_name, $date_field, $dom_field, $getall, $assigned_user_id, $user_wise_enable, $start_date = "", $end_date = "") { // $GLOBALS['log']->fatal('Begin: CustomSugarWebServiceImpl->periodic_scorecard_count'); /*check whether the session is valid or not*/ $error = new SoapError(); if (!self::$helperObject->checkSessionAndModuleAccess($session, 'invalid_session', '', '', '', $error)) { return; } $module_bean = BeanFactory::newBean($module_name); $dom_name = $module_bean->field_defs[$dom_field]['options']; //$GLOBALS['log']->fatal("module : $module_name || date_field : $date_field || dom_field : $dom_field || getall : $getall || assigned_user_id : $assigned_user_id || user_wise_enable : $user_wise_enable || dom_name : $dom_name"); if (!is_array($module_bean->field_defs[$date_field])) { $date_field = ""; } switch ($module_name) { case 'Calls': $record_array = self::$helperObject->result_get_scorecard_count_call($module_name, $date_field, $getall, $assigned_user_id, $user_wise_enable, $start_date, $end_date); break; default: $record_array = self::$helperObject->result_get_scorecard_count($module_name, $date_field, $dom_field, $dom_name, $getall, $assigned_user_id, $user_wise_enable, $start_date, $end_date); break; } // $GLOBALS['log']->fatal('End: CustomSugarWebServiceImpl->periodic_scorecard_count'); return $record_array; } //RESULT DASHBOARD END Jaykumar patel