Author Topic: Overview Calendar display, preference for "Everyone"  (Read 3157 times)

vin_gal

  • Newbie
  • *
  • Posts: 1
    • View Profile
Overview Calendar display, preference for "Everyone"
« on: March 29, 2010, 05:44:19 pm »
We have several users who need to see the same Calendar info (an overlay of multiple workspaces' calendars).

It appears as though the "Overview" Calendar only shows calendar items that were added by yourself ("My Calendar"), rather than defaulting to "Everyone" with all items in view.

It would be great if there were a preference setting so that the default Calendar view in the "Overview" tab could be set to default to "Everyone", instead of just "My Calendar".

gwest39

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Overview Calendar display, preference for "Everyone"
« Reply #1 on: September 22, 2010, 11:50:21 pm »
I too would like to see a feature to show more than just your own calendar events on the Overview tab. I modified the "fengoffice/application/views/dashboard/widget_calendar.php" file to use the same settings from the user filter and status filter on the Calendar tab and use them on the Overview tab. This will apply only to events in the calendar on the Overview tab as tasks will still use the Dashboard settings from "Show tasks assigned to:" in your user preferences. If at any time you change your Calendar tab user filter or status filter settings, you will have to refresh the Overview tab by double-clicking on the tab title so that it will reflect the same thing as your Calendar tab for events. I attached the modified "widget_calendar.php" file to this post (from Feng Office version 1.7.2) or you can change a few lines described below. (You need to be logged in to download the file and then remove the .txt extension from the file name after downloading.)

Basically, I added two lines to set an "$event_user_filter" and "$event_status_filter" variable. The existing "$user_filter" variable comes from the "Show tasks assigned to:" option from the Dashboard user settings. It does not apply to events shown, but does apply to the tasks that are shown in the Overview calendar.

Code: [Select]
$user_comp_filter = user_config_option('pending tasks widget assigned to filter');
$exploded = explode(":", $user_comp_filter);
$user_filter_id = array_var($exploded, 1);
$user_filter = $user_filter_id > 0 ? Users::findById($user_filter_id) : null;

// ***********The Two Lines were added here*************
$event_user_filter = user_config_option('calendar user filter');
$event_status_filter = user_config_option('calendar status filter');

$date_start = new DateTimeValue(mktime(0, 0, 0, $currentmonth, $startday, $currentyear));
$date_end = new DateTimeValue(mktime(0, 0, 0, $currentmonth, $endday, $currentyear));
$milestones = ProjectMilestones::getRangeMilestonesByUser($date_start, $date_end, $user_filter, $tags, active_project());
$tmp_tasks = ProjectTasks::getRangeTasksByUser($date_start, $date_end, $user_filter, $tags, active_project());
$birthdays = Contacts::instance()->getRangeContactsByBirthday($date_start, $date_end);

Then the values where changed in "ProjectEvents::getDayProjectEvents" to show "$event_user_filter" and "$event_status_filter". The "$event_user_filter" variable replaces the existing "logged_user()->getId()" (which is whoever is logged in and why it shows only your own calendar events). The "$event_status_filter" variable replaces the fixed ' 0 1 3' which represent the statuses of "Pending response" (0), "Will attend" (1), "Will not Attend" (2), and "Maybe" (3).

Code: [Select]
//}else $output .= " ";
$output .= "</div>";
// This loop writes the events for the day in the cell
if (is_numeric($w)){
$result = ProjectEvents::getDayProjectEvents($dtv, $tags, active_project(), $event_user_filter, $event_status_filter);
if(!$result)
$result = array();

This will cause the Overview calendar to pull the same events as the Calendar tab using the same user filter and status filter settings. The tasks shown in the Overview calendar will still be based on the  "Show tasks assigned to:" option from the Dashboard user settings.
« Last Edit: September 23, 2010, 01:11:07 am by gwest39 »

billydekid

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Overview Calendar display, preference for "Everyone"
« Reply #2 on: October 29, 2010, 01:22:44 am »
Hi,

I'm new on fengoffice, and use version 1.7.2.
Regarding this topic,

Does this subject is what I want?

I have a "shared workspace" but on Overview tab, under the "Upcoming events, milestones and tasks" bar -- the 2 weeks calendar is not shown. Blank page.

I have tried to change with the widget_calendar.php edited by gwest39, but nothing happened.

Any configuration that I miss?

Thanks,
[bayu]