816 lines
34 KiB
Smarty
816 lines
34 KiB
Smarty
|
|
|
||
|
|
{*
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The contents of this file are subject to the SugarCRM Professional End User
|
||
|
|
* License Agreement ("License") which can be viewed at
|
||
|
|
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
|
||
|
|
* By installing or using this file, You have unconditionally agreed to the
|
||
|
|
* terms and conditions of the License, and You may not use this file except in
|
||
|
|
* compliance with the License. Under the terms of the license, You shall not,
|
||
|
|
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
|
||
|
|
* or otherwise transfer Your rights to the Software, and 2) use the Software
|
||
|
|
* for timesharing or service bureau purposes such as hosting the Software for
|
||
|
|
* commercial gain and/or for the benefit of a third party. Use of the Software
|
||
|
|
* may be subject to applicable fees and any use of the Software without first
|
||
|
|
* paying applicable fees is strictly prohibited. You do not have the right to
|
||
|
|
* remove SugarCRM copyrights from the source code or user interface.
|
||
|
|
*
|
||
|
|
* 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.
|
||
|
|
*
|
||
|
|
* Your Warranty, Limitations of liability and Indemnity are expressly stated
|
||
|
|
* in the License. Please refer to the License for the specific language
|
||
|
|
* governing these rights and limitations under the License. Portions created
|
||
|
|
* by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.; All Rights Reserved.
|
||
|
|
*/
|
||
|
|
|
||
|
|
// $Id$
|
||
|
|
|
||
|
|
*}
|
||
|
|
<!-- BEGIN: main -->
|
||
|
|
<link rel="stylesheet" type="text/css" href="themes/{THEME}/navigation.css?s=4.5.0&c=" />
|
||
|
|
<link rel="stylesheet" type="text/css" href="themes/{THEME}/style.css?s=4.5.0&c=" />
|
||
|
|
<link rel="stylesheet" type="text/css" href="themes/{THEME}/colors.sugar.css?s=4.5.0&c=" />
|
||
|
|
<link rel="stylesheet" type="text/css" href="themes/{THEME}/fonts.normal.css?s=4.5.0&c=" />
|
||
|
|
<link href="themes/{THEME}/colors.sugar.css?s=4.5.0&c=" rel="stylesheet" type="text/css" title="color:sugar" />
|
||
|
|
<link href="themes/{THEME}/colors.blue.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:blue" />
|
||
|
|
<link href="themes/{THEME}/colors.green.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:green" />
|
||
|
|
<link href="themes/{THEME}/colors.purple.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:purple" />
|
||
|
|
<link href="themes/{THEME}/colors.ocher.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:ocher" />
|
||
|
|
|
||
|
|
<link href="themes/{THEME}/fonts.normal.css?s=4.5.0&c=" rel="stylesheet" type="text/css" title="font:normal" />
|
||
|
|
<link href="themes/{THEME}/fonts.larger.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="font:larger" />
|
||
|
|
<link href="themes/{THEME}/fonts.largest.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="font:largest" />
|
||
|
|
|
||
|
|
<center><h1>{call_name}</h1></center>
|
||
|
|
|
||
|
|
<hr width="90%">
|
||
|
|
|
||
|
|
<center>
|
||
|
|
<table border="0" cellpadding="0" cellspacing="0" width="90%">
|
||
|
|
<tr>
|
||
|
|
<th colspan="2" class='listViewPaginationTdS1'><h3>Information</h3></th>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td width="25%" class="tabDetailViewDL"><slot>Phone Number:</slot></td>
|
||
|
|
<td class="tabDetailViewDF">{call_number}</td>
|
||
|
|
</tr>
|
||
|
|
<!-- BEGIN: account_info_switch -->
|
||
|
|
<tr>
|
||
|
|
<td width="25%" class="tabDetailViewDL"><slot>Account:</slot></td>
|
||
|
|
<td class="tabDetailViewDF">{account_name}</td>
|
||
|
|
</tr>
|
||
|
|
<!-- END: account_info_switch -->
|
||
|
|
<!-- BEGIN: website_switch -->
|
||
|
|
<tr>
|
||
|
|
<td width="25%" class="tabDetailViewDL"><slot>Website:</slot></td>
|
||
|
|
<td class="tabDetailViewDF">{url}</td>
|
||
|
|
</tr>
|
||
|
|
<!-- END: website_switch -->
|
||
|
|
<!-- BEGIN: email_switch -->
|
||
|
|
<tr>
|
||
|
|
<td width="25%" class="tabDetailViewDL"><slot>Email:</slot></td>
|
||
|
|
<td class="tabDetailViewDF">{email}</td>
|
||
|
|
</tr>
|
||
|
|
<!-- END: email_switch -->
|
||
|
|
<!-- BEGIN: addr_switch -->
|
||
|
|
<tr valign="top">
|
||
|
|
<td width="25%" class="tabDetailViewDL"><slot>Address:</slot></td>
|
||
|
|
<td class="tabDetailViewDF">{addrstreet}<br>
|
||
|
|
{addrcity} {addrstate} {addrzip} {addrcountry}
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<!-- END: addr_switch -->
|
||
|
|
<!-- BEGIN: billing_addr_switch -->
|
||
|
|
<tr valign="top">
|
||
|
|
<td width="25%" class="tabDetailViewDL"><slot>Billing Address:</slot></td>
|
||
|
|
<td class="tabDetailViewDF">{billingaddrstreet}<br>
|
||
|
|
{billingaddrcity} {billingaddrstate} {billingaddrzip} {billingaddrcountry}
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<!-- END: billing_addr_switch -->
|
||
|
|
|
||
|
|
<script type="text/javascript" src="include/asterisk/calendar/e.js"></script>
|
||
|
|
<script type="text/javascript" src="include/asterisk/calendar/d.js"></script>
|
||
|
|
<script type="text/javascript" src="include/asterisk/calendar/homw.js"></script>
|
||
|
|
<script type="text/javascript" src="include/asterisk/calendar/cal.js"></script>
|
||
|
|
|
||
|
|
<div style="position: relative; visibility:hidden; width: 250px; height: 5px; left: -220px; top: 190px; background-color: yellow;">
|
||
|
|
<iframe src="include/asterisk/calendar/calx.html" id="CalFrame" name="CalFrame" style="visibility: hidden; position: relative; z-index: 100;" marginheight="0" marginwidth="0" noresize="" frameborder="0" scrolling="no"></iframe>
|
||
|
|
<script language="javascript" src="include/asterisk/calendar/calx.js"></script>
|
||
|
|
|
||
|
|
<input id="FDate" name="FDate" value="mm/dd/yyyy" type="hidden">
|
||
|
|
</table>
|
||
|
|
<br>
|
||
|
|
<center>
|
||
|
|
<table border="0" cellspacing="0" cellpadding="5" width="90%">
|
||
|
|
<tr>
|
||
|
|
<th align="center">
|
||
|
|
<!-- BEGIN: call_record_switch -->
|
||
|
|
<script language="Javascript">
|
||
|
|
function startRecording(){
|
||
|
|
window.location.href="index.php?module=Contacts&action=AS_Popup&html=Dial&form=Dial&number={call_number}&dialed=0{save_suffix}&start_recording=1";}
|
||
|
|
</script>
|
||
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
||
|
|
<tr>
|
||
|
|
<th align="center"><font color="red">Start Recording:</font></td>
|
||
|
|
</tr><tr>
|
||
|
|
<!--<th align="center"><input type="button" class="button" value=" Start " name="start_recording" id="start_recording" onclick="javascript: startRecording();"></th> -->
|
||
|
|
<th align="center"><input type="button" class="button" value=" Start " name="start_recording" id="start_recording" onclick="javascript: alert('Recording functionality is not currently implemented')"></th>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<!-- END: call_record_switch -->
|
||
|
|
</th>
|
||
|
|
<th align="center">
|
||
|
|
<!-- BEGIN: call_scheduled_switch -->
|
||
|
|
<script>
|
||
|
|
//BEGIN - CREDIT FOR THIS CODE IS GIVEN TO http://www.captain.at/howto-ajax-form-post-request.php
|
||
|
|
var http_request = false;
|
||
|
|
function makePOSTRequest(url, parameters) {
|
||
|
|
http_request = false;
|
||
|
|
if (window.XMLHttpRequest) { // Mozilla, Safari,...
|
||
|
|
http_request = new XMLHttpRequest();
|
||
|
|
if (http_request.overrideMimeType) {
|
||
|
|
// set type accordingly to anticipated content type
|
||
|
|
//http_request.overrideMimeType('text/xml');
|
||
|
|
http_request.overrideMimeType('text/html');
|
||
|
|
}
|
||
|
|
} else if (window.ActiveXObject) { // IE
|
||
|
|
try {
|
||
|
|
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
||
|
|
} catch (e) {
|
||
|
|
try {
|
||
|
|
http_request = new ActiveXObject("Microsoft.XMLHTTP");
|
||
|
|
} catch (e) {}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (!http_request) {
|
||
|
|
alert('Cannot create XMLHTTP instance');
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
http_request.onreadystatechange = alertContents;
|
||
|
|
http_request.open('POST', url, true);
|
||
|
|
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||
|
|
http_request.setRequestHeader("Content-length", parameters.length);
|
||
|
|
http_request.setRequestHeader("Connection", "close");
|
||
|
|
http_request.send(parameters);
|
||
|
|
}
|
||
|
|
|
||
|
|
function alertContents() {
|
||
|
|
if (http_request.readyState == 4) {
|
||
|
|
if (http_request.status == 200) {
|
||
|
|
//alert(http_request.responseText);
|
||
|
|
result = http_request.responseText;
|
||
|
|
//document.getElementById('myspan').innerHTML = result;
|
||
|
|
} else {
|
||
|
|
alert('There was a problem with the request.');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function get(obj) {
|
||
|
|
var poststr = addCall('{call_name}','{call_id}','{type}','{current_user_name}','{current_user_id}');
|
||
|
|
makePOSTRequest('index.php', poststr);
|
||
|
|
}
|
||
|
|
//END - CREDIT FOR THIS CODE IS GIVEN TO http://www.captain.at/howto-ajax-form-post-request.php
|
||
|
|
|
||
|
|
function addCall(call_name, call_id, type, curr_usr_name, curr_usr_id){
|
||
|
|
var date=new Date();
|
||
|
|
var m=date.getMonth();
|
||
|
|
var d=date.getDate();
|
||
|
|
var h=date.getHours();
|
||
|
|
|
||
|
|
var parameters = "module=Calls&name=Call Made To "+call_name+"&direction=Outbound&status=Held&date_start="+date.getFullYear()+"-"+m+"-"+d+"&time_hour_start="+h+"&time_minute_start="+getMinuteTime()+"&duration_hours=0&duration_minutes=15&should_remind=0&assigned_user_name="+curr_usr_name+"&assigned_user_id="+curr_usr_id+"&action=Save";
|
||
|
|
|
||
|
|
if(type=="Contact"){
|
||
|
|
parameters += "&parent_type=Contacts&parent_id="+call_id+"&parent_name="+call_name+"&contact_name="+call_name+"&contact_id="+call_id;
|
||
|
|
}
|
||
|
|
else if(type=="Account"){
|
||
|
|
parameters +="&parent_type=Accounts&parent_id="+call_id+"&parent_name="+call_name;
|
||
|
|
}
|
||
|
|
else if(type=="Lead"){
|
||
|
|
parameters +="&parent_type=Leads&parent_id="+call_id+"&parent_name="+call_name;
|
||
|
|
}
|
||
|
|
|
||
|
|
return parameters;
|
||
|
|
}
|
||
|
|
|
||
|
|
function getMinuteTime(){
|
||
|
|
var date=new Date();
|
||
|
|
if(date.getMinutes()<15)
|
||
|
|
return "0";
|
||
|
|
else if(date.getMinutes()<30)
|
||
|
|
return "15";
|
||
|
|
else if(date.getMinutes()<45)
|
||
|
|
return "30";
|
||
|
|
else
|
||
|
|
return "45";
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function removeScheduled(){
|
||
|
|
document.getElementById('call_scheduled').style.display='none';
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
<table id="call_scheduled" border="0" cellspacing="0" cellpadding="0">
|
||
|
|
<tr>
|
||
|
|
<th> Was this call scheduled? </th>
|
||
|
|
</tr><tr>
|
||
|
|
<th><input type="button" class="button" value=" YES " name="call_y_scheduled" id="call_y_scheduled" onclick="javascript:removeScheduled()">   <input type="button" class="button" value=" NO " name="call_n_scheduled" id="call_n_scheduled" onclick="javascript:get(this.parentNode);removeScheduled();"></th>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<!-- END: call_scheduled_switch -->
|
||
|
|
</th>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<!--
|
||
|
|
================================================================================================================================================
|
||
|
|
DISPLAY CALL INFORMATION ABOVE
|
||
|
|
|
||
|
|
QUICK CREATE ABILITY BELOW
|
||
|
|
================================================================================================================================================
|
||
|
|
-->
|
||
|
|
|
||
|
|
<script language="javascript">
|
||
|
|
function show_hide_toggle(elementId, width, height){
|
||
|
|
hide_others(elementId);
|
||
|
|
if (document.getElementById && !document.all) {
|
||
|
|
obj = getObj(elementId);
|
||
|
|
if(obj.style.display == 'none'){
|
||
|
|
resizeWindow(width, height);
|
||
|
|
obj.style.display = '';
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
resizeWindow('550','350');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function resizeWindow(width, height){
|
||
|
|
window.resizeTo(width, height);
|
||
|
|
}
|
||
|
|
|
||
|
|
function hide_others(elementId){
|
||
|
|
hideStatus();
|
||
|
|
if(elementId=='div_quickCreateCall'){
|
||
|
|
obj=getObj('div_quickCreateTask');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateNote');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateMeeting');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
}
|
||
|
|
if(elementId=='div_quickCreateMeeting'){
|
||
|
|
obj=getObj('div_quickCreateTask');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateNote');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateCall');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
}
|
||
|
|
else if (elementId=='div_quickCreateTask'){
|
||
|
|
obj=getObj('div_quickCreateCall');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateNote');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateMeeting');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
}
|
||
|
|
else if (elementId=='div_quickCreateNote'){
|
||
|
|
obj=getObj('div_quickCreateTask');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateMeeting');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
obj=getObj('div_quickCreateCall');
|
||
|
|
obj.style.display = 'none';
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function hideStatus(){
|
||
|
|
MeetingStatus=getObj('div_quickCreateMeetingStatus');
|
||
|
|
CallStatus=getObj('div_quickCreateCallStatus');
|
||
|
|
TaskStatus=getObj('div_quickCreateTaskStatus');
|
||
|
|
NoteStatus=getObj('div_quickCreateNoteStatus');
|
||
|
|
|
||
|
|
MeetingStatus.style.display = "none";
|
||
|
|
CallStatus.style.display = "none";
|
||
|
|
TaskStatus.style.display = "none";
|
||
|
|
NoteStatus.style.display = "none";
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function getObj(elementId){
|
||
|
|
return document.getElementById(elementId);
|
||
|
|
}
|
||
|
|
|
||
|
|
function quickCreateMeeting(){
|
||
|
|
var fName = document.form_quickCreateMeeting.elements['name'].value;
|
||
|
|
var fStatus = document.form_quickCreateMeeting.elements['status'].value;
|
||
|
|
var fStartDate = document.form_quickCreateMeeting.elements['fdt'].value;
|
||
|
|
var fStartHour = document.form_quickCreateMeeting.elements['date_start_time_hour'].options[document.form_quickCreateMeeting.elements['date_start_time_hour'].selectedIndex].value;
|
||
|
|
var fStartMinute = document.form_quickCreateMeeting.elements['date_start_time_minute'].options[document.form_quickCreateMeeting.elements['date_start_time_minute'].selectedIndex].value;
|
||
|
|
var fDescription = document.form_quickCreateMeeting.elements['description'].value;
|
||
|
|
|
||
|
|
if(fName == "")
|
||
|
|
{
|
||
|
|
alert("Name field is required");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if(fStartDate == "")
|
||
|
|
{
|
||
|
|
alert("Date field is required");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
var parameters = "module=Meetings&name="+fName+"&status="+fStatus+"&date_start="+fStartDate+" "+fStartHour+":"+fStartMinute+"&description="+fDescription+"&reminder_checked=1&reminder_time=600&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||
|
|
|
||
|
|
if("{type}"=="Contact"){
|
||
|
|
parameters += "&parent_type=Contacts&parent_id={call_id}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Account"){
|
||
|
|
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Lead"){
|
||
|
|
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
makePOSTRequest('index.php',parameters);
|
||
|
|
|
||
|
|
document.form_quickCreateMeeting.elements['name'].value = "";
|
||
|
|
todayDate(document.form_quickCreateMeeting.elements['fdt']);
|
||
|
|
//document.form_quickCreateMeeting.elements['fdt'].value = "";
|
||
|
|
document.form_quickCreateMeeting.elements['description'].value = "";
|
||
|
|
setHourTime(document.form_quickCreateMeeting.elements['date_start_time_hour']);
|
||
|
|
setMinuteTime(document.form_quickCreateMeeting.elements['date_start_time_minute']);
|
||
|
|
|
||
|
|
show_hide_toggle('div_quickCreateMeeting', '500', '575');
|
||
|
|
MeetingStatus=getObj('div_quickCreateMeetingStatus');
|
||
|
|
MeetingStatus.style.display='';
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function quickCreateCall(){
|
||
|
|
var fName = document.form_quickCreateCall.elements['name'].value;
|
||
|
|
var fDirection = document.form_quickCreateCall.elements['direction'].options[document.form_quickCreateCall.elements['direction'].selectedIndex].value;
|
||
|
|
var fStatus = document.form_quickCreateCall.elements['status'].value;
|
||
|
|
var fStartDate = document.form_quickCreateCall.elements['fdt'].value;
|
||
|
|
var fStartHour = document.form_quickCreateCall.elements['date_start_time_hour'].options[document.form_quickCreateCall.elements['date_start_time_hour'].selectedIndex].value;
|
||
|
|
var fStartMinute = document.form_quickCreateCall.elements['date_start_time_minute'].options[document.form_quickCreateCall.elements['date_start_time_minute'].selectedIndex].value;
|
||
|
|
var fDescription = document.form_quickCreateCall.elements['description'].value;
|
||
|
|
|
||
|
|
if(fName == "")
|
||
|
|
{
|
||
|
|
alert("Subject field is required");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if(fStartDate == "")
|
||
|
|
{
|
||
|
|
alert("Date field is required");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
var parameters = "module=Calls&name="+fName+"&direction="+fDirection+"&status="+fStatus+"&date_start="+fStartDate+" "+fStartHour+":"+fStartMinute+"&description="+fDescription+"&duration_hours=0&duration_minutes=15&should_remind=0&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||
|
|
|
||
|
|
if("{type}"=="Contact"){
|
||
|
|
parameters += "&parent_type=Contacts&parent_id={call_id}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Account"){
|
||
|
|
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Lead"){
|
||
|
|
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
makePOSTRequest('index.php',parameters);
|
||
|
|
|
||
|
|
document.form_quickCreateCall.elements['name'].value = "";
|
||
|
|
todayDate(document.form_quickCreateCall.elements['fdt']);
|
||
|
|
//document.form_quickCreateCall.elements['fdt'].value = "";
|
||
|
|
document.form_quickCreateCall.elements['description'].value = "";
|
||
|
|
setHourTime(document.form_quickCreateCall.elements['date_start_time_hour']);
|
||
|
|
setMinuteTime(document.form_quickCreateCall.elements['date_start_time_minute']);
|
||
|
|
|
||
|
|
show_hide_toggle('div_quickCreateCall', '500', '575');
|
||
|
|
CallStatus=getObj('div_quickCreateCallStatus');
|
||
|
|
CallStatus.style.display='';
|
||
|
|
}
|
||
|
|
|
||
|
|
function quickCreateTask(){
|
||
|
|
var fName = document.form_quickCreateTask.elements['name'].value;
|
||
|
|
var fPriority = document.form_quickCreateTask.elements['priority'].value;
|
||
|
|
var fDateDue = document.form_quickCreateTask.elements['fdt'].value;
|
||
|
|
|
||
|
|
if(fName == "")
|
||
|
|
{
|
||
|
|
alert("Subject field is required");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
var parameters = "module=Tasks&name="+fName+"&priority="+fPriority+"&date_due="+fDateDue+"&status=Not Started"+"&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||
|
|
|
||
|
|
if("{type}"=="Contact"){
|
||
|
|
parameters += "&parent_type=Accounts&parent_id={account_id}&parent_name={account_name}&contact_name={call_name}&contact_id={call_id}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Account"){
|
||
|
|
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Lead"){
|
||
|
|
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
makePOSTRequest('index.php', parameters);
|
||
|
|
|
||
|
|
document.form_quickCreateTask.elements['name'].value = "";
|
||
|
|
document.form_quickCreateTask.elements['fdt'].value = "";
|
||
|
|
|
||
|
|
show_hide_toggle('div_quickCreateTask', '500', '575');
|
||
|
|
TaskStatus=getObj('div_quickCreateTaskStatus');
|
||
|
|
TaskStatus.style.display='';
|
||
|
|
}
|
||
|
|
|
||
|
|
function quickCreateNote(){
|
||
|
|
var fName = document.form_quickCreateNote.elements['name'].value;
|
||
|
|
var fDescription = document.form_quickCreateNote.elements['description'].value;
|
||
|
|
|
||
|
|
if(fName == "")
|
||
|
|
{
|
||
|
|
alert("Subject field required");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
var parameters = "module=Notes&name="+fName+"&description="+fDescription+"&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||
|
|
if("{type}"=="Contact"){
|
||
|
|
parameters += "&parent_type=Accounts&parent_id={account_id}&parent_name={account_name}&contact_name={call_name}&contact_id={call_id}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Account"){
|
||
|
|
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
else if("{type}"=="Lead"){
|
||
|
|
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||
|
|
}
|
||
|
|
makePOSTRequest('index.php',parameters);
|
||
|
|
|
||
|
|
document.form_quickCreateNote.elements['name'].value = "";
|
||
|
|
document.form_quickCreateNote.elements['description'].value = "";
|
||
|
|
|
||
|
|
show_hide_toggle('div_quickCreateNote', '500', '575');
|
||
|
|
NoteStatus=getObj('div_quickCreateNoteStatus');
|
||
|
|
NoteStatus.style.display='';
|
||
|
|
}
|
||
|
|
|
||
|
|
function todayDate(obj){
|
||
|
|
var myDate = new Date();
|
||
|
|
curr_month = myDate.getMonth() + 1 + '';//to convert to string
|
||
|
|
if(curr_month.length==1){
|
||
|
|
curr_month = "0"+curr_month;
|
||
|
|
}
|
||
|
|
curr_day = myDate.getDate()+'';//to convert to string
|
||
|
|
if(curr_day.length==1){
|
||
|
|
curr_day = "0"+curr_day;
|
||
|
|
}
|
||
|
|
curr_year = myDate.getFullYear();
|
||
|
|
renderDate = curr_month+"/"+curr_day+"/"+curr_year;
|
||
|
|
obj.value = renderDate;
|
||
|
|
}
|
||
|
|
|
||
|
|
function setMinuteTime(obj){
|
||
|
|
var minuteTime = getMinuteTime();
|
||
|
|
if (minuteTime == "00"){
|
||
|
|
obj.selectedIndex = 0;
|
||
|
|
}
|
||
|
|
else if (minuteTime == "15"){
|
||
|
|
obj.selectedIndex = 1;
|
||
|
|
}
|
||
|
|
else if (minuteTime == "30"){
|
||
|
|
obj.selectedIndex = 2;
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
obj.selectedIndex = 3;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function setHourTime(obj){
|
||
|
|
var date = new Date();
|
||
|
|
h = date.getHours();
|
||
|
|
obj.selectedIndex = h;
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="leftColumnModuleHead">
|
||
|
|
<tr>
|
||
|
|
<th width="100%" class="leftColumnModuleName"> </th>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<!--
|
||
|
|
================================================================================================================================================
|
||
|
|
|
||
|
|
QUICK CREATE BUTTONS
|
||
|
|
|
||
|
|
================================================================================================================================================
|
||
|
|
-->
|
||
|
|
|
||
|
|
<br>
|
||
|
|
<center>
|
||
|
|
|
||
|
|
<table width="70%" cellspacing="5">
|
||
|
|
<tr align="center">
|
||
|
|
<td>
|
||
|
|
<input title="QuickMeeting [Alt+M]" accessKey="M" class="button" onclick="show_hide_toggle('div_quickCreateMeeting', '550', '575');" type="submit" name="button" value="QuickMeeting">
|
||
|
|
<input title="QuickCall [Alt+M]" accessKey="M" class="button" onclick="show_hide_toggle('div_quickCreateCall', '550', '575');" type="submit" name="button" value="QuickCall">
|
||
|
|
<input title="QuickTask [Alt+T]" accessKey="T" class="button" onclick="show_hide_toggle('div_quickCreateTask', '550', '575');" type="submit" name="button" value="QuickTask">
|
||
|
|
<input title="QuickNote [Alt+N]" accessKey="N" class="button" onclick="show_hide_toggle('div_quickCreateNote', '550', '575');" type="submit" name="button" value="QuickNote">
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
|
||
|
|
<div id="div_quickCreateMeetingStatus" style="display:none"><font color="red" size="2"><b>Quick Meeting Saved</b></font></div>
|
||
|
|
<div id="div_quickCreateCallStatus" style="display:none"><font color="red" size="2"><b>Quick Call Saved</b></font></div>
|
||
|
|
<div id="div_quickCreateTaskStatus" style="display:none"><font color="red" size="2"><b>Quick Task Saved</b></font></div>
|
||
|
|
<div id="div_quickCreateNoteStatus" style="display:none"><font color="red" size="2"><b>Quick Note Saved</b></font></div>
|
||
|
|
|
||
|
|
</center>
|
||
|
|
|
||
|
|
<!--
|
||
|
|
================================================================================================================================================
|
||
|
|
|
||
|
|
QUICK CREATE MEETING
|
||
|
|
|
||
|
|
================================================================================================================================================
|
||
|
|
-->
|
||
|
|
<div id="div_quickCreateMeeting" style="display:none">
|
||
|
|
<form id="form_quickCreateMeeting" name="form_quickCreateMeeting">
|
||
|
|
<table width="50%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||
|
|
<tr>
|
||
|
|
<td valign="top" width='25%' class='tabEditViewDF' NOWRAP>
|
||
|
|
Subject: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<input type='text' name='name' id='name' size='20' maxlength='50' value='' title='' tabindex='0' >
|
||
|
|
</td>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>
|
||
|
|
Status: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<select name="status" id="status" title='' tabindex="0" >
|
||
|
|
<option label="Planned" value="Planned">Planned</option>
|
||
|
|
<option label="Held" value="Held">Held</option>
|
||
|
|
<option label="Not Held" value="Not Held">Not Held</option>
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
</tr><tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP> Start Date & Time: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
||
|
|
<tr valign="middle">
|
||
|
|
<td nowrap>
|
||
|
|
|
||
|
|
<input id="fdt" name="fdt" value="" size="10" maxlength="13" class="textfield" onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);" type="text">
|
||
|
|
|
||
|
|
<select id="date_start_time_hour" name="date_start_time_hour">
|
||
|
|
<option label="00" value="00">00</option>
|
||
|
|
<option label="01" value="01">01</option>
|
||
|
|
<option label="02" value="02">02</option>
|
||
|
|
<option label="03" value="03">03</option>
|
||
|
|
<option label="04" value="04">04</option>
|
||
|
|
<option label="05" value="05">05</option>
|
||
|
|
<option label="06" value="06">06</option>
|
||
|
|
<option label="07" value="07">07</option>
|
||
|
|
<option label="08" value="08">08</option>
|
||
|
|
<option label="09" value="09">09</option>
|
||
|
|
<option label="10" value="10">10</option>
|
||
|
|
<option label="11" value="11">11</option>
|
||
|
|
<option label="12" value="12">12</option>
|
||
|
|
<option label="13" value="13">13</option>
|
||
|
|
<option label="14" value="14">14</option>
|
||
|
|
<option label="15" value="15">15</option>
|
||
|
|
<option label="16" value="16">16</option>
|
||
|
|
<option label="17" value="17">17</option>
|
||
|
|
<option label="18" value="18">18</option>
|
||
|
|
<option label="19" value="19">19</option>
|
||
|
|
<option label="20" value="20">20</option>
|
||
|
|
<option label="21" value="21">21</option>
|
||
|
|
<option label="22" value="22">22</option>
|
||
|
|
<option label="23" value="23">23</option>
|
||
|
|
</select> :
|
||
|
|
<select id="date_start_time_minute" name="date_start_time_minute">
|
||
|
|
<option label="00" value="00">00</option>
|
||
|
|
<option label="15" value="15">15</option>
|
||
|
|
<option label="30" value="30">30</option>
|
||
|
|
<option label="45" value="45">45</option>
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</td>
|
||
|
|
</tr><tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP>
|
||
|
|
Description:
|
||
|
|
<br>
|
||
|
|
<textarea id="description" name="description" rows="3" cols="40" title='' tabindex="0"></textarea>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<p>
|
||
|
|
<div style="padding-top: 2px">
|
||
|
|
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateMeeting()" type="button" name="button" value="Save">
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!--
|
||
|
|
================================================================================================================================================
|
||
|
|
|
||
|
|
QUICK CREATE CALL
|
||
|
|
|
||
|
|
================================================================================================================================================
|
||
|
|
-->
|
||
|
|
<div id="div_quickCreateCall" style="display:none">
|
||
|
|
<form id="form_quickCreateCall" name="form_quickCreateCall">
|
||
|
|
<table width="50%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||
|
|
<tr>
|
||
|
|
<td valign="top" width='25%' class='tabEditViewDF' NOWRAP>
|
||
|
|
Subject: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<input type='text' name='name' id='name' size='20' maxlength='50' value='' title='' tabindex='0' >
|
||
|
|
</td>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>
|
||
|
|
Status: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<select name="status" id="status" title='' tabindex="0" >
|
||
|
|
<option label="Planned" value="Planned">Planned</option>
|
||
|
|
<option label="Held" value="Held">Held</option>
|
||
|
|
<option label="Not Held" value="Not Held">Not Held</option>
|
||
|
|
</select>
|
||
|
|
<select name="direction" id="direction" title='' tabindex="0" >
|
||
|
|
<option label="Inbound" value="Inbound">Inbound</option>
|
||
|
|
<option label="Outbound" value="Outbound">Outbound</option>
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
</tr><tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP> Start Date & Time: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
||
|
|
<tr valign="middle">
|
||
|
|
<td nowrap>
|
||
|
|
|
||
|
|
|
||
|
|
<input id="fdt" name="fdt" value="" size="10" maxlength="13" class="textfield" onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);" type="text">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<select id="date_start_time_hour" name="date_start_time_hour">
|
||
|
|
<option label="00" value="00">00</option>
|
||
|
|
<option label="01" value="01">01</option>
|
||
|
|
<option label="02" value="02">02</option>
|
||
|
|
<option label="03" value="03">03</option>
|
||
|
|
<option label="04" value="04">04</option>
|
||
|
|
<option label="05" value="05">05</option>
|
||
|
|
<option label="06" value="06">06</option>
|
||
|
|
<option label="07" value="07">07</option>
|
||
|
|
<option label="08" value="08">08</option>
|
||
|
|
<option label="09" value="09">09</option>
|
||
|
|
<option label="10" value="10">10</option>
|
||
|
|
<option label="11" value="11">11</option>
|
||
|
|
<option label="12" value="12">12</option>
|
||
|
|
<option label="13" value="13">13</option>
|
||
|
|
<option label="14" value="14">14</option>
|
||
|
|
<option label="15" value="15">15</option>
|
||
|
|
<option label="16" value="16">16</option>
|
||
|
|
<option label="17" value="17">17</option>
|
||
|
|
<option label="18" value="18">18</option>
|
||
|
|
<option label="19" value="19">19</option>
|
||
|
|
<option label="20" value="20">20</option>
|
||
|
|
<option label="21" value="21">21</option>
|
||
|
|
<option label="22" value="22">22</option>
|
||
|
|
<option label="23" value="23">23</option>
|
||
|
|
</select> :
|
||
|
|
<select id="date_start_time_minute" name="date_start_time_minute">
|
||
|
|
<option label="00" value="00">00</option>
|
||
|
|
<option label="15" value="15">15</option>
|
||
|
|
<option label="30" value="30">30</option>
|
||
|
|
<option label="45" value="45">45</option>
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</td>
|
||
|
|
</tr><tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP>
|
||
|
|
Description:
|
||
|
|
<br>
|
||
|
|
<textarea id="description" name="description" rows="3" cols="40" title='' tabindex="0"></textarea>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<p>
|
||
|
|
<div style="padding-top: 2px">
|
||
|
|
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateCall()" type="button" name="button" value="Save">
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!--
|
||
|
|
================================================================================================================================================
|
||
|
|
|
||
|
|
QUICK CREATE TASK
|
||
|
|
|
||
|
|
================================================================================================================================================
|
||
|
|
-->
|
||
|
|
<div id="div_quickCreateTask" style="display:none">
|
||
|
|
<form id="form_quickCreateTask" name="form_quickCreateTask">
|
||
|
|
<table width="50%" cellpadding="3" cellspacing="0" border="0"><tr><td align="left">
|
||
|
|
|
||
|
|
<table width="100%" cellspacing="0" cellpadding="0" class='tabDetailView' id='tabFormPagination'>
|
||
|
|
</table>
|
||
|
|
|
||
|
|
<div id="DEFAULT">
|
||
|
|
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||
|
|
<tr>
|
||
|
|
<td valign="top" width='25%' class='tabEditViewDF' NOWRAP>
|
||
|
|
Subject: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<input type='text' name='name' id='name' size='20' maxlength='50' value='' title='' tabindex='0' >
|
||
|
|
</td>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>
|
||
|
|
Priority: <span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<select name="priority" id="priority" title='' tabindex="0" >
|
||
|
|
<option label="High" value="High">High</option>
|
||
|
|
<option label="Medium" value="Medium">Medium</option>
|
||
|
|
<option label="Low" value="Low">Low</option>
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
</tr><tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP> Due Date:
|
||
|
|
<br>
|
||
|
|
|
||
|
|
<input id="fdt" name="fdt" value="" size="10" maxlength="13" class="textfield" onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);" type="text">
|
||
|
|
|
||
|
|
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
<p>
|
||
|
|
<div style="padding-top: 2px">
|
||
|
|
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateTask()" type="button" name="button" value="Save">
|
||
|
|
</div>
|
||
|
|
</table>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!--
|
||
|
|
================================================================================================================================================
|
||
|
|
|
||
|
|
QUICK CREATE NOTE
|
||
|
|
|
||
|
|
================================================================================================================================================
|
||
|
|
!-->
|
||
|
|
<div id="div_quickCreateNote" style="display:none">
|
||
|
|
<form id="form_quickCreateNote" name="form_quickCreateNote">
|
||
|
|
|
||
|
|
<table width="50%" cellspacing="0" cellpadding="0" class='tabDetailView' id='tabFormPagination'>
|
||
|
|
</table>
|
||
|
|
|
||
|
|
<div id="DEFAULT">
|
||
|
|
<table width="50%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||
|
|
<tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>Note Subject:<span class="required">*</span>
|
||
|
|
<br>
|
||
|
|
<input type='text' name='name' id='name' size='35' maxlength='255' value='' title='' tabindex='0' >
|
||
|
|
</td>
|
||
|
|
</tr><!--<tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>Attachment:
|
||
|
|
<br>
|
||
|
|
<input id="filename" name="filename" type="file" title='' size="35" maxlength='255' value="">
|
||
|
|
</td>
|
||
|
|
</tr>--><tr>
|
||
|
|
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>Note:
|
||
|
|
<br>
|
||
|
|
<textarea id="description" name="description" rows="3" cols="35" title='' tabindex="0"></textarea>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<p>
|
||
|
|
<div style="padding-top: 2px">
|
||
|
|
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateNote()" type="button" name="button" value="Save">
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<script>
|
||
|
|
todayDate(document.form_quickCreateMeeting.elements['fdt']);
|
||
|
|
todayDate(document.form_quickCreateCall.elements['fdt']);
|
||
|
|
|
||
|
|
setHourTime(document.form_quickCreateMeeting.elements['date_start_time_hour']);
|
||
|
|
setHourTime(document.form_quickCreateCall.elements['date_start_time_hour']);
|
||
|
|
|
||
|
|
setMinuteTime(document.form_quickCreateMeeting.elements['date_start_time_minute']);
|
||
|
|
setMinuteTime(document.form_quickCreateCall.elements['date_start_time_minute']);
|
||
|
|
</script>
|
||
|
|
<!-- END: main -->
|