示例#1
0
 function testRecurringFromOutlook()
 {
     $meeting = new Meeting();
     $meeting->id = uniqid();
     $meeting->name = 'Test Meeting Recurring';
     $meeting->recurring_source = 'Outlook';
     // can't edit
     $this->assertFalse($meeting->ACLAccess('edit'));
     $meeting->recurring_source = '';
     // can edit
     $this->assertTrue($meeting->ACLAccess('edit'));
 }
示例#2
0
 public function testACLAccess()
 {
     $meeting = new Meeting();
     //test without recurring_source
     $this->assertEquals(true, $meeting->ACLAccess('edit'));
     $this->assertEquals(true, $meeting->ACLAccess('save'));
     $this->assertEquals(true, $meeting->ACLAccess('editview'));
     $this->assertEquals(true, $meeting->ACLAccess('delete'));
     //test with recurring_source
     $meeting->recurring_source = 'test';
     $this->assertEquals(false, $meeting->ACLAccess('edit'));
     $this->assertEquals(false, $meeting->ACLAccess('save'));
     $this->assertEquals(false, $meeting->ACLAccess('editview'));
     $this->assertEquals(false, $meeting->ACLAccess('delete'));
 }
示例#3
0
if ($_REQUEST['cur_module'] == 'Calls') {
    require_once "modules/Calls/Call.php";
    $bean = new Call();
    $type = 'call';
    $table_name = 'calls';
    $jn = "call_id_c";
}
if ($_REQUEST['cur_module'] == 'Meetings') {
    require_once "modules/Meetings/Meeting.php";
    $bean = new Meeting();
    $type = 'meeting';
    $table_name = 'meetings';
    $jn = "meeting_id_c";
}
$bean->retrieve($_REQUEST['record']);
if (!$bean->ACLAccess('DetailView')) {
    $json_arr = array('succuss' => 'no');
    echo json_encode($json_arr);
    die;
}
if ($bean->ACLAccess('Save')) {
    $editview = 1;
} else {
    $editview = 0;
}
if ($r_id = $bean->id) {
    $bean->retrieve($r_id);
    if (!empty($bean->parent_type) && !empty($bean->parent_id)) {
        require_once $beanFiles[$beanList[$bean->parent_type]];
        $par = new $beanList[$bean->parent_type]();
        $par->retrieve($bean->parent_id);
示例#4
0
    $bean = new Call();
    $type = 'call';
    $table_name = 'calls';
    $jn = "call_id_c";
}
if ($_REQUEST['cur_module'] == 'Meetings') {
    require_once "modules/Meetings/Meeting.php";
    $bean = new Meeting();
    $type = 'meeting';
    $table_name = 'meetings';
    $jn = "meeting_id_c";
}
if (!empty($_REQUEST['record'])) {
    $bean->retrieve($_REQUEST['record']);
}
if (!$bean->ACLAccess('Save')) {
    $json_arr = array('succuss' => 'no');
    echo json_encode($json_arr);
    die;
}
$bean->name = $_REQUEST['name'];
$bean->date_start = $_REQUEST['date_start'];
$bean->date_end = $_REQUEST['date_start'];
$bean->duration_hours = $_REQUEST['duration_hours'];
$bean->duration_minutes = $_REQUEST['duration_minutes'];
if ($_REQUEST['reminder_checked']) {
    $bean->reminder_time = $_REQUEST['reminder_time'];
} else {
    $bean->reminder_time = -1;
}
if ($_REQUEST['cur_module'] == 'Calls') {
示例#5
0
        if ($sugar_config["dbconfig"]["db_type"] == "mssql") {
            //add condition for MS Sql server.
            $where .= " AND calls.date_start + ' ' + calls.time_start <= '" . $laterWhere["date"] . " " . $laterWhere["time"] . "' ";
        } else {
            $GLOBALS['log']->fatal("No database type identified.");
        }
    }
    $call->disable_row_level_security = true;
    $focus_calls_list = $call->get_full_list("time_start", $where);
}
$open_activity_list = array();
if (count($focus_meetings_list) > 0) {
    foreach ($focus_meetings_list as $meeting) {
        $td = $timedate->merge_date_time(from_db_convert($meeting->date_start, 'date'), from_db_convert($meeting->time_start, 'time'));
        $tag = 'span';
        if ($meeting->ACLAccess('view', $meeting->isOwner($current_user->id))) {
            $tag = 'a';
        }
        $open_activity_list[] = array('name' => $meeting->name, 'id' => $meeting->id, 'type' => 'Meeting', 'module' => 'Meetings', 'status' => $meeting->status, 'parent_id' => $meeting->parent_id, 'parent_type' => $meeting->parent_type, 'parent_name' => $meeting->parent_name, 'contact_id' => $meeting->contact_id, 'contact_name' => $meeting->contact_name, 'normal_date_start' => $meeting->date_start, 'date_start' => $timedate->to_display_date($td), 'normal_time_start' => $meeting->time_start, 'time_start' => $timedate->to_display_time($td, true), 'required' => $meeting->required, 'accept_status' => $meeting->accept_status, 'tag' => $tag);
    }
}
if (count($focus_calls_list) > 0) {
    foreach ($focus_calls_list as $call) {
        $td = $timedate->merge_date_time(from_db_convert($call->date_start, 'date'), from_db_convert($call->time_start, 'time'));
        $tag = 'span';
        if ($call->ACLAccess('view', $call->isOwner($current_user->id))) {
            $tag = 'a';
        }
        $open_activity_list[] = array('name' => $call->name, 'id' => $call->id, 'type' => 'Call', 'module' => 'Calls', 'status' => $call->status, 'parent_id' => $call->parent_id, 'parent_type' => $call->parent_type, 'parent_name' => $call->parent_name, 'contact_id' => $call->contact_id, 'contact_name' => $call->contact_name, 'date_start' => $timedate->to_display_date($td), 'normal_date_start' => $call->date_start, 'normal_time_start' => $call->time_start, 'time_start' => $timedate->to_display_time($td, true), 'required' => $call->required, 'accept_status' => $call->accept_status, 'tag' => $tag);
    }
}
 function display($defines, $additionalFormFields = null)
 {
     $focus = new Meeting();
     if (!$focus->ACLAccess('EditView')) {
         return '';
     }
     return parent::display($defines, $additionalFormFields);
 }
