public function testCreateReminderAndCreateLinkAndDeleteCall()
 {
     $call = new call();
     $aosContracts = new AOS_Contracts();
     $aosContracts->name = 'test';
     //test createReminder()
     $aosContracts->createReminder();
     //verify record ID to check that record is saved
     $this->assertTrue(isset($aosContracts->call_id));
     $this->assertEquals(36, strlen($aosContracts->call_id));
     //verify the parent_type value set by createReminder()
     $call->retrieve($aosContracts->call_id);
     $this->assertAttributeEquals('AOS_Contracts', 'parent_type', $call);
     //test createLink() and verify the parent_type value
     $aosContracts->createLink();
     $call->retrieve($aosContracts->call_id);
     $this->assertAttributeEquals('Accounts', 'parent_type', $call);
     //delete the call and verify that this record cannot be retrieved anymore.
     $aosContracts->deleteCall();
     $call->retrieve($aosContracts->call_id);
     $this->assertEquals(null, $result);
 }
Example #2
0
 function deleteCall()
 {
     require_once 'modules/Calls/Call.php';
     $call = new call();
     if ($this->call_id != null) {
         $call->id = $this->call_id;
         $call->mark_deleted($call->id);
     }
 }
Example #3
0
<?php

//required includes at start
require_once 'inc/top.php';
//others required includes only here
require_once 'inc/session.php';
require_once 'inc/functions/time.php';
require_once 'inc/classes/call.php';
require_once 'inc/classes/customer.php';
require_once 'inc/classes/web.php';
require_once 'inc/classes/subject.php';
require_once 'inc/classes/country.php';
if (isset($_POST['create'])) {
    $call = new call();
    $customer = new customer();
    $duration = $_POST['minutes'] * 60 + $_POST['seconds'];
    if ($customer->exists($_POST['mail'], false)) {
        $call->create($_SESSION['users']['id'], $_POST['type'], $_POST['web'], $_POST['subject'], $duration, $_POST['comments'], $customer->MailToId($_POST['mail']));
    } else {
        $customer->create($_POST['name'], $_POST['mail'], $_POST['city'], $_POST['country'], $_POST['phone']);
        $call->create($_SESSION['users']['id'], $_POST['type'], $_POST['web'], $_POST['subject'], $duration, $_POST['comments'], $customer->MailToId($_POST['mail']));
    }
    $msg = $call->printNiceLog(false);
}
$html['title'] = 'Create';
$html['head'] = '<script src="themes/' . THEME . '/js/jquery.js" type="text/javascript"></script>';
//theme header
include_once 'themes/' . THEME . '/header.php';
?>
			<div class="title">
				<h2>Create</h2>
Example #4
0
<?php

require_once 'modules/Calls_Reschedule/Calls_Reschedule.php';
require_once 'modules/Calls/Call.php';
global $locale, $app_list_strings, $app_strings, $current_user;
$id = $_GET['call_id'];
//get the call id
$call = new call();
//get the users name format settings
$firstname = $current_user->first_name;
$lastname = $current_user->last_name;
$full_name = $locale->getLocaleFormattedName($firstname, $lastname);
$user_real_names = $current_user->getPreference('use_real_names');
if ($user_real_names == 'on') {
    $Name = $full_name;
} else {
    $Name = $current_user->user_name;
}
$time_format = $current_user->getPreference('timef');
//get the current users time format setting
$dateformat = $current_user->getPreference('datef');
//get the current users date format
$call->retrieve($id);
//get the call fields
$time_stamp = $call->date_start;
//get the time stamp for the current call
//Set the date and time input fields on the pop-up based on the current users time format setting
switch ($time_format) {
    case 'H:i':
        $existing_date = explode(" ", $time_stamp);
        //splits the date from the time
Example #5
0
<?php

require_once 'modules/Calls_Reschedule/Calls_Reschedule.php';
require_once 'modules/Calls/Call.php';
$call = new call();
$timedate = new TimeDate();
$id = $_POST['call_id'];
$date = $_POST['date'];
$reason = $_POST['reason'];
$hour = $_POST['date_start_hours'];
$minutes = $_POST['date_start_minutes'];
$ampm = $_POST['date_start_meridiem'];
$time_format = $timedate->get_user_time_format();
//get the logged in users time settings
//Combine date and time dependant on users settings
$time_separator = ":";
if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)) {
    $time_separator = $match[1];
}
if (!empty($hour) && !empty($minutes)) {
    $time_start = $hour . $time_separator . $minutes;
}
if (isset($ampm) && !empty($ampm)) {
    $time_start = $timedate->merge_time_meridiem($time_start, $timedate->get_time_format(), $ampm);
}
if (isset($time_start) && strlen($date) == 10) {
    $date_start = $date . ' ' . $time_start;
}
$call->retrieve($id);
$call->date_start = $date_start;
//set new the start date
Example #6
0
<?php

