$HD_Form->FG_GO_LINK_AFTER_ACTION = "A2B_entity_card.php?atmenu=card&stitle=Customers_Card&id="; if ($form_action == "add_sip") { $friend_param_update = " sip_buddy='1' "; if (!USE_REALTIME) { $key = "sip_changed"; } } else { $friend_param_update = " iax_buddy='1' "; if (!USE_REALTIME) { $key = "iax_changed"; } } if (!USE_REALTIME) { $who = Notification::$AGENT; $who_id = $_SESSION['agent_id']; NotificationsDAO::AddNotification($key, Notification::$HIGH, $who, $who_id); } $instance_table_friend = new Table('cc_card'); $instance_table_friend->Update_table($HD_Form->DBHandle, $friend_param_update, "id='{$id_cc_card}'", $func_table = null); if ($form_action == "add_sip") { $TABLE_BUDDY = 'cc_sip_buddies'; } else { $TABLE_BUDDY = 'cc_iax_buddies'; } $instance_table_friend = new Table($TABLE_BUDDY, '*'); $list_friend = $instance_table_friend->Get_list($HD_Form->DBHandle, "id_cc_card='{$id_cc_card}'", null, null, null, null); if (is_array($list_friend) && count($list_friend) > 0) { Header("Location: " . $HD_Form->FG_GO_LINK_AFTER_ACTION); exit; } $form_action = "add";
include './lib/customer.smarty.php'; if (!has_rights(ACX_SUPPORT)) { Header("HTTP/1.0 401 Unauthorized"); Header("Location: PP_error.php?c=accessdenied"); die; } getpost_ifset(array('title', 'description', 'priority', 'component')); $HD_Form->setDBHandler(DbConnect()); $HD_Form->init(); // ADD TICKET if ((strlen($description) > 0 || strlen($title) > 0) && is_numeric($priority) && is_numeric($component)) { $fields = "creator,title, description, id_component, priority, viewed_cust"; $ticket_table = new Table('cc_ticket', $fields); $values = "'" . $_SESSION["card_id"] . "', '" . $title . "', '" . $description . "', '" . $component . "', '" . $priority . "' ,'0'"; $id_ticket = $ticket_table->Add_table($HD_Form->DBHandle, $values, null, null, "id"); NotificationsDAO::AddNotification("ticket_added_cust", Notification::$LOW, Notification::$CUST, $_SESSION['card_id'], Notification::$LINK_TICKET_CUST, $id_ticket); $table_card = new Table("cc_card", "firstname, lastname, language, email"); $card_clause = "id = " . $_SESSION["card_id"]; $result = $table_card->Get_list($HD_Form->DBHandle, $card_clause); $owner = $_SESSION["pr_login"] . " (" . $result[0]['firstname'] . " " . $result[0]['lastname'] . ")"; try { $mail = new Mail(Mail::$TYPE_TICKET_NEW, null, $result[0]['language']); $mail->replaceInEmail(Mail::$TICKET_OWNER_KEY, $owner); $mail->replaceInEmail(Mail::$TICKET_NUMBER_KEY, $id_ticket); $mail->replaceInEmail(Mail::$TICKET_DESCRIPTION_KEY, $description); $mail->replaceInEmail(Mail::$TICKET_PRIORITY_KEY, Ticket::DisplayPriority($priority)); $mail->replaceInEmail(Mail::$TICKET_STATUS_KEY, "NEW"); $mail->replaceInEmail(Mail::$TICKET_TITLE_KEY, $title); $mail->send($result[0]['email']); } catch (A2bMailException $e) { $error_msg = $e->getMessage();
function Write_Notification($security_key, $from, $subject, $priority) { if (!$this->Check_SecurityKey ($security_key)) { return array("ERROR", "INVALID KEY"); } //add notification $who = Notification::$SOAPSERVER; $who_id = 0; $key = "SOAP-Server Notification : ".$subject; //Priority -> 0:Low ; 1:Medium ; 2:High if ($priority < 0 || $priority > 2) { $priority = 0; } NotificationsDAO::AddNotification($key, $priority, $who, $who_id); return array (true, 'Write_Notification SUCCESS'); }
if ($action == "add" && empty($err_msg)) { if ($remittance_type == "BANK") { $type = 1; } else { $type = 0; } $table_remittance = new Table("cc_remittance_request"); $fields = "id_agent,amount,type"; $values = $_SESSION['agent_id'] . ",'{$amount_gobal_cur}',{$type}"; $id = $table_remittance->Add_table($DBHandle_max, $values, $fields, "cc_remittance_request", "id"); if (is_numeric($id) && $id > 0) { $insert = true; } else { $insert = false; } NotificationsDAO::AddNotification("remittance_added_agent", Notification::$MEDIUM, Notification::$AGENT, $_SESSION['agent_id'], Notification::$LINK_REMITTANCE, $id); } } ?> <table style="width:90%;margin:0 auto;" align="center"> <tr> <td align="center"> <table width="80%" align="center" class="tablebackgroundcamel"> <tr> <td rowspan="2"><img src="<?php echo KICON_PATH; ?> /gnome-finance.gif" class="kikipic"/></td> <td width="50%">
function has_rights($condition) { return $_SESSION["rights"] & $condition; } $ACXACCESS = $_SESSION["rights"] > 0 ? true : false; $ACXDASHBOARD = has_rights(ACX_DASHBOARD); $ACXCUSTOMER = has_rights(ACX_CUSTOMER); $ACXBILLING = has_rights(ACX_BILLING); $ACXRATECARD = has_rights(ACX_RATECARD); $ACXTRUNK = has_rights(ACX_TRUNK); $ACXDID = has_rights(ACX_DID); $ACXCALLREPORT = has_rights(ACX_CALL_REPORT); $ACXCRONTSERVICE = has_rights(ACX_CRONT_SERVICE); $ACXMAIL = has_rights(ACX_MAIL); $ACXADMINISTRATOR = has_rights(ACX_ADMINISTRATOR); $ACXMAINTENANCE = has_rights(ACX_MAINTENANCE); $ACXCALLBACK = has_rights(ACX_CALLBACK); $ACXOUTBOUNDCID = has_rights(ACX_OUTBOUNDCID); $ACXPACKAGEOFFER = has_rights(ACX_PACKAGEOFFER); $ACXPREDICTIVEDIALER = has_rights(ACX_PREDICTIVE_DIALER); $ACXINVOICING = has_rights(ACX_INVOICING); $ACXSUPPORT = has_rights(ACX_SUPPORT); $ACXSETTING = has_rights(ACX_ACXSETTING); $ACXMODIFY_REFILLS = has_rights(ACX_MODIFY_REFILLS); $ACXMODIFY_PAYMENTS = has_rights(ACX_MODIFY_PAYMENTS); $ACXMODIFY_CUSTOMERS = has_rights(ACX_MODIFY_CUSTOMERS); $ACXDELETE_NOTIFICATIONS = has_rights(ACX_DELETE_NOTIFICATIONS); $ACXDELETE_CDR = has_rights(ACX_DELETE_CDR); if (isset($_SESSION["admin_id"])) { $NEW_NOTIFICATION = NotificationsDAO::IfNewNotification($_SESSION["admin_id"]); }
/** * Function to added new sign-ups in the notification * @public */ static public function create_notification_signup() { global $A2B; $FormHandler = FormHandler::GetInstance(); $id_card = $FormHandler -> RESULT_QUERY; NotificationsDAO::AddNotification("added_new_signup",Notification::$MEDIUM,Notification::$CUST,$id_card,Notification::$LINK_CARD,$id_card); }
include '../lib/agent.smarty.php'; if (!has_rights(ACX_SUPPORT)) { Header("HTTP/1.0 401 Unauthorized"); Header("Location: PP_error.php?c=accessdenied"); die; } getpost_ifset(array('title', 'description', 'priority', 'component')); $HD_Form->setDBHandler(DbConnect()); $HD_Form->init(); // ADD Ticket if (strlen($description) > 0 && is_numeric($priority) && strlen($title) > 0 && is_numeric($component)) { $fields = "creator,creator_type,title, description, id_component, priority, viewed_agent"; $ticket_table = new Table('cc_ticket', $fields); $values = "'" . $_SESSION["agent_id"] . "',1, '" . $title . "', '" . $description . "', '" . $component . "', '" . $priority . "' ,'0'"; $id_ticket = $ticket_table->Add_table($HD_Form->DBHandle, $values, null, null, "id"); NotificationsDAO::AddNotification("ticket_added_agent", Notification::$MEDIUM, Notification::$AGENT, $_SESSION['agent_id'], Notification::$LINK_TICKET_AGENT, $id_ticket); $table_agent = new Table("cc_agent", "firstname,lastname,language,email"); $agent_clause = "id = " . $_SESSION["agent_id"]; $result = $table_agent->Get_list($HD_Form->DBHandle, $agent_clause); $owner = $_SESSION["pr_login"] . " (" . $result[0]['firstname'] . " " . $result[0]['lastname'] . ")"; try { $mail = new Mail(Mail::$TYPE_TICKET_NEW, null, $result[0]['language']); $mail->replaceInEmail(Mail::$TICKET_OWNER_KEY, $owner); $mail->replaceInEmail(Mail::$TICKET_NUMBER_KEY, $id_ticket); $mail->replaceInEmail(Mail::$TICKET_PRIORITY_KEY, Ticket::DisplayPriority($priority)); $mail->replaceInEmail(Mail::$TICKET_DESCRIPTION_KEY, $description); $mail->replaceInEmail(Mail::$TICKET_STATUS_KEY, "NEW"); $mail->replaceInEmail(Mail::$TICKET_TITLE_KEY, $title); $mail->send($result[0]['email']); } catch (A2bMailException $e) { $error_msg = $e->getMessage();
} die; } if (empty($page)) { $page = 1; } $DBHandle = DbConnect(); // #### HEADER SECTION $smarty->display('main__vt.tpl'); if (!VT_DEMO) { echo $CC_help_notifications; } $nb_by_page = 15; $nb_total = NotificationsDAO::getNbNotifications(); $nb_page = ceil($nb_total / $nb_by_page); $list_notifications = NotificationsDAO::getNotifications($_SESSION['admin_id'], ($page - 1) * $nb_by_page, $nb_by_page); ?> <style type="text/css"> .newrecord { font-weight : bold; color : #444444; cursor : pointer; } </style> <?php if (sizeof($list_notifications) > 0 && $list_notifications[0] != null) { ?> <table width="90%" style ="margin-left:auto;margin-right:auto;" cellspacing="2" cellpadding="2" border="0"> <tr>
function insert_voip_config ($sip, $iax, $id_card, $accountnumber, $passui_secret, $useralias, $language) { $who_id = ''; if (!isset ($sip)) $sip = 0; if (!isset ($iax)) $iax = 0; // SIP / IAX FRIENDS TABLE $FG_TABLE_SIP_NAME = "cc_sip_buddies"; $FG_TABLE_IAX_NAME = "cc_iax_buddies"; if ((isset ($sip)) || (isset ($iax))) { $type = FRIEND_TYPE; $allow = str_replace(' ', '', FRIEND_ALLOW); $context = FRIEND_CONTEXT; $nat = FRIEND_NAT; $amaflags = FRIEND_AMAFLAGS; $qualify = FRIEND_QUALIFY; $host = FRIEND_HOST; $dtmfmode = FRIEND_DTMFMODE; if (!USE_REALTIME) { if(($sip == 1) && ($iax == 1)) $key = "sip_iax_changed"; elseif ($sip == 1) $key = "sip_changed"; elseif ($iax == 1) $key = "iax_changed"; //check who if (isset($_SESSION["user_type"]) && $_SESSION["user_type"]=="ADMIN") { $who = Notification::$ADMIN; $who_id = $_SESSION['admin_id']; } elseif (isset($_SESSION["user_type"]) && $_SESSION["user_type"]=="AGENT") { $who = Notification::$AGENT; $who_id = $_SESSION['agent_id']; } else { $who=Notification::$UNKNOWN; $id=-1; } NotificationsDAO::AddNotification($key, Notification::$HIGH, $who, $who_id); } } // Insert data for sip_buddy if ($sip) { $FG_QUERY_ADITION_SIP_FIELDS = "name, accountcode, regexten, amaflags, callerid, context, dtmfmode, host, type, defaultuser, allow, secret, id_cc_card, nat, qualify, language, rtptimeout, rtpholdtimeout, rtpkeepalive, allowtransfer"; $instance_sip_table = new Table($FG_TABLE_SIP_NAME, $FG_QUERY_ADITION_SIP_FIELDS); $FG_QUERY_ADITION_SIP_IAX_VALUE = "'$useralias', '$accountnumber', '', '$amaflags', '', '$context', '$dtmfmode','$host', '$type', ". "'$useralias', '$allow', '$passui_secret', '$id_card', '$nat', '$qualify', '$language', '60', '300', '30', 'yes'"; $result_query1 = $instance_sip_table->Add_table($this->DBHandler, $FG_QUERY_ADITION_SIP_IAX_VALUE, null, null, null); if (USE_REALTIME) { $_SESSION["is_sip_iax_change"] = 1; $_SESSION["is_sip_changed"] = 1; } } // Insert data for iax_buddy if ($iax) { $FG_QUERY_ADITION_IAX_FIELDS = "name, accountcode, regexten, amaflags, callerid, context, host, type, username, allow, secret, id_cc_card, qualify"; $instance_iax_table = new Table($FG_TABLE_IAX_NAME, $FG_QUERY_ADITION_IAX_FIELDS); $FG_QUERY_ADITION_SIP_IAX_VALUE = "'$accountnumber', '$accountnumber', '$accountnumber', '$amaflags', '', '$context', '$host', '$type', ". "'$accountnumber', '$allow', '$passui_secret', '$id_card', '$qualify'"; $result_query2 = $instance_iax_table->Add_table($this->DBHandler, $FG_QUERY_ADITION_SIP_IAX_VALUE, null, null, null); if (USE_REALTIME) { $_SESSION["is_sip_iax_change"] = 1; $_SESSION["is_iax_changed"] = 1; } } }
public function insert_voip_config($sip, $iax, $id_card, $accountnumber, $passui_secret) { $who_id = ''; if (!isset($sip)) { $sip = 0; } if (!isset($iax)) { $iax = 0; } // SIP / IAX FRIENDS TABLE $FG_TABLE_SIP_NAME = "cc_sip_buddies"; $FG_TABLE_IAX_NAME = "cc_iax_buddies"; if (isset($sip) || isset($iax)) { $type = FRIEND_TYPE; $allow = str_replace(' ', '', FRIEND_ALLOW); $context = FRIEND_CONTEXT; $nat = FRIEND_NAT; $amaflags = FRIEND_AMAFLAGS; $qualify = FRIEND_QUALIFY; $host = FRIEND_HOST; $dtmfmode = FRIEND_DTMFMODE; if (!USE_REALTIME) { if ($sip == 1 && $iax == 1) { $key = "sip_iax_changed"; } elseif ($sip == 1) { $key = "sip_changed"; } elseif ($iax == 1) { $key = "iax_changed"; } //check who if (isset($_SESSION["user_type"]) && $_SESSION["user_type"] == "ADMIN") { $who = Notification::$ADMIN; $who_id = $_SESSION['admin_id']; } elseif (isset($_SESSION["user_type"]) && $_SESSION["user_type"] == "AGENT") { $who = Notification::$AGENT; $who_id = $_SESSION['agent_id']; } else { $who = Notification::$UNKNOWN; $id = -1; } NotificationsDAO::AddNotification($key, Notification::$HIGH, $who, $who_id); } } // Insert data for sip_buddy if ($sip) { $FG_QUERY_ADITION_SIP_FIELDS = "name, accountcode, regexten, amaflags, callerid, context, dtmfmode, host, type, username, allow, secret, id_cc_card, nat, qualify"; $instance_sip_table = new Table($FG_TABLE_SIP_NAME, $FG_QUERY_ADITION_SIP_FIELDS); $FG_QUERY_ADITION_SIP_IAX_VALUE = "'{$accountnumber}', '{$accountnumber}', '{$accountnumber}', '{$amaflags}', '', '{$context}', '{$dtmfmode}','{$host}', '{$type}', " . "'{$accountnumber}', '{$allow}', '{$passui_secret}', '{$id_card}', '{$nat}', '{$qualify}'"; $result_query1 = $instance_sip_table->Add_table($this->DBHandler, $FG_QUERY_ADITION_SIP_IAX_VALUE, null, null, null); if (USE_REALTIME) { $_SESSION["is_sip_iax_change"] = 1; $_SESSION["is_sip_changed"] = 1; } } // Insert data for iax_buddy if ($iax) { $FG_QUERY_ADITION_IAX_FIELDS = "name, accountcode, regexten, amaflags, callerid, context, host, type, username, allow, secret, id_cc_card, qualify"; $instance_iax_table = new Table($FG_TABLE_IAX_NAME, $FG_QUERY_ADITION_IAX_FIELDS); $FG_QUERY_ADITION_SIP_IAX_VALUE = "'{$accountnumber}', '{$accountnumber}', '{$accountnumber}', '{$amaflags}', '', '{$context}', '{$host}', '{$type}', " . "'{$accountnumber}', '{$allow}', '{$passui_secret}', '{$id_card}', '{$qualify}'"; $result_query2 = $instance_iax_table->Add_table($this->DBHandler, $FG_QUERY_ADITION_SIP_IAX_VALUE, null, null, null); if (USE_REALTIME) { $_SESSION["is_sip_iax_change"] = 1; $_SESSION["is_iax_changed"] = 1; } } }