示例#7
0
<?php

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
require_once "modules/Calls/Call.php";
require_once "modules/Meetings/Meeting.php";
require_once "modules/ECalendar/functions.php";
if ($_REQUEST['cur_module'] == 'Calls') {
    $bean = new Call();
    $table_name = 'calls';
    $jn = "call_id_c";
}
if ($_REQUEST['cur_module'] == 'Meetings') {
    $bean = new Meeting();
    $table_name = 'meetings';
    $jn = "meeting_id_c";
}
$bean->retrieve($_REQUEST['record']);
if (!$bean->ACLAccess('delete')) {
    die;
}
$bean->mark_deleted($_REQUEST['record']);
if ($_REQUEST['delete_recurring']) {
    remove_recurence($bean, $table_name, $jn, $_REQUEST['record']);
}
$json_arr = array('succuss' => 'yes');
ob_clean();
echo json_encode($json_arr);
 *
 * All copies of the Covered Code must include on each user interface screen:
 *    (i) the "Powered by SugarCRM" logo and
 *    (ii) the SugarCRM copyright notice
 * in the same form as they appear in the distribution.  See full license for
 * requirements.
 *
 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 ********************************************************************************/
/*********************************************************************************
 * Description:  TODO: To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
require_once 'modules/Meetings/Meeting.php';
$focus = new Meeting();
if (!isset($_REQUEST['record'])) {
    sugar_die($mod_strings['ERR_DELETE_RECORD']);
}
$focus->retrieve($_REQUEST['record']);
if (!$focus->ACLAccess('Delete')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
$focus->mark_deleted($_REQUEST['record']);
header("Location: index.php?module=" . $_REQUEST['return_module'] . "&action=" . $_REQUEST['return_action'] . "&record=" . $_REQUEST['return_id']);