//START NEW PERIODIC DASHBOARD
public function periodic_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", "#49924c", "#ff6d00", "#3ab5e4", "#6892a4", "#913e98", "#d97a14","#716b32","#14bd7e","#c465bb","#462a36");
//array_rand($dashboard_color_array)
$final_return_array = array();
// $GLOBALS['log']->fatal("module_list : " . print_r($module_list, true));
if (isset($module_list)) {
foreach ($module_list as $module_name => $value) {
$count_array = self::$helperObject->periodic_get_dashboard_count($module_name, $value['ta_date_field'], $getall, $start_date, $end_date);
$count_array['color'] = next($dashboard_color_array);
$return[] = $count_array;
}
}
// $GLOBALS['log']->fatal('End: CustomSugarWebServiceImpl->lat_dashboard_count');
return $return;
}
public function periodic_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->periodic_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->periodic_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;
}
public function lat_multi_scorecard_count($session, $module_name, $date_field, $dom_field, $getall, $assigned_user_id, $user_wise_enable)
{
$GLOBALS['log']->fatal('Begin: CustomSugarWebServiceImpl->lat_multi_scorecard_count'.$module_name);
/*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->lat_get_scorecard_count_call($module_name, $date_field, $getall, $assigned_user_id, $user_wise_enable);
break;
default:
$record_array = self::$helperObject->lat_multi_get_scorecard_count($module_name, $date_field, $dom_field, $dom_name, $getall, $assigned_user_id, $user_wise_enable);
break;
}
// $GLOBALS['log']->fatal('End: CustomSugarWebServiceImpl->lat_multi_scorecard_count');
return $record_array;
}
//END NEW PERIODIC DASHBOARD