$users_and_groups = $prospect_win->get_users_and_groups($selected_user, false, 'assigned_to'); $group_users = array(); if (array_key_exists('data', $prospect_win_by_amount) && count($prospect_win_by_amount['data']) > 0) { if (count($users_and_groups) > 0) { if (array_key_exists('users', $users_and_groups) && count($users_and_groups['users']) > 0) { foreach ($users_and_groups['users'] as $key => $val) { if (!array_key_exists($key, $prospect_win_by_amount['data'])) { $prospect_win_by_amount['data'][$key] = 0.0; } } } if (array_key_exists('groups', $users_and_groups) && count($users_and_groups['groups']) > 0) { $do_group_users = new GroupUserRelation(); foreach ($users_and_groups['groups'] as $key => $val) { $do_group_users->get_users_related_to_group($val["idgroup"]); if ($do_group_users->getNumRows() > 0) { while ($do_group_users->next()) { $group_users[$key][] = array("user_name" => $do_group_users->user_name, "firstname" => $do_group_users->firstname, "lastname" => $do_group_users->lastname); } } if (!array_key_exists($key, $prospect_win_by_amount['data'])) { $prospect_win_by_amount['data'][$key] = 0.0; } } } } } $graph_height = 350; $height_offset = 5; $record_count = count($prospect_win_by_amount['data']); if ($record_count > $height_offset) {
echo '<p>' . nl2br($do_group->description) . '</p>'; ?> </div> <div class="right_200"> <a href="<?php echo NavigationControl::getNavigationLink($module, "group_edit", $do_group->idgroup); ?> " class="btn btn-primary"><i class="icon-white icon-edit"></i> <?php echo _('Update'); ?> </a> </div> <div class="clear_float"></div> <h3><?php echo _('Members associated to this group'); ?> </h3> <?php $do_group_user_rel = new GroupUserRelation(); $do_group_user_rel->get_users_related_to_group($do_group->idgroup); if ($do_group_user_rel->getNumRows() > 0) { while ($do_group_user_rel->next()) { echo '<p><a href="' . NavigationControl::getNavigationLink("User", "detail", $do_group_user_rel->iduser) . '">' . $do_group_user_rel->firstname . ' ' . $do_group_user_rel->lastname . '(' . $do_group_user_rel->user_name . ')</a></p>'; } } ?> </div> </div> </div><!--/row--> </div><!--/span--> </div><!--/row-->
/** * function to get the other assigne for feed. By default a feed is displayed to the users * above the action user. But in some situations its necessary to notify other user like the * users within the same group etc. * This method will return those users for feed. * @param integer $action_user_id * @param array $other_assigne * @param integer $idrecord */ public function get_other_assigne($action_user_id, $other_assigne, $idrecord = 0) { $other_assigne_users = array(); if (array_key_exists("related", $other_assigne)) { switch ($other_assigne["related"]) { case "group": if (array_key_exists("data", $other_assigne)) { if (array_key_exists("key", $other_assigne["data"]) && $other_assigne["data"]["key"] == "oldgroup") { $idgroup = $other_assigne["data"]["val"]; $do_group_user_rel = new GroupUserRelation(); $do_group_user_rel->get_users_related_to_group($idgroup); if ($do_group_user_rel->getNumRows() > 0) { while ($do_group_user_rel->next()) { $other_assigne_users[] = $do_group_user_rel->iduser; } } } if (array_key_exists("key", $other_assigne["data"]) && $other_assigne["data"]["key"] == "newgroup") { $idgroup = $other_assigne["data"]["val"]; $do_group_user_rel = new GroupUserRelation(); $do_group_user_rel->get_users_related_to_group($idgroup); if ($do_group_user_rel->getNumRows() > 0) { while ($do_group_user_rel->next()) { $other_assigne_users[] = $do_group_user_rel->iduser; } } } } break; } } return $other_assigne_users; }