//required includes at start
require_once 'inc/top.php';
//others required includes only here
require_once 'inc/session.php';
require_once 'inc/classes/call.php';
$call = new call();
if (isset($_POST['delete'])) {
    $call->deleteSelected();
}
$msg = $call->printNiceLog(false);
$html['title'] = 'Calls';
//theme header
include_once 'themes/' . THEME . '/header.php';
?>
			<div class="title">
				<h2>Calls</h2>
				<p><small>All the calls.</small></p>
			</div>
			<div class="entry">
				<fieldset>
					<legend>Calls</legend>
					<?php 
echo $msg;
?>
					<form action="calls.php" method="post">

					<table id="table-1" summary="tables">
						<thead>
							<tr>
Example #7
0
<?php

//required includes at start
require_once 'inc/top.php';
//others required includes only here
require_once 'inc/session.php';
require_once 'inc/functions/time.php';
require_once 'inc/classes/call.php';
require_once 'inc/classes/customer.php';
require_once 'inc/classes/web.php';
require_once 'inc/classes/subject.php';
require_once 'inc/classes/country.php';
$call = new call();
$info = $call->getInfo($_GET['id']);
$customer = new customer();
$info2 = $customer->getInfo($info['customer']);
if (isset($_POST['edit'])) {
    $duration = $_POST['minutes'] * 60 + $_POST['seconds'];
    if ($customer->exists($_POST['mail'], false)) {
        $call->edit($_POST['id'], $_SESSION['users']['id'], $_POST['type'], $_POST['web'], $_POST['subject'], $duration, $_POST['comments'], $customer->MailToId($_POST['mail']));
    } else {
        $customer->create($_POST['name'], $_POST['mail'], $_POST['city'], $_POST['country'], $_POST['phone']);
        $call->edit($_POST['id'], $_SESSION['users']['id'], $_POST['type'], $_POST['web'], $_POST['subject'], $duration, $_POST['comments'], $customer->MailToId($_POST['mail']));
    }
    $msg = $call->printNiceLog(false);
    $_GET['id'] = $_POST['id'];
    $info = $call->getInfo($_GET['id']);
    $info2 = $customer->getInfo($info['customer']);
}
$html['title'] = 'Edit';
$html['head'] = '<script src="themes/' . THEME . '/js/jquery.js" type="text/javascript"></script>';
Example #8
0
<?php

/*
@info
Κλάση για την πραγματοποίηση κλήσης/sms σε περίπτωση ανάγκης
@details
Λαμβάνει από τη βάση το κινητό τηλέφωνο του συγκεκριμένου οδηγού ή πελάτη ανάλογα
*/
header('Content-type=application/json; charset=utf-8');
require_once __DIR__ . '/db_connect.php';
$database = new DB_CONNECT();
$caller = new call();
$caller->makecall($_REQUEST["client"], $_REQUEST["Deviceid"]);
//======================================================================
class call
{
    private $jsonResponse;
    private $client;
    private $deviceid;
    private $sql;
    private $query;
    private $row;
    function __construct()
    {
        $this->jsonResponse = array();
        $this->client = null;
        $this->deviceid = null;
        $this->sql = "";
        $this->query = null;
        $this->row = null;
    }
Example #9
0
		<ul>	
			<li id="search" style="background: none;">
				<form id="searchform" method="get" action="edit.php">
					<div>
						<input type="text" name="id" id="s" size="15" />
						<br />
						<input type="submit" value="Call ID" />
					</div>
				</form>
			</li>
			<li>
				<h2>Last Calls</h2>
				<ul>
					<?php 
require_once 'inc/classes/call.php';
$call = new call();
$call->lastCalls();
?>
				</ul>
			</li>
			<li>
				<h2>Last Customers</h2>
				<ul>
					<?php 
require_once 'inc/classes/customer.php';
$customer = new customer();
$customer->lastCustomers();
?>
				</ul>
			</li>