添加到 trunk

+YUCHENG HU+

git-svn-id: https://svn.code.sf.net/p/hawebs/svn@141 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-06-12 07:24:12 +00:00
parent ddbe02ba45
commit ff1e10683b
90 changed files with 15686 additions and 0 deletions
@@ -0,0 +1,38 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $result;
global $client;
global $Server_Path;
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
if($accountid != '')
{
$params = array('id' => "$accountid", 'block'=>"$block",'contactid'=>$customerid,'sessionid'=>"$sessionid");
$result = $client->call('get_details', $params, $Server_Path, $Server_Path);
// Check for Authorization
if (count($result) == 1 && $result[0] == "#NOT AUTHORIZED#") {
echo '<tr>
<td colspan="6" align="center"><b>'.getTranslatedString('LBL_NOT_AUTHORISED').'</b></td>
</tr></table></td></tr></table></td></tr></table>';
die();
}
$noteinfo = $result[0][$block];
echo '<table><tr><td><input class="crmbutton small cancel" type="button" value="'.getTranslatedString('LBL_BACK_BUTTON').'" onclick="window.history.back();"/></td></tr></table>';
echo getblock_fieldlist($noteinfo);
echo '</table></td></tr>';
echo '</table></td></tr></table></td></tr></table>';
echo '<!-- --End-- -->';
}
?>
@@ -0,0 +1,28 @@
<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<script language="JavaScript" src="js/general.js"></script>
<table class="dvtContentSpace" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<form name="index" method="post" action="index.php">
<input type="hidden" name="module">
<input type="hidden" name="action">
<input type="hidden" name="fun">
<tr>
<td style="padding:5px;">
@@ -0,0 +1,27 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
include("index.html");
global $result;
if($customerid == '')
$customerid = $_SESSION['customer_id'];
$block = 'Accounts';
if($_REQUEST['id'] == '')
{
$params = Array('id'=>$customerid);
$accountid = $client->call('get_check_account_id', $params, $Server_Path, $Server_Path);
}
else
$accountid = $_REQUEST['id'];
if($accountid != '')
include("AccountDetail.php");
?>
@@ -0,0 +1,11 @@
ACKNOWLEDGMENTS:
The vtiger Customer Portal contains the software product of other developers.
We wish to acknowledge the following third party software that are used in vtiger Customer Portal:
1. GNU LGPL License for usage of nusoap downloaded from http://sourceforge.net/projects/nusoap
---------------------------------------------
© 2005 www.vtiger.com. All Rights Reserved.
@@ -0,0 +1,39 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $result;
global $client;
global $Server_Path;
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
if($id != '')
{
$params = array('id' => "$id", 'block'=>"$block",'contactid'=>$customerid,'sessionid'=>"$sessionid");
$result = $client->call('get_details', $params, $Server_Path, $Server_Path);
// Check for Authorization
if (count($result) == 1 && $result[0] == "#NOT AUTHORIZED#") {
echo '<tr>
<td colspan="6" align="center"><b>'.getTranslatedString('LBL_NOT_AUTHORISED').'</b></td>
</tr></table></td></tr></table></td></tr></table>';
die();
}
$noteinfo = $result[0][$block];
echo '<table><tr><td><input class="crmbutton small cancel" type="button" value="'.getTranslatedString('LBL_BACK_BUTTON').'" onclick="window.history.back();"/></td></tr></table>';
echo getblock_fieldlist($noteinfo);
echo '</table></td></tr>';
echo '</table></td></tr></table></td></tr></table>';
echo '<!-- --End-- -->';
}
?>
@@ -0,0 +1,58 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $result;
global $client;
$onlymine=$_REQUEST['onlymine'];
if($onlymine == 'true') {
$mine_selected = 'selected';
$all_selected = '';
} else {
$mine_selected = '';
$all_selected = 'selected';
}
if ($customerid != '')
{
$params = array();
echo '<tr>
<td><span class="lvtHeaderText">'.getTranslatedString("LBL_CONTACTS").'</span</td>';
$allow_all = $client->call('show_all',array('module'=>'Contacts'),$Server_Path, $Server_Path);
if($allow_all == 'true'){
echo '<td align="right" style="padding-right:50px;"> <b>'.getTranslatedString('SHOW').'</b>&nbsp; <select name="list_type" onchange="getList(this, \'Contacts\');">
<option value="mine" '. $mine_selected .'>'.getTranslatedString('MINE').'</option>
<option value="all"'. $all_selected .'>'.getTranslatedString('ALL').'</option>
</select></td></tr>';
}
echo '<tr><td colspan="2"><hr noshade="noshade" size="1" width="100%" align="left">
<table width="95%" border="0" cellspacing="0" cellpadding="5" align="center">';
$block = "Contacts";
$sessionid = $_SESSION['customer_sessionid'];
$params = array('id' => "$customerid", 'block'=>"$block",'sessionid'=>"$sessionid",'onlymine'=>$onlymine);
$result = $client->call('get_list_values', $params, $Server_Path, $Server_Path);
// Check for Authorization
if (count($result) == 1 && $result[0] == "#NOT AUTHORIZED#") {
echo '<tr>
<td colspan="6" align="center"><b>'.getTranslatedString("LBL_NOT_AUTHORISED").'</b></td>
</tr></table></td></tr></table></td></tr></table>';
die();
}
echo getblock_fieldlistview($result,$block);
}
?>
@@ -0,0 +1,23 @@
<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<script language="JavaScript" src="js/general.js"></script>
<table class="dvtContentSpace" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<form name="index" method="post" action="index.php">
<input type="hidden" name="module">
<input type="hidden" name="action">
<input type="hidden" name="fun">
<tr>
<td style="padding:5px;">
@@ -0,0 +1,37 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
$only_mine = (isset($_REQUEST['only_mine'])) ? " checked " : "";
@include("../PortalConfig.php");
if(!isset($_SESSION['customer_id']) || $_SESSION['customer_id'] == '')
{
@header("Location: $Authenticate_Path/login.php");
exit;
}
include("index.html");
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
global $result;
if($_REQUEST['id'] == '')
{
include("ContactsList.php");
}
else
{ $id=$_REQUEST['id'];
$block = "Contacts";
include("ContactsDetail.php");
}
echo '</table> </td></tr></table></td></tr></table>';
?>
@@ -0,0 +1,96 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
include("include.php");
include("version.php");
require_once("PortalConfig.php");
require_once("include/utils/utils.php");
global $version,$default_language,$result;
$username = trim($_REQUEST['username']);
$password = trim($_REQUEST['pw']);
session_start();
setPortalCurrentLanguage();
$default_language = getPortalCurrentLanguage();
require_once("language/".$default_language.".lang.php");
$params = array('user_name' => "$username",
'user_password'=>"$password",
'version' => "$version");
$result = $client->call('authenticate_user', $params, $Server_Path, $Server_Path);
//The following are the debug informations
$err = $client->getError();
if ($err)
{
//Uncomment the following lines to get the error message in login screen itself.
/*
echo '<h2>Error Message</h2><pre>' . $err . '</pre>';
echo '<h2>request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
exit;
*/
$login_error_msg = getTranslatedString("LBL_CANNOT_CONNECT_SERVER");
$login_error_msg = base64_encode('<font color=red size=1px;> '.$login_error_msg.' </font>');
header("Location: login.php?login_error=$login_error_msg");
exit;
}
if(strtolower($result[0]['user_name']) == strtolower($username) && strtolower($result[0]['user_password']) == strtolower($password))
{
session_start();
$_SESSION['customer_id'] = $result[0]['id'];
$_SESSION['customer_sessionid'] = $result[0]['sessionid'];
$_SESSION['customer_name'] = $result[0]['user_name'];
$_SESSION['last_login'] = $result[0]['last_login_time'];
$_SESSION['support_start_date'] = $result[0]['support_start_date'];
$_SESSION['support_end_date'] = $result[0]['support_end_date'];
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params1 = Array(Array('id' => "$customerid", 'sessionid'=>"$sessionid", 'flag'=>"login"));
$result2 = $client->call('update_login_details', $params1, $Server_Path, $Server_Path);
$params = array('customerid'=>$customerid);
$permission = $client->call('get_modules',$params,$Server_path,$Server_path);
$module = $permission[0];
if($permission == '')
{
echo getTranslatedString('LBL_NO_PERMISSION_FOR_ANY_MODULE');
exit;
}
// Store the permitted modules in session for re-use
$_SESSION['__permitted_modules'] = $permission;
header("Location: index.php?action=index&module=$module");
}
else
{
if($result[0] == 'NOT COMPATIBLE'){
$error_msg = getTranslatedString("LBL_VERSION_INCOMPATIBLE");
}elseif($result[0] == 'INVALID_USERNAME_OR_PASSWORD') {
$error_msg = getTranslatedString("LBL_ENTER_VALID_USER");
}elseif($result[0] == 'MORE_THAN_ONE_USER'){
$error_msg = getTranslatedString("MORE_THAN_ONE_USER");
}
else
$error_msg = getTranslatedString("LBL_CANNOT_CONNECT_SERVER");
$login_error_msg = base64_encode('<font color=red size=1px;> '.$error_msg.' </font>');
header("Location: login.php?login_error=$login_error_msg");
}
?>
@@ -0,0 +1,40 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $result;
global $client;
global $Server_Path;
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
echo '<!--Get Document Details Information -->';
if($note_id != '')
{
$params = array('id' => "$note_id", 'block'=>"$block",'contactid'=>$customerid,'sessionid'=>"$sessionid");
$result = $client->call('get_details', $params, $Server_Path, $Server_Path);
// Check for Authorization
if (count($result) == 1 && $result[0] == "#NOT AUTHORIZED#") {
echo '<tr>
<td colspan="6" align="center"><b>'.getTranslatedString('LBL_NOT_AUTHORISED').'</b></td>
</tr></table></td></tr></table></td></tr></table>';
die();
}
$noteinfo = $result[0][$block];
echo '<table><tr><td><input class="crmbutton small cancel" type="button" value="'.getTranslatedString('LBL_BACK_BUTTON').'" onclick="window.history.back();"/></td></tr></table>';
echo getblock_fieldlist($noteinfo);
echo '</table></td></tr>';
echo '</table></td></tr></table></td></tr></table>';
echo '<!-- --End-- -->';
}
?>
@@ -0,0 +1,45 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $result;
global $client;
$onlymine=$_REQUEST['onlymine'];
if($onlymine == 'true') {
$mine_selected = 'selected';
$all_selected = '';
} else {
$mine_selected = '';
$all_selected = 'selected';
}
echo '<tr>
<td><span class="lvtHeaderText">'.getTranslatedString("LBL_NOTES_INFORMATION").'</span</td>';
$allow_all = $client->call('show_all',array('Documents'),$Server_Path, $Server_Path);
if($allow_all == 'true'){
echo '<td align="right" style="padding-right:50px;"> <b>'.getTranslatedString('SHOW').'</b>&nbsp; <select name="list_type" onchange="getList(this, \'Documents\');">
<option value="mine" '. $mine_selected .'>'.getTranslatedString('MINE').'</option>
<option value="all"'. $all_selected .'>'.getTranslatedString('ALL').'</option>
</select></td></tr>';
}
echo '<tr><td colspan="2"><hr noshade="noshade" size="1" width="100%" align="left">
<table width="95%" border="0" cellspacing="0" cellpadding="5" align="center">';
if ($customerid != '' )
{
$block = "Documents";
$params = array('id' => "$customerid", 'block'=>"$block",'sessionid'=>$sessionid,'onlymine'=>$onlymine);
$result = $client->call('get_list_values', $params, $Server_Path, $Server_Path);
echo getblock_fieldlistview($result,$block);
}
?>
@@ -0,0 +1,28 @@
<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<script language="JavaScript" src="js/general.js"></script>
<table class="dvtContentSpace" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<form name="index" method="post" action="index.php">
<input type="hidden" name="module">
<input type="hidden" name="action">
<input type="hidden" name="fun">
<tr>
<td style="padding:5px;">
@@ -0,0 +1,37 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
$only_mine = (isset($_REQUEST['only_mine'])? " checked " : "");
@include("../PortalConfig.php");
if(!isset($_SESSION['customer_id']) || $_SESSION['customer_id'] == '')
{
@header("Location: $Authenticate_Path/login.php");
exit;
}
include("index.html");
global $result;
$sessionid = $_SESSION['customer_sessionid'];
$customerid = $_SESSION['customer_id'];
$note_id =$_REQUEST['id'];
$block= 'Documents';
if( $note_id == '')
include("DocumentsList.php");
else
include("DocumentDetail.php");
if($_REQUEST['folderid'] !='')
include("DownloadFile.php");
echo '</table> </td></tr></table></td></tr></table>';
?>
@@ -0,0 +1,12 @@
<?php
/*
* Created on Feb 10, 2009
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$id = $_REQUEST['file_id'];
global $client;
$res = $client->call('updateCount',array($id),$Server_Path,$Server_Path);
?>
@@ -0,0 +1,125 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
if($_REQUEST['faqid'] != '')
$faqid = $_REQUEST['faqid'];
$faq_array = $_SESSION['faq_array'];
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$list = '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="dummy">';
for($i=0;$i<count($faq_array);$i++)
{
if($faqid == $faq_array[$i]['id'])
{
$faq_id = $faq_array[$i]['id'];
$faq_module_no = $faq_array[$i]['faqno'];
$faq_createdtime = $faq_array[$i]['faqcreatedtime'];
$faq_modifiedtime = $faq_array[$i]['faqmodifiedtime'];
$faq_productid = $faq_array[$i]['product_id'];
$faq_category = $faq_array[$i]['category'];
$comments_array = $_SESSION['faq_array'][$i]['comments'];
$createdtime_array = $_SESSION['faq_array'][$i]['createdtime'];
$comments_count = count($comments_array);
$list .= '<tr><td colspan="2" class="detailedViewHeader">'.getTranslatedString('LBL_FAQ_TITLE').'</td><td align="right" class="detailedViewHeader">
<span id="faq" class="lnkHdr" onMouseOver="fnShow(this)" onMouseOut="fnHideDiv(\'faqDetail\')">'.getTranslatedString('LBL_FAQ_DETAIL').'</span></td></tr>';
$list .= '<tr><td width="75%" valign="top" style="padding-right:5px;" colspan="3">'.$faq_array[$i]['question'];
$list .= '<br><br><b>'.getTranslatedString('LBL_ANSWER').'</b><br>'.$faq_array[$i]['answer'].'</td>
</tr>';
$list .= '<tr><td colspan="3" class="detailedViewHeader">'.getTranslatedString('LBL_COMMENTS').'</td></tr>';
$list .= '
<tr>
<td colspan="3">
<div id="scrollTab2">
<table width="98%" border="0" cellspacing="5" cellpadding="5">';
for($j=0;$j<$comments_count;$j++)
{
$list .= '
<tr>
<td width="5%" valign="top"> '.($comments_count-$j).' </td>
<td width="95%">
'.$comments_array[$j];
if ($createdtime_array[$j]!="0000-00-00 00:00:00")
$list .= '<br><span class="hdr">'.getTranslatedString('LBL_ADDED_ON').$createdtime_array[$j].'</span>';
$list .= '
</td>
</tr>';
}
$list .= '
</table>
</div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr><td colspan="3" class="detailedViewHeader">'.getTranslatedString('LBL_DOCUMENTS').'</td></tr>';
$module = 'Documents';
$params = array('id' => "$faqid",'module'=>"$module", 'contactid'=>"$customerid",'sessionid'=>"$sessionid");
$result = $client->call('get_documents', $params, $Server_Path, $Server_Path);
$list .= getblock_fieldlistview($result,$module);
$list .='<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
' .
'<form name="comments" method="POST" action="index.php">
<input type="hidden" name="module">
<input type="hidden" name="action">
<input type="hidden" name="fun">
<input type=hidden name=faqid value="'.$faqid.'">
<tr>
<td colspan="3" class="detailedViewHeader">'.getTranslatedString('LBL_ADD_COMMENT').'</td>
</tr>
<tr>
<td colspan="3" class="dvtCellInfo">
<textarea name="comments" cols="80" rows="5" class="detailedViewTextBox">&nbsp;</textarea>
</td>
</tr>
<tr>
<td colspan="3" class="dvtCellInfo">
<input title="'.getTranslatedString('LBL_SAVE_ALT').'" accesskey="S" class="small" name="submit" value="'.getTranslatedString('LBL_SUBMIT').'" style="width: 70px;" type="submit" onclick="this.form.module.value=\'Faq\';this.form.action.value=\'index\';this.form.fun.value=\'faq_updatecomment\'; if(trim(this.form.comments.value) != \'\') return true; else return false;"/>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</form>
<tr>
<td style="padding:3px;">'.getPageOption().'</td>
</tr>';
}
}
$list .= ' </table>';
//This is added to get the FAQ details as a Popup on Mouse over
$list .= getArticleIdTime($faq_module_no,$faq_productid,$faq_category,$faq_createdtime,$faq_modifiedtime);
echo $list;
?>
@@ -0,0 +1,25 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
//This is to save the comment made by the customer
$faqid = $_REQUEST['faqid'];
$comment = $_REQUEST['comments'];
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
//commented customer should be added as author for the comment
$params = Array(Array('id' => "$customerid", 'sessionid'=>"$sessionid", 'faqid'=>"$faqid", 'comment'=>"$comment"));
$result = $client->call('save_faq_comment', $params, $Server_Path, $Server_Path);
?>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,159 @@
<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<table class="dvtContentSpace" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td valign="top">&nbsp;</td>
</tr>
<tr>
<td align="right" valign="top">
<form name="Submit" method="POST" action="index.php">
<input type=hidden name="fun" value="search">
<input type=hidden name="module" value="Faq">
<input type=hidden name="action" value="index">
<input type="text" name="search_text" value="<?php echo $search_text; ?>">&nbsp;in&nbsp;
<?php echo getSearchCombo(); ?>
<input class= "crmbutton small cancel" type="submit" name="search" onclick="form.fun.value='search'" value="<?php echo getTranslatedString('LBL_SEARCH'); ?>">
</form>
</td>
</tr>
<tr><td align="left" valign="top"><span class='lvtHeaderText'><?PHP echo getTranslatedString('LBL_KNOWLEDGE_BASE');?></span></td></tr>
<tr>
<td align="left" valign="top">
<table cellpadding="0" cellspacing="0" class="mainTab">
<?PHP if(!empty($faq_array)){ ?>
<tr>
<td style="padding: 10px;width:20%;" valign="top">
<?PHP if((count($category_array))>0 && $category_array !=null){ ?>
<table class="lftMnu" border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><a href="javascript:;toggleView('category')"><img id="categoryimg" src="images/minus.gif" border="0" align="absmiddle"></a></td>
<td><a href="javascript:;toggleView('category')"><img src="images/category.gif" border="0" align="absmiddle"></a></td>
<td><a href="javascript:;toggleView('category')" class="kbNavHead"><?php echo getTranslatedString('LNK_CATEGORY'); ?></a></td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<div id="category" style="display:block">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
for($i=0,$j=1;$i<count($category_array);$i++,$j++){
$noof_faqs = getNoofFaqsPerCategory($category_array[$i]);
if(is_string($_REQUEST['category_index'])){
$category_index = (int)$_REQUEST['category_index'];
}
?>
<tr>
<td nowrap><a class="hdr" href="index.php?module=Faq&action=index&fun=faqs&category_index=<?php echo $i; ?>">
<?php if($category_index === $i)
echo '<b>'.text_length($category_array[$i]).'</b>';
else
echo text_length($category_array[$i]);
?>
</a> <span class="hdr">
<?php if($category_index === $i)
echo '<b>'.'('.$noof_faqs.')'.'</b>';
else
echo '('.$noof_faqs.')';
?></span></td>
</tr>
<?php } ?>
</table>
</div>
</td>
</tr>
</table>
<?PHP } ?>
<?PHP if($product_array != null) { ?>
<table class="lftMnu" border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><a href="javascript:;toggleView('products_array')"><img id="products_arrayimg" src="images/minus.gif" border="0" align="absmiddle"></a></td>
<td><a href="javascript:;toggleView('products_array')"><img src="images/products.gif" border="0" align="absmiddle"></a></td>
<td><a href="javascript:;toggleView('products_array')" class="kbNavHead"><?php echo getTranslatedString('LNK_PRODUCTS'); ?></a></td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<div id="products_array" style="display:block">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
for($i=0,$j=1;$i<count($product_array);$i++,$j++) {
$noof_faqs = getNoofFaqsPerProduct($product_array[$i]['productid']);
?>
<tr>
<td nowrap>
<a class="hdr" href="index.php?module=Faq&action=index&fun=faqs&productid=<?php echo $product_array[$i]['productid']; ?>">
<?php if($_REQUEST['productid'] == $product_array[$i]['productid'])
echo '<b>'.$product_array[$i]['productname'].'</b>';
else
echo $product_array[$i]['productname'];
?>
</a> <span class="hdr">
<?php if($_REQUEST['productid'] == $product_array[$i]['productid'])
echo '<b>'.'('.$noof_faqs.')'.'</b>';
else
echo '('.$noof_faqs.')';
?></span>
</td>
</tr>
<?php } ?>
</table>
</div>
</td>
</tr>
</table>
<?PHP } ?>
</td>
<td style="padding:10px;width:80%" valign="top">
<?PHP } else { ?>
<tr>
<td>
<?PHP echo getTranslatedString('LBL_KNOWLEDGE_BASE').' '.getTranslatedString('LBL_NOT_AVAILABLE');?>
</td>
</tr>
</table>
<?PHP } ?>
<script language="JavaScript" src="js/cookies.js"></script>
<script>
function toggleView(view) {
if(document.getElementById(view) != null){
if (document.getElementById(view).style.display=="block") {
document.getElementById(view).style.display="none"
document.getElementById(view+"img").src="images/plus.gif"
set_cookie("kb_"+view,"none")
} else {
document.getElementById(view).style.display="block"
document.getElementById(view+"img").src="images/minus.gif"
set_cookie("kb_"+view,"block")
}
}
}
var view=new Array("category","products_array")
for (i=0;i<view.length;i++) {
if(document.getElementById(view) != null){
if (get_cookie("kb_"+view[i])==null || get_cookie("kb_"+view[i])=="" || get_cookie("kb_"+view[i])=="block") {
document.getElementById(view[i]).style.display="block"
document.getElementById(view[i]+"img").src="images/minus.gif"
} else {
document.getElementById(view[i]).style.display="none"
document.getElementById(view[i]+"img").src="images/plus.gif"
}
}
}
</script>
@@ -0,0 +1,104 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
@include("../PortalConfig.php");
if(!isset($_SESSION['customer_id']) || $_SESSION['customer_id'] == '')
{
@header("Location: $Authenticate_Path/login.php");
exit;
}
include("include.php");
//This is added first because when we add new comment, the comments will be added first and then Faq list will be retrieved
if($_REQUEST['fun'] == 'faq_updatecomment')
{
include("Faq/SaveFaqComment.php");
}
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array('id' => "$customerid", 'sessionid'=>"$sessionid"));
$result = $client->call('get_KBase_details', $params, $Server_Path, $Server_Path);
$category_array = $result[0];
$faq_array = $result[2];
if(@array_key_exists('productid',$result[1][0]) && @array_key_exists('productname',$result[1][0]))
$product_array = $result[1];
elseif(@array_key_exists('id',$result[1][0]) && @array_key_exists('question',$result[1][0]) && @array_key_exists('answer',$result[1][0]))
$faq_array = $result[1];
$_SESSION['product_array'] = $product_array;
$_SESSION['category_array'] = $category_array;
$_SESSION['faq_array'] = $faq_array;
$search_text = $_REQUEST['search_text'];
include("Faq/Utils.php");
include("Faq/index.html");
if($_REQUEST['fun'] == '')
{
if(!empty($faq_array))
echo getLatestlyCreatedFaqList();
}
elseif($_REQUEST['fun'] == 'faqs')
{
if($_REQUEST['category_index'] != '')
{
echo ListFaqsPerCategory($_REQUEST['category_index']);
}
elseif($_REQUEST['productid'] != '')
{
echo ListFaqsPerProduct($_REQUEST['productid']);
}
else
{
echo 'Wrong parameters';
}
}
elseif($_REQUEST['fun'] == 'search')
{
$search_text = $_REQUEST['search_text'];
$search_category = explode(":",$_REQUEST['search_category']);
$searchlist .= getSearchResult($search_text,$search_category[1],$search_category[0]);
echo $searchlist;
}
elseif($_REQUEST['fun'] == 'faq_detail')
{
include("Faq/FaqDetail.php");
}
elseif($_REQUEST['fun'] == 'faq_updatecomment')
{
?>
<script>
var faqid = <?php echo $_REQUEST['faqid']; ?>;
window.location.href = "index.php?module=Faq&action=index&fun=faq_detail&faqid="+faqid
</script>
<?php
}
//The following tags are opened in index.html
echo '
</td>
</tr>
</table>
</td>
</tr>
</table>
';
?>
@@ -0,0 +1,196 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $client;
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid"));
$result = $client->call('get_combo_values', $params, $Server_Path, $Server_Path);
$_SESSION['combolist'] = $result;
$combolist = $_SESSION['combolist'];
for($i=0;$i<count($result);$i++)
{
if($result[$i]['productid'] != '')
{
$productslist[0] = $result[$i]['productid'];
}
if($result[$i]['productname'] != '')
{
$productslist[1] = $result[$i]['productname'];
}
if($result[$i]['ticketpriorities'] != '')
{
$ticketpriorities = $result[$i]['ticketpriorities'];
}
if($result[$i]['ticketseverities'] != '')
{
$ticketseverities = $result[$i]['ticketseverities'];
}
if($result[$i]['ticketcategories'] != '')
{
$ticketcategories = $result[$i]['ticketcategories'];
}
if($result[$i]['servicename'] != ''){
$servicename = $result[$i]['servicename'];
}
if($result[$i]['serviceid'] != ''){
$serviceid= $result[$i]['serviceid'];
}
}
if($productslist[0] != '#MODULE INACTIVE#'){
$noofrows = count($productslist[0]);
for($i=0;$i<$noofrows;$i++)
{
if($i > 0)
$productarray .= ',';
$productarray .= "'".$productslist[1][$i]."'";
}
}
if($servicename == '#MODULE INACTIVE#' || $serviceid == '#MODULE INACTIVE#'){
unset($servicename);
unset($serviceid);
}
?>
<tr><td colspan="2">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="35">&nbsp;</td>
</tr>
<tr>
<td align="left">
<span class="lvtHeaderText">&nbsp;&nbsp;<?PHP echo getTranslatedString('LBL_NEW_TICKET');?></span>
<hr noshade="noshade" size="1" width="90%" align="left"><br><br>
<table width="80%" border="0" cellspacing="0" cellpadding="5" align="center">
<form name="Save" method="post" action="index.php">
<input type="hidden" name="module" value="HelpDesk">
<input type="hidden" name="action" value="index">
<input type="hidden" name="fun" value="saveticket">
<tr>
<td colspan="4" class="detailedViewHeader"><b><?PHP echo getTranslatedString('LBL_NEW_TICKET');?></b></td></tr>
<tr>
<td class="dvtCellLabel" align="right"><font color="red">*</font><?PHP echo getTranslatedString('TICKET_TITLE');?></td>
<td colspan="3" class="dvtCellInfo">
<input type="text" name="title" class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'">
</td>
</tr>
<tr>
<td class="dvtCellLabel" align="right" width="20%"><?PHP echo getTranslatedString('LBL_PRODUCT_NAME');?></td>
<!-- Product auto drop down - start -->
<style>@import url( css/dropdown.css );</style>
<script src="js/modomt.js"></script>
<script src="js/getobject2.js"></script>
<script src="js/acdropdown.js"></script>
<script language="javascript">var products = new Array(<?php echo $productarray; ?>);</script>
<td class="dvtCellInfo" width="20%">
<input class="dropdown" autocomplete="off" name="productid" id="inputer2" style="width: 135px;" acdropdown="true" autocomplete_list="array:products" autocomplete_list_sort="false" autocomplete_matchsubstring="true">
<!-- Product auto drop down - end -->
</td>
<td class="dvtCellLabel" align="right" width="20%"><?PHP echo getTranslatedString('LBL_SERVICE_CONTRACTS');?></td>
<td class="dvtCellInfo" width="20%">&nbsp;
<?php
$list = '<select name=servicename size="1" class="detailedViewTextBox">';
$list .= '<OPTION value="">'.getTranslatedString('NONE').'</OPTION>';
for($i=0;$i<count($servicename);$i++){
$list .= '<OPTION value="'.$serviceid[$i].'" >'.$servicename[$i].'</OPTION>';
}
$list .= '</select>';
echo $list;
?>
</td>
</tr>
<tr>
<td class="dvtCellLabel" align="right"><?PHP echo getTranslatedString('LBL_TICKET_PRIORITY');?></td>
<td class="dvtCellInfo">
<?php
echo getComboList('priority',$ticketpriorities);
?>
</td>
<td class="dvtCellLabel" align="right"><?PHP echo getTranslatedString('LBL_TICKET_SEVERITY');?></td>
<td class="dvtCellInfo">
<?php
echo getComboList('severity',$ticketseverities);
?>
</td>
</tr>
<tr>
<td class="dvtCellLabel" align="right"><?PHP echo getTranslatedString('LBL_TICKET_CATEGORY');?></td>
<td class="dvtCellInfo">
<?php
echo getComboList('category',$ticketcategories);
?>
</td>
</tr>
<tr>
<td class="dvtCellLabel" align="right"><?PHP echo getTranslatedString('LBL_DESCRIPTION');?></td>
<td colspan="3" class="dvtCellInfo">
<textarea name="description" cols="55" rows="5" class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'"></textarea>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">
<div align="center">
<input class="crmbutton small cancel" title="<?PHP echo getTranslatedString('LBL_SAVE_ALT');?>" accesskey="S" class="small" name="button" value="<?PHP echo getTranslatedString('LBL_SAVE');?>" style="width: 70px;" type="submit" onclick="return formvalidate(this.form)">
<input class="crmbutton small cancel" title="<?PHP echo getTranslatedString('LBL_CANCEL_ALT');?>" accesskey="X" class="small" name="button" value="<?PHP echo getTranslatedString('LBL_CANCEL');?>" style="width: 70px;" type="button" onclick="window.history.back()";>
</div>
</td>
<td>&nbsp;</td>
</tr>
<tt><td colspan="4">&nbsp;</td></tt>
</form>
</table>
</td>
</tr>
</table>
<script>
function formvalidate(form)
{
if(trim(form.title.value) == '')
{
alert("Ticket Title is empty");
return false;
}
return true;
}
function trim(s)
{
while (s.substring(0,1) == " ")
{
s = s.substring(1, s.length);
}
while (s.substring(s.length-1, s.length) == ' ')
{
s = s.substring(0,s.length-1);
}
return s;
}
</script>
<?php
?>
@@ -0,0 +1,88 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $client;
global $result;
$ticket = Array(
'title'=>'title',
'productid'=>'productid',
'description'=>'description',
'priority'=>'priority',
'category'=>'category',
'owner'=>'owner',
'module'=>'module'
);
foreach($ticket as $key => $val)
$ticket[$key] = $_REQUEST[$key];
$ticket['owner'] = $username;
$ticket['productid'] = $_SESSION['combolist'][0]['productid'][$ticket['productid']];
$title = $_REQUEST['title'];
$description = $_REQUEST['description'];
$priority = $_REQUEST['priority'];
$severity = $_REQUEST['severity'];
$category = $_REQUEST['category'];
$parent_id = $_SESSION['customer_id'];
$productid = $_SESSION['combolist'][0]['productid'][$_REQUEST['productid']];
$module = $_REQUEST['ticket_module'];
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$serviceid = $_REQUEST['servicename'];
$params = Array(Array(
'id'=>"$customerid",
'sessionid'=>"$sessionid",
'title'=>"$title",
'description'=>"$description",
'priority'=>"$priority",
'severity'=>"$severity",
'category'=>"$category",
'user_name' => "$username",
'parent_id'=>"$parent_id",
'product_id'=>"$productid",
'module'=>"$module",
'assigned_to'=>"$Ticket_Assigned_to",
'serviceid'=>"$serviceid"
));
$record_result = $client->call('create_ticket', $params);
if(isset($record_result[0]['new_ticket']) && $record_result[0]['new_ticket']['ticketid'] != '')
{
$new_record = 1;
$ticketid = $record_result[0]['new_ticket']['ticketid'];
}
if($new_record == 1)
{
?>
<script>
var ticketid = <?php echo $ticketid; ?>;
window.location.href = "index.php?module=HelpDesk&action=index&fun=detail&ticketid="+ticketid
</script>
<?php
}
else
{
echo getTranslatedSrting('LBL_PROBLEM_IN_TICKET_SAVING');
include("NewTicket.php");
}
?>
@@ -0,0 +1,60 @@
<?php
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
?>
<table cellpadding="5" cellspacing="0" width="100%" border="0">
<tr>
<td colspan="7" align="right"><a href="javascript:fnDown('tabSrch');" class="hdr"><?php echo getTranslatedString('LBL_CLOSE'); ?></a></td>
</tr>
<tr>
<td width="20%">
<?PHP echo getTranslatedString('TICKETID');?> <br>
<input name="search_ticketid" type="text" class="inputTxt" value="">
</td>
<td width="20%">
<?PHP echo getTranslatedString('TICKET_TITLE');?><br>
<input name="search_title" type="text" class="inputTxt" value="">
</td>
<td width="10%">
<?PHP echo getTranslatedString('TICKET_STATUS');?><br>
<?php
$status_array = getPicklist('ticketstatus');
echo getComboList('search_ticketstatus',$status_array,' ');
?>
</td>
<td width="10%">
<?PHP echo getTranslatedString('TICKET_PRIORITY');?><br>
<?php
$priority_array = getPicklist('ticketpriorities');
echo getComboList('search_ticketpriority',$priority_array,' ');
?>
</td>
<td width="10%">
<?PHP echo getTranslatedString('TICKET_CATEGORY');?> <br>
<?php
$category_array = getPicklist('ticketcategories');
echo getComboList('search_ticketcategory',$category_array,' ');
?>
</td>
<td width="15%">
<?PHP echo getTranslatedString('TICKET_MATCH');?> <br>
<select name="search_match">
<option value="all"><?php echo getTranslatedString('LBL_ALL'); ?></option>
<option value="any"><?php echo getTranslatedString('LBL_ANY'); ?></option>
</select>
</td>
<td width="15%">
&nbsp; <br>
<input name="Search" type="submit" value="<?php echo getTranslatedString('LBL_SEARCH'); ?>" class="inputTxt" onclick="fnDown('tabSrch');this.form.module.value='HelpDesk';this.form.action.value='index';this.form.fun.value='search'">
</td>
</tr>
<tr>
<td colspan="7">&nbsp;</td>
</tr>
</table>
@@ -0,0 +1,247 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
?>
<input align="left" class="crmbutton small cancel"type="button" value="<?PHP echo getTranslatedString('LBL_BACK_BUTTON');?>" onclick="window.history.back();"/>
</td>
<td></td><td></td>
<td align="right">
<input class="crmbutton small cancel" name="newticket" type="submit" value="<?PHP echo getTranslatedString('LBL_NEW_TICKET');?>" onclick="this.form.module.value='HelpDesk';this.form.action.value='index';this.form.fun.value='newticket'">&nbsp;&nbsp;&nbsp;
<input class="crmbutton small cancel" name="srch" type="button" value="<?PHP echo getTranslatedString('LBL_SEARCH');?>" onClick="showSearchFormNow('tabSrch');">
</td>
</form>
<?PHP
global $result;
global $client;
global $Server_Path;
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
if($ticketid != '')
{
$params = array('id' => "$ticketid", 'block'=>"$block",'contactid'=>$customerid,'sessionid'=>"$sessionid");
$result = $client->call('get_details', $params, $Server_Path, $Server_Path);
// Check for Authorization
if (count($result) == 1 && $result[0] == "#NOT AUTHORIZED#") {
echo '<tr>
<td colspan="6" align="center"><b>'.getTranslatedString('LBL_NOT_AUTHORISED').'</b></td>
</tr></table></td></tr></table></td></tr></table>';
include("footer.html");
die();
}
$ticketinfo = $result[0][$block];
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'ticketid' => "$ticketid"));
$commentresult = $client->call('get_ticket_comments', $params, $Server_Path, $Server_Path);
$ticketscount = count($result);
$commentscount = count($commentresult);
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'ticketid' => "$ticketid"));
//Get the creator of this ticket
$creator = $client->call('get_ticket_creator', $params, $Server_Path, $Server_Path);
$ticket_status = '';
foreach($ticketinfo as $key=>$value) {
$fieldlabel = $value['fieldlabel'];
$fieldvalue = $value['fieldvalue'];
if ($fieldlabel == 'Status') {
$ticket_status = $fieldvalue;
break;
}
}
//If the ticket is created by this customer and status is not Closed then allow him to Close this ticket otherwise not
if ($ticket_status != 'Closed' && $ticket_status != '') {
$ticket_close_link = '<a href=index.php?module=HelpDesk&action=index&fun=close_ticket&ticketid='.$ticketid.'><b>'.getTranslatedString('LBL_CLOSE_TICKET').'</b></a>&nbsp;&nbsp;&nbsp;';
} else {
$ticket_close_link = '';
}
echo getblock_header('Ticket Information','4',$ticket_close_link);
echo getblock_fieldlist($ticketinfo);
if($commentscount >= 1 && is_array($commentresult))
{
$list .= '
<tr><td colspan="5" class="detailedViewHeader"><b>'.getTranslatedString('LBL_TICKET_COMMENTS').'</b></td></tr>
<tr>
<td colspan="4" class="dvtCellInfo">
<div id="scrollTab2">
<table width="100%" border="0" cellspacing="5" cellpadding="5">';
//Form the comments in between tr tags
for($j=0;$j<$commentscount;$j++)
{
$list .= '
<tr>
<td width="5%" valign="top">'.($commentscount-$j).'</td>
<td width="95%">'.$commentresult[$j]['comments'].'<br><span class="hdr">'.getTranslatedString('LBL_COMMENT_BY').' : '.$commentresult[$j]['owner'].' '.getTranslatedString('LBL_ON').' '.$commentresult[$j]['createdtime'].'</span></td>
</tr>';
}
$list .= '
</table>
</div>
</td>
</tr>';
}
if($ticket_status != 'Closed')
{
$list .= '
<tr><td colspan="4" class="detailedViewHeader"><b>'.getTranslatedString('LBL_ADD_COMMENT').'</b></td></tr>
<form name="comments" action="index.php" method="post">
<input type="hidden" name="module">
<input type="hidden" name="action">
<input type="hidden" name="fun">
<input type=hidden name=ticketid value='.$ticketid.'>
<tr>
<td colspan="4" class="dvtCellInfo"><textarea name="comments" cols="55" rows="5" class="detailedViewTextBox" onFocus="this.className=\'detailedViewTextBoxOn\'" onBlur="this.className=\'detailedViewTextBox\'"></textarea></td>
</tr>
<tr>
<td><input class="crmbutton small cancel" title="'.getTranslatedString('LBL_SUBMIT').'" accesskey="S" class="small" name="submit" value="'.getTranslatedString('LBL_SUBMIT').'" style="width: 70px;" type="submit" onclick="this.form.module.value=\'HelpDesk\';this.form.action.value=\'index\';this.form.fun.value=\'updatecomment\'; if(trim(this.form.comments.value) != \'\') return true; else return false;"/></td>
</form>
<td colspan="2">&nbsp;</td>
<td>&nbsp;</td>
</tr>';
}
$files_array = getTicketAttachmentsList($ticketid);
if($files_array[0] != "#MODULE INACTIVE#"){
$list .= '
<!-- Added for Attachment -->
<tr><td colspan=4>&nbsp;</td></tr>
<tr><td colspan="4" class="detailedViewHeader"><b>'.getTranslatedString('LBL_ATTACHMENTS').'</b></td></tr>';
//Get the attachments list and form in the tr tag
$attachments_count = count($files_array);
if(is_array($files_array))
{
for($j=0;$j<$attachments_count;$j++)
{
$filename = $files_array[$j]['filename'];
$filetype = $files_array[$j]['filetype'];
$filesize = $files_array[$j]['filesize'];
$fileid = $files_array[$j]['fileid'];
$filelocationtype = $files_array[$j]['filelocationtype'];
//To display the attachments title
$attachments_title = '';
if($j == 0)
$attachments_title = '<b>'.getTranslatedString('LBL_ATTACHMENTS').'</b>';
if($filelocationtype == 'I'){
$list .= '
<tr>
<td class="dvtCellLabel" align="right">'.$attachments_title.'</td>
<td class="dvtCellInfo" colspan="3"><a href="index.php?downloadfile=true&fileid='.$fileid.'&filename='.$filename.'&filetype='.$filetype.'&filesize='.$filesize.'&ticketid='.$ticketid.'">'.ltrim($filename,$ticketid.'_').'</a></td>
</tr>';
}else {
$list .='<tr>' .
'<td class ="dvtCellLabel" align="right">'.$attachments_title.'</td>' .
'<td class="dvtCellInfo" colspan="3"><a target="blank" href='.$filename.'>'.$filename.'</a></td>' .
'</tr>';
}
}
}
else{
$list .= '<tr><td>'.getTranslatedString('NO_ATTACHMENTS').'</td></tr>';
}
}
//To display the file upload error
if($upload_status != '')
{
$list .= '<tr>
<td class="dvtCellLabel" align="right"><b>'.getTranslatedString('LBL_FILE_UPLOADERROR').'</b></td>
<td class="dvtCellInfo" colspan="3"><font color="red">'.$upload_status.'</font></td>
</tr>';
}
//Provide the Add Comment option if the ticket is not Closed
if($ticket_status != 'Closed' && $files_array[0] != "#MODULE INACTIVE#")
{
//To display the File Browse option to upload attachment
$list .= '
<tr>
<form name="fileattachment" method="post" enctype="multipart/form-data" action="index.php">
<input type="hidden" name="module" value="HelpDesk">
<input type="hidden" name="action" value="index">
<input type="hidden" name="fun" value="uploadfile">
<input type="hidden" name="ticketid" value="'.$ticketid.'">
<td class="dvtCellLabel" align="right">'.getTranslatedString('LBL_ATTACH_FILE').'</td>
<td colspan=2 class="dvtCellInfo"><input type="file" size="50" name="customerfile" class="detailedViewTextBox" onchange="validateFilename(this)" />
<input type="hidden" name="customerfile_hidden"/></td>
<td class="dvtCellInfo"><input class="crmbutton small cancel" name="Attach" type="submit" value="'.getTranslatedString('LBL_ATTACH').'"></td>
</form>
</tr>';
}
$list .= '
</table>
</td>
</tr>
</table>
</td></tr>
';
echo $list;
echo '</table></td></tr>';
echo '</table></td></tr></table></td></tr></table>';
echo '<!-- --End-- -->';
}
else
echo getTranslatedString('LBL_NONE_SUBMITTED');
$filevalidation_script = <<<JSFILEVALIDATION
<script type="text/javascript">
function getFileNameOnly(filename) {
var onlyfilename = filename;
// Normalize the path (to make sure we use the same path separator)
var filename_normalized = filename.replace(/\\\\/g, '/');
if(filename_normalized.lastIndexOf("/") != -1) {
onlyfilename = filename_normalized.substring(filename_normalized.lastIndexOf("/") + 1);
}
return onlyfilename;
}
/* Function to validate the filename */
function validateFilename(form_ele) {
if (form_ele.value == '') return true;
var value = getFileNameOnly(form_ele.value);
// Color highlighting logic
var err_bg_color = "#FFAA22";
if (typeof(form_ele.bgcolor) == "undefined") {
form_ele.bgcolor = form_ele.style.backgroundColor;
}
// Validation starts here
var valid = true;
/* Filename length is constrained to 255 at database level */
if (value.length > 255) {
alert(alert_arr.LBL_FILENAME_LENGTH_EXCEED_ERR);
valid = false;
}
if (!valid) {
form_ele.style.backgroundColor = err_bg_color;
return false;
}
form_ele.style.backgroundColor = form_ele.bgcolor;
form_ele.form[form_ele.name + '_hidden'].value = value;
return true;
}
</script>
JSFILEVALIDATION;
echo $filevalidation_script;
?>
@@ -0,0 +1,40 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
function getTicketSearchQuery() {
if(trim($_REQUEST['search_ticketid']) != '')
{
$where .= "vtiger_troubletickets.ticketid = '".addslashes($_REQUEST['search_ticketid'])."'&&&";
}
if(trim($_REQUEST['search_title']) != '')
{
//$where .= "vtiger_troubletickets.title = '".$_REQUEST['search_title']."'&&&";
$where .= "vtiger_troubletickets.title like '%".addslashes(trim($_REQUEST['search_title']))."%'&&&";
}
if(trim($_REQUEST['search_ticketstatus']) != '')
{
$where .= "vtiger_troubletickets.status = '".$_REQUEST['search_ticketstatus']."'&&&";
}
if(trim($_REQUEST['search_ticketpriority']) != '')
{
$where .= "vtiger_troubletickets.priority = '".$_REQUEST['search_ticketpriority']."'&&&";
}
if(trim($_REQUEST['search_ticketcategory']) != '')
{
$where .= "vtiger_troubletickets.category = '".$_REQUEST['search_ticketcategory']."'&&&";
}
$where = trim($where,'&&&');
return $where;
}
?>
@@ -0,0 +1,167 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
$onlymine=$_REQUEST['onlymine'];
if($onlymine == 'true') {
$mine_selected = 'selected';
$all_selected = '';
} else {
$mine_selected = '';
$all_selected = 'selected';
}
?>
<span class="lvtHeaderText">
<?PHP echo getTranslatedString('SHOW');?>&nbsp;</b>
<select id="ticket_status_combo" onchange="this.form.module.value='HelpDesk';this.form.action.value='index';this.form.fun.value='home'; showTickets(index)">
<?php
echo getStatusComboList($show);
?>
</select>
<?PHP $show = $client->call('show_all',array('module'=>'HelpDesk'), $Server_Path, $Server_Path);
if($show == 'true'){
echo '&nbsp; <select id="only_mine_combo" name="list_type" onchange="getList(this, \'HelpDesk\');">
<option value="mine" '. $mine_selected .'>'.getTranslatedString('MINE').'</option>
<option value="all"'. $all_selected .'>'.getTranslatedString('ALL').'</option>
</select>';
}
?>
<td></td><td></td>
<td align="right"><input class="crmbutton small cancel" name="newticket" type="submit" value="<?PHP echo getTranslatedString('LBL_NEW_TICKET');?>" onclick="this.form.module.value='HelpDesk';this.form.action.value='index';this.form.fun.value='newticket'">&nbsp;&nbsp;&nbsp;
<input class="crmbutton small cancel" name="srch" type="button" value="<?PHP echo getTranslatedString('LBL_SEARCH');?>" onClick="showSearchFormNow('tabSrch');">
</td>
</form>
</tr>
<tr>
<td colspan="2">&nbsp;
</td>
</tr>
</table>
<?PHP
global $result;
$list = '';
$closedlist = '';
if($result == '') {
$list .= '<tr><td>';
$list .= '<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
$list .= '<tr><td class="pageTitle">'.getTranslatedString('LBL_NONE_SUBMITTED').'</td></tr></table>';
$list .= '</td></tr>';
} else {
$header = $result[0]['head'][0];
$nooffields = count($header);
$data = $result[1]['data'];
$rowcount = count($data);
$showstatus = $_REQUEST['showstatus'];
if($showstatus != '' && $rowcount >= 1) {
$list .= '<tr><td colspan="1"><div id="scrollTab">';
$list .= '<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
$list .= '<tr><td class="mnu">'.getTranslatedString($showstatus)." ".getTranslatedString('LBL_TICKETS').' </td></tr></table>';
$list .= '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
$list .= '<tr>';
for($i=0; $i<$nooffields; $i++)
{
$header_value = $header[$i]['fielddata'];
$list .= '<td class="detailedViewHeader" align="center">'.$header_value.'</td>';
}
$list .= '</tr>';
$ticketexist = 0;
for($i=0;$i<count($data);$i++)
{
$ticketlist = '';
if ($i%2==0)
$ticketlist .= '<tr class="dvtLabel">';
else
$ticketlist .= '<tr class="dvtInfo">';
$ticket_status = '';
for($j=0; $j<$nooffields; $j++) {
$ticketlist .= '<td>'.getTranslatedString($data[$i][$j]['fielddata']).'</td>';
if ($header[$j]['fielddata'] == 'Status') {
$ticket_status = $data[$i][$j]['fielddata'];
}
}
$ticketlist .= '</tr>';
if($ticket_status == $showstatus){
$list .= $ticketlist;
$ticketexist++;
}
}
if($ticketexist == 0)
{
$list .= '<tr><td>&nbsp;</td></tr><tr><td class="pageTitle">'.getTranslatedString('LBL_NONE_SUBMITTED').'</td></tr>';
}
$list .= '</table>';
}
else {
$list .= '<tr><td colspan="2"><div id="scrollTab">';
$list .= '<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
$list .= '<tr><td class="mnu">'.getTranslatedString('LBL_MY_OPEN_TICKETS').'</td></tr></table>';
$list .= '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
$list .= '<tr>';
$closedlist .= '<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
$closedlist .= '<tr><td class="mnu">'.getTranslatedString('LBL_CLOSED_TICKETS').'</td></tr></table>';
$closedlist .= '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
$closedlist .= '<tr>';
for($i=0; $i<$nooffields; $i++)
{
$header_value = $header[$i]['fielddata'];
$headerlist .= '<td class="detailedViewHeader" align="center">'.getTranslatedString($header_value).'</td>';
}
$headerlist .= '</tr>';
$list .= $headerlist;
$closedlist .= $headerlist;
for($i=0;$i<count($data);$i++)
{
$ticketlist = '';
if ($i%2==0)
$ticketlist .= '<tr class="dvtLabel">';
else
$ticketlist .= '<tr class="dvtInfo">';
$ticket_status = '';
for($j=0; $j<$nooffields; $j++) {
$ticketlist .= '<td>'.$data[$i][$j]['fielddata'].'</td>';
if ($header[$j]['fielddata'] == 'Status') {
$ticket_status = $data[$i][$j]['fielddata'];
}
}
$ticketlist .= '</tr>';
if($ticket_status == getTranslatedString('LBL_STATUS_CLOSED'))
$closedlist .= $ticketlist;
elseif($ticket_status != '')
$list .= $ticketlist;
}
$list .= '</table>';
$closedlist .= '</table>';
$closedlist .= '</div></td></tr>';
$list .= '<br><br>'.$closedlist;
}
}
echo $list;
?>
@@ -0,0 +1,227 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
function getComboList($name, $value, $defaultval='', $selectval='')
{
$list = '<select name="'.$name.'" size="1" class="detailedViewTextBox">';
//Add the default value as a first option
if($defaultval != '')
$list .= '<OPTION value="'.$defaultval.'">'.$defaultval.'</OPTION>';
foreach($value as $index => $val)
{
$selected = '';
if($selectval == $val)
$selected = ' selected ';
$list .= '<OPTION value="'.$val.'" '.$selected.'>'.$val.'</OPTION>';
}
$list .= '</select>';
return $list;
}
function UpdateComment()
{
global $client,$Server_Path;
$ticketid = $_REQUEST['ticketid'];
$ownerid = $_SESSION['customer_id'];
$comments = $_REQUEST['comments'];
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'ticketid'=>"$ticketid",'ownerid'=>"$customerid",'comments'=>"$comments"));
$commentresult = $client->call('update_ticket_comment', $params, $Server_Path, $Server_Path);
}
function Close_Ticket($ticketid)
{
global $client,$Server_Path;
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'ticketid'=>"$ticketid"));
$result = $client->call('close_current_ticket', $params, $Server_Path, $Server_Path);
return $result;
}
function getPicklist($picklist_name)
{
// Static cache to re-use information
static $_picklist_cache = array();
if(isset($_picklist_cache[$picklist_name])) {
return $_picklist_cache[$picklist_name];
}
global $client,$Server_Path;
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'picklist_name'=>"$picklist_name"));
$ticket_picklist_array = $client->call('get_picklists', $params, $Server_Path, $Server_Path);
// Save the result for re-use
$_picklist_cache[$picklist_name] = $ticket_picklist_array;
return $ticket_picklist_array;
}
function getStatusComboList($selectedvalue='')
{
$temp_array = getPicklist('ticketstatus');
$status_combo = "<option value=''>".getTranslatedString('LBL_ALL')."</option>";
foreach($temp_array as $index => $val)
{
$select = '';
if($val == $selectedvalue)
$select = ' selected';
$status_combo .= '<option value="'.$val.'"'.$select.'>'.getTranslatedString($val).'</option>';
}
return $status_combo;
}
//Added for My Settings - Save Password
function SavePassword($version)
{
global $client;
$customer_id = $_SESSION['customer_id'];
$customer_name = $_SESSION['customer_name'];
$oldpw = trim($_REQUEST['old_password']);
$newpw = trim($_REQUEST['new_password']);
$confirmpw = trim($_REQUEST['confirm_password']);
$params = Array('user_name'=>"$customer_name",'user_password'=>"$oldpw",'version'=>"$version",'login'=>'false');
$result = $client->call('authenticate_user',$params);
$sessionid = $_SESSION['customer_sessionid'];
if($oldpw == $result[0]['user_password'])
{
if(strcasecmp($newpw,$confirmpw) == 0)
{
$customerid = $result[0]['id'];
// $customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'username'=>"$customer_name",'password'=>"$newpw",'version'=>"$version"));
$result_change_password = $client->call('change_password',$params);
if($result_change_password[0] == 'MORE_THAN_ONE_USER'){
$errormsg .= getTranslatedString('MORE_THAN_ONE_USER');
}else{
$errormsg .= getTranslatedString('MSG_PASSWORD_CHANGED');
}
}
else
{
$errormsg .= getTranslatedString('MSG_ENTER_NEW_PASSWORDS_SAME');
}
}elseif($result[0] == 'INVALID_USERNAME_OR_PASSWORD') {
$errormsg .= getTranslatedString('LBL_ENTER_VALID_USER');
}elseif($result[0] == 'MORE_THAN_ONE_USER'){
$errormsg .= getTranslatedString('MORE_THAN_ONE_USER');
}
else
{
$errormsg .= getTranslatedString('MSG_YOUR_PASSWORD_WRONG');
}
return $errormsg;
}
function getTicketAttachmentsList($ticketid)
{
global $client;
$customer_name = $_SESSION['customer_name'];
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'ticketid'=>"$ticketid"));
$result = $client->call('get_ticket_attachments',$params);
return $result;
}
function AddAttachment()
{
global $client, $Server_Path;
$ticketid = $_REQUEST['ticketid'];
$ownerid = $_SESSION['customer_id'];
$filename = $_FILES['customerfile']['name'];
$filetype = $_FILES['customerfile']['type'];
$filesize = $_FILES['customerfile']['size'];
$fileerror = $_FILES['customerfile']['error'];
if (isset($_REQUEST['customerfile_hidden'])) {
$filename = $_REQUEST['customerfile_hidden'];
}
$upload_error = '';
if($fileerror == 4)
{
$upload_error = getTranslatedString('LBL_GIVE_VALID_FILE');
}
elseif($fileerror == 2)
{
$upload_error = getTranslatedString('LBL_UPLOAD_FILE_LARGE');
}
elseif($fileerror == 3)
{
$upload_error = getTranslatedString('LBL_PROBLEM_UPLOAD');
}
//Copy the file in temp and then read and pass the contents of the file as a string to db
global $upload_dir;
if(!is_dir($upload_dir)) {
echo getTranslatedString('LBL_NOTSET_UPLOAD_DIR');
exit;
}
if($filesize > 0)
{
if(move_uploaded_file($_FILES["customerfile"]["tmp_name"],$upload_dir.'/'.$filename))
{
$filecontents = base64_encode(fread(fopen($upload_dir.'/'.$filename, "r"), $filesize));
}
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$params = Array(Array(
'id'=>"$customerid",
'sessionid'=>"$sessionid",
'ticketid'=>"$ticketid",
'filename'=>"$filename",
'filetype'=>"$filetype",
'filesize'=>"$filesize",
'filecontents'=>"$filecontents"
));
if($filecontents != ''){
$commentresult = $client->call('add_ticket_attachment', $params, $Server_Path, $Server_Path);
}else{
echo getTranslatedString('LBL_FILE_HAS_NO_CONTENTS');
exit();
}
}
else
{
$upload_error = getTranslatedString('LBL_UPLOAD_VALID_FILE');
}
return $upload_error;
}
?>
@@ -0,0 +1,64 @@
<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<?PHP $only_mine = (isset($_REQUEST['only_mine'])) ? " checked " : ""; ?>
<?php $show= ''; if($_REQUEST['showstatus'] != '') $show = $_REQUEST['showstatus']; ?>
<script language="JavaScript" src="js/general.js"></script>
<table class="dvtContentSpace" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<form name="index" method="post" action="index.php">
<input type="hidden" name="module">
<input type="hidden" name="action">
<input type="hidden" name="fun">
<tr>
<td style="padding:5px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td align="left">
<script>
function verify_data(form,fldval)
{
com = trim(form.fldval.value);
if(com != '')
{
return true;
}
else
{
return false;
}
}
function showTickets(form)
{
var showstatus = form.ticket_status_combo.value;
var obj = form.only_mine_combo;
var onlymine = true;
if (obj != null) {
var list_type = form.only_mine_combo.value;
if (list_type == 'all') {
onlymine = false;
}
}
window.location.href = "index.php?module=HelpDesk&action=index&showstatus="+showstatus+"&onlymine="+onlymine;
}
</script>
@@ -0,0 +1,89 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
@include("../PortalConfig.php");
if(!isset($_SESSION['customer_id']) || $_SESSION['customer_id'] == '')
{
@header("Location: $Authenticate_Path/login.php");
exit;
}
include("HelpDesk/index.html");
include("HelpDesk/TicketSearch.php");
global $result;
$username = $_SESSION['customer_name'];
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
$onlymine=$_REQUEST['onlymine'];
if($onlymine == 'true') {
$mine_selected = 'selected';
$all_selected = '';
} else {
$mine_selected = '';
$all_selected = 'selected';
}
if($_REQUEST['fun'] == '' || $_REQUEST['fun'] == 'home' || $_REQUEST['fun'] == 'search')
{
// This is an archaic parameter list
$match_condition = (isset($_REQUEST['search_match']))?$_REQUEST['search_match']:'';
$where = getTicketSearchQuery();
$params = Array(Array('id'=>"$customerid", 'sessionid'=>"$sessionid", 'user_name' => "$username", 'onlymine' => $onlymine, 'where' => "$where", 'match' => "$match_condition"));
$result = $client->call('get_tickets_list', $params, $Server_Path, $Server_Path);
include("TicketsList.php");
}
elseif($_REQUEST['fun'] == 'newticket')
{
include("NewTicket.php");
}
elseif($_REQUEST['fun'] == 'updatecomment' || $_REQUEST['fun'] == 'close_ticket' || $_REQUEST['fun'] == 'uploadfile')
{
if($_REQUEST['fun'] == 'updatecomment')
{
UpdateComment();
}
if($_REQUEST['fun'] == 'close_ticket')
{
$ticketid = $_REQUEST['ticketid'];
$res = Close_Ticket($ticketid);
}
if($_REQUEST['fun'] == 'uploadfile')
{
$upload_status = AddAttachment();
if($upload_status != ''){
echo $upload_status;
exit(0);
}
}
?>
<script>
var ticketid = <?php echo $_REQUEST['ticketid']; ?>;
window.location.href = "index.php?module=HelpDesk&action=index&fun=detail&ticketid="+ticketid
</script>
<?php
}
elseif($_REQUEST['fun'] == 'detail')
{
$ticketid = $_REQUEST['ticketid'];
$block = 'HelpDesk';
include("TicketDetail.php");
}
elseif($_REQUEST['fun'] == 'saveticket')
{
include("SaveTicket.php");
}
echo '</table></td></tr></table></td></tr></table>';
?>
@@ -0,0 +1 @@
Please look at http://wiki.vtiger.com for more details.
@@ -0,0 +1,41 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $result;
global $client;
global $Server_Path;
echo '<!--Get Invoice Details Information -->';
$customerid = $_SESSION['customer_id'];
$sessionid = $_SESSION['customer_sessionid'];
if($id != '')
{
//Get the Basic Information
$block = "Invoice";
$params = array('id' => "$id", 'block'=>"$block", 'contactid'=>"$customerid",'sessionid'=>"$sessionid");
$result = $client->call('get_invoice_detail', $params, $Server_Path, $Server_Path);
// Check for Authorization
if (count($result) == 1 && $result[0] == "#NOT AUTHORIZED#") {
echo '<tr>
<td colspan="6" align="center"><b>'.getTranslatedString('LBL_NOT_AUTHORISED').'</b></td>
</tr></table></td></tr></table></td></tr></table>';
die();
}
$invinfo = $result[0][$block];
echo '<table><tr><td><input class="crmbutton small cancel" type="button" value="'.getTranslatedString('LBL_BACK_BUTTON').'" onclick="window.history.back();"/></td></tr></table>';
echo getblock_fieldlist($invinfo);
echo '<tr><td colspan ="4"><table width="100%">';
echo '</table></td></tr>';
echo '</table></td></tr></table></td></tr></table>';
echo '<!-- --End-- -->';
}
?>

Some files were not shown because too many files have changed in this diff Show More