Exemplo n.º 1
0
 /**
  * Function to save a given record model of the current module
  * @param Vtiger_Record_Model $recordModel
  */
 public function saveRecord($recordModel)
 {
     $recordModel = parent::saveRecord($recordModel);
     //code added to send mail to the vtiger_invitees
     $selectUsers = $recordModel->get('selectedusers');
     if (!empty($selectUsers)) {
         $invities = implode(';', $selectUsers);
         $mail_contents = $recordModel->getInviteUserMailData();
         $activityMode = $recordModel->getModuleName() == 'Calendar' ? 'Task' : 'Events';
         sendInvitation($invities, $activityMode, $recordModel->get('subject'), $mail_contents);
     }
 }
Exemplo n.º 2
0
         $activity_type = "Events";
     }
     ChangeStatus($status, $return_id, $activity_type);
     $mail_data = getActivityMailInfo($return_id, $status, $activity_type);
     if ($mail_data['sendnotification'] == 1) {
         getEventNotification($activity_type, $mail_data['subject'], $mail_data);
     }
     $invitee_qry = "select * from vtiger_invitees where activityid=?";
     $invitee_res = $adb->pquery($invitee_qry, array($return_id));
     $count = $adb->num_rows($invitee_res);
     if ($count != 0) {
         for ($j = 0; $j < $count; $j++) {
             $invitees_ids[] = $adb->query_result($invitee_res, $j, "inviteeid");
         }
         $invitees_ids_string = implode(';', $invitees_ids);
         sendInvitation($invitees_ids_string, $activity_type, $mail_data['subject'], $mail_data);
     }
 }
 if ($type == 'activity_postpone') {
 }
 if ($_REQUEST['viewOption'] == 'hourview' && ($mysel == 'day' || $mysel == 'week' || $mysel == 'month' || $mysel == 'year')) {
     $calendar_arr['calendar']->add_Activities($current_user);
 }
 if (isset($_REQUEST['viewOption']) && $_REQUEST['viewOption'] != null && $subtab == 'event') {
     if ($_REQUEST['viewOption'] == 'hourview') {
         $cal_log->debug("going to get calendar Event HourView");
         if ($calendar_arr['view'] == 'day') {
             echo getDayViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt');
         } elseif ($calendar_arr['view'] == 'week') {
             echo getWeekViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt');
         } elseif ($calendar_arr['view'] == 'month') {
Exemplo n.º 3
0
    $record = $focus->id;
    foreach ($storearray as $id) {
        if ($id != '') {
            $sql = "insert into vtiger_cntactivityrel values (?,?)";
            $adb->pquery($sql, array($id, $record));
            if (!empty($heldevent_id)) {
                $sql = "insert into vtiger_cntactivityrel values (?,?)";
                $adb->pquery($sql, array($id, $heldevent_id));
            }
        }
    }
}
//code added to send mail to the vtiger_invitees
if (isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid'] != '') {
    $mail_contents = getRequestData($return_id);
    sendInvitation($_REQUEST['inviteesid'], $_REQUEST['activity_mode'], $_REQUEST['subject'], $mail_contents);
}
//to delete contact account relation while editing event
if (isset($_REQUEST['deletecntlist']) && $_REQUEST['deletecntlist'] != '' && $_REQUEST['mode'] == 'edit') {
    //split the string and store it in an array
    $storearray = explode(";", $_REQUEST['deletecntlist']);
    foreach ($storearray as $id) {
        if ($id != '') {
            $record = $focus->id;
            $sql = "delete from vtiger_cntactivityrel where contactid=? and activityid=?";
            $adb->pquery($sql, array($id, $record));
        }
    }
}
//to delete activity and its parent table relation
if (isset($_REQUEST['del_actparent_rel']) && $_REQUEST['del_actparent_rel'] != '' && $_REQUEST['mode'] == 'edit') {
<?php

define('NOTIFICATION_DEBUG', true);
//echo '<h1>With sender & private</h1>';
//$player->sendNotification ('test', 'system', array ('user' => $other), $other);
$plid = Neuron_Core_Tools::getInput('_GET', 'id', 'int', 0);
$player = $plid > 0 ? Dolumar_Players_Player::getFromId($plid) : false;
if ($player) {
    sendInvitation($player);
} else {
    echo '<p style="color: red;">User not found! Append id=USER_ID to the URL.</p>';
}
function sendInvitation($player)
{
    $player->invitePeople('testinvitesender', 'system', 'testinvitereceiver', 'system');
    echo '<p style="color: green;">A notification has been sent to user ' . $player->getName() . '.</p>';
}