Results 1 to 4 of 4

Thread: Create Meeting -> Availabability Question

  1. #1
    aleon is offline Junior Member
    Join Date
    Dec 2007
    Posts
    3

    Default What controls scheduling availability?

    When scheduling a new meeting in the meetings module, what exactly controls the availability display under scheduling?

    I realize that the accept_status field in meetings_users needs to be set to 'accept', however there must be something else controlling whether or not it shows if a person is available or not.

    I came to this conclusion while writing a recurring events script for our instance. I set the accept_status field to accept for all recurring events, however this does not seem to control whether or not they are being shown as available or not in the scheduling section of the meetings module.

    What else in the system is controlling this availability?

    Any help is appreciated.
    Last edited by aleon; 2008-01-09 at 07:31 PM.

  2. #2
    aleon is offline Junior Member
    Join Date
    Dec 2007
    Posts
    3

    Default Re: Create Meeting -> Availabability Question

    Solution: Basically Sugar utilizes VCal to determine the free/busy status of each user, however this is not done automatically for every user and in fact is done only once for the creator of a meeting.

    This was obviously a problem when creating 200 meetings in a recurring series.

    The only way to solve this problem, as far as I can tell, is to run the Vcal caching function (on a recurring basis) for every user in the system by utilizing something like this

    PHP Code:
    while($userarray mysql_fetch_assoc($user)){
        require_once(
    'modules/Users/User.php');
        
    $usert = new User();
        
    $usert->retrieve($userarray['id']);
        require_once(
    'modules/vCals/vCal.php');
        
    vCal::cache_sugar_vcal($usert);

    Drawback: Even if a user has not accepted a meeting, they will be shown as busy irregardless.

  3. #3
    obaez is offline Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Default Re: Create Meeting -> Availabability Question

    Hi;

    Please I want to know how I can execute your recommendation.

    Thanks in advance.

  4. #4
    obaez is offline Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Default Re: Create Meeting -> Availabability Question

    Solution:

    Change the next lines:


    htdocs\sugarcrm\modules\Meetings\MeetingFormBase.p hp

    foreach($focus->users_arr as $user_id) {
    if(empty($user_id) || isset($existing_users[$user_id]) || isset($deleteUsers[$user_id])) {
    continue;
    }

    if(!isset($acceptStatusUsers[$user_id])) {
    $focus->users->add($user_id);
    } else {
    // update query to preserve accept_status
    $qU = 'UPDATE meetings_users SET deleted = 0, accept_status = \''.$acceptStatusUsers[$user_id].'\' ';
    $qU .= 'WHERE meeting_id = \''.$focus->id.'\' ';
    $qU .= 'AND user_id = \''.$user_id.'\'';
    $focus->db->query($qU);

    For:



    foreach($focus->users_arr as $user_id) {
    if(empty($user_id) || isset($existing_users[$user_id]) || isset($deleteUsers[$user_id])) {
    continue;
    }

    if(!isset($acceptStatusUsers[$user_id])) {
    $focus->users->add($user_id);
    $qU = 'UPDATE meetings_users SET deleted = 0, accept_status = \'accept\' ';
    $qU .= 'WHERE meeting_id = \''.$focus->id.'\' ';
    $qU .= 'AND user_id = \''.$user_id.'\'';
    $focus->db->query($qU);

    require_once('modules/Users/User.php');
    $usert = new User();
    $usert->retrieve($user_id);
    require_once('modules/vCals/vCal.php');
    vCal::cache_sugar_vcal($usert);
    } else {
    // update query to preserve accept_status
    $qU = 'UPDATE meetings_users SET deleted = 0, accept_status = \''.$acceptStatusUsers[$user_id].'\' ';
    $qU .= 'WHERE meeting_id = \''.$focus->id.'\' ';
    $qU .= 'AND user_id = \''.$user_id.'\'';
    $focus->db->query($qU);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Workflow Quote -> Create Opportunity
    By StephaneZ in forum Developer Help
    Replies: 3
    Last Post: 2007-10-09, 07:15 PM
  2. Replies: 1
    Last Post: 2006-11-01, 02:50 PM
  3. Replies: 0
    Last Post: 2006-06-21, 02:54 PM
  4. Replies: 0
    Last Post: 2005-11-07, 04:22 PM
  5. Create Meeting Error, GLOBAL_REGISTRY
    By xtwang in forum Help
    Replies: 0
    Last Post: 2005-05-18, 12:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •