Add php files
This commit is contained in:
59
modules/EcmCalls/AjaxSave.php
Executable file
59
modules/EcmCalls/AjaxSave.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
global $current_user;
|
||||
if(!ACLController::checkAccess('EcmCalls', "edit", true)) {
|
||||
ACLController::displayNoAccess();
|
||||
return;
|
||||
}
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
$focus = new EcmCall();
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
if(isset($focus->id) && $focus->id != '') {
|
||||
$focus->note = $_REQUEST['note'];
|
||||
$focus->save();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
22
modules/EcmCalls/AnMenu.php
Executable file
22
modules/EcmCalls/AnMenu.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
require_once('modules/EcmCalls/anMenu/anMenu.php');
|
||||
$anMenu = new anMenu();
|
||||
if($_REQUEST['anMenuAction'] == "getAccountsSelect") {
|
||||
echo $anMenu->getAccountsSelectJSON($_REQUEST['an_menu_parent_id']);
|
||||
}
|
||||
if($_REQUEST['anMenuAction'] == "getContactsSelect") {
|
||||
echo $anMenu->getContactsSelectJSON($_REQUEST['an_menu_parent_id']);
|
||||
}
|
||||
if($_REQUEST['anMenuAction'] == "getUsersSelect") {
|
||||
echo $anMenu->getUsersSelectJSON($_REQUEST['an_menu_parent_id']);
|
||||
}
|
||||
if($_REQUEST['anMenuAction'] == "Save") {
|
||||
if(isset($_POST['an_menu_data']) && $_POST['an_menu_data'] != '') {
|
||||
$json = getJSONobj();
|
||||
$an_menu_data = $json->decode(htmlspecialchars_decode($_POST['an_menu_data']));
|
||||
if($anMenu->SavePhone($an_menu_data)) {
|
||||
echo $an_menu_data['an_menu_parent_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
163
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.data.php
Executable file
163
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.data.php
Executable file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
global $current_user;
|
||||
|
||||
$dashletData['MyEcmCallsDashlet']['searchFields'] = array(
|
||||
'calldate' => array('query_type'=>'') ,
|
||||
'parent_from' => array('query_type' => ''),
|
||||
'call_type' => array('query_type'=>''),
|
||||
'call_disposition' => array('query_type'=>''),
|
||||
);
|
||||
$dashletData['MyEcmCallsDashlet']['columns'] = array(
|
||||
|
||||
|
||||
'TYPE_IMG' => array(
|
||||
'width' => 2,
|
||||
'default' => true,
|
||||
'label' => ' ',
|
||||
'sortable' => false,
|
||||
),
|
||||
|
||||
'DISPOSITION' => array(
|
||||
'width' => 5,
|
||||
'default' => true,
|
||||
'label' => 'LBL_DISPOSITION',
|
||||
),
|
||||
|
||||
'CALLDATE' => array(
|
||||
'width' => 10,
|
||||
'default' => true,
|
||||
'label' => 'LBL_CALLDATE',
|
||||
),
|
||||
|
||||
'CLID' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_CLID',
|
||||
),
|
||||
|
||||
'SRC' => array(
|
||||
'width' => 15,
|
||||
'default' => true,
|
||||
'label' => 'LBL_SRC',
|
||||
),
|
||||
|
||||
'DST' => array(
|
||||
'width' => 15,
|
||||
'default' => true,
|
||||
'label' => 'LBL_DST',
|
||||
),
|
||||
|
||||
'ACCOUNT' => array(
|
||||
'width' => 15,
|
||||
'default' => true,
|
||||
'label' => 'Account',
|
||||
),
|
||||
|
||||
'DCONTEXT' => array(
|
||||
'width' => 10,
|
||||
'default' => false,
|
||||
'label' => 'LBL_DCONTEXT',
|
||||
),
|
||||
|
||||
'CHANNEL' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_CHANNEL',
|
||||
),
|
||||
|
||||
'DSTCHANNEL' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_DSTCHANNEL',
|
||||
),
|
||||
|
||||
'LASTAPP' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_LASTAPP',
|
||||
),
|
||||
|
||||
'LASTDATA' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_LASTDATA',
|
||||
),
|
||||
|
||||
'DURATION' => array(
|
||||
'width' => 5,
|
||||
'default' => true,
|
||||
'align' => 'center',
|
||||
'label' => 'LBL_DURATION',
|
||||
),
|
||||
|
||||
'BILLSEC' => array(
|
||||
'width' => 5,
|
||||
'default' => true,
|
||||
'align' => 'center',
|
||||
'label' => 'LBL_BILLSEC',
|
||||
),
|
||||
|
||||
'AMAFLAGS' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_AMAFLAGS',
|
||||
),
|
||||
|
||||
'ACCOUNTCODE' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_ACCOUNTCODE',
|
||||
),
|
||||
|
||||
'USERFIELD' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_USERFIELD',
|
||||
),
|
||||
'HINT' => array(
|
||||
'width' => 2,
|
||||
'default' => true,
|
||||
'label' => ' ',
|
||||
'sortable' => false,
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
46
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.meta.php
Executable file
46
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.meta.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
global $app_strings;
|
||||
|
||||
$dashletMeta['MyEcmCallsDashlet'] = array('module' => 'EcmCalls',
|
||||
'title' => translate('LBL_DASHLET_MY_ECMCALLS', 'EcmCalls'),
|
||||
'description' => 'A customizable view into EcmCalls',
|
||||
'category' => 'Module Views');
|
||||
?>
|
||||
206
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.php
Executable file
206
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.php
Executable file
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
require_once('include/Dashlets/DashletGeneric.php');
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
|
||||
class MyEcmCallsDashlet extends DashletGeneric {
|
||||
|
||||
var $parent_from;
|
||||
var $call_type;
|
||||
|
||||
function MyEcmCallsDashlet($id, $def = null) {
|
||||
global $current_user, $app_strings;
|
||||
require('modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.data.php');
|
||||
|
||||
parent::DashletGeneric($id, $def);
|
||||
|
||||
if(!empty($def['parent_from'])) $this->parent_from = $def['parent_from'];
|
||||
if(!empty($def['call_type'])) $this->call_type = $def['call_type'];
|
||||
if(!empty($def['call_disposition'])) $this->call_disposition = $def['call_disposition'];
|
||||
if(!empty($def['call_duration'])) $this->call_duration = $def['call_duration'];
|
||||
if(!empty($def['call_duration_type'])) $this->call_duration_type = $def['call_duration_type'];
|
||||
|
||||
if(empty($def['title'])) $this->title = translate('LBL_DASHLET_MY_ECMCALLS', 'EcmCalls');
|
||||
|
||||
$this->searchFields = $dashletData['MyEcmCallsDashlet']['searchFields'];
|
||||
$this->columns = $dashletData['MyEcmCallsDashlet']['columns'];
|
||||
|
||||
$this->seedBean = new EcmCall();
|
||||
$this->lvs->quickViewLinks = false;
|
||||
//var_dump($this->parent_from);
|
||||
}
|
||||
function buildWhere() {
|
||||
global $current_user;
|
||||
|
||||
$returnArray = array();
|
||||
|
||||
if(!is_array($this->filters)) {
|
||||
// use defaults
|
||||
$this->filters = array();
|
||||
foreach($this->searchFields as $name => $params) {
|
||||
if(!empty($params['default']))
|
||||
$this->filters[$name] = $params['default'];
|
||||
}
|
||||
}
|
||||
foreach($this->filters as $name=>$params) {
|
||||
if(!empty($params)) {
|
||||
if($name == 'assigned_user_id' && $this->myItemsOnly) continue; // don't handle assigned user filter if filtering my items only
|
||||
$widgetDef = $this->seedBean->field_defs[$name];
|
||||
|
||||
$widgetClass = $this->layoutManager->getClassFromWidgetDef($widgetDef, true);
|
||||
$widgetDef['table'] = $this->seedBean->table_name;
|
||||
$widgetDef['table_alias'] = $this->seedBean->table_name;
|
||||
|
||||
switch($widgetDef['type']) {// handle different types
|
||||
case 'date':
|
||||
case 'datetime':
|
||||
if(!empty($params['date']))
|
||||
$widgetDef['input_name0'] = $params['date'];
|
||||
$_REQUEST['calldate_advanced'] = $params['type'];
|
||||
break;
|
||||
default:
|
||||
$widgetDef['input_name0'] = $params;
|
||||
if(is_array($params) && !empty($params)) { // handle array query
|
||||
array_push($returnArray, $widgetClass->queryFilterone_of($widgetDef, false));
|
||||
}
|
||||
else {
|
||||
array_push($returnArray, $widgetClass->queryFilterStarts_With($widgetDef, true));
|
||||
}
|
||||
$widgetDef['input_name0'] = $params;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$_REQUEST['searchFormTab'] = "advanced_search";
|
||||
if($this->call_type == "incoming") {
|
||||
$_REQUEST['parent_to_advanced'] = "Users";
|
||||
if($this->myItemsOnly)
|
||||
$_REQUEST['parent_to_id_advanced'] = array($current_user->id);
|
||||
else
|
||||
$_REQUEST['parent_to_id_advanced'] = $this->parent_from;
|
||||
}
|
||||
else if($this->call_type == "outgoing" || $this->call_type == "both") {
|
||||
$_REQUEST['parent_from_advanced'] = "Users";
|
||||
if($this->myItemsOnly)
|
||||
$_REQUEST['parent_from_id_advanced'] = array($current_user->id);
|
||||
else
|
||||
$_REQUEST['parent_from_id_advanced'] = $this->parent_from;
|
||||
}
|
||||
if($this->call_type == "both") $_REQUEST['in_out_advanced'] = 'on';
|
||||
if($this->call_disposition) $_REQUEST['disposition_advanced'] = $this->call_disposition;
|
||||
if($this->call_duration) $_REQUEST['duration_advanced'] = $this->call_duration;
|
||||
if($this->call_duration_type) $_REQUEST['duration_type_advanced'] = $this->call_duration_type;
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
function saveOptions($req) {
|
||||
$options = parent::saveOptions($req);
|
||||
$options['parent_from'] = $req['parent_from'];
|
||||
$options['call_type'] = $req['call_type'];
|
||||
$options['call_disposition'] = $req['call_disposition'];
|
||||
$options['call_duration'] = $req['call_duration'];
|
||||
$options['call_duration_type'] = $req['call_duration_type'];
|
||||
return $options;
|
||||
}
|
||||
|
||||
function displayOptions() {
|
||||
$this->processDisplayOptions();
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
global $app_list_strings;
|
||||
$this->currentSearchFields['calldate']['input'] = '<select name="type_calldate">'.get_select_options_with_id($app_list_strings['search_date_type_dom'],(empty($this->filters['calldate']) ? '' : $this->filters['calldate'])).'</select>';
|
||||
|
||||
|
||||
$GLOBALS['db'] = new MysqlManager();
|
||||
$GLOBALS['db']->connect();
|
||||
$query = "SELECT `id`, CONCAT(IFNULL(CONCAT(`first_name`,' '),''), '', `last_name`) as `name` FROM `users` WHERE `status`='Active' and `deleted`=0 ORDER BY `name`";
|
||||
$results = $GLOBALS['db']->query($query);
|
||||
$arr = array();
|
||||
if(is_resource($results)) {
|
||||
while($row = $GLOBALS['db']->fetchByAssoc($results)) $arr[$row['id']] = $row['name'];
|
||||
}
|
||||
$this->currentSearchFields['parent_from']['input'] = '<select id="parent_from" name="parent_from[]" multiple="multiple" size="5" style="width:150px;">'.get_select_options_with_id($arr,(empty($this->parent_from) ? '' : $this->parent_from)).'</select>';
|
||||
|
||||
$this->currentSearchFields['call_type']['input'] = '<select id="call_type" name="call_type" style="width:150px;">'.get_select_options_with_id($app_list_strings['ecmcalls_chart_call_type_dom'],(empty($this->call_type) ? '' : $this->call_type)).'</select>';
|
||||
|
||||
$disp_arr=array(
|
||||
''=>'select',
|
||||
'ANSWERED'=>'Answered',
|
||||
'BUSY'=>'Busy',
|
||||
'FAILED'=>'Failed',
|
||||
'NO ANSWER'=>'No answer',
|
||||
);
|
||||
$sel='<select name="call_disposition">';
|
||||
foreach($disp_arr as $k=>$v){
|
||||
$sel.='<option value="'.$k.'"';
|
||||
if($this->call_disposition==$k)$sel.=' selected';
|
||||
$sel.='>'.$v.'</option>';
|
||||
}
|
||||
$sel.='</select>';
|
||||
$this->currentSearchFields['call_disposition']['input'] = $sel;
|
||||
$this->currentSearchFields['call_disposition']['label'] = 'Disposition';
|
||||
|
||||
$cdt=array(
|
||||
''=>'select',
|
||||
'less'=>'<=',
|
||||
'more'=>'>',
|
||||
);
|
||||
$sel='<select name="call_duration_type">';
|
||||
foreach($cdt as $k=>$v){
|
||||
$sel.='<option value="'.$k.'"';
|
||||
if($this->call_duration_type==$k)$sel.=' selected';
|
||||
$sel.='>'.$v.'</option>';
|
||||
}
|
||||
$sel.='</select>';
|
||||
|
||||
$this->currentSearchFields['call_duration']['input']=$sel.'<input name="call_duration" size="3" type="text" value="'.$this->call_duration.'"> s';
|
||||
$this->currentSearchFields['call_duration']['label'] = 'Duration';
|
||||
|
||||
$this->configureSS->assign('searchFields', $this->currentSearchFields);
|
||||
return $this->configureSS->fetch($this->configureTpl);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
74
modules/EcmCalls/Delete.php
Executable file
74
modules/EcmCalls/Delete.php
Executable file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
|
||||
$focus = new EcmCall();
|
||||
|
||||
// PERFORM THE DELETE IF GIVEN A RECORD TO DELETE
|
||||
if(!isset($_REQUEST['record']))
|
||||
sugar_die("A record number must be specified to delete the record.");
|
||||
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
if(!$focus->ACLAccess('Delete')) {
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
$focus->mark_deleted($_REQUEST['record']);
|
||||
|
||||
// NOW THAT THE DELETE HAS BEEN PERFORMED, RETURN TO GIVEN LOCATION
|
||||
handleRedirect($return_id,'EcmCalls');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
37
modules/EcmCalls/DetailView.php
Executable file
37
modules/EcmCalls/DetailView.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
require_once('modules/EcmCalls/Forms.php');
|
||||
require_once ('include/time.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$focus = new EcmCall();
|
||||
|
||||
if(isset($_REQUEST['record'])) {
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
//$focus->format_all_fields();
|
||||
} else {}
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('include/MVC/View/views/view.detail.php');
|
||||
$detail = new ViewDetail();
|
||||
$detail->bean = $focus;
|
||||
$detail->preDisplay();
|
||||
|
||||
require_once('modules/Currencies/Currency.php');
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($focus->currency_id);
|
||||
$detail->ss->assign("CURRENCY_NAME", $currency->name);
|
||||
$detail->ss->assign("CURRENCY_SYMBOL", $currency->symbol);
|
||||
|
||||
echo $detail->display();
|
||||
|
||||
//subpanel init
|
||||
require_once('include/SubPanel/SubPanelTiles.php');
|
||||
$subpanel = new SubPanelTiles($focus, 'EcmCalls');
|
||||
echo $subpanel->display();
|
||||
|
||||
?>
|
||||
50
modules/EcmCalls/DoCall.php
Executable file
50
modules/EcmCalls/DoCall.php
Executable file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
if(!isset($_REQUEST['number']) || $_REQUEST['number'] == '') return; else $number = $_REQUEST['number'];
|
||||
global $current_user, $app_strings, $mod_strings;
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
|
||||
|
||||
$url = EcmCall::CentralUrl($number);
|
||||
if($url && $url != '')
|
||||
echo ''.$url.'';
|
||||
?>
|
||||
1644
modules/EcmCalls/EcmCall.php
Executable file
1644
modules/EcmCalls/EcmCall.php
Executable file
File diff suppressed because it is too large
Load Diff
403
modules/EcmCalls/EcmCallsChartImg.php
Executable file
403
modules/EcmCalls/EcmCallsChartImg.php
Executable file
@@ -0,0 +1,403 @@
|
||||
<?php
|
||||
|
||||
$GLOBALS['db'] = new MysqlManager();
|
||||
$GLOBALS['db']->connect();
|
||||
|
||||
global $mod_strings;
|
||||
//***********************************************************************************************************************//
|
||||
|
||||
function returnErrorData() {
|
||||
header("Content-type: image/png");
|
||||
if(isset($_GET['imgWidth']) && $_GET['imgWidth'] != '') $imgWidth = intval($_GET['imgWidth']); else $imgWidth = 600;
|
||||
if(isset($_GET['imgHeight']) && $_GET['imgHeight'] != '') $imgHeight = intval($_GET['imgHeight']); else $imgHeight = 600;
|
||||
$im = @imagecreate($imgWidth, $imgHeight)
|
||||
or die("Cannot Initialize new GD image stream");
|
||||
$background_color = imagecolorallocate($im, 255, 255, 255);
|
||||
$text_color = imagecolorallocate($im, 100, 100, 100);
|
||||
$grey = imagecolorallocate($im, 135, 135, 135);
|
||||
imagerectangle($im, 0, 0, $imgWidth-1, $imgHeight-1, $grey);
|
||||
global $mod_strings;
|
||||
imagestring($im, 7, 20, 20, translate('LBL_ECMCALLS_NO_DATA', 'Charts'), $text_color);
|
||||
//imagettftext($im, 18, 20, 20, 18, $text_color, "CENTURY.TTF", $mod_strings['LBL_ECMCALLS_NO_DATA']);
|
||||
imagepng($im);
|
||||
imagedestroy($im);
|
||||
die();
|
||||
}
|
||||
|
||||
// ecmcall_id, calldate, phone
|
||||
|
||||
function getUserData($id, $options, $type) {
|
||||
$data = array();
|
||||
$query = "SELECT `user_name`, `phone_work`, `phone_mobile`, `phone_home`, `phone_other`, `phone_fax`,`first_name`,`last_name` FROM `users` WHERE `id`='$id' LIMIT 1";
|
||||
$name = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($query));
|
||||
if ($name['phone_work'] != '') $name['phone'] = 'phone_work';
|
||||
elseif ($name['phone_mobile'] != '') $name['phone'] = 'phone_mobile';
|
||||
elseif ($name['phone_home'] != '') $name['phone'] = 'phone_home';
|
||||
elseif ($name['phone_other'] != '') $name['phone'] = 'phone_other';
|
||||
elseif ($name['phone_fax'] != '') $name['phone'] = 'phone_fax';
|
||||
|
||||
$phone = $name[$name['phone']];
|
||||
|
||||
|
||||
|
||||
if ($name['phone_work'] != '' && strlen($phone) > strlen($name['phone_work'])) $phone = $name['phone_work'];
|
||||
elseif ($name['phone_mobile'] != '' && strlen($phone) > strlen($name['phone_mobile'])) $phone = $name['phone_mobile'];
|
||||
elseif ($name['phone_home'] != '' && strlen($phone) > strlen($name['phone_home'])) $phone = $name['phone_home'];
|
||||
elseif ($name['phone_other'] != '' && strlen($phone) > strlen($name['phone_other'])) $phone = $name['phone_other'];
|
||||
elseif ($name['phone_fax'] != '' && strlen($phone) > strlen($name['phone_fax'])) $phone = $name['phone_fax'];
|
||||
|
||||
if($options['pbuts_show_numbers'] == 1) $name['user_name'] .= "\n(".$phone.')';
|
||||
|
||||
//die();
|
||||
|
||||
$query = "SELECT DISTINCT `cdr`.`calldate`, `cdr`.`src`, `cdr`.`duration`, `cdr`.`billsec` ";
|
||||
$query .= "FROM `cdr`, `ecmcalls_beans` AS `eb` ";
|
||||
$query .= "WHERE `cdr`.`id`=`eb`.`ecmcall_id` ";
|
||||
$query .= "AND `eb`.`bean_id`='$id' ";
|
||||
|
||||
if($type == "outgoing")
|
||||
$query .= "AND ((LPAD(`eb`.`src`,50,'0')=LPAD(`cdr`.`src`,50,'0')) OR (LPAD(`eb`.`src`,50,'0')=LPAD(`cdr`.`dcontext`,50,'0'))) ";
|
||||
else
|
||||
if($type == "incoming")
|
||||
$query .= "AND (LPAD(`eb`.`src`,50,'0')=LPAD(`cdr`.`dst`,50,'0')) ";
|
||||
|
||||
$where = '';
|
||||
|
||||
|
||||
if($options['pbuts_date_select'] == 'THIS_DAY' || $options['pbuts_date_select'] == 'LAST_DAY') {
|
||||
require_once('modules/EcmCalls/TimeDateC.php');
|
||||
$tdc = new TimeDateC();
|
||||
$td = $tdc->queryFilter($options['pbuts_date_select']);
|
||||
|
||||
if($options['pbuts_date_select'] == 'LAST_DAY') {
|
||||
$td = $td['end'];
|
||||
} elseif($options['pbuts_date_select'] == 'THIS_DAY') {
|
||||
$td = $td['begin'];
|
||||
//convert date
|
||||
global $timedate, $timezones;
|
||||
require_once('modules/EcmCalls/TimeDateC.php');
|
||||
$tdc = new TimeDateC();
|
||||
$td = $tdc->handle_offset($td, $tdc->get_db_date_time_format(), true);
|
||||
}
|
||||
$td = substr($td,0,-9);
|
||||
$options['pbuts_date'] = $td;
|
||||
}
|
||||
|
||||
$time_to = '00:00:00';
|
||||
if(isset($options['pbuts_time_to']) && $options['pbuts_time_to'] != '') {
|
||||
$time_to = $options['pbuts_time_to'];
|
||||
$pbuts_date = $options['pbuts_date'];
|
||||
if($time_to == '24:00') $time_to = '23:59:59'; else $time_to .= ':00';
|
||||
$time_to = $pbuts_date.' '.$time_to;
|
||||
//convert date
|
||||
global $timedate, $timezones;
|
||||
require_once('modules/EcmCalls/TimeDateC.php');
|
||||
$tdc = new TimeDateC();
|
||||
$time_to = $timedate->handle_offset($time_to, $timedate->get_db_date_time_format(), false);
|
||||
$time_to = $tdc->handle_offset($time_to, $tdc->get_db_date_time_format(), true);
|
||||
}
|
||||
|
||||
$time_from = '00:00:00';
|
||||
if(isset($options['pbuts_time_from']) && $options['pbuts_time_from'] != '') {
|
||||
$time_from = $options['pbuts_time_from'];
|
||||
$pbuts_date = $options['pbuts_date'];
|
||||
if($time_from == '24:00') $time_from = '23:59:59'; else $time_from .= ':00';
|
||||
$time_from = $pbuts_date.' '.$time_from;
|
||||
|
||||
//convert date
|
||||
global $timedate, $timezones;
|
||||
require_once('modules/EcmCalls/TimeDateC.php');
|
||||
$tdc = new TimeDateC();
|
||||
$time_from = $timedate->handle_offset($time_from, $timedate->get_db_date_time_format(), false);
|
||||
$time_from = $tdc->handle_offset($time_from, $tdc->get_db_date_time_format(), true);
|
||||
}
|
||||
|
||||
//var_dump($time_from);
|
||||
//var_dump($time_to);
|
||||
//die();
|
||||
|
||||
if(isset($options['pbuts_date']) && $options['pbuts_date'] != '') {
|
||||
if($where != '') $where .= "AND ";
|
||||
$where .= "`cdr`.`calldate` >= '$time_from' AND `cdr`.`calldate` <= '$time_to' ";
|
||||
}
|
||||
|
||||
|
||||
$query .= 'AND '.$where;
|
||||
$results = $GLOBALS['db']->query($query);
|
||||
|
||||
if(is_resource($results)) {
|
||||
|
||||
$calls = array();
|
||||
while($row = $GLOBALS['db']->fetchByAssoc($results)) $calls[] = $row;
|
||||
|
||||
$data_tmp = array();
|
||||
$data_tmp['values']['<=60']['x'] = array();
|
||||
$data_tmp['values']['>60']['x'] = array();
|
||||
foreach($calls as $value) {
|
||||
$date_ = substr($value['calldate'],0,-3);
|
||||
$dd = split(" ",$date_);
|
||||
$dd[0] = str_replace("-", "", $dd[0]);
|
||||
$dd[1] = split(":",$dd[1]);
|
||||
$dur = intval($options['pbuts_watch_seconds']);
|
||||
if($options['pbuts_watch'] == 'duration') {
|
||||
if(intval($value['duration']) <= $dur) $kk = '<=60'; else $kk = '>60';
|
||||
} else {
|
||||
if(intval($value['billsec']) <= $dur) $kk = '<=60'; else $kk = '>60';
|
||||
}
|
||||
$yyy = intval($dd[1][0])*60+intval($dd[1][1]);
|
||||
if(!isset($yax)) $ymax = $yyy; elseif($yyy > $ymax) $ymax = $yyy;
|
||||
if(!isset($ymin)) $ymin = $yyy; elseif($yyy < $ymin) $ymin = $yyy;
|
||||
$data_tmp['values'][$kk]['y'][] = $yyy;
|
||||
}
|
||||
|
||||
if(count($data_tmp['values']['<=60']['y']) > 0 || count($data_tmp['values']['>60']['y']) > 0) {
|
||||
$data = $data_tmp;
|
||||
$name['user_name']=iconv("utf-8","iso-8859-2",$name['first_name']."\n".$name['last_name']."\n(".$name['phone_work'].")");
|
||||
$data['name'] = $name['user_name'];
|
||||
$data['ymin'] = $ymin;
|
||||
$data['ymax'] = $ymax;
|
||||
$data['count'] = count($data);
|
||||
}
|
||||
//print_r($data);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
//**********************************************************************************************************************//
|
||||
|
||||
|
||||
|
||||
|
||||
global $current_user;
|
||||
$options = $_SESSION['EcmCallsChart'][$_REQUEST['chartName']][$current_user->id];
|
||||
|
||||
if(isset($_GET['imgWidth']) && $_GET['imgWidth'] != '') $imgWidth = intval($_GET['imgWidth']); else $imgWidth = 600;
|
||||
if(isset($_GET['imgHeight']) && $_GET['imgHeight'] != '') $imgHeight = intval($_GET['imgHeight']); else $imgHeight = 600;
|
||||
|
||||
if(!is_array($options)) return;
|
||||
|
||||
|
||||
//function getUserPthones
|
||||
|
||||
//print_r($options);
|
||||
//die();
|
||||
|
||||
|
||||
|
||||
include ("include/jpgraph/1.26/src/jpgraph.php");
|
||||
include ("include/jpgraph/1.26/src/jpgraph_scatter.php");
|
||||
|
||||
|
||||
$graph = new Graph($imgWidth,$imgHeight);
|
||||
|
||||
|
||||
$yaxis = array();
|
||||
for($i=0; $i<=24*60; $i+=1) $yaxis[intval(sprintf("%02d%02d",$i/60,$i%60))] = sprintf("%02d:%02d",$i/60,$i%60);
|
||||
|
||||
$colors = array('red', 'blue', 'yellow', 'green', 'white', 'brown', 'orange');
|
||||
|
||||
|
||||
$yLabels = array(); $yLabels[0] = ' ';
|
||||
$users_ = array();
|
||||
$users_['start'] = array('name' => ' ', 'lp' => 0);
|
||||
if($options['pbuts_type'] == 'incoming' || $options['pbuts_type'] == 'both') {
|
||||
|
||||
$data1 = array();
|
||||
$yLc = 1;
|
||||
foreach($options['pbuts_users'] as $key => $user_id) {
|
||||
//for($powiel=0; $powiel<5; $powiel++){
|
||||
$data_tmp = getUserData($user_id, $options, 'incoming');
|
||||
if(is_array($data_tmp) && count($data_tmp) > 0) {
|
||||
if(!isset($users_[$user_id])) $users_[$user_id] = array('name' => $data_tmp['name'], 'lp' => count($users_));
|
||||
$data_tmp['values']['<=60']['x'] = array_pad($data_tmp['values']['<=60']['x'], count($data_tmp['values']['<=60']['y']), $users_[$user_id]['lp']);
|
||||
$data_tmp['values']['>60']['x'] = array_pad($data_tmp['values']['>60']['x'], count($data_tmp['values']['>60']['y']), $users_[$user_id]['lp']);
|
||||
$data1[] = $data_tmp;
|
||||
$yLabels[$yLc++] = $data_tmp['name'];
|
||||
if(!isset($ymin)) $ymin = $data_tmp['ymin']; elseif($data_tmp['ymin'] < $ymin) $ymin = $data_tmp['ymin'];
|
||||
if(!isset($ymax)) $ymax = $data_tmp['ymax']; elseif($data_tmp['ymax'] > $ymax) $ymax = $data_tmp['ymax'];
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
if(count($data1) > 0) {
|
||||
$less60legend = false;
|
||||
$more60legend = false;
|
||||
$sp = array();
|
||||
foreach($data1 as $key => $value) {
|
||||
if(count($value['values']['<=60']['x']) > 0) {
|
||||
$sp['<=60'][$key] = new ScatterPlot($value['values']['<=60']['x'],$value['values']['<=60']['y']);
|
||||
$sp['<=60'][$key]->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
$sp['<=60'][$key]->mark->SetFillColor('red');
|
||||
$sp['<=60'][$key]->mark->SetWidth(5);
|
||||
if(!$less60legend) {
|
||||
$less60legend = true;
|
||||
$sp['<=60'][$key]->SetLegend($mod_strings['LBL_INCOMING_LESS_THAN'].intval($options['pbuts_watch_seconds']).'s');
|
||||
}
|
||||
$graph->Add($sp['<=60'][$key]);
|
||||
}
|
||||
if(count($value['values']['>60']['x']) > 0) {
|
||||
$sp['>60'][$key] = new ScatterPlot($value['values']['>60']['x'],$value['values']['>60']['y']);
|
||||
$sp['>60'][$key]->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
$sp['>60'][$key]->mark->SetFillColor('blue');
|
||||
$sp['>60'][$key]->mark->SetWidth(5);
|
||||
if(!$more60legend) {
|
||||
$more60legend = true;
|
||||
$sp['>60'][$key]->SetLegend($mod_strings['LBL_INCOMING_MORE_THAN'].intval($options['pbuts_watch_seconds']).'s');
|
||||
}
|
||||
$graph->Add($sp['>60'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} //echo "\n";
|
||||
if($options['pbuts_type'] == 'both' || $options['pbuts_type'] == 'outgoing') {
|
||||
$data2 = array();
|
||||
$yLc = 1;
|
||||
foreach($options['pbuts_users'] as $key => $user_id) {
|
||||
//for($powiel=0; $powiel<5; $powiel++){
|
||||
$data_tmp = getUserData($user_id, $options, 'outgoing');
|
||||
if(is_array($data_tmp) && count($data_tmp) > 0) {
|
||||
if(!isset($users_[$user_id])) $users_[$user_id] = array('name' => $data_tmp['name'], 'lp' => count($users_));
|
||||
$data_tmp['values']['<=60']['x'] = array_pad($data_tmp['values']['<=60']['x'], count($data_tmp['values']['<=60']['y']), $users_[$user_id]['lp']);
|
||||
$data_tmp['values']['>60']['x'] = array_pad($data_tmp['values']['>60']['x'], count($data_tmp['values']['>60']['y']), $users_[$user_id]['lp']);
|
||||
$data2[] = $data_tmp;
|
||||
$yLabels[$yLc++] = $data_tmp['name'];
|
||||
if(!isset($ymin)) $ymin = $data_tmp['ymin']; elseif($data_tmp['ymin'] < $ymin) $ymin = $data_tmp['ymin'];
|
||||
if(!isset($ymax)) $ymax = $data_tmp['ymax']; elseif($data_tmp['ymax'] > $ymax) $ymax = $data_tmp['ymax'];
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
if(count($data2) > 0) {
|
||||
$less60legend = false;
|
||||
$more60legend = false;
|
||||
$sp = array();
|
||||
foreach($data2 as $key => $value) {
|
||||
if(count($value['values']['<=60']['x']) > 0) {
|
||||
$sp['<=60'][$key] = new ScatterPlot($value['values']['<=60']['x'],$value['values']['<=60']['y']);
|
||||
$sp['<=60'][$key]->mark->SetType(MARK_UTRIANGLE);
|
||||
//$sp['<=60'][$key]->mark->SetType(MARK_IMG,'modules/Home/Dashlets/MyEcmCallsMoreDashlets/green.gif',1);
|
||||
$sp['<=60'][$key]->mark->SetFillColor('red');
|
||||
$sp['<=60'][$key]->mark->SetWidth(10);
|
||||
if(!$less60legend) {
|
||||
$less60legend = true;
|
||||
$sp['<=60'][$key]->SetLegend($mod_strings['LBL_OUTGOING_LESS_THAN'].intval($options['pbuts_watch_seconds']).'s');
|
||||
}
|
||||
$graph->Add($sp['<=60'][$key]);
|
||||
}
|
||||
if(count($value['values']['>60']['x']) > 0) {
|
||||
$sp['>60'][$key] = new ScatterPlot($value['values']['>60']['x'],$value['values']['>60']['y']);
|
||||
$sp['>60'][$key]->mark->SetType(MARK_UTRIANGLE);
|
||||
//$sp['<=60'][$key]->mark->SetType(MARK_IMG,'modules/Home/Dashlets/MyEcmCallsMoreDashlets/red.gif',1);
|
||||
$sp['>60'][$key]->mark->SetFillColor('blue');
|
||||
$sp['>60'][$key]->mark->SetWidth(10);
|
||||
if(!$more60legend) {
|
||||
$more60legend = true;
|
||||
$sp['>60'][$key]->SetLegend($mod_strings['LBL_OUTGOING_MORE_THAN'].intval($options['pbuts_watch_seconds']).'s');
|
||||
}
|
||||
$graph->Add($sp['>60'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$users_['end'] = array( 'name' => ' ', 'lp' => count($users_));
|
||||
//die();
|
||||
|
||||
$yLabels = array();
|
||||
foreach($users_ as $key => $value) $yLabels[$value['lp']] = $value['name'];
|
||||
if(count($data1)==0 && count($data2)==0) returnErrorData();
|
||||
|
||||
$d1 = new ScatterPlot(array(0),array($ymin));
|
||||
$d1->mark->SetType(MARK_FILLEDRECTANGLE);
|
||||
$d1->mark->SetFillColor('green');
|
||||
$d1->mark->SetWidth(10);
|
||||
$graph->Add($d1);
|
||||
|
||||
$d2 = new ScatterPlot(array(count($users_)-1),array($ymin));
|
||||
$d2->mark->SetType(MARK_FILLEDRECTANGLE);
|
||||
$d2->mark->SetFillColor('green');
|
||||
$d2->mark->SetWidth(10);
|
||||
$graph->Add($d2);
|
||||
//var_dump(count($data));
|
||||
//die();
|
||||
|
||||
if($options['pbuts_date_select'] == 'THIS_DAY' || $options['pbuts_date_select'] == 'LAST_DAY') {
|
||||
require_once('modules/EcmCalls/TimeDateC.php');
|
||||
$tdc = new TimeDateC();
|
||||
$td = $tdc->queryFilter($options['pbuts_date_select']);
|
||||
|
||||
if($options['pbuts_date_select'] == 'LAST_DAY') {
|
||||
$td = $td['end'];
|
||||
} elseif($options['pbuts_date_select'] == 'THIS_DAY') {
|
||||
$td = $td['begin'];
|
||||
//convert date
|
||||
global $timedate, $timezones;
|
||||
require_once('modules/EcmCalls/TimeDateC.php');
|
||||
$tdc = new TimeDateC();
|
||||
$td = $tdc->handle_offset($td, $tdc->get_db_date_time_format(), true);
|
||||
}
|
||||
$td = substr($td,0,-9);
|
||||
$date = $td;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetScale("linlin");
|
||||
$sTitle = ", ".(isset($date) && $date != '' ? $date : $options['pbuts_date']).' '.$options['pbuts_time_from'].' - '.$options['pbuts_time_to'];
|
||||
$graph->title->Set($options['title'].$sTitle);
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$graph->SetMargin(80,30,40,130);
|
||||
|
||||
$graph->xgrid->Show();
|
||||
$graph->xgrid->SetColor('gray@0.5');
|
||||
$graph->ygrid->SetColor('gray@0.5');
|
||||
|
||||
$graph->SetFrame(true,'gray@0.3');
|
||||
|
||||
$ymin = intval($ymin/5)*5;
|
||||
$ymax = intval($ymax/5)*5;
|
||||
|
||||
$xLabels = array();
|
||||
$xTF = split(":",$options['pbuts_time_from']);
|
||||
$xTFrom = $ymin-15;//intval($xTF[0])*60+intval($xTF[1]);
|
||||
$xTT = split(":",$options['pbuts_time_to']);
|
||||
$xTTo = $ymax+15;//intval($xTT[0])*60+intval($xTT[1]);
|
||||
$tick = abs($xTTo-$xTFrom); if($tick == 0) $tick = 15;
|
||||
$tick = intval($tick/60);
|
||||
//var_dump($tick);
|
||||
if($tick/5 > 4) $tick = 60;
|
||||
elseif($tick/5 >= 3) $tick = 45;
|
||||
elseif($tick/5 >= 2) $tick = 30;
|
||||
elseif($tick/5 >= 1) $tick = 30;
|
||||
elseif($tick%5 == 0) $tick = intval(($tick/5))*10; else $tick = intval(($tick/5))*10 + 10;
|
||||
if(abs($xTFrom-$xTTo) < 60) $tick = 2;
|
||||
if($tick == 0) $tick = 5;
|
||||
//var_dump(intval($tick)); die();
|
||||
for( $i = 0, $j=$xTFrom; $i <= abs($xTTo-$xTFrom); $i+=$tick, $j+=$tick) {
|
||||
$xLabels[] = sprintf("%02d:%02d",$j/60,$j%60);
|
||||
$xTickPositions[] = $j;
|
||||
}
|
||||
//print_r($xTickPositions);
|
||||
//print_r($xLabels);
|
||||
//die();
|
||||
$graph->xaxis->SetTickPositions($xTickPositions,null,$xLabels);
|
||||
$graph->xaxis->SetLabelAngle(90);
|
||||
|
||||
|
||||
|
||||
$yTickPositions = array();
|
||||
foreach($yLabels as $key=>$value) $yTickPositions[] = count($yTickPositions);
|
||||
|
||||
if(count($yLabels) == 1) {
|
||||
$yTickPositions[] = count($yTickPositions);
|
||||
$yLabels[] = '';
|
||||
}
|
||||
$graph->yaxis->SetTickPositions($yTickPositions,null,$yLabels);
|
||||
//print_r($yTickPositions);
|
||||
//print_r($yLabels);
|
||||
//die();
|
||||
//$graph->legend->SetLayout(LEGEND_HOR);
|
||||
$graph->legend->Pos(0.2,0.97,"left","bottom");
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
28
modules/EcmCalls/EcmCallsHook.php
Executable file
28
modules/EcmCalls/EcmCallsHook.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
class EcmCallsHook {
|
||||
function afterSave(&$bean, $event, $arguments) {
|
||||
|
||||
if($bean->added_custom_field_defs == true) {
|
||||
$file = "modules/$bean->module_dir/$bean->object_name.php";
|
||||
if(file_exists($file)) {
|
||||
require_once($file);
|
||||
$bean_tmp = new $bean->object_name();
|
||||
$bean_tmp->retrieve($bean->id);
|
||||
if(isset($bean) && isset($bean->EcmCallInfo) && is_array($bean->EcmCallInfo)) $bean_tmp->EcmCallInfo = $bean->EcmCallInfo;
|
||||
$bean = &$bean_tmp;
|
||||
}
|
||||
}
|
||||
|
||||
EcmCall::deleteEcmCallPhones($bean->module_dir, $bean->id);
|
||||
foreach($bean->field_defs as $name => $value) {
|
||||
if($value['type'] == "phone" || strpos($name,"phone_") === 0)
|
||||
EcmCall::addEcmCallPhone($bean->$name, $bean->module_dir, $bean->id, $name, $bean);
|
||||
}
|
||||
|
||||
}
|
||||
function afterDelete(&$bean, $event, $arguments) {
|
||||
EcmCall::deleteEcmCallPhones($bean->module_dir, $bean->id);
|
||||
}
|
||||
}
|
||||
?>
|
||||
99
modules/EcmCalls/EcmCallsQuickCreate.php
Executable file
99
modules/EcmCalls/EcmCallsQuickCreate.php
Executable file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/EditView/QuickCreate.php');
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
require_once('include/javascript/javascript.php');
|
||||
|
||||
class EcmCallsQuickCreate extends QuickCreate {
|
||||
|
||||
var $javascript;
|
||||
|
||||
function process() {
|
||||
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
|
||||
$mod_strings = return_module_language($current_language, 'EcmCalls');
|
||||
|
||||
parent::process();
|
||||
|
||||
//BUILDER:START dropdowns setup
|
||||
//BUILDER:END dropdowns setup
|
||||
|
||||
if($this->viaAJAX) { // OVERRIDE FOR AJAX CALL
|
||||
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"ecmcallsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"ecmcalls\"); else return false;'");
|
||||
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_ecmcalls\")';");
|
||||
}
|
||||
|
||||
$this->ss->assign('viaAJAX', $this->viaAJAX);
|
||||
|
||||
$this->javascript = new javascript();
|
||||
$this->javascript->setFormName('ecmcallsQuickCreate');
|
||||
|
||||
$focus = new EcmCall();
|
||||
$this->javascript->setSugarBean($focus);
|
||||
$this->javascript->addAllFields('');
|
||||
|
||||
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
$popup_request_data = array(
|
||||
'call_back_function' => 'set_return',
|
||||
'form_name' => 'ecmcallsQuickCreate',
|
||||
'field_to_name_array' => array(
|
||||
'id' => 'account_id',
|
||||
'name' => 'account_name',
|
||||
),
|
||||
);
|
||||
|
||||
$encoded_popup_request_data = $json->encode($popup_request_data);
|
||||
$this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
45
modules/EcmCalls/EditView.php
Executable file
45
modules/EcmCalls/EditView.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
require_once('modules/EcmCalls/Forms.php');
|
||||
require_once ('include/time.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$json_config = new json_config();
|
||||
$json = getJSONobj();
|
||||
$OPT = array();
|
||||
|
||||
$focus = new EcmCall();
|
||||
|
||||
if(isset($_REQUEST['record'])) {
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
}
|
||||
else {}
|
||||
|
||||
if($_REQUEST['isDuplicate'] == 'true') {
|
||||
$_POST['isDuplicate'] = true;
|
||||
$focus->id = '';
|
||||
$OPT['isDuplicate'] = true;
|
||||
}
|
||||
|
||||
$scriptOpt = '<script language="javascript">
|
||||
var OPT = '.$json->encode($OPT).';
|
||||
</script>';
|
||||
echo $scriptOpt;
|
||||
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('include/MVC/View/views/view.edit.php');
|
||||
$edit = new ViewEdit();
|
||||
$edit->bean = $focus;
|
||||
|
||||
|
||||
$edit->preDisplay();
|
||||
|
||||
echo $edit->display();
|
||||
|
||||
?>
|
||||
103
modules/EcmCalls/FirstRun.php
Executable file
103
modules/EcmCalls/FirstRun.php
Executable file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
//set trigger to table 'cdr'
|
||||
|
||||
include('config.php');
|
||||
$data_base_name = $sugar_config['dbconfig']['db_name'];
|
||||
|
||||
$query = "DROP TRIGGER IF EXISTS `$data_base_name`.`id_create`;";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
$query = "CREATE TRIGGER `$data_base_name`.`id_create` BEFORE INSERT ON `$data_base_name`.`cdr` FOR EACH ROW SET NEW.id = UUID() ;";
|
||||
$result1 = $GLOBALS['db']->query($query);
|
||||
|
||||
$query = "DROP TRIGGER IF EXISTS `$data_base_name`.`ecmcalls_assign`;";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
$query = "CREATE TRIGGER `$data_base_name`.`ecmcalls_assign` AFTER INSERT ON `$data_base_name`.`cdr`
|
||||
FOR EACH ROW BEGIN
|
||||
INSERT INTO `ecmcalls_beans` (`id`, `ecmcall_id`, `bean_id`, `bean_module`, `src`, `date_modified`, `deleted`) SELECT UUID() as `id`, NEW.id as `ecmcall_id`, `ecp`.`bean_id` as `bean_id`, `ecp`.`bean_module` as `bean_module`, `ecp`.`phone` as `src`, NEW.calldate as `date_modified`, '0' as `deleted` FROM `ecmcallsphones` as `ecp` WHERE `ecp`.`bean_module` <> 'EcmCalls' AND ((LPAD(NEW.dst,50,'0') = LPAD(`ecp`.`phone`,50,'0')) OR ((LPAD(NEW.src,50,'0') = LPAD(`ecp`.`phone`,50,'0')) OR (LPAD(NEW.dcontext,50,'0') = LPAD(`ecp`.`phone`,50,'0'))));
|
||||
END ;";
|
||||
$result2 = $GLOBALS['db']->query($query);
|
||||
|
||||
if(!$result1 || !$result2)
|
||||
echo "Cannnot create triggers to table \"cdr\". The database user must have super privileges to do this!<br>\n";
|
||||
else
|
||||
echo "Triggers to table \"cd\" are created.<br>\n";
|
||||
|
||||
|
||||
$query = "DROP TABLE IF EXISTS `ecmcallsphones`;";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
|
||||
|
||||
echo "Creating a table \"EcmCallsPhones\"...<br>\n";
|
||||
|
||||
$query = "CREATE TABLE IF NOT EXISTS `ecmcallsphones` (
|
||||
`id` char(36) NOT NULL,
|
||||
`bean_module` varchar(25) NOT NULL,
|
||||
`bean_id` char(36) NOT NULL,
|
||||
`phone` varchar(25) NOT NULL,
|
||||
`note` varchar(50) NOT NULL,
|
||||
`index` int(4) default NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_ecmcallsphones_bean_id` (`bean_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
||||
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
if($result) {
|
||||
echo "Table \"EcmCallsPhones\" is created.<br>\n";
|
||||
$result = true;
|
||||
}
|
||||
else {
|
||||
echo "Error with creating table EcmCallsPhones! Contact with admin for username and password to database!<br>\n";
|
||||
}
|
||||
|
||||
|
||||
if($result) {
|
||||
|
||||
echo "Table \"EcmCallsPhones\" exists.<br>\n";
|
||||
echo "Updating data from Contacts, Accounts, Users to EcmCallsPhones...<br>\n";
|
||||
echo "Updating data successfull end!<br>\n";
|
||||
|
||||
echo "<br>";
|
||||
echo "Creating unique id to \"cdr\" table records if some exists...<br>\n";
|
||||
|
||||
|
||||
function getTableEcmCallsCount() {
|
||||
$query = "SELECT COUNT(*) FROM `cdr` WHERE `id` IS NULL OR `id`=''";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
if($result) {
|
||||
$result = $GLOBALS['db']->fetchByAssoc($result);
|
||||
if($result) return intval($result['COUNT(*)']); else return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$query = "UPDATE `cdr` SET `id` = '".create_guid()."' WHERE `id` IS NULL OR `id`='' LIMIT 1";
|
||||
while(getTableEcmCallsCount()) {
|
||||
echo $query.'<br>';
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
$count++;
|
||||
};
|
||||
|
||||
if($count == 0)
|
||||
echo "Table \"cdr\" is empty or all records have set unique id.<br>\n";
|
||||
else
|
||||
echo "Unique id is set for $count records.<br>\n";
|
||||
|
||||
|
||||
echo "<br>";
|
||||
echo "Assigning Users, Contacts and Accounts phones to central calls records if some records exists...<br>\n";
|
||||
$file = "modules/EcmCalls/EcmCall.php";
|
||||
require_once($file);
|
||||
if(EcmCall::autoAssigning())
|
||||
echo "Assigning successfull!";
|
||||
else
|
||||
echo "Assigning fail!";
|
||||
|
||||
echo "<br><br>Module EcmCalls is succesfully installed!!!";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
64
modules/EcmCalls/Forms.php
Executable file
64
modules/EcmCalls/Forms.php
Executable file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* CREATE JAVASCRIPT TO VALIDATE THE DATA ENTERED INTO A RECORD.
|
||||
*******************************************************************************/
|
||||
function get_validate_record_js () {
|
||||
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* CREATE FORM FOR MENU RAPID CREATE
|
||||
*******************************************************************************/
|
||||
function get_new_record_form () {
|
||||
}
|
||||
|
||||
?>
|
||||
121
modules/EcmCalls/GenerateExampleData.php
Executable file
121
modules/EcmCalls/GenerateExampleData.php
Executable file
@@ -0,0 +1,121 @@
|
||||
<a href="index.php?module=EcmCalls&action=GenerateExampleData&ecAction=ClearActualData">Clear Actual Data</a><br />
|
||||
<a href="index.php?module=EcmCalls&action=GenerateExampleData&ecAction=ClearEcmCallsPhones">Clear EcmCallsPhones</a><br />
|
||||
<a href="index.php?module=EcmCalls&action=GenerateExampleData&ecAction=AssigningCalls">Assigning Calls</a><br />
|
||||
<a href="index.php?module=EcmCalls&action=GenerateExampleData&ecAction=GenerateNewData">Generate New Data</a><br />
|
||||
<a href="index.php?module=EcmCalls&action=GenerateExampleData&ecAction=RefreshORWSON">Refresh Old Records With src_old Number</a><br />
|
||||
<?php
|
||||
|
||||
$GLOBALS['db'] = new MysqlManager();
|
||||
$GLOBALS['db']->connect();
|
||||
|
||||
|
||||
if($_REQUEST['ecAction'] == 'RefreshORWSON') {
|
||||
echo 'Refresh Old Records With src_old Number<br>';
|
||||
$query = "UPDATE `cdr` SET `src_old` = `src`, `src` = `dcontext` WHERE INSTR(`channel`, CONCAT('SIP/', `dcontext`, '-')) = 1;";
|
||||
echo $query.' - '.$GLOBALS['db']->query($query).'<br/>';
|
||||
} else
|
||||
if($_REQUEST['ecAction'] == 'ClearActualData') {
|
||||
echo 'Clear Actual Data<br>';
|
||||
$query = "TRUNCATE TABLE `cdr`;";
|
||||
echo $query.' - '.$GLOBALS['db']->query($query).'<br/>';
|
||||
$query = "TRUNCATE TABLE `ecmcalls_beans`;";
|
||||
echo $query.' - '.$GLOBALS['db']->query($query).'<br/>';
|
||||
} else
|
||||
if($_REQUEST['ecAction'] == 'ClearEcmCallsPhones') {
|
||||
echo 'Clear EcmCalls Phones<br />';
|
||||
$query = "TRUNCATE TABLE `ecmcallsphones`;";
|
||||
echo $query.' - '.$GLOBALS['db']->query($query).'<br/>';
|
||||
} else
|
||||
if($_REQUEST['ecAction'] == 'AssigningCalls') {
|
||||
echo 'Assigning Calls<br />';
|
||||
$file = "modules/EcmCalls/EcmCall.php";
|
||||
require_once($file);
|
||||
if(EcmCall::autoAssigning())
|
||||
echo "Assigning successfull!";
|
||||
else
|
||||
echo "Assigning fail!";
|
||||
} else
|
||||
if($_REQUEST['ecAction'] == 'GenerateNewData') {
|
||||
echo 'Generate New Data<br>';
|
||||
$query = "SELECT DISTINCT `phone` FROM `ecmcallsphones` as `ecp`
|
||||
LEFT JOIN `users` as `u` ON `ecp`.`bean_id` = `u`.`id`
|
||||
LEFT JOIN `accounts` as `a` ON `ecp`.`bean_id` = `a`.`id`
|
||||
LEFT JOIN `contacts` as `c` ON `ecp`.`bean_id` = `c`.`id`
|
||||
LEFT JOIN `leads` as `l` ON `ecp`.`bean_id` = `l`.`id`
|
||||
WHERE `u`.`deleted` = 0
|
||||
OR `a`.`deleted` = 0
|
||||
OR `c`.`deleted` = 0
|
||||
OR `l`.`deleted` = 0
|
||||
;";
|
||||
$results = $GLOBALS['db']->query($query);
|
||||
if(is_resource($results)) {
|
||||
$phones = array();
|
||||
while($row = $GLOBALS['db']->fetchByAssoc($results)) {
|
||||
$phones[] = $row['phone'];
|
||||
}
|
||||
}
|
||||
|
||||
$count = count($phones);
|
||||
|
||||
$types = array( "in", "out", "inside" );
|
||||
$statuses = array( "NO ANSWER", "ANSWERED", "FAILED" );
|
||||
|
||||
for( $i = 0; $i < 1000; $i ++ ) {
|
||||
|
||||
$type = $types[rand()%count($types)];
|
||||
$status = $statuses[rand()%count($statuses)];
|
||||
|
||||
if($type == "in") {
|
||||
$rand = rand() % $count;
|
||||
$from = $phones[$rand];
|
||||
do {
|
||||
$rand = rand() % $count;
|
||||
$to = $phones[$rand];
|
||||
} while(strlen($to) > 4 && $to != $from);
|
||||
} else if($type == "out") {
|
||||
$rand = rand() % $count;
|
||||
$to = $phones[$rand];
|
||||
do {
|
||||
$rand = rand() % $count;
|
||||
$from = $phones[$rand];
|
||||
} while(strlen($from) > 4 && $from != $to);
|
||||
} else if($type == "inside") {
|
||||
do {
|
||||
$rand = rand() % $count;
|
||||
$from = $phones[$rand];
|
||||
} while(strlen($from) > 4);
|
||||
do {
|
||||
$rand = rand() % $count;
|
||||
$to = $phones[$rand];
|
||||
} while(strlen($to) > 4 && $to != $from);
|
||||
}
|
||||
|
||||
$rand_date = date("Y-m-d H:i:s", time()-rand(0,600000));
|
||||
|
||||
$rand_billsec = rand(0, 120);
|
||||
$rand_duration = $rand_duration + rand(0,30);
|
||||
|
||||
|
||||
|
||||
$query = "INSERT INTO `cdr` (`calldate`, `clid`, `src`, `dst`, `dcontext`, `channel`, `dstchannel`, `lastapp`, `lastdata`, `duration`, `billsec`, `disposition`, `amaflags`, `accountcode`, `userfield`) VALUES ";
|
||||
|
||||
$values = array(
|
||||
|
||||
"('$rand_date', '$from', '$from', '$to', '$from', 'SIP/$to-082dca58', 'mISDN/1-u120', 'Dial', 'misdn/1/0048665981372|60|TW', $rand_duration, $rand_billsec, '$status', 3, '', '')",
|
||||
|
||||
"('$rand_date', '$from', '$from', '$to', '$from', 'SIP/$to-082ea848', 'mISDN/1-u122', 'Dial', 'misdn/1/0048672652269|60|TW', $rand_duration, $rand_billsec, '$status', 3, '', '')",
|
||||
|
||||
"('$rand_date', '$from', '$from', '$to', 'default', 'Local/$to@default-e524,2', '', 'Busy', '', $rand_duration, $rand_billsec, '$status', 3, '', '')",
|
||||
|
||||
);
|
||||
|
||||
$query .= $values[rand() % count($values)].';';
|
||||
$GLOBALS['db']->query($query);
|
||||
//echo $query.'<br />';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
10
modules/EcmCalls/Hint.php
Executable file
10
modules/EcmCalls/Hint.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Untitled Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
1847
modules/EcmCalls/ListView/EcmCallsListView.php
Executable file
1847
modules/EcmCalls/ListView/EcmCallsListView.php
Executable file
File diff suppressed because it is too large
Load Diff
30
modules/EcmCalls/ListView2.php
Executable file
30
modules/EcmCalls/ListView2.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
require_once('modules/EcmCalls/Forms.php');
|
||||
require_once ('include/time.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$json_config = new json_config();
|
||||
|
||||
$focus = new EcmCall();
|
||||
|
||||
if(isset($_REQUEST['record'])) {
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
}
|
||||
else {}
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('modules/EcmCalls/views/ListView/view.list.my.php');
|
||||
$list = new ViewListMy();
|
||||
$list->bean = $focus;
|
||||
|
||||
|
||||
$list->preDisplay();
|
||||
$list->display();
|
||||
|
||||
?>
|
||||
60
modules/EcmCalls/Menu.php
Executable file
60
modules/EcmCalls/Menu.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
global $mod_strings, $current_user;
|
||||
|
||||
// if(ACLController::checkAccess('EcmCalls', 'edit', true))
|
||||
// $module_menu [] = Array("index.php?module=EcmCalls&action=EditView&return_module=EcmCalls&return_action=DetailView", $mod_strings['LNK_NEW_ECMCALLS'],"CreateEcmCalls", 'EcmCalls');
|
||||
if(ACLController::checkAccess('EcmCalls', 'list', true))
|
||||
$module_menu [] = Array("index.php?module=EcmCalls&action=index&return_module=EcmCalls&return_action=DetailView", $mod_strings['LNK_ECMCALLS_LIST'],'EcmCalls', 'EcmCalls');
|
||||
if(ACLController::checkAccess('EcmCalls', 'list', true) && is_admin($current_user))
|
||||
$module_menu [] = Array("index.php?module=EcmCalls&action=Settings&return_module=EcmCalls&return_action=index", $mod_strings['LNK_ECMCALLS_SETTINGS'], 'SettingsEcmCalls', 'SettingsEcmCalls');
|
||||
|
||||
?>
|
||||
57
modules/EcmCalls/Popup.php
Executable file
57
modules/EcmCalls/Popup.php
Executable file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
require_once('include/Popups/Popup_picker.php');
|
||||
|
||||
$popup = new Popup_Picker();
|
||||
|
||||
echo $popup->process_page();
|
||||
|
||||
?>
|
||||
97
modules/EcmCalls/Save.php
Executable file
97
modules/EcmCalls/Save.php
Executable file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
require_once("modules/EcmCalls/EcmCall.php");
|
||||
require_once('include/formbase.php');
|
||||
|
||||
$focus = new EcmCall();
|
||||
|
||||
if(isset($_POST['record']) && $_POST['record'] != '') {
|
||||
$focus->retrieve($_POST['record']);
|
||||
}
|
||||
|
||||
if(!$focus->ACLAccess('Save')){
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
/*
|
||||
if (!empty($_POST['assigned_user_id']) && ($focus->assigned_user_id != $_POST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
|
||||
$check_notify = TRUE;
|
||||
}else{
|
||||
$check_notify = FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
$check_notify = FALSE;
|
||||
|
||||
foreach($focus->column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($focus->additional_column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$focus->save($check_notify);
|
||||
$return_id = $focus->id;
|
||||
|
||||
echo $return_id;
|
||||
|
||||
handleRedirect($return_id,'EcmCalls');
|
||||
|
||||
?>
|
||||
352
modules/EcmCalls/SearchForm.php
Executable file
352
modules/EcmCalls/SearchForm.php
Executable file
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/SearchForm/SearchForm.php');
|
||||
|
||||
class EcmCallsSearchForm extends SearchForm {
|
||||
|
||||
function EcmCallsSearchForm($module, &$seedBean, $tpl = null) {
|
||||
parent::SearchForm($module, $seedBean, $tpl);
|
||||
|
||||
/*
|
||||
global $app_strings;
|
||||
$this->tabs[] = array('title' => $app_strings['LNK_SAVED_VIEWS'],
|
||||
'link' => $module . '|saved_views',
|
||||
'key' => $module . '|saved_views');
|
||||
*/
|
||||
}
|
||||
|
||||
function setup() {
|
||||
parent::setup();
|
||||
|
||||
//date settings
|
||||
global $timedate;
|
||||
$time_format = $timedate->get_user_time_format();
|
||||
$date_format = $timedate->get_cal_date_format();
|
||||
$time_separator = ":";
|
||||
if(preg_match('/\d+([^\d])\d+([^\d]*)/s', $time_format, $match)) {
|
||||
$time_separator = $match[1];
|
||||
}
|
||||
$t23 = strpos($time_format, '23') !== false ? '%H' : '%I';
|
||||
if(!isset($match[2]) || $match[2] == '') {
|
||||
$this->xtpl->assign("CALENDAR_FORMAT",$date_format . ' ' . $t23 . $time_separator . "%M");
|
||||
} else {
|
||||
$pm = $match[2] == "pm" ? "%P" : "%p";
|
||||
$this->xtpl->assign("CALENDAR_FORMAT",$date_format . ' ' . $t23 . $time_separator . "%M" . $pm);
|
||||
}
|
||||
|
||||
$this->xtpl->assign("TIME_FORMAT",$time_format);
|
||||
|
||||
global $app_list_strings, $mod_strings;
|
||||
$parents = array(
|
||||
'' => '',
|
||||
'Contacts' => $app_list_strings['moduleList']['Contacts'],
|
||||
'Accounts' => $app_list_strings['moduleList']['Accounts'],
|
||||
'Users' => $mod_strings['LBL_PARENT_FROM'],//$app_list_strings['moduleList']['Users'],
|
||||
);
|
||||
|
||||
if(isset($_REQUEST['calldate_basic']) && $_REQUEST['calldate_basic'] != '') {
|
||||
$_REQUEST['call_date_from_basic'] = '';
|
||||
$_REQUEST['call_date_to_basic'] = '';
|
||||
}
|
||||
|
||||
$this->xtpl->assign("PARENT_FROM_BASIC",get_select_options_with_id($parents, $_REQUEST['parent_from_basic']));
|
||||
$this->xtpl->assign("PARENT_TO_BASIC",get_select_options_with_id($parents, $_REQUEST['parent_to_basic']));
|
||||
|
||||
if(isset($_REQUEST['call_date_from_basic']) && strlen($_REQUEST['call_date_from_basic'])>6) $this->xtpl->assign("CALLDATEFROMBASIC",$_REQUEST['call_date_from_basic']);
|
||||
if(isset($_REQUEST['call_date_to_basic']) && strlen($_REQUEST['call_date_to_basic'])>6) $this->xtpl->assign("CALLDATETOBASIC",$_REQUEST['call_date_to_basic']);
|
||||
|
||||
global $app_list_strings;
|
||||
$this->xtpl->assign("CALLDATE_BASIC",get_select_options_with_id($app_list_strings['search_date_type_dom'], $_REQUEST['calldate_basic']));
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['calldate_advanced']) && $_REQUEST['calldate_advanced'] != '') {
|
||||
$_REQUEST['call_date_from_advanced'] = '';
|
||||
$_REQUEST['call_date_to_advanced'] = '';
|
||||
}
|
||||
|
||||
$this->xtpl->assign("PARENT_FROM_ADVANCED",get_select_options_with_id($parents, $_REQUEST['parent_from_advanced']));
|
||||
$this->xtpl->assign("PARENT_TO_ADVANCED",get_select_options_with_id($parents, $_REQUEST['parent_to_advanced']));
|
||||
|
||||
|
||||
$json = getJSONobj();
|
||||
$pio = array (
|
||||
'ids' => array (
|
||||
'Accounts' => $this->getParentsIds('Accounts',true),
|
||||
'Contacts' => $this->getParentsIds('Contacts',true),
|
||||
'Users' => $this->getParentsIds('Users',true),
|
||||
),
|
||||
);
|
||||
$this->xtpl->assign("PARENT_IDS_OBJECTS", str_replace('"', '\"', $json->encode($pio)));
|
||||
|
||||
$this->xtpl->assign("PARENT_FROM_ID_ADVANCED",get_select_options_with_id($this->getParentsIds($_REQUEST['parent_from_advanced'],true),$_REQUEST['parent_from_id_advanced']));
|
||||
$this->xtpl->assign("PARENT_TO_ID_ADVANCED",get_select_options_with_id($this->getParentsIds($_REQUEST['parent_to_advanced'],true),$_REQUEST['parent_to_id_advanced']));
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['call_date_from_advanced']) && strlen($_REQUEST['call_date_from_advanced'])>6) $this->xtpl->assign("CALLDATEFROMADVANCED",$_REQUEST['call_date_from_advanced']);
|
||||
if(isset($_REQUEST['call_date_to_advanced']) && strlen($_REQUEST['call_date_to_advanced'])>6) $this->xtpl->assign("CALLDATETOADVANCED",$_REQUEST['call_date_to_advanced']);
|
||||
|
||||
global $app_list_strings;
|
||||
$this->xtpl->assign("CALLDATE_ADVANCED",get_select_options_with_id($app_list_strings['search_date_type_dom'], $_REQUEST['calldate_advanced']));
|
||||
|
||||
$this->xtpl->assign("CURRENT_USER_ONLY_ADVANCED",((isset($_REQUEST['current_user_only_advanced']) && $_REQUEST['current_user_only_advanced']=="on")?"checked":""));
|
||||
|
||||
$this->xtpl->assign("IN_OUT_ADVANCED",((isset($_REQUEST['in_out_advanced']) && $_REQUEST['in_out_advanced']=="on")?"checked":""));
|
||||
}
|
||||
|
||||
function getParentsIds($module,$empty=false) {
|
||||
|
||||
$arr = array();
|
||||
//if($empty) $arr[''] = ' ';
|
||||
|
||||
$where = '';
|
||||
switch ($module) {
|
||||
case "Users": $what = " `id`, CONCAT(IFNULL(CONCAT(`first_name`,' '),''), `last_name`) as name "; $where = " `id` <> '1' AND ";
|
||||
$order_by = " `name` ASC";
|
||||
break;
|
||||
case "Contacts": $what = " `id`, CONCAT(IFNULL(CONCAT(`first_name`,' '),''), `last_name`) as name ";
|
||||
$order_by = " `name` ASC";
|
||||
break;
|
||||
case "Accounts": $what = " `id`, `name` ";
|
||||
$order_by = " `name` ASC";
|
||||
break;
|
||||
}
|
||||
|
||||
$query = "SELECT $what FROM `".strtolower($module)."` WHERE $where `deleted`='0' ORDER BY ".$order_by;
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
if($result)
|
||||
while($row = $GLOBALS['db']->fetchByAssoc($result)) $arr[$row['id']] = $row['name'];
|
||||
|
||||
return $arr;
|
||||
|
||||
}
|
||||
|
||||
function generateSearchWhere($add_custom_fields = false, $module='') {
|
||||
|
||||
//var_dump($_REQUEST);
|
||||
|
||||
global $timedate;
|
||||
$values = $this->searchFields;
|
||||
|
||||
$where_clauses = array();
|
||||
$like_char = '%';
|
||||
$table_name = $this->bean->object_name;
|
||||
|
||||
foreach($this->searchFields as $field=>$parms) {
|
||||
$customField = false;
|
||||
// Jenny - Bug 7462: We need a type check here to avoid database errors
|
||||
// when searching for numeric fields. This is a temporary fix until we have
|
||||
// a generic search form validation mechanism.
|
||||
$type = (!empty($this->bean->field_name_map[$field]['type']))?$this->bean->field_name_map[$field]['type']:'';
|
||||
if(!empty($this->bean->field_name_map[$field]['source']) && $this->bean->field_name_map[$field]['source'] == 'custom_fields'){
|
||||
$customField = true;
|
||||
}
|
||||
|
||||
if ($type == 'int') {
|
||||
if (!empty($parms['value'])) {
|
||||
$tempVal = explode(',', $parms['value']);
|
||||
$newVal = '';
|
||||
foreach($tempVal as $key => $val) {
|
||||
if (!empty($newVal))
|
||||
$newVal .= ',';
|
||||
if(!empty($val) && !(is_numeric($val)))
|
||||
$newVal .= -1;
|
||||
else
|
||||
$newVal .= $val;
|
||||
}
|
||||
$parms['value'] = $newVal;
|
||||
}
|
||||
}
|
||||
// do not include where clause for custom fields with checkboxes that are unchecked
|
||||
elseif($type == 'bool' && empty($parms['value']) && $customField) {
|
||||
continue;
|
||||
}
|
||||
elseif($type == 'bool' && !empty($parms['value'])){
|
||||
if ($parms['value'] == 'on'){
|
||||
$parms['value'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($parms['value']) && $parms['value'] != "") {
|
||||
$operator = 'like';
|
||||
if(!empty($parms['operator'])) {
|
||||
$operator = $parms['operator'];
|
||||
}
|
||||
|
||||
if(is_array($parms['value'])) {
|
||||
$field_value = '';
|
||||
|
||||
// If it is a custom field of mutliselect we have to do some special processing
|
||||
if($customField && !empty($this->bean->field_name_map[$field]['isMultiSelect']) && $this->bean->field_name_map[$field]['isMultiSelect']) {
|
||||
$operator = 'custom_enum';
|
||||
$db_field = $this->bean->table_name . "_cstm." . $field;
|
||||
foreach($parms['value'] as $key => $val) {
|
||||
if($val != ' ' and $val != '') {
|
||||
$qVal = $GLOBALS['db']->quote($val);
|
||||
if (!empty($field_value)) {
|
||||
$field_value .= ' or ';
|
||||
}
|
||||
$field_value .= "$db_field like '$qVal' or $db_field like '%$qVal^%' or $db_field like '%^$qVal%' or $db_field like '%^$qVal^%'";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$operator = 'in';
|
||||
foreach($parms['value'] as $key => $val) {
|
||||
if($val != ' ' and $val != '') {
|
||||
if (!empty($field_value)) {
|
||||
$field_value .= ',';
|
||||
}
|
||||
$field_value .= "'" . $GLOBALS['db']->quote($val) . "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$field_value = $GLOBALS['db']->quote($parms['value']);
|
||||
}
|
||||
|
||||
//set db_fields array.
|
||||
if(!isset($parms['db_field'])) {
|
||||
$parms['db_field'] = array($field);
|
||||
}
|
||||
|
||||
if(isset($parms['my_items']) and $parms['my_items'] == true) {
|
||||
global $current_user;
|
||||
$field_value = $GLOBALS['db']->quote($current_user->id);
|
||||
$operator = '=';
|
||||
}
|
||||
|
||||
$where = '';
|
||||
$itr = 0;
|
||||
if($field_value != '') {
|
||||
foreach ($parms['db_field'] as $db_field) {
|
||||
|
||||
if (strstr($db_field, '.') === false) {
|
||||
if(!$customField){
|
||||
$db_field = $this->bean->table_name . "." . $db_field;
|
||||
}else{
|
||||
$db_field = $this->bean->table_name . "_cstm." . $db_field;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($type == 'date') {
|
||||
// Collin - Have mysql as first because it's usually the case
|
||||
// The regular expression check is to circumvent special case YYYY-MM
|
||||
if($GLOBALS['db']->dbType == 'mysql') {
|
||||
if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
|
||||
$field_value = $timedate->to_db_date($field_value, false);
|
||||
$operator = '=';
|
||||
} else {
|
||||
$operator = 'db_date';
|
||||
}
|
||||
} else if($GLOBALS['db']->dbType == 'oci8') {
|
||||
if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
|
||||
$field_value = $timedate->to_db_date($field_value, false);
|
||||
$field_value = "to_date('" . $field_value . "', 'YYYY-MM-DD hh24:mi:ss')";
|
||||
}
|
||||
$operator = 'db_date';
|
||||
} else if($GLOBALS['db']->dbType == 'mssql') {
|
||||
if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
|
||||
$field_value = "Convert(DateTime, '".$timedate->to_db_date($field_value, false)."')";
|
||||
}
|
||||
$operator = 'db_date';
|
||||
} else {
|
||||
$field_value = $timedate->to_db_date($field_value, false);
|
||||
$operation = '=';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($GLOBALS['db']->dbType == 'oci8' && isset($parms['query_type']) && $parms['query_type'] == 'case_insensitive') {
|
||||
$db_field = 'upper(' . $db_field . ")";
|
||||
$field_value = strtoupper($field_value);
|
||||
}
|
||||
|
||||
$itr++;
|
||||
if(!empty($where)) {
|
||||
$where .= " OR ";
|
||||
}
|
||||
|
||||
switch(strtolower($operator)) {
|
||||
case 'subquery':
|
||||
$where .= "{$db_field} IN ({$parms['subquery']} '{$field_value}%')";
|
||||
break;
|
||||
case 'like':
|
||||
$where .= $db_field . " like '".$field_value.$like_char."'";
|
||||
break;
|
||||
case 'in':
|
||||
$where .= $db_field . " in (".$field_value.')';
|
||||
break;
|
||||
case '=':
|
||||
$where .= $db_field . " = '".$field_value ."'";
|
||||
break;
|
||||
case 'db_date':
|
||||
if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
|
||||
$where .= $db_field . " = ". $field_value;
|
||||
} else {
|
||||
// Create correct date_format conversion String
|
||||
if($GLOBALS['db']->dbType == 'oci8') {
|
||||
$where .= db_convert($db_field,'date_format',array("'YYYY-MM'")) . " = '" . $field_value . "'";
|
||||
} else {
|
||||
$where .= db_convert($db_field,'date_format',array("'%Y-%m'")) . " = '" . $field_value . "'";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($where)) {
|
||||
if($itr > 1) {
|
||||
array_push($where_clauses, '( '.$where.' )');
|
||||
}
|
||||
else {
|
||||
array_push($where_clauses, $where);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $where_clauses;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
123
modules/EcmCalls/Settings.php
Executable file
123
modules/EcmCalls/Settings.php
Executable file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
global $current_user;
|
||||
if(!is_admin($current_user)) {
|
||||
ACLController::displayNoAccess();
|
||||
return;
|
||||
}
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once('modules/EcmCalls/config.php');
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
require_once ('include/time.php');
|
||||
|
||||
global $theme;
|
||||
$theme_path = "themes/".$theme."/";
|
||||
$image_path = $theme_path."images/";
|
||||
require_once ($theme_path.'layout_utils.php');
|
||||
|
||||
|
||||
$xtpl = new XTemplate ('modules/EcmCalls/Settings.html');
|
||||
$xtpl->assign("MOD", $mod_strings);
|
||||
$xtpl->assign("APP", $app_strings);
|
||||
|
||||
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
|
||||
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
|
||||
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
|
||||
if (empty($_REQUEST['return_id'])) $xtpl->assign("RETURN_ACTION", 'index');
|
||||
|
||||
|
||||
//$xtpl->assign("CENTRAL_AREACODE",$ecmcalls_config['central_areacode']);
|
||||
$xtpl->assign("PHONE_LIST", EcmCall::getPhoneList());
|
||||
|
||||
$json = getJSONobj();
|
||||
$scriptOpt = '<script language="javascript">
|
||||
var MOD = '.str_replace('"','\"',$json->encode($mod_strings)).';
|
||||
</script>';
|
||||
echo $scriptOpt;
|
||||
|
||||
//// Timezone
|
||||
require_once('include/timezone/timezones.php');
|
||||
global $timezones;
|
||||
|
||||
$timezoneOptions = '';
|
||||
ksort($timezones);
|
||||
foreach($timezones as $key => $value) {
|
||||
$selected =($ecmcalls_config['central_timezone'] == $key) ? ' SELECTED="true"' : '';
|
||||
$dst = !empty($value['dstOffset']) ? '(+DST)' : '';
|
||||
$gmtOffset =($value['gmtOffset'] / 60);
|
||||
|
||||
if(!strstr($gmtOffset,'-')) {
|
||||
$gmtOffset = '+'.$gmtOffset;
|
||||
}
|
||||
$timezoneOptions .= "<option value='$key'".$selected.">".str_replace(array('_','North'), array(' ', 'N.'),$key). "(GMT".$gmtOffset.") ".$dst."</option>";
|
||||
}
|
||||
$xtpl->assign('CENTRAL_TIMEZONE_OPTIONS', $timezoneOptions);
|
||||
|
||||
|
||||
echo "\n<p>\n";
|
||||
echo get_module_title('EcmGroupSales', $GLOBALS['mod_strings']['LBL_ECMGROUPSALES_SETTINGS_TITLE'], true);
|
||||
echo "\n</p>\n";
|
||||
|
||||
$xtpl->parse("main");
|
||||
$xtpl->out("main");
|
||||
|
||||
// require_once('include/javascript/javascript.php');
|
||||
// $javascript = new javascript();
|
||||
// $javascript->setFormName('Settings');
|
||||
// $javascript->addAllFields('');
|
||||
|
||||
//BUILDER:START Pro only
|
||||
// $javascript->addFieldGeneric( 'team_name', 'varchar', $app_strings['LBL_TEAM'] ,'true');
|
||||
// $javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
|
||||
//BUILDER:END Pro only
|
||||
|
||||
// $javascript->addFieldGeneric('central_areacode', 'varchar', $mod_strings['LBL_CENTRAL_AREACODE'] , 'true');
|
||||
// $javascript->addToValidateBinaryDependency('central_areacode', 'alpha' ,$app_strings['ERR_SQS_NO_MATCH_FIELD'].$mod_strings['LBL_CENTRAL_AREACODE'], 'false', '', 'team_id');
|
||||
|
||||
|
||||
// $javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
|
||||
|
||||
// echo $javascript->getScript();
|
||||
|
||||
|
||||
?>
|
||||
72
modules/EcmCalls/SettingsSave.php
Executable file
72
modules/EcmCalls/SettingsSave.php
Executable file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
global $current_user;
|
||||
if(!is_admin($current_user)) {
|
||||
ACLController::displayNoAccess();
|
||||
return;
|
||||
}
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once('modules/EcmCalls/config.php');
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
|
||||
$arr = array(
|
||||
//'central_areacode' => $_POST['central_areacode'],
|
||||
'central_timezone' => $_POST['central_timezone'],
|
||||
);
|
||||
|
||||
$str = "<?php\n\$ecmcalls_config = ".var_export($arr,true).";\n?>";
|
||||
|
||||
$config = fopen("modules/EcmCalls/config.php", "w");
|
||||
fwrite($config,$str);
|
||||
fclose($config);
|
||||
|
||||
$_SESSION['ecmcalls_config'] = $arr;
|
||||
|
||||
$json = getJSONobj();
|
||||
//var_dump($json->decode(htmlspecialchars_decode($_REQUEST['phone_list']))); die();
|
||||
EcmCall::savePhoneList($json->decode(htmlspecialchars_decode($_REQUEST['phone_list'])));
|
||||
|
||||
|
||||
header("Location: index.php?module=EcmCalls&action=index");
|
||||
|
||||
?>
|
||||
58
modules/EcmCalls/SubPanel.php
Executable file
58
modules/EcmCalls/SubPanel.php
Executable file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
extract($_POST, EXTR_PREFIX_SAME, "wddx");
|
||||
|
||||
if(isset($searchModule) && $searchModule != '' && isset($searchRecord) && searchRecord != '') {
|
||||
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
EcmCall::loadCallsSettings();
|
||||
|
||||
if(isset($_SESSION['ecmcalls_phones'][$searchModule][$searchRecord])) {
|
||||
|
||||
function myImplode($before, $after, $glue, $array){
|
||||
$nbItem = count($array);
|
||||
$i = 1;
|
||||
foreach($array as $item){
|
||||
if($i < $nbItem){
|
||||
$output .= "$before$item$after$glue";
|
||||
}else $output .= "$before$item$after";
|
||||
$i++;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
$base = $_SESSION['ecmcalls_phones'][$searchModule][$searchRecord];
|
||||
|
||||
//$ecmcall = new EcmCall();
|
||||
$arr = array();
|
||||
foreach($base['numbers'] as $key => $number) $arr[] = $number[0];
|
||||
|
||||
$q_numbers = myImplode('`src` LIKE \'%','\'',' OR ',$arr).' OR '.myImplode(' `dst` LIKE \'%','\'',' OR ',$arr).' OR '.myImplode(' `dcontext` LIKE \'%','%\'',' OR ',$arr);
|
||||
$query = "SELECT `disposition`, `calldate`, `src`, `dst`, `duration`, `billsec`, `id`, `note`, `dcontext`, `dstchannel` FROM `cdr` WHERE ($q_numbers) AND `deleted`='0'";
|
||||
|
||||
|
||||
$calls_ = array();
|
||||
$call = new EcmCall();
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
if($result) {
|
||||
while($row = $GLOBALS['db']->fetchByAssoc($result)) {
|
||||
$calls_[] = $call->processCall($row);
|
||||
}
|
||||
}
|
||||
|
||||
global $odd_bg, $even_bg, $hilite_bg;
|
||||
$json = getJSONobj();
|
||||
$calls = array(
|
||||
'positions' => $calls_,
|
||||
'colors' => array(
|
||||
'even_bg' => $even_bg,
|
||||
'hilite_bg' => $hilite_bg,
|
||||
'odd_bg' => $odd_bg
|
||||
),
|
||||
);
|
||||
echo '['.$json->encode($calls).']';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
395
modules/EcmCalls/SubPanel/EcmCallsSubPanel.php
Executable file
395
modules/EcmCalls/SubPanel/EcmCallsSubPanel.php
Executable file
@@ -0,0 +1,395 @@
|
||||
<?php
|
||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
||||
die ( 'Not A Valid Entry Point' );
|
||||
/**
|
||||
* Generic sub-panel class
|
||||
*
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
require_once ('XTemplate/xtpl.php');
|
||||
|
||||
require_once ('modules/EcmCalls/ListView/EcmCallsListView.php');
|
||||
require_once ('include/dir_inc.php');
|
||||
require_once ('include/utils/file_utils.php');
|
||||
require_once ('include/SubPanel/registered_layout_defs.php');
|
||||
|
||||
//AG todo remove subpanedata and subpanel id from this class...
|
||||
|
||||
|
||||
/*
|
||||
* A single subpanel
|
||||
*/
|
||||
|
||||
class EcmCallsSubPanel {
|
||||
var $hideNewButton = false;
|
||||
var $subpanel_id;
|
||||
var $parent_record_id;
|
||||
var $parent_module; // the name of the parent module
|
||||
var $parent_bean; // the instantiated bean of the parent
|
||||
var $template_file;
|
||||
var $linked_fields;
|
||||
var $action = 'DetailView';
|
||||
var $show_select_button = true;
|
||||
var $subpanel_define = null; // contains the layout_def.php
|
||||
var $subpane_defs;
|
||||
var $subpanel_query = null;
|
||||
function EcmCallsSubPanel($module,$record_id,$subpanel_id,$subpanelDef,$layout_def_key = '') {
|
||||
global $theme, $beanList, $beanFiles, $focus, $app_strings;
|
||||
|
||||
$this->subpanel_defs = $subpanelDef;
|
||||
$this->subpanel_id = $subpanel_id;
|
||||
$this->parent_record_id = $record_id;
|
||||
$this->parent_module = $module;
|
||||
|
||||
$this->parent_bean = $focus;
|
||||
$result = $focus;
|
||||
|
||||
if (empty ( $result )) {
|
||||
$parent_bean_name = $beanList [$module];
|
||||
$parent_bean_file = $beanFiles [$parent_bean_name];
|
||||
require_once ($parent_bean_file);
|
||||
$this->parent_bean = new $parent_bean_name ( );
|
||||
$this->parent_bean->retrieve ( $this->parent_record_id );
|
||||
$result = $this->parent_bean;
|
||||
}
|
||||
|
||||
if ($record_id != 'fab4' && $result == null) {
|
||||
sugar_die ( $app_strings ['ERROR_NO_RECORD'] );
|
||||
}
|
||||
|
||||
if (empty ( $subpanelDef )) {
|
||||
//load the subpanel by name.
|
||||
if (! class_exists ( 'MyClass' )) {
|
||||
require ('include/SubPanel/SubPanelDefinitions.php');
|
||||
}
|
||||
$panelsdef = new SubPanelDefinitions ( $result, $layout_def_key );
|
||||
$subpanelDef = $panelsdef->load_subpanel ( $subpanel_id );
|
||||
$this->subpanel_defs = $subpanelDef;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setTemplateFile($template_file) {
|
||||
$this->template_file = $template_file;
|
||||
}
|
||||
|
||||
function setBeanList(&$value) {
|
||||
$this->bean_list = $value;
|
||||
}
|
||||
|
||||
function setHideNewButton($value) {
|
||||
$this->hideNewButton = $value;
|
||||
}
|
||||
|
||||
function getHeaderText($currentModule) {
|
||||
}
|
||||
|
||||
function get_buttons($panel_query = null) {
|
||||
|
||||
$thisPanel = & $this->subpanel_defs;
|
||||
$subpanel_def = $thisPanel->get_buttons ();
|
||||
if (! isset ( $this->listview )) {
|
||||
$this->listview = new EcmCallsListView ( );
|
||||
}
|
||||
$layout_manager = $this->listview->getLayoutManager ();
|
||||
$widget_contents = '<div class="listViewButtons"><table cellpadding="0" cellspacing="0"><tr>';
|
||||
foreach ( $subpanel_def as $widget_data ) {
|
||||
$widget_data ['query'] = urlencode ( $panel_query );
|
||||
$widget_data ['action'] = $_REQUEST ['action'];
|
||||
$widget_data ['module'] = $thisPanel->get_inst_prop_value ( 'module' );
|
||||
$widget_data ['focus'] = $this->parent_bean;
|
||||
$widget_data ['subpanel_definition'] = $thisPanel;
|
||||
$widget_contents .= '<td style="padding-right: 2px; padding-bottom: 2px;">' . "\n";
|
||||
|
||||
if (empty ( $widget_data ['widget_class'] )) {
|
||||
$widget_contents .= "widget_class not defined for top subpanel buttons";
|
||||
} else {
|
||||
$widget_contents .= $layout_manager->widgetDisplay ( $widget_data );
|
||||
}
|
||||
|
||||
$widget_contents .= '</td>';
|
||||
}
|
||||
|
||||
$widget_contents .= '</tr></table></div>';
|
||||
return $widget_contents;
|
||||
}
|
||||
|
||||
function ProcessSubPanelListView($xTemplatePath,&$mod_strings) {
|
||||
|
||||
global $app_strings;
|
||||
global $image_path;
|
||||
global $current_user;
|
||||
global $sugar_config;
|
||||
|
||||
if (isset ( $this->listview )) {
|
||||
$ListView = & $this->listview;
|
||||
} else {
|
||||
$ListView = new EcmCallsListView ( );
|
||||
}
|
||||
$ListView->initNewXTemplate ( $xTemplatePath, $this->subpanel_defs->mod_strings );
|
||||
$ListView->xTemplateAssign ( "RETURN_URL", "&return_module=" . $this->parent_module . "&return_action=DetailView&return_id=" . $this->parent_bean->id );
|
||||
$ListView->xTemplateAssign ( "RELATED_MODULE", $this->parent_module ); // TODO: what about unions?
|
||||
$ListView->xTemplateAssign ( "RECORD_ID", $this->parent_bean->id );
|
||||
$ListView->xTemplateAssign ( "EDIT_INLINE_PNG", get_image ( $image_path . 'edit_inline', 'align="absmiddle" alt="' . $app_strings ['LNK_EDIT'] . '" border="0"' ) );
|
||||
$ListView->xTemplateAssign ( "DELETE_INLINE_PNG", get_image ( $image_path . 'delete_inline', 'align="absmiddle" alt="' . $app_strings ['LNK_DELETE'] . '" border="0"' ) );
|
||||
$ListView->xTemplateAssign ( "REMOVE_INLINE_PNG", get_image ( $image_path . 'delete_inline', 'align="absmiddle" alt="' . $app_strings ['LNK_REMOVE'] . '" border="0"' ) );
|
||||
$header_text = '';
|
||||
|
||||
if (is_admin ( $current_user ) && $_REQUEST ['module'] != 'DynamicLayout' && ! empty ( $_SESSION ['editinplace'] )) {
|
||||
$exploded = explode ( '/', $xTemplatePath );
|
||||
$file_name = $exploded [sizeof ( $exploded ) - 1];
|
||||
$mod_name = $exploded [sizeof ( $exploded ) - 2];
|
||||
$header_text = " <a href='index.php?action=index&module=DynamicLayout&from_action=$file_name&from_module=$mod_name&mod_lang=" . $_REQUEST ['module'] . "'>" . get_image ( $image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'" ) . "</a>";
|
||||
}
|
||||
$ListView->setHeaderTitle ( '' );
|
||||
$ListView->setHeaderText ( '' );
|
||||
|
||||
ob_start ();
|
||||
|
||||
$ListView->is_dynamic = true;
|
||||
$ListView->records_per_page = $sugar_config ['list_max_entries_per_subpanel'] + 0;
|
||||
$ListView->start_link_wrapper = "javascript:showSubPanel('" . $this->subpanel_id . "','";
|
||||
$ListView->subpanel_id = $this->subpanel_id;
|
||||
$ListView->end_link_wrapper = "',true);";
|
||||
|
||||
$where = '';
|
||||
$ListView->setQuery ( $where, '', '', '' );
|
||||
$ListView->show_export_button = false;
|
||||
|
||||
//function returns the query that was used to populate sub-panel data.
|
||||
$query = $ListView->process_dynamic_listview ( $this->parent_module, $this->parent_bean, $this->subpanel_defs );
|
||||
|
||||
$this->subpanel_query = $query;
|
||||
$ob_contents = ob_get_contents ();
|
||||
ob_end_clean ();
|
||||
|
||||
$ob_contents = str_replace('action=SubPanelViewerMy','action=SubPanelViewer',$ob_contents);
|
||||
$ob_contents = str_replace('action=SubPanelViewer','action=SubPanelViewerMy',$ob_contents);
|
||||
|
||||
return $ob_contents;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the subpanel
|
||||
*/
|
||||
|
||||
function display() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
global $timedate;
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
global $app_list_strings;
|
||||
global $gridline, $theme;
|
||||
global $beanList;
|
||||
global $beanFiles;
|
||||
global $current_language;
|
||||
require_once ('themes/' . $theme . '/layout_utils.php');
|
||||
$image_path = 'themes/' . $theme . '/images/';
|
||||
|
||||
$result_array = array ( );
|
||||
|
||||
$return_string = $this->ProcessSubPanelListView ( $this->template_file, $result_array );
|
||||
|
||||
|
||||
print $return_string;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getModulesWithSubpanels() {
|
||||
global $beanList;
|
||||
$dir = dir ( 'modules' );
|
||||
$modules = array ( );
|
||||
while ( $entry = $dir->read () ) {
|
||||
if (file_exists ( 'modules/' . $entry . '/layout_defs.php' )) {
|
||||
$modules [$entry] = $entry;
|
||||
}
|
||||
}
|
||||
return $modules;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get an array of subpanels for this module
|
||||
*/
|
||||
|
||||
function getModuleSubpanels($module) {
|
||||
require_once ('include/SubPanel/SubPanelDefinitions.php');
|
||||
global $beanList, $beanFiles;
|
||||
if (! isset ( $beanList [$module] )) {
|
||||
return array ( );
|
||||
}
|
||||
|
||||
$class = $beanList [$module];
|
||||
require_once ($beanFiles [$class]);
|
||||
$mod = new $class ( );
|
||||
$spd = new SubPanelDefinitions ( $mod );
|
||||
$tabs = $spd->get_available_tabs (true);
|
||||
$ret_tabs = array ( );
|
||||
$reject_tabs = array ('history' => 1, 'activities' => 1 );
|
||||
foreach ( $tabs as $key => $tab ) {
|
||||
foreach($tab as $k=>$v){
|
||||
if (! isset ( $reject_tabs [$k] )) {
|
||||
$ret_tabs [$k] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $ret_tabs;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the definition for a subpanel
|
||||
* Creates the new definition in the Ext directory and then uses the module installer to activate the new definition
|
||||
* @param panel A string identifier for the subpanel to update
|
||||
* @param subsection The section of the definition to be overridden (for example,
|
||||
* @param override The new definition as an Array
|
||||
*/
|
||||
|
||||
function saveSubPanelDefOverride($panel,$subsection,$override) {
|
||||
global $layout_defs, $beanList;
|
||||
|
||||
//save the new subpanel
|
||||
$name = "subpanel_layout['list_fields']";
|
||||
|
||||
//bugfix: load looks for moduleName/metadata/subpanels, not moduleName/subpanels
|
||||
$path = 'custom/modules/' . $panel->_instance_properties ['module'] . '/metadata/subpanels';
|
||||
$filename = $panel->parent_bean->object_name . $panel->_instance_properties ['subpanel_name'];
|
||||
mkdir_recursive ( $path, true );
|
||||
write_array_to_file ( $name, $override, $path . '/' . $filename . '.php' );
|
||||
|
||||
//save the override for the layoutdef
|
||||
$name = "layout_defs['" . $panel->parent_bean->module_dir . "']['subpanel_setup']['" . strtolower ( $panel->name ) . "']"; // tyoung 10.12.07 pushed panel->name to lowercase to match case in subpaneldefs.php files - gave error on bad index 'module' as this override key didn't match the key in the subpaneldefs
|
||||
$extname = '_override' . $panel->parent_bean->object_name . $panel->_instance_properties ['module'] . $panel->_instance_properties ['subpanel_name'];
|
||||
$newValue = override_value_to_string ( $name, 'override_subpanel_name', $filename );
|
||||
|
||||
mkdir_recursive ( 'custom/Extension/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs', true );
|
||||
$fp = fopen ( 'custom/Extension/modules/' . $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$extname.php", 'w' );
|
||||
fwrite ( $fp, "<?php\n//auto-generated file DO NOT EDIT\n$newValue\n?>" );
|
||||
fclose ( $fp );
|
||||
|
||||
require_once ('ModuleInstall/ModuleInstaller.php');
|
||||
$moduleInstaller = new ModuleInstaller ( );
|
||||
$moduleInstaller->silent = true; // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs
|
||||
$moduleInstaller->rebuild_layoutdefs ();
|
||||
if (file_exists ( 'modules/' . $panel->parent_bean->module_dir . '/layout_defs.php' ))
|
||||
include ('modules/' . $panel->parent_bean->module_dir . '/layout_defs.php');
|
||||
if (file_exists ( 'custom/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php' ))
|
||||
include ('custom/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php');
|
||||
}
|
||||
|
||||
function get_subpanel_setup($module) {
|
||||
$subpanel_setup = '';
|
||||
$layout_defs = get_layout_defs ();
|
||||
|
||||
if (! empty ( $layout_defs ) && ! empty ( $layout_defs [$module] ['subpanel_setup'] )) {
|
||||
$subpanel_setup = $layout_defs [$module] ['subpanel_setup'];
|
||||
}
|
||||
|
||||
return $subpanel_setup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the subpanel definition for a specified subpanel
|
||||
* The definition is a merge of the default definition and any custom definition
|
||||
* @param module The module name
|
||||
* @param subpanel_id Subpanel identifier (string)
|
||||
* @return Array
|
||||
*/
|
||||
function getSubPanelDefine($module,$subpanel_id) {
|
||||
$default_subpanel_define = SubPanel::_get_default_subpanel_define ( $module, $subpanel_id );
|
||||
$custom_subpanel_define = SubPanel::_get_custom_subpanel_define ( $module, $subpanel_id );
|
||||
|
||||
$subpanel_define = array_merge ( $default_subpanel_define, $custom_subpanel_define );
|
||||
|
||||
if (empty ( $subpanel_define )) {
|
||||
print ('Could not load subpanel definition for: ' . $subpanel_id);
|
||||
}
|
||||
|
||||
return $subpanel_define;
|
||||
}
|
||||
|
||||
function _get_custom_subpanel_define($module,$subpanel_id) {
|
||||
$ret_val = array ( );
|
||||
|
||||
if ($subpanel_id != '') {
|
||||
$layout_defs = get_layout_defs ();
|
||||
|
||||
if (! empty ( $layout_defs [$module] ['custom_subpanel_defines'] [$subpanel_id] )) {
|
||||
$ret_val = $layout_defs [$module] ['custom_subpanel_defines'] [$subpanel_id];
|
||||
}
|
||||
}
|
||||
|
||||
return $ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param module Not used (?)
|
||||
* @param subpanel_id Subpanel Identifier (string)
|
||||
*/
|
||||
function _get_default_subpanel_define($module,$subpanel_id) {
|
||||
$ret_val = array ( );
|
||||
|
||||
if ($subpanel_id != '') {
|
||||
$layout_defs = get_layout_defs (); // just get the global $layout_defs...
|
||||
|
||||
if (! empty ( $layout_defs [$subpanel_id] ['default_subpanel_define'] )) {
|
||||
$ret_val = $layout_defs [$subpanel_id] ['default_subpanel_define'];
|
||||
}
|
||||
}
|
||||
|
||||
return $ret_val;
|
||||
}
|
||||
}
|
||||
?>
|
||||
104
modules/EcmCalls/SubPanelViewer.php
Executable file
104
modules/EcmCalls/SubPanelViewer.php
Executable file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SubPanelViewer
|
||||
*
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
global $gridline;
|
||||
global $theme;
|
||||
global $beanList;
|
||||
global $beanFiles;
|
||||
|
||||
|
||||
if(empty($_REQUEST['spModule']))
|
||||
{
|
||||
die("'module' was not defined");
|
||||
}
|
||||
|
||||
$_REQUEST['module'] = $_REQUEST['spModule'];
|
||||
$_POST['module'] = $_REQUEST['spModule'];
|
||||
$_GET['module'] = $_REQUEST['spModule'];
|
||||
|
||||
echo $_REQUEST['module'];
|
||||
|
||||
if(empty($_REQUEST['record']))
|
||||
{
|
||||
die("'record' was not defined");
|
||||
}
|
||||
|
||||
if(!isset($beanList[$_REQUEST['module']]))
|
||||
{
|
||||
die("'".$_REQUEST['module']."' is not defined in \$beanList");
|
||||
}
|
||||
|
||||
$subpanel = $_REQUEST['subpanel'];
|
||||
$record = $_REQUEST['record'];
|
||||
$module = $_REQUEST['module'];
|
||||
|
||||
require_once('themes/'.$theme.'/layout_utils.php');
|
||||
$image_path = 'themes/'.$theme.'/images/';
|
||||
|
||||
if(empty($_REQUEST['inline']))
|
||||
{
|
||||
insert_popup_header($theme);
|
||||
}
|
||||
|
||||
//require_once('include/SubPanel/SubPanelDefinitions.php');
|
||||
//require_once($beanFiles[$beanList[$_REQUEST['module']]]);
|
||||
//$focus=new $beanList[$_REQUEST['module']];
|
||||
//$focus->retrieve($record);
|
||||
|
||||
include('include/SubPanel/SubPanel.php');
|
||||
$layout_def_key = '';
|
||||
if(!empty($_REQUEST['layout_def_key'])){
|
||||
$layout_def_key = $_REQUEST['layout_def_key'];
|
||||
}
|
||||
|
||||
$subpanel_object = new SubPanel($module, $record, $subpanel,null, $layout_def_key);
|
||||
|
||||
$subpanel_object->setTemplateFile('include/SubPanel/SubPanelDynamic.html');
|
||||
echo (empty($_REQUEST['inline']))?$subpanel_object->get_buttons():'' ;
|
||||
|
||||
$subpanel_object->display();
|
||||
|
||||
if(empty($_REQUEST['inline']))
|
||||
{
|
||||
insert_popup_footer($theme);
|
||||
}
|
||||
|
||||
?>
|
||||
101
modules/EcmCalls/SubPanelViewerMy.php
Executable file
101
modules/EcmCalls/SubPanelViewerMy.php
Executable file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SubPanelViewer
|
||||
*
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
global $gridline;
|
||||
global $theme;
|
||||
global $beanList;
|
||||
global $beanFiles;
|
||||
|
||||
|
||||
if(empty($_REQUEST['spModule']))
|
||||
{
|
||||
die("'module' was not defined");
|
||||
}
|
||||
|
||||
$_REQUEST['module'] = $_REQUEST['spModule'];
|
||||
|
||||
|
||||
if(empty($_REQUEST['record']))
|
||||
{
|
||||
die("'record' was not defined");
|
||||
}
|
||||
|
||||
if(!isset($beanList[$_REQUEST['module']]))
|
||||
{
|
||||
die("'".$_REQUEST['module']."' is not defined in \$beanList");
|
||||
}
|
||||
|
||||
$subpanel = $_REQUEST['subpanel'];
|
||||
$record = $_REQUEST['record'];
|
||||
$module = $_REQUEST['module'];
|
||||
|
||||
require_once('themes/'.$theme.'/layout_utils.php');
|
||||
$image_path = 'themes/'.$theme.'/images/';
|
||||
|
||||
if(empty($_REQUEST['inline']))
|
||||
{
|
||||
insert_popup_header($theme);
|
||||
}
|
||||
|
||||
//require_once('include/SubPanel/SubPanelDefinitions.php');
|
||||
//require_once($beanFiles[$beanList[$_REQUEST['module']]]);
|
||||
//$focus=new $beanList[$_REQUEST['module']];
|
||||
//$focus->retrieve($record);
|
||||
|
||||
include('modules/EcmCalls/SubPanel/EcmCallsSubPanel.php');
|
||||
$layout_def_key = '';
|
||||
if(!empty($_REQUEST['layout_def_key'])){
|
||||
$layout_def_key = $_REQUEST['layout_def_key'];
|
||||
}
|
||||
|
||||
$subpanel_object = new EcmCallsSubPanel($module, $record, $subpanel,null, $layout_def_key);
|
||||
|
||||
$subpanel_object->setTemplateFile('include/SubPanel/SubPanelDynamic.html');
|
||||
echo (empty($_REQUEST['inline']))?$subpanel_object->get_buttons():'' ;
|
||||
|
||||
$subpanel_object->display();
|
||||
|
||||
if(empty($_REQUEST['inline']))
|
||||
{
|
||||
insert_popup_footer($theme);
|
||||
}
|
||||
|
||||
?>
|
||||
1053
modules/EcmCalls/TimeDateC.php
Executable file
1053
modules/EcmCalls/TimeDateC.php
Executable file
File diff suppressed because it is too large
Load Diff
100
modules/EcmCalls/anMenu/anMenu.php
Executable file
100
modules/EcmCalls/anMenu/anMenu.php
Executable file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
require_once("XTemplate/xtpl.php");
|
||||
|
||||
class anMenu {
|
||||
|
||||
var $xtpl = 'modules/EcmCalls/anMenu/anMenu.html';
|
||||
|
||||
function trimColon($str) {
|
||||
$pos = strrpos($str,':');
|
||||
if($pos == strlen($str)-1) $str = substr($str,0,$pos);
|
||||
return $str;
|
||||
}
|
||||
|
||||
function getParentOptions() {
|
||||
global $app_list_strings, $mod_strings;
|
||||
|
||||
$arr = array(
|
||||
'Accounts' => $app_list_strings['moduleList']['Accounts'],
|
||||
'Contacts' => $app_list_strings['moduleList']['Contacts'],
|
||||
'Users' => translate("LBL_PARENT_FROM", "EcmCalls"),//$app_list_strings['moduleList']['Users'],
|
||||
);
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function getBeanSelect($bean_module, $bean_name, $bean_id) {
|
||||
$arr = array();
|
||||
$file = "modules/$bean_module/$bean_name.php";
|
||||
if(file_exists($file)) {
|
||||
|
||||
require_once($file);
|
||||
$focus = new $bean_name();
|
||||
$focus->retrieve($bean_id);
|
||||
|
||||
foreach($focus->field_defs as $name => $value) {
|
||||
if($value['type'] == "phone" || strpos($name,"phone_") === 0)
|
||||
$arr[$name] = $this->formatNumerName(translate($value['vname'], $bean_module), $focus->$name);
|
||||
}
|
||||
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function getAccountsSelectJSON($parent_id = '') {
|
||||
return '<select id="an_menu_parent_phone" name="an_menu_parent_phone">'.get_select_options_with_id($this->getBeanSelect("Accounts", "Account", $parent_id),'').'</select>';
|
||||
}
|
||||
|
||||
function getUsersSelectJSON($parent_id = '') {
|
||||
return '<select id="an_menu_parent_phone" name="an_menu_parent_phone">'.get_select_options_with_id($this->getBeanSelect("Users", "User", $parent_id),'').'</select>';
|
||||
}
|
||||
|
||||
function getContactsSelectJSON($parent_id = '') {
|
||||
return '<select id="an_menu_parent_phone" name="an_menu_parent_phone">'.get_select_options_with_id($this->getBeanSelect("Contacts", "Contact", $parent_id),'').'</select>';
|
||||
}
|
||||
|
||||
|
||||
function formatNumerName($label,$number = '') {
|
||||
$str = $this->trimColon($label);
|
||||
if(isset($number) && $number != '') $str .= ' -> '.$number;
|
||||
return $str;
|
||||
}
|
||||
|
||||
function SavePhone($amd) {
|
||||
global $beanList, $beanFiles;
|
||||
$bean = $beanList[$amd['an_menu_parent']];
|
||||
$path = $beanFiles[$bean];
|
||||
if(file_exists($path)) {
|
||||
require_once($path);
|
||||
$focus = new $bean();
|
||||
$focus->retrieve($amd['an_menu_parent_id']);
|
||||
$focus->EcmCallInfo = array(
|
||||
'update_records' => $amd['an_menu_update_records'],
|
||||
'old_parent' => $amd['an_menu_old_parent'],
|
||||
'old_parent_id' => $amd['an_menu_old_parent_id'],
|
||||
'old_parent_phone' => $amd['an_menu_old_parent_phone'],
|
||||
'ecmcall_record' => $amd['an_menu_ecmcall_record'],
|
||||
'parent_phone' => $amd['an_menu_parent_phone']
|
||||
);
|
||||
if(isset($focus->id) && $focus->id != '') {
|
||||
$focus->$amd['an_menu_parent_phone'] = $amd['an_menu_new_phone'];
|
||||
$focus->save();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function display() {
|
||||
global $mod_strings, $app_strings, $current_language, $app_list_strings;
|
||||
$xtpl = new XTemplate ($this->xtpl);
|
||||
$xtpl->assign("MOD", return_module_language($current_language, 'EcmCalls'));
|
||||
$xtpl->assign("APP", $app_strings);
|
||||
$xtpl->assign("AN_MENU_PARENT_OPTIONS", get_select_options_with_id($this->getParentOptions(),''));
|
||||
$xtpl->assign("AN_MENU_PARENT_PHONES_OPTIONS", $this->getAccountsSelectJSON());
|
||||
$xtpl->assign("AN_MENU_UPDATE_RECORDS_OPTIONS", get_select_options_with_id($app_list_strings['calls_update_records_dom'],''));
|
||||
$xtpl->parse("main");
|
||||
$xtpl->out("main");
|
||||
}
|
||||
}
|
||||
?>
|
||||
31
modules/EcmCalls/assigncalls.php
Executable file
31
modules/EcmCalls/assigncalls.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// inner join ecmcalls_beans as e on c.id=e.ecmcall_id
|
||||
/*$w=mysql_query("select c.* from cdr as c where c.calldate>='2010-08-01 00:00:00'");
|
||||
while($r=mysql_fetch_array($w)){
|
||||
$ww=mysql_query("select * from ecmcalls_beans where ecmcall_id='".$r['id']."' and src='".$r['dst']."' and deleted='0'");
|
||||
if(mysql_num_rows($ww)==0 && strlen($r['dst'])>=9){
|
||||
$rrr=mysql_fetch_array(mysql_query("select name,phone_office,id from accounts where phone_office like '%".$r['dst']."%' and deleted='0'"));
|
||||
if($rrr['id']){
|
||||
echo "#src: ".$r['src']." dst: ".$r['dst']." ".$rrr['name']." ".$rrr['phone_office']."<br>";
|
||||
$dst=$r['dst'];
|
||||
if(!eregi("0048",$r['dst'])){
|
||||
$dst='0048'.$r['dst'];
|
||||
if(strlen($dst>=12))echo "update cdr set dst='".$dst."' where id='".$r['id']."'<br>";
|
||||
}
|
||||
if(strlen($dst>=12))echo "insert into ecmcalls_beans(id,ecmcall_id,bean_id,bean_module,src,date_modified,deleted) values('".create_guid()."','".$r['id']."','".$rrr['id']."','Accounts','".$dst."','".date("Y-m-d H:i:s")."','0');<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
$w=mysql_query("select c.* from cdr as c where c.calldate>='2010-08-01 00:00:00'");
|
||||
while($r=mysql_fetch_array($w)){
|
||||
if(!eregi("0048",$r['dst']) && strlen($r['dst'])==9){
|
||||
echo "update cdr set dst='0048".$r['dst']."' where id='".$r['id']."';<br>";
|
||||
}
|
||||
}*/
|
||||
$w=mysql_query("select * from ecmcalls_beans where date_modified>='2010-08-01 00:00:00'");
|
||||
while($r=mysql_fetch_array($w)){
|
||||
if(!eregi("0048",$r['src']) && strlen($r['src'])==9){
|
||||
echo "update ecmcalls_beans set src='0048".$r['src']."' where id='".$r['id']."';<br>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
18
modules/EcmCalls/chart.php
Executable file
18
modules/EcmCalls/chart.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ("include/jpgraph/1.26/src/jpgraph.php");
|
||||
include ("include/jpgraph/1.26/src/jpgraph_scatter.php");
|
||||
$datax = array(3.5,3.7,3,4,6.2,6,3.5,8,14,8,11.1,13.7);
|
||||
$datay = array(20,22,12,13,17,20,16,19,30,31,40,43);
|
||||
$graph = new Graph(300,200,"auto");
|
||||
$graph->SetScale("linlin");
|
||||
$graph->img->SetMargin(40,40,40,40);
|
||||
$graph->SetShadow();
|
||||
$graph->title->Set("A simple scatter plot");
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
$sp1 = new ScatterPlot($datay,$datax);
|
||||
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
|
||||
$sp1->mark->SetFillColor("red");
|
||||
$sp1->mark->SetWidth(8);
|
||||
$graph->Add($sp1);
|
||||
$graph->Stroke();
|
||||
?>
|
||||
40
modules/EcmCalls/chart/EcmCallsChart.php
Executable file
40
modules/EcmCalls/chart/EcmCallsChart.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
require_once('include/Sugar_Smarty.php');
|
||||
require_once('include/SugarCharts/SugarChart.php');
|
||||
|
||||
class EcmCallsChart extends SugarChart {
|
||||
|
||||
function display($name, $xmlFile, $width='320', $height='480', $resize=false){
|
||||
require_once('include/Sugar_Smarty.php');
|
||||
|
||||
// generate strings for chart if it does not exist
|
||||
global $current_language, $theme;
|
||||
|
||||
$chartStringsXML = 'cache/xml/chart_strings.' . $current_language .'.lang.xml';
|
||||
if (!file_exists($chartStringsXML)){
|
||||
$this->generateChartStrings($chartStringsXML);
|
||||
}
|
||||
|
||||
$sugar_smarty = new Sugar_Smarty();
|
||||
|
||||
$sugar_smarty->assign("chartName", $name);
|
||||
$sugar_smarty->assign("chartXMLFile", $xmlFile);
|
||||
$sugar_smarty->assign("chartStringsXML", $chartStringsXML);
|
||||
|
||||
// chart styles and color definitions
|
||||
$sugar_smarty->assign("chartStyleCSS", chartStyle());
|
||||
$sugar_smarty->assign("chartColorsXML", chartColors());
|
||||
|
||||
$sugar_smarty->assign("width", $width);
|
||||
$sugar_smarty->assign("height", $height);
|
||||
|
||||
$sugar_smarty->assign("resize", $resize);
|
||||
|
||||
return $sugar_smarty->fetch('modules/EcmCalls/chart/chart.tpl');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
5
modules/EcmCalls/config.php
Executable file
5
modules/EcmCalls/config.php
Executable file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$ecmcalls_config = array (
|
||||
'central_timezone' => 'Europe/Warsaw',
|
||||
);
|
||||
?>
|
||||
106
modules/EcmCalls/field_arrays.php
Executable file
106
modules/EcmCalls/field_arrays.php
Executable file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
$fields_array['EcmCall'] = array (
|
||||
|
||||
'column_fields' => Array(
|
||||
|
||||
'id',
|
||||
'deleted',
|
||||
'note',
|
||||
|
||||
//NEW COLUMN FIELDS
|
||||
|
||||
'calldate',
|
||||
'src',
|
||||
'dst',
|
||||
'dcontext',
|
||||
'channel',
|
||||
'dstchannel',
|
||||
'lastapp',
|
||||
'lastdata',
|
||||
'duration',
|
||||
'billsec',
|
||||
'disposition',
|
||||
'amaflags',
|
||||
'accountcode',
|
||||
'userfield'
|
||||
|
||||
),
|
||||
|
||||
'list_fields' => Array(
|
||||
|
||||
'id',
|
||||
'deleted',
|
||||
'note',
|
||||
|
||||
//NEW COLUMN FIELDS
|
||||
'calldate',
|
||||
'src',
|
||||
'dst',
|
||||
'dcontext',
|
||||
'channel',
|
||||
'dstchannel',
|
||||
'lastapp',
|
||||
'lastdata',
|
||||
'duration',
|
||||
'billsec',
|
||||
'disposition',
|
||||
'amaflags',
|
||||
'accountcode',
|
||||
'userfield'
|
||||
|
||||
),
|
||||
|
||||
'required_fields' => array(
|
||||
'calldate'=>1
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
335
modules/EcmCalls/formloader.php
Executable file
335
modules/EcmCalls/formloader.php
Executable file
@@ -0,0 +1,335 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
$module = $_REQUEST['module'];
|
||||
|
||||
$cM = $_REQUEST['createModule'];
|
||||
|
||||
$lA = $_REQUEST['loaderAction'];
|
||||
|
||||
$fN = $_REQUEST['loaderFieldName'];
|
||||
|
||||
$record = $_REQUEST['record'];
|
||||
|
||||
if($lA == "EditView") {
|
||||
|
||||
ob_start();
|
||||
|
||||
$_REQUEST['module'] = $cM;
|
||||
|
||||
$_REQUEST['action'] = "EditView";
|
||||
|
||||
$_REQUEST['record'] = $record;
|
||||
|
||||
$_POST['module'] = $cM;
|
||||
|
||||
$_POST['action'] = "EditView";
|
||||
|
||||
$_POST['record'] = $record;
|
||||
|
||||
$_GET['record'] = $record;
|
||||
|
||||
include('index.php');
|
||||
|
||||
$out = ob_get_contents();
|
||||
|
||||
ob_end_clean();
|
||||
|
||||
echo $out;
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($lA == "get_module_fields") {
|
||||
|
||||
global $beanList, $beanFiles;
|
||||
|
||||
$file = 'cache/modules/'.$cM.'/'.$beanList[$cM].'vardefs.php';
|
||||
|
||||
if(file_exists($file)) {
|
||||
|
||||
include($file);
|
||||
|
||||
$dict = $GLOBALS['dictionary'][$beanList[$cM]]['fields'];
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
$file = 'modules/'.$cM.'/vardefs.php';
|
||||
|
||||
if(file_exists($file)) { include($file); $dict = $dictionary[$beanList[$cM]]['fields']; } else return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$file = $beanFiles[$beanList[$cM]];
|
||||
|
||||
if(file_exists($file)) {
|
||||
|
||||
require_once($file);
|
||||
|
||||
$bean = new $beanList[$cM]();
|
||||
|
||||
$bean->retrieve($record);
|
||||
|
||||
if(isset($bean->id) && $bean->id != '') {
|
||||
|
||||
$arr = array();
|
||||
|
||||
foreach($dict as $key => $value) {
|
||||
|
||||
if(isset($bean->$value['name']) && (is_string($bean->$value['name']) || is_float($bean->$value['name']) || is_int($bean->$value['name']) || is_bool($bean->$value['name'])))
|
||||
|
||||
$arr[$value['name']] = $bean->$value['name'];
|
||||
|
||||
}
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
echo '['.str_replace('"','\"',$json->encode($arr)).']';
|
||||
|
||||
} else return;
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
|
||||
|
||||
<title></title>
|
||||
|
||||
<script type="text/javascript" src="include/javascript/sugar_grp1_yui.js?s=5.0.0c&c="></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="hidder" style="position:absolute;left:0;top:0;width:105%;height:100%;background-color:white;visibility:visible;text-align:center;padding:40px;"><img src="themes/default/images/loading.gif"/></div>
|
||||
|
||||
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
|
||||
|
||||
function doRequest(where,post,success,error) {
|
||||
|
||||
this.Display = function(result) { success(result.responseText); }
|
||||
|
||||
this.Fail = function(result){ if(error) error(result); }
|
||||
|
||||
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function iframeLoad() {
|
||||
|
||||
var frame = document.getElementById("input_create");
|
||||
|
||||
|
||||
var doc = frame.contentDocument;
|
||||
|
||||
if(typeof(doc) == "undefined" || !doc)
|
||||
|
||||
doc = frame.contentWindow.document;
|
||||
|
||||
//alert(doc.forms.DetailView);
|
||||
|
||||
|
||||
|
||||
if(doc && doc.forms && ((doc.forms.EditView || doc.forms.DetailView || doc.forms.Save) || doc.return_module_fields)) {
|
||||
|
||||
|
||||
|
||||
if(doc.forms.EditView) {
|
||||
|
||||
|
||||
|
||||
} else
|
||||
|
||||
if(doc.forms.DetailView) {
|
||||
|
||||
var record = doc.forms.DetailView.record;
|
||||
|
||||
if(record && record.value != "") {
|
||||
|
||||
doRequest(
|
||||
|
||||
"index.php",
|
||||
|
||||
"module="+module+"&action=formloader&loaderAction=get_module_fields&createModule="+cM+"&to_pdf=1&record="+record.value,
|
||||
|
||||
function(result) {
|
||||
|
||||
if(result == '')
|
||||
|
||||
window.close();
|
||||
|
||||
else {
|
||||
|
||||
|
||||
var obj = eval(result);
|
||||
|
||||
if(obj) {
|
||||
|
||||
obj = obj[0];
|
||||
|
||||
eval('window.opener.'+fN+'.responseData(obj)');
|
||||
|
||||
}
|
||||
|
||||
window.close();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
function(result) {
|
||||
|
||||
window.close();
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
} else window.close();
|
||||
|
||||
} else
|
||||
|
||||
if(doc.forms.Save) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else { window.close(); return; }
|
||||
|
||||
|
||||
|
||||
var main = doc.getElementById('main');
|
||||
|
||||
if(main) {
|
||||
|
||||
var dd = doc.createElement('div');
|
||||
dd.innerHTML = '<table style="width:100%;"><tr id="main2"></tr></table>';
|
||||
|
||||
doc.body.insertBefore(dd,doc.body.firstChild);
|
||||
|
||||
doc.getElementById('main2').appendChild(main);
|
||||
main.style.position = 'absolute';
|
||||
main.style.left = 0;
|
||||
main.style.top = 0;
|
||||
for(var i=1; i<doc.body.childNodes.length; i++) if(doc.body.childNodes[i] !== main && doc.body.childNodes[i].style) {
|
||||
doc.body.childNodes[i].style.visibility = 'hidden';
|
||||
}
|
||||
if(doc && doc.forms && !doc.forms.DetailView) doc.body.FormLoader = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var oldLocation = '';
|
||||
|
||||
setInterval(function(){
|
||||
|
||||
var frame = document.getElementById("input_create");
|
||||
|
||||
if(frame) {
|
||||
|
||||
var doc = frame.contentDocument;
|
||||
|
||||
if(doc == undefined || doc == null)
|
||||
|
||||
doc = frame.contentWindow.document;
|
||||
|
||||
|
||||
|
||||
if(doc && doc.body && doc.body.FormLoader) {
|
||||
|
||||
if(hidder.style.visibility = "visible") hidder.style.visibility = "hidden";
|
||||
|
||||
} else {
|
||||
|
||||
if(hidder.style.visibility = "hidden") hidder.style.visibility = "visible"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},60);
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if($lA == "ViewForm") {
|
||||
|
||||
echo '<script language="javascript">
|
||||
|
||||
var module = "'.$module.'";
|
||||
|
||||
var cM = "'.$cM.'";
|
||||
|
||||
var lA = "'.$lA.'";
|
||||
|
||||
var fN = "'.$fN.'";
|
||||
|
||||
</script>';
|
||||
|
||||
$data = '';
|
||||
|
||||
foreach($_REQUEST as $key=>$value) {
|
||||
|
||||
if(strpos($key,"fl_") === 0) {
|
||||
|
||||
$data .= "&".substr($key,3)."=".$value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "<iframe onload='iframeLoad();' frameborder='no' width='100%' height='100%' id='input_create' name='input_create' src='index.php?module=$module&action=formloader&to_pdf=1&loaderAction=EditView&createModule=$cM".$data."'></iframe>";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
3
modules/EcmCalls/index2.php
Executable file
3
modules/EcmCalls/index2.php
Executable file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
require_once('ListView.php');
|
||||
?>
|
||||
211
modules/EcmCalls/language/en_us.lang.php
Executable file
211
modules/EcmCalls/language/en_us.lang.php
Executable file
@@ -0,0 +1,211 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
// FOR SYSTEM USE
|
||||
'LBL_MODULE_NAME' => 'Calls',
|
||||
'LBL_MODULE_TITLE' => 'Calls: Home',
|
||||
'LBL_MODULE_ID' => 'Calls',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Calls Search',
|
||||
'LBL_LIST_FORM_TITLE' => 'Calls List',
|
||||
'LBL_NEW_FORM_TITLE' => 'New Calls',
|
||||
'LBL_ECMCALLS' => 'Calls:',
|
||||
'LBL_ECMCALLS_SUBJECT' => 'Calls Subject:',
|
||||
'LBL_SYSTEM_ID' => 'System ID',
|
||||
|
||||
'LBL_DASHLET_MY_ECMCALLS' => 'My Last Calls',
|
||||
|
||||
|
||||
'LBL_ID'=>'ID',
|
||||
'LBL_DELETED'=>'Deleted',
|
||||
'LBL_CALLDATE'=>'Call Date',
|
||||
'LBL_CLID'=>'Clid',
|
||||
'LBL_SRC'=>'Source',
|
||||
'LBL_DST'=>'Destination',
|
||||
'LBL_DCONTEXT'=>'Dcontext',
|
||||
'LBL_CHANNEL'=>'Channel',
|
||||
'LBL_DSTCHANNEL'=>'Destination Channel',
|
||||
'LBL_LASTAPP'=>'Last Application',
|
||||
'LBL_LASTDATA'=>'Last Data',
|
||||
'LBL_DURATION'=>'Duration',
|
||||
'LBL_BILLSEC'=>'Billsec',
|
||||
'LBL_DISPOSITION'=>'Disposition',
|
||||
'LBL_AMAFLAGS'=>'Amaflags',
|
||||
'LBL_ACCOUNTCODE'=>'Account Code',
|
||||
'LBL_USERFIELD'=>'User Field',
|
||||
|
||||
'LBL_ADDRESS' => 'Address:',
|
||||
|
||||
'LBL_CALLDATE_FROM' => 'Call Date From:',
|
||||
'LBL_CALLDATE_TO' => 'Call Date To:',
|
||||
'LBL_FROM' => 'From:',
|
||||
'LBL_TO' => 'To:',
|
||||
'LBL_OWN_PHONES' => 'Own Central Phones:',
|
||||
'LBL_CENTRAL_PHONE' => 'Central Phone',
|
||||
|
||||
'LBL_ECMCALLS_SETTINGS_TITLE' => 'Calls: Settings',
|
||||
'LBL_CENTRAL_AREACODE' => 'Central Areacode',
|
||||
'LBL_CENTRAL_TIMEZONE' => 'Central TimeZone',
|
||||
'LBL_EDIT_TITLE' => 'Edit',
|
||||
'LBL_CANCEL_TITLE' => 'Cancel',
|
||||
'LBL_SAVE_TITLE' => 'Save',
|
||||
'LBL_NOTE_TITLE' => 'Note',
|
||||
'LBL_NOTE_LENGTH' => 'Length:',
|
||||
'LBL_NOTE' => 'Note',
|
||||
|
||||
'LBL_INSERT_NEW_ROW' => 'Insert New Row',
|
||||
'LBL_DELETE_ROW' => 'Delete Row',
|
||||
'LBL_MOVE_ROW_UP' => 'Move Up',
|
||||
'LBL_MOVE_ROW_DOWN' => 'Move Down',
|
||||
|
||||
'LBL_IN_OUT_FROM' => 'In/Out Calls',
|
||||
|
||||
// FOR LIST VIEW
|
||||
'LBL_LIST_NAME' => 'Name',
|
||||
'LBL_LIST_SUBJECT' => 'Subject',
|
||||
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
|
||||
'LBL_LIST_MY_ECMCALLS' => 'My Assigned EcmCalls',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
|
||||
'LBL_LIST_CODE' => 'code',
|
||||
'LBL_LIST_SELLING_PRICE' => 'Price',
|
||||
'LBL_LIST_DESCRIPTION' => 'Description',
|
||||
|
||||
// FOR NOTIFICATION POPUPS
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this call?',
|
||||
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the Call?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this call from this account?',
|
||||
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the call.',
|
||||
|
||||
// FOR DEFAULT FIELDS
|
||||
'LBL_NAME' => 'Name:',
|
||||
'LBL_SUBJECT' => 'Name:',
|
||||
'LBL_CREATED_BY' => 'Created by:',
|
||||
'LBL_CREATED' => 'Created by:',
|
||||
'LBL_ASSIGNED_TO' => 'Assigned to:',
|
||||
'LBL_ASSIGNED_USER_ID' => 'Assigned To:',
|
||||
'LBL_DATE_ENTERED' => 'Date Created:',
|
||||
'LBL_DATE_CREATED' => 'Create Date:',
|
||||
'LBL_DATE_MODIFIED' => 'Last Modified',
|
||||
'LBL_MODIFIED_BY' => 'Last Modified by:',
|
||||
'LBL_MODIFIED' => 'Modified by:',
|
||||
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
|
||||
|
||||
// FOR NEW FIELDS
|
||||
'LBL_CODE' => 'Code:',
|
||||
'LBL_PURCHASE_PRICE' => 'Purchase Price:',
|
||||
'LBL_SELLING_PRICE' => 'Selling Price:',
|
||||
'LBL_DESCRIPTION' => 'Description:',
|
||||
'LBL_VAT' => 'Vat:',
|
||||
'LBL_CATEGORY' => 'Category:',
|
||||
'LBL_UNIT' => 'Unit:',
|
||||
'LBL_CURRENCY' => 'Currency:',
|
||||
|
||||
'LBL_FILES' => 'Files:',
|
||||
'LBL_ADD_FILE' => 'Add File',
|
||||
'LBL_ADD_DOCUMENT' => 'Add Document',
|
||||
|
||||
// FOR GROUPS
|
||||
'LBL_GROUP_MASTER' => 'ECMCALL INFORMATION',
|
||||
'LBL_GROUP_CODE' => '',
|
||||
'LBL_GROUP_PRICE' => '',
|
||||
'LBL_GROUP_DESCRIPTION' => '',
|
||||
// FOR SUBPANELS
|
||||
'LBL_ECMCALLS_SUBPANEL_TITLE' => 'Calls',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
|
||||
'LBL_ECMCALLS' => 'Calls',
|
||||
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Documents',
|
||||
|
||||
// FOR MENU LABELS
|
||||
'LNK_NEW_ECMCALLS' => 'New Call',
|
||||
'LNK_LIST_ECMCALL' => 'Calls List',
|
||||
|
||||
// FOR MENU LINKS
|
||||
'LNK_NEW_ECMCALL' => 'New Call',
|
||||
'LNK_ECMCALLS_LIST' => 'Calls',
|
||||
'LNK_ECMCALLS_SETTINGS' => 'Calls Settings',
|
||||
'LNK_ECMCALLS_REPORTS' => 'Calls Reports',
|
||||
// FOR ADDITIONAL MENUS
|
||||
|
||||
// FOR DASHLETS
|
||||
'LBL_LIST_ECMCALLS' => 'Calls',
|
||||
|
||||
'LBL_ASSIGN_MENU_TITLE' => 'Assign number:',
|
||||
'LBL_ASSIGN_MENU_PARENT_NAME' => 'To',
|
||||
'LBL_ASSIGN_MENU_PARENT_PHONE' => 'Save To',
|
||||
'LBL_ASSIGN_MENU_NEW_NUMBER' => 'New Number',
|
||||
'LBL_ASSIGN_MENU_SAVE_BUTTON' => 'Save',
|
||||
'LBL_ASSIGN_MENU_CANCEL_BUTTON' => 'Cancel',
|
||||
'LBL_ASSIGN_MENU_SELECT_BUTTON' => 'Select',
|
||||
'LBL_ASSIGN_MENU_CLEAR_BUTTON' => 'Clear',
|
||||
'LBL_ASSIGN_MENU_CREATE_BUTTON' => 'Create',
|
||||
'LBL_ASSIGN_MENU_SAVE_SUCCESS' => 'Save success!',
|
||||
'LBL_ASSIGN_MENU_SAVE_FAILURE' => 'Save Error!',
|
||||
'LBL_ASSIGN_MENU_UPDATE_RECORDS' => 'Update records',
|
||||
|
||||
|
||||
'LBL_INCOMING_LESS_THAN' => 'Incoming, duration <= ',
|
||||
'LBL_INCOMING_MORE_THAN' => 'Incoming, duration > ',
|
||||
'LBL_OUTGOING_LESS_THAN' => 'Outgoing, duration <= ',
|
||||
'LBL_OUTGOING_MORE_THAN' => 'Outgoing, duration > ',
|
||||
|
||||
'LBL_PARENT_FROM' => 'Employees',
|
||||
'LBL_CALL_TYPE' => 'Type',
|
||||
'LBL_ECMCALLS_WATCH' => 'Watch:',
|
||||
|
||||
'LBL_NUMBER_OWNER_TYPE_ACCOUNTS' => 'Account',
|
||||
'LBL_NUMBER_OWNER_TYPE_CONTACTS' => 'Contact',
|
||||
'LBL_NUMBER_OWNER_TYPE_USERS' => 'Employee',
|
||||
'LBL_NUMBER_OWNER_TYPE_OTHERS' => 'Other',
|
||||
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
210
modules/EcmCalls/language/ge_ge.lang.php
Executable file
210
modules/EcmCalls/language/ge_ge.lang.php
Executable file
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
// FOR SYSTEM USE
|
||||
'LBL_MODULE_NAME' => 'Calls',
|
||||
'LBL_MODULE_TITLE' => 'Calls: Home',
|
||||
'LBL_MODULE_ID' => 'Calls',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Calls Search',
|
||||
'LBL_LIST_FORM_TITLE' => 'Calls List',
|
||||
'LBL_NEW_FORM_TITLE' => 'New Calls',
|
||||
'LBL_ECMCALLS' => 'Calls:',
|
||||
'LBL_ECMCALLS_SUBJECT' => 'Calls Subject:',
|
||||
'LBL_SYSTEM_ID' => 'System ID',
|
||||
|
||||
'LBL_DASHLET_MY_ECMCALLS' => 'My Last Calls',
|
||||
|
||||
|
||||
'LBL_ID'=>'ID',
|
||||
'LBL_DELETED'=>'Deleted',
|
||||
'LBL_CALLDATE'=>'Call Date',
|
||||
'LBL_CLID'=>'Clid',
|
||||
'LBL_SRC'=>'Source',
|
||||
'LBL_DST'=>'Destination',
|
||||
'LBL_DCONTEXT'=>'Dcontext',
|
||||
'LBL_CHANNEL'=>'Channel',
|
||||
'LBL_DSTCHANNEL'=>'Destination Channel',
|
||||
'LBL_LASTAPP'=>'Last Application',
|
||||
'LBL_LASTDATA'=>'Last Data',
|
||||
'LBL_DURATION'=>'Duration',
|
||||
'LBL_BILLSEC'=>'Billsec',
|
||||
'LBL_DISPOSITION'=>'Disposition',
|
||||
'LBL_AMAFLAGS'=>'Amaflags',
|
||||
'LBL_ACCOUNTCODE'=>'Account Code',
|
||||
'LBL_USERFIELD'=>'User Field',
|
||||
|
||||
'LBL_ADDRESS' => 'Address:',
|
||||
|
||||
'LBL_CALLDATE_FROM' => 'Call Date From:',
|
||||
'LBL_CALLDATE_TO' => 'Call Date To:',
|
||||
'LBL_FROM' => 'From:',
|
||||
'LBL_TO' => 'To:',
|
||||
'LBL_OWN_PHONES' => 'Own Central Phones:',
|
||||
'LBL_CENTRAL_PHONE' => 'Central Phone',
|
||||
|
||||
'LBL_ECMCALLS_SETTINGS_TITLE' => 'Calls: Settings',
|
||||
'LBL_CENTRAL_AREACODE' => 'Central Areacode',
|
||||
'LBL_CENTRAL_TIMEZONE' => 'Central TimeZone',
|
||||
'LBL_EDIT_TITLE' => 'Edit',
|
||||
'LBL_CANCEL_TITLE' => 'Cancel',
|
||||
'LBL_SAVE_TITLE' => 'Save',
|
||||
'LBL_NOTE_TITLE' => 'Note',
|
||||
'LBL_NOTE_LENGTH' => 'Length:',
|
||||
'LBL_NOTE' => 'Note',
|
||||
|
||||
'LBL_INSERT_NEW_ROW' => 'Insert New Row',
|
||||
'LBL_DELETE_ROW' => 'Delete Row',
|
||||
'LBL_MOVE_ROW_UP' => 'Move Up',
|
||||
'LBL_MOVE_ROW_DOWN' => 'Move Down',
|
||||
|
||||
'LBL_IN_OUT_FROM' => 'In/Out Calls',
|
||||
|
||||
// FOR LIST VIEW
|
||||
'LBL_LIST_NAME' => 'Name',
|
||||
'LBL_LIST_SUBJECT' => 'Subject',
|
||||
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
|
||||
'LBL_LIST_MY_ECMCALLS' => 'My Assigned EcmCalls',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
|
||||
'LBL_LIST_CODE' => 'code',
|
||||
'LBL_LIST_SELLING_PRICE' => 'Price',
|
||||
'LBL_LIST_DESCRIPTION' => 'Description',
|
||||
|
||||
// FOR NOTIFICATION POPUPS
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this call?',
|
||||
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the Call?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this call from this account?',
|
||||
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the call.',
|
||||
|
||||
// FOR DEFAULT FIELDS
|
||||
'LBL_NAME' => 'Name:',
|
||||
'LBL_SUBJECT' => 'Name:',
|
||||
'LBL_CREATED_BY' => 'Created by:',
|
||||
'LBL_CREATED' => 'Created by:',
|
||||
'LBL_ASSIGNED_TO' => 'Assigned to:',
|
||||
'LBL_ASSIGNED_USER_ID' => 'Assigned To:',
|
||||
'LBL_DATE_ENTERED' => 'Date Created:',
|
||||
'LBL_DATE_CREATED' => 'Create Date:',
|
||||
'LBL_DATE_MODIFIED' => 'Last Modified',
|
||||
'LBL_MODIFIED_BY' => 'Last Modified by:',
|
||||
'LBL_MODIFIED' => 'Modified by:',
|
||||
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
|
||||
|
||||
// FOR NEW FIELDS
|
||||
'LBL_CODE' => 'Code:',
|
||||
'LBL_PURCHASE_PRICE' => 'Purchase Price:',
|
||||
'LBL_SELLING_PRICE' => 'Selling Price:',
|
||||
'LBL_DESCRIPTION' => 'Description:',
|
||||
'LBL_VAT' => 'Vat:',
|
||||
'LBL_CATEGORY' => 'Category:',
|
||||
'LBL_UNIT' => 'Unit:',
|
||||
'LBL_CURRENCY' => 'Currency:',
|
||||
|
||||
'LBL_FILES' => 'Files:',
|
||||
'LBL_ADD_FILE' => 'Add File',
|
||||
'LBL_ADD_DOCUMENT' => 'Add Document',
|
||||
|
||||
// FOR GROUPS
|
||||
'LBL_GROUP_MASTER' => 'ECMCALL INFORMATION',
|
||||
'LBL_GROUP_CODE' => '',
|
||||
'LBL_GROUP_PRICE' => '',
|
||||
'LBL_GROUP_DESCRIPTION' => '',
|
||||
// FOR SUBPANELS
|
||||
'LBL_ECMCALLS_SUBPANEL_TITLE' => 'Calls',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
|
||||
'LBL_ECMCALLS' => 'Calls',
|
||||
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Documents',
|
||||
|
||||
// FOR MENU LABELS
|
||||
'LNK_NEW_ECMCALLS' => 'New Call',
|
||||
'LNK_LIST_ECMCALL' => 'Calls List',
|
||||
|
||||
// FOR MENU LINKS
|
||||
'LNK_NEW_ECMCALL' => 'New Call',
|
||||
'LNK_ECMCALLS_LIST' => 'Calls',
|
||||
'LNK_ECMCALLS_SETTINGS' => 'Calls Settings',
|
||||
'LNK_ECMCALLS_REPORTS' => 'Calls Reports',
|
||||
// FOR ADDITIONAL MENUS
|
||||
|
||||
// FOR DASHLETS
|
||||
'LBL_LIST_ECMCALLS' => 'Calls',
|
||||
|
||||
'LBL_ASSIGN_MENU_TITLE' => 'Assign number:',
|
||||
'LBL_ASSIGN_MENU_PARENT_NAME' => 'To',
|
||||
'LBL_ASSIGN_MENU_PARENT_PHONE' => 'Save To',
|
||||
'LBL_ASSIGN_MENU_NEW_NUMBER' => 'New Number',
|
||||
'LBL_ASSIGN_MENU_SAVE_BUTTON' => 'Save',
|
||||
'LBL_ASSIGN_MENU_CANCEL_BUTTON' => 'Cancel',
|
||||
'LBL_ASSIGN_MENU_SELECT_BUTTON' => 'Select',
|
||||
'LBL_ASSIGN_MENU_CLEAR_BUTTON' => 'Clear',
|
||||
'LBL_ASSIGN_MENU_CREATE_BUTTON' => 'Create',
|
||||
'LBL_ASSIGN_MENU_SAVE_SUCCESS' => 'Save success!',
|
||||
'LBL_ASSIGN_MENU_SAVE_FAILURE' => 'Save Error!',
|
||||
'LBL_ASSIGN_MENU_UPDATE_RECORDS' => 'Update records',
|
||||
|
||||
|
||||
'LBL_INCOMING_LESS_THAN' => 'Incoming, duration <= ',
|
||||
'LBL_INCOMING_MORE_THAN' => 'Incoming, duration > ',
|
||||
'LBL_OUTGOING_LESS_THAN' => 'Outgoing, duration <= ',
|
||||
'LBL_OUTGOING_MORE_THAN' => 'Outgoing, duration > ',
|
||||
|
||||
'LBL_PARENT_FROM' => 'Employees',
|
||||
'LBL_CALL_TYPE' => 'Type',
|
||||
'LBL_ECMCALLS_WATCH' => 'Watch:',
|
||||
|
||||
'LBL_NUMBER_OWNER_TYPE_ACCOUNTS' => 'Account',
|
||||
'LBL_NUMBER_OWNER_TYPE_CONTACTS' => 'Contact',
|
||||
'LBL_NUMBER_OWNER_TYPE_USERS' => 'Employee',
|
||||
'LBL_NUMBER_OWNER_TYPE_OTHERS' => 'Other',
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
210
modules/EcmCalls/language/pl_pl.lang.php
Executable file
210
modules/EcmCalls/language/pl_pl.lang.php
Executable file
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
// FOR SYSTEM USE
|
||||
'LBL_MODULE_NAME' => 'Połączenia',
|
||||
'LBL_MODULE_TITLE' => 'Połączenia: Strona Główna',
|
||||
'LBL_MODULE_ID' => 'Połączenia',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Wyszukiwanie',
|
||||
'LBL_LIST_FORM_TITLE' => 'Lista Połączeń',
|
||||
'LBL_NEW_FORM_TITLE' => 'Nowe Połączenie',
|
||||
'LBL_ECMCALLS' => 'Połączenia:',
|
||||
'LBL_ECMCALLS_SUBJECT' => 'Połączenie:',
|
||||
'LBL_SYSTEM_ID' => 'System ID',
|
||||
|
||||
'LBL_DASHLET_MY_ECMCALLS' => 'Moje Ostatnie Połączenia',
|
||||
|
||||
|
||||
'LBL_ID'=>'ID',
|
||||
'LBL_DELETED'=>'Usunięte',
|
||||
'LBL_CALLDATE'=>'Data Połączenia',
|
||||
'LBL_CLID'=>'Clid',
|
||||
'LBL_SRC'=>'Źródło',
|
||||
'LBL_DST'=>'Przeznaczenie',
|
||||
'LBL_DCONTEXT'=>'Dcontext',
|
||||
'LBL_CHANNEL'=>'Kanał',
|
||||
'LBL_DSTCHANNEL'=>'Kanał Przeznaczenia',
|
||||
'LBL_LASTAPP'=>'Ostatnia Aplikacja',
|
||||
'LBL_LASTDATA'=>'Ostatnia Data',
|
||||
'LBL_DURATION'=>'Czas',
|
||||
'LBL_BILLSEC'=>'Czas Rozmowy',
|
||||
'LBL_DISPOSITION'=>'Status',
|
||||
'LBL_AMAFLAGS'=>'Amaflags',
|
||||
'LBL_ACCOUNTCODE'=>'Kod Firmy',
|
||||
'LBL_USERFIELD'=>'Użytkownik',
|
||||
|
||||
'LBL_ADDRESS' => 'Adres:',
|
||||
|
||||
'LBL_CALLDATE_FROM' => 'Data Połączenia Od:',
|
||||
'LBL_CALLDATE_TO' => 'Data Połączenia Do:',
|
||||
'LBL_FROM' => 'Od:',
|
||||
'LBL_TO' => 'Do:',
|
||||
'LBL_OWN_PHONES' => 'Własne Centralne Telefony:',
|
||||
'LBL_CENTRAL_PHONE' => 'Telefon Centralny',
|
||||
|
||||
'LBL_ECMCALLS_SETTINGS_TITLE' => 'Połączenia: Ustawienia',
|
||||
'LBL_CENTRAL_AREACODE' => 'Kod strefy',
|
||||
'LBL_CENTRAL_TIMEZONE' => 'Strefa Czasowa',
|
||||
'LBL_EDIT_TITLE' => 'Edycja',
|
||||
'LBL_CANCEL_TITLE' => 'Anuluj',
|
||||
'LBL_SAVE_TITLE' => 'Zapisz',
|
||||
'LBL_NOTE_TITLE' => 'Zanotuj',
|
||||
'LBL_NOTE_LENGTH' => 'Dugość:',
|
||||
'LBL_NOTE' => 'Zanotuj:',
|
||||
|
||||
'LBL_INSERT_NEW_ROW' => 'Wstaw Nowy Wiersz',
|
||||
'LBL_DELETE_ROW' => 'Usuń Wiersz',
|
||||
'LBL_MOVE_ROW_UP' => 'W górę',
|
||||
'LBL_MOVE_ROW_DOWN' => 'W dół',
|
||||
|
||||
'LBL_IN_OUT_FROM' => 'In/Out Połączenia',
|
||||
|
||||
// FOR LIST VIEW
|
||||
'LBL_LIST_NAME' => 'Nazwa',
|
||||
'LBL_LIST_SUBJECT' => 'Tytuł',
|
||||
'LBL_LIST_LAST_MODIFIED' => 'Ostatnio Modyfikowane',
|
||||
'LBL_LIST_MY_ECMCALLS' => 'Moje Przypisane Połączenia',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przypisany Użytkownik',
|
||||
'LBL_LIST_CODE' => 'Kod',
|
||||
'LBL_LIST_SELLING_PRICE' => 'Cena',
|
||||
'LBL_LIST_DESCRIPTION' => 'Opis',
|
||||
|
||||
// FOR NOTIFICATION POPUPS
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this call?',
|
||||
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the Call?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this call from this account?',
|
||||
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the call.',
|
||||
|
||||
// FOR DEFAULT FIELDS
|
||||
'LBL_NAME' => 'Nazwa:',
|
||||
'LBL_SUBJECT' => 'Nazwa:',
|
||||
'LBL_CREATED_BY' => 'Utworzone Przez:',
|
||||
'LBL_CREATED' => 'Utworzone Przez:',
|
||||
'LBL_ASSIGNED_TO' => 'Przypisane Do:',
|
||||
'LBL_ASSIGNED_USER_ID' => 'Przypisane Do:',
|
||||
'LBL_DATE_ENTERED' => 'Data Utworzenia:',
|
||||
'LBL_DATE_CREATED' => 'Data Utworzenia:',
|
||||
'LBL_DATE_MODIFIED' => 'Ostatnio Modyfikowane',
|
||||
'LBL_MODIFIED_BY' => 'Ostatnio Modyfikowane Przez:',
|
||||
'LBL_MODIFIED' => 'Modyfikowane Przez:',
|
||||
'LBL_DATE_LAST_MODIFIED' => 'Data Modyfikacji:',
|
||||
|
||||
// FOR NEW FIELDS
|
||||
'LBL_CODE' => 'Kod:',
|
||||
'LBL_PURCHASE_PRICE' => 'Cena Zakupu:',
|
||||
'LBL_SELLING_PRICE' => 'Cena Sprzedaży:',
|
||||
'LBL_DESCRIPTION' => 'Opis:',
|
||||
'LBL_VAT' => 'Vat:',
|
||||
'LBL_CATEGORY' => 'Kategoria:',
|
||||
'LBL_UNIT' => 'J.m.:',
|
||||
'LBL_CURRENCY' => 'Waluta:',
|
||||
|
||||
'LBL_FILES' => 'Pliki:',
|
||||
'LBL_ADD_FILE' => 'Dodaj Plik',
|
||||
'LBL_ADD_DOCUMENT' => 'Dodaj Dokument',
|
||||
|
||||
// FOR GROUPS
|
||||
'LBL_GROUP_MASTER' => 'ECMCALL INFORMATION',
|
||||
'LBL_GROUP_CODE' => '',
|
||||
'LBL_GROUP_PRICE' => '',
|
||||
'LBL_GROUP_DESCRIPTION' => '',
|
||||
// FOR SUBPANELS
|
||||
'LBL_ECMCALLS_SUBPANEL_TITLE' => 'Połączenia',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Aktywności',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'Historia',
|
||||
'LBL_ECMCALLS' => 'Połączenia',
|
||||
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Documenty',
|
||||
|
||||
// FOR MENU LABELS
|
||||
'LNK_NEW_ECMCALLS' => 'Nowe Połączenie',
|
||||
'LNK_LIST_ECMCALL' => 'Lista Połączeń',
|
||||
|
||||
// FOR MENU LINKS
|
||||
'LNK_NEW_ECMCALL' => 'Nowe Połączenie',
|
||||
'LNK_ECMCALLS_LIST' => 'Połączenia',
|
||||
'LNK_ECMCALLS_SETTINGS' => 'Ustawienia Połączeń',
|
||||
'LNK_ECMCALLS_REPORTS' => 'Raport Połączeń',
|
||||
// FOR ADDITIONAL MENUS
|
||||
|
||||
// FOR DASHLETS
|
||||
'LBL_LIST_ECMCALLS' => 'Połączenia',
|
||||
|
||||
'LBL_ASSIGN_MENU_TITLE' => 'Przypisz Numer:',
|
||||
'LBL_ASSIGN_MENU_PARENT_NAME' => 'Do',
|
||||
'LBL_ASSIGN_MENU_PARENT_PHONE' => 'Zapisz Do',
|
||||
'LBL_ASSIGN_MENU_NEW_NUMBER' => 'Nowy Numer',
|
||||
'LBL_ASSIGN_MENU_SAVE_BUTTON' => 'Zapisz',
|
||||
'LBL_ASSIGN_MENU_CANCEL_BUTTON' => 'Anuluj',
|
||||
'LBL_ASSIGN_MENU_SELECT_BUTTON' => 'Wybierz',
|
||||
'LBL_ASSIGN_MENU_CLEAR_BUTTON' => 'Wyczyść',
|
||||
'LBL_ASSIGN_MENU_CREATE_BUTTON' => 'Utwórz',
|
||||
'LBL_ASSIGN_MENU_SAVE_SUCCESS' => 'Zapis udany!',
|
||||
'LBL_ASSIGN_MENU_SAVE_FAILURE' => 'Błąd zapisu!',
|
||||
'LBL_ASSIGN_MENU_UPDATE_RECORDS' => 'Uaktualnij rekordy',
|
||||
|
||||
|
||||
'LBL_INCOMING_LESS_THAN' => 'Przychodzące, czas <= ',
|
||||
'LBL_INCOMING_MORE_THAN' => 'Przychodzące, czas > ',
|
||||
'LBL_OUTGOING_LESS_THAN' => 'Wychodzące, czas <= ',
|
||||
'LBL_OUTGOING_MORE_THAN' => 'Wychodzące, czas > ',
|
||||
|
||||
'LBL_PARENT_FROM' => 'Pracownicy',
|
||||
'LBL_CALL_TYPE' => 'Typ',
|
||||
'LBL_ECMCALLS_WATCH' => 'Sledź:',
|
||||
|
||||
'LBL_NUMBER_OWNER_TYPE_ACCOUNTS' => 'Firma',
|
||||
'LBL_NUMBER_OWNER_TYPE_CONTACTS' => 'Kontakt',
|
||||
'LBL_NUMBER_OWNER_TYPE_USERS' => 'Pracownik',
|
||||
'LBL_NUMBER_OWNER_TYPE_OTHERS' => 'Pozostałe',
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
181
modules/EcmCalls/language/pl_pl.lang2.php
Executable file
181
modules/EcmCalls/language/pl_pl.lang2.php
Executable file
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
// FOR SYSTEM USE
|
||||
'LBL_MODULE_NAME' => 'Calls',
|
||||
'LBL_MODULE_TITLE' => 'Calls: Home',
|
||||
'LBL_MODULE_ID' => 'Calls',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Calls Search',
|
||||
'LBL_LIST_FORM_TITLE' => 'Calls List',
|
||||
'LBL_NEW_FORM_TITLE' => 'New Calls',
|
||||
'LBL_ECMCALLS' => 'Calls:',
|
||||
'LBL_ECMCALLS_SUBJECT' => 'Calls Subject:',
|
||||
'LBL_SYSTEM_ID' => 'System ID',
|
||||
|
||||
'LBL_DASHLET_MY_ECMCALLS' => 'My Last Calls',
|
||||
|
||||
|
||||
'LBL_ID'=>'ID',
|
||||
'LBL_DELETED'=>'Deleted',
|
||||
'LBL_CALLDATE'=>'Call Date',
|
||||
'LBL_CLID'=>'Clid',
|
||||
'LBL_SRC'=>'Source',
|
||||
'LBL_DST'=>'Destination',
|
||||
'LBL_DCONTEXT'=>'Dcontext',
|
||||
'LBL_CHANNEL'=>'Channel',
|
||||
'LBL_DSTCHANNEL'=>'Destination Channel',
|
||||
'LBL_LASTAPP'=>'Last Application',
|
||||
'LBL_LASTDATA'=>'Last Data',
|
||||
'LBL_DURATION'=>'Duration',
|
||||
'LBL_BILLSEC'=>'Billsec',
|
||||
'LBL_DISPOSITION'=>'Disposition',
|
||||
'LBL_AMAFLAGS'=>'Amaflags',
|
||||
'LBL_ACCOUNTCODE'=>'Account Code',
|
||||
'LBL_USERFIELD'=>'User Field',
|
||||
|
||||
'LBL_ADDRESS' => 'Address:',
|
||||
|
||||
'LBL_CALLDATE_FROM' => 'Call Date From:',
|
||||
'LBL_CALLDATE_TO' => 'Call Date To:',
|
||||
'LBL_FROM' => 'From:',
|
||||
'LBL_TO' => 'To:',
|
||||
'LBL_OWN_PHONES' => 'Own Central Phones:',
|
||||
'LBL_CENTRAL_PHONE' => 'Central Phone',
|
||||
|
||||
'LBL_ECMCALLS_SETTINGS_TITLE' => 'Calls: Settings',
|
||||
'LBL_CENTRAL_AREACODE' => 'Central Areacode',
|
||||
'LBL_CENTRAL_TIMEZONE' => 'Central TimeZone',
|
||||
'LBL_EDIT_TITLE' => 'Edit',
|
||||
'LBL_CANCEL_TITLE' => 'Cancel',
|
||||
'LBL_SAVE_TITLE' => 'Save',
|
||||
'LBL_NOTE_TITLE' => 'Note',
|
||||
'LBL_NOTE_LENGTH' => 'Length:',
|
||||
'LBL_NOTE' => 'Note',
|
||||
|
||||
'LBL_INSERT_NEW_ROW' => 'Insert New Row',
|
||||
'LBL_DELETE_ROW' => 'Delete Row',
|
||||
'LBL_MOVE_ROW_UP' => 'Move Up',
|
||||
'LBL_MOVE_ROW_DOWN' => 'Move Down',
|
||||
|
||||
'LBL_IN_OUT_FROM' => 'In/Out Calls',
|
||||
|
||||
// FOR LIST VIEW
|
||||
'LBL_LIST_NAME' => 'Name',
|
||||
'LBL_LIST_SUBJECT' => 'Subject',
|
||||
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
|
||||
'LBL_LIST_MY_ECMCALLS' => 'My Assigned EcmCalls',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
|
||||
'LBL_LIST_CODE' => 'code',
|
||||
'LBL_LIST_SELLING_PRICE' => 'Price',
|
||||
'LBL_LIST_DESCRIPTION' => 'Description',
|
||||
|
||||
// FOR NOTIFICATION POPUPS
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this call?',
|
||||
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the Call?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this call from this account?',
|
||||
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the call.',
|
||||
|
||||
// FOR DEFAULT FIELDS
|
||||
'LBL_NAME' => 'Name:',
|
||||
'LBL_SUBJECT' => 'Name:',
|
||||
'LBL_CREATED_BY' => 'Created by:',
|
||||
'LBL_CREATED' => 'Created by:',
|
||||
'LBL_ASSIGNED_TO' => 'Assigned to:',
|
||||
'LBL_ASSIGNED_USER_ID' => 'Assigned To:',
|
||||
'LBL_DATE_ENTERED' => 'Date Created:',
|
||||
'LBL_DATE_CREATED' => 'Create Date:',
|
||||
'LBL_DATE_MODIFIED' => 'Last Modified',
|
||||
'LBL_MODIFIED_BY' => 'Last Modified by:',
|
||||
'LBL_MODIFIED' => 'Modified by:',
|
||||
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
|
||||
|
||||
// FOR NEW FIELDS
|
||||
'LBL_CODE' => 'Code:',
|
||||
'LBL_PURCHASE_PRICE' => 'Purchase Price:',
|
||||
'LBL_SELLING_PRICE' => 'Selling Price:',
|
||||
'LBL_DESCRIPTION' => 'Description:',
|
||||
'LBL_VAT' => 'Vat:',
|
||||
'LBL_CATEGORY' => 'Category:',
|
||||
'LBL_UNIT' => 'Unit:',
|
||||
'LBL_CURRENCY' => 'Currency:',
|
||||
|
||||
'LBL_FILES' => 'Files:',
|
||||
'LBL_ADD_FILE' => 'Add File',
|
||||
'LBL_ADD_DOCUMENT' => 'Add Document',
|
||||
|
||||
// FOR GROUPS
|
||||
'LBL_GROUP_MASTER' => 'ECMCALL INFORMATION',
|
||||
'LBL_GROUP_CODE' => '',
|
||||
'LBL_GROUP_PRICE' => '',
|
||||
'LBL_GROUP_DESCRIPTION' => '',
|
||||
// FOR SUBPANELS
|
||||
'LBL_ECMCALLS_SUBPANEL_TITLE' => 'Calls',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
|
||||
'LBL_ECMCALLS' => 'Calls',
|
||||
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Documents',
|
||||
|
||||
// FOR MENU LABELS
|
||||
'LNK_NEW_ECMCALLS' => 'New Call',
|
||||
'LNK_LIST_ECMCALL' => 'Calls List',
|
||||
|
||||
// FOR MENU LINKS
|
||||
'LNK_NEW_ECMCALL' => 'New Call',
|
||||
'LNK_ECMCALLS_LIST' => 'Calls',
|
||||
'LNK_ECMCALLS_SETTINGS' => 'Calls Settings',
|
||||
'LNK_ECMCALLS_REPORTS' => 'Calls Reports',
|
||||
// FOR ADDITIONAL MENUS
|
||||
|
||||
// FOR DASHLETS
|
||||
'LBL_LIST_ECMCALLS' => 'Calls',
|
||||
);
|
||||
|
||||
?>
|
||||
60
modules/EcmCalls/metadata/SearchFields.php
Executable file
60
modules/EcmCalls/metadata/SearchFields.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$searchFields['EcmCalls'] = array (
|
||||
'userfield' => array('query_type' => 'default'),
|
||||
'accountcode' => array('query_type' => 'default'),
|
||||
'src' => array('query_type' => 'default'),
|
||||
'dst' => array('query_type' => 'default'),
|
||||
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true),
|
||||
//'parent_from'=> array('query_type'=>'default','options' => 'bug_release_dom', 'template_var' => 'PARENT_FROM_OPTIONS', 'options_add_blank' => true),
|
||||
);
|
||||
|
||||
?>
|
||||
89
modules/EcmCalls/metadata/additionalDetails2.php
Executable file
89
modules/EcmCalls/metadata/additionalDetails2.php
Executable file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/utils.php');
|
||||
|
||||
function additionalDetailsEcmCall($fields) {
|
||||
static $mod_strings;
|
||||
global $app_strings;
|
||||
if(empty($mod_strings)) {
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, 'EcmCalls');
|
||||
}
|
||||
|
||||
$overlib_string = '';
|
||||
|
||||
//BUILDER:START overlibstring
|
||||
if(!empty($fields['CODE'])){
|
||||
$overlib_string .= '<b>'. $mod_strings['LBL_CODE'] . '</b> ' . substr($fields['CODE'], 0, 300);
|
||||
if(strlen($fields['CODE']) > 300) $overlib_string .= '...';
|
||||
$overlib_string .= '<br>';
|
||||
}
|
||||
if(!empty($fields['SELLING_PRICE'])){
|
||||
$overlib_string .= '<b>'. $mod_strings['LBL_SELLING_PRICE'] . '</b> ' . substr($fields['SELLING_PRICE'], 0, 300);
|
||||
if(strlen($fields['SELLING_PRICE']) > 300) $overlib_string .= '...';
|
||||
$overlib_string .= '<br>';
|
||||
}
|
||||
if(!empty($fields['DESCRIPTION'])){
|
||||
$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
|
||||
if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
|
||||
$overlib_string .= '<br>';
|
||||
}
|
||||
//BUILDER:END overlibstring
|
||||
|
||||
return array(
|
||||
'fieldToAddTo' => 'NAME',
|
||||
'string' => $overlib_string,
|
||||
'editLink' => "index.php?action=EditView&module=EcmCalls&return_module=EcmCalls&record={$fields['ID']}",
|
||||
'viewLink' => "index.php?action=DetailView&module=EcmCalls&return_module=EcmCalls&record={$fields['ID']}");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
82
modules/EcmCalls/metadata/detailviewdefs.php
Executable file
82
modules/EcmCalls/metadata/detailviewdefs.php
Executable file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
* *******************************************************************************/
|
||||
|
||||
global $app_list_strings;
|
||||
|
||||
$viewdefs['EcmCalls']['DetailView'] = array (
|
||||
'templateMeta' => array (
|
||||
'form' => array (
|
||||
'buttons' => array ('EDIT', 'DUPLICATE', 'DELETE'),
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array (
|
||||
array ('label' => '10', 'field' => '30'),
|
||||
array ('label' => '10', 'field' => '30')
|
||||
),
|
||||
'includes' => array(
|
||||
),
|
||||
),
|
||||
|
||||
'panels' => array (
|
||||
array('name', 'assigned_user_name'),
|
||||
array(
|
||||
'code',
|
||||
array(
|
||||
'customCode' => '{$fields.purchase_price.value} {$CURRENCY_SYMBOL}'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'category_id',
|
||||
array(
|
||||
'customCode' => '{$fields.selling_price.value} {$CURRENCY_SYMBOL}'
|
||||
)
|
||||
),
|
||||
array('vat_id', 'unit_id'),
|
||||
array(
|
||||
'',
|
||||
array(
|
||||
'label' => 'LBL_CURRENCY',
|
||||
'customCode' => '{$CURRENCY_NAME}',
|
||||
)
|
||||
),
|
||||
array('description'),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
88
modules/EcmCalls/metadata/editviewdefs.php
Executable file
88
modules/EcmCalls/metadata/editviewdefs.php
Executable file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
* *******************************************************************************/
|
||||
|
||||
global $sugar_config;
|
||||
|
||||
$viewdefs['EcmCalls']['EditView'] = array (
|
||||
|
||||
'templateMeta' => array (
|
||||
'form' => array (
|
||||
'buttons'=>array('SAVE', 'CANCEL',),
|
||||
),
|
||||
|
||||
'maxColumns' => '2',
|
||||
|
||||
'widths' => array (
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
|
||||
'includes' => array(
|
||||
array('file'=>'include/JSON.js'),
|
||||
array('file'=>'include/javascript/quicksearch.js'),
|
||||
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
'panels' => array (
|
||||
array(
|
||||
array(
|
||||
'name' => 'name',
|
||||
'tabindex' => 'n',
|
||||
'customCode' => '<textarea id="name" name="name" maxlength="5120" cols="70" rows="3">{$fields.name.value}</textarea>',
|
||||
),
|
||||
'assigned_user_name'),
|
||||
array('code', 'purchase_price'),
|
||||
array('category_id', 'selling_price'),
|
||||
array('vat_id', 'unit_id'),
|
||||
array(
|
||||
'',
|
||||
array(
|
||||
'label' => 'LBL_CURRENCY',
|
||||
'tabindex' => 'c',
|
||||
'customCode' => '<select id="currency_id" name="currency_id">{$CURRENCY_OPTIONS}</select>'
|
||||
)
|
||||
),
|
||||
array('description'),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
162
modules/EcmCalls/metadata/listviewdefs.php
Executable file
162
modules/EcmCalls/metadata/listviewdefs.php
Executable file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$listViewDefs['EcmCalls'] = array(
|
||||
|
||||
'TYPE_IMG' => array(
|
||||
'width' => 2,
|
||||
'default' => true,
|
||||
'label' => ' ',
|
||||
'sortable' => false,
|
||||
),
|
||||
|
||||
'DISPOSITION' => array(
|
||||
'width' => 5,
|
||||
'default' => true,
|
||||
'label' => 'LBL_DISPOSITION',
|
||||
),
|
||||
|
||||
'CALLDATE' => array(
|
||||
'width' => 10,
|
||||
'default' => true,
|
||||
'label' => 'LBL_CALLDATE',
|
||||
),
|
||||
|
||||
'CLID' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_CLID',
|
||||
),
|
||||
|
||||
'SRC' => array(
|
||||
'width' => 15,
|
||||
'default' => true,
|
||||
'label' => 'LBL_SRC',
|
||||
),
|
||||
|
||||
'DST' => array(
|
||||
'width' => 15,
|
||||
'default' => true,
|
||||
'label' => 'LBL_DST',
|
||||
),
|
||||
|
||||
'DCONTEXT' => array(
|
||||
'width' => 10,
|
||||
'default' => false,
|
||||
'label' => 'LBL_DCONTEXT',
|
||||
),
|
||||
|
||||
'CHANNEL' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_CHANNEL',
|
||||
),
|
||||
|
||||
'DSTCHANNEL' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_DSTCHANNEL',
|
||||
),
|
||||
|
||||
'LASTAPP' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_LASTAPP',
|
||||
),
|
||||
|
||||
'LASTDATA' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_LASTDATA',
|
||||
),
|
||||
|
||||
'DURATION' => array(
|
||||
'width' => 5,
|
||||
'default' => true,
|
||||
'align' => 'center',
|
||||
'label' => 'LBL_DURATION',
|
||||
),
|
||||
|
||||
'BILLSEC' => array(
|
||||
'width' => 5,
|
||||
'default' => true,
|
||||
'align' => 'center',
|
||||
'label' => 'LBL_BILLSEC',
|
||||
),
|
||||
|
||||
'AMAFLAGS' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_AMAFLAGS',
|
||||
),
|
||||
|
||||
'ACCOUNTCODE' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_ACCOUNTCODE',
|
||||
),
|
||||
|
||||
'USERFIELD' => array(
|
||||
'width' => 20,
|
||||
'default' => false,
|
||||
'label' => 'LBL_USERFIELD',
|
||||
),
|
||||
'HINT' => array(
|
||||
'width' => 2,
|
||||
'default' => true,
|
||||
'label' => ' ',
|
||||
'sortable' => false,
|
||||
),
|
||||
);
|
||||
?>
|
||||
62
modules/EcmCalls/metadata/popupdefs.php
Executable file
62
modules/EcmCalls/metadata/popupdefs.php
Executable file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$popupMeta = array(
|
||||
'moduleMain' => 'EcmCall',
|
||||
'varName' => 'ECMCALL',
|
||||
'orderBy' => 'ecmcalls.name',
|
||||
'whereClauses' => array(
|
||||
'name' => 'ecmcalls.name',
|
||||
'selling_price' => 'ecmcalls.selling_price',
|
||||
'code' => 'ecmcalls.code',
|
||||
),
|
||||
'searchInputs' => array('name', 'name')
|
||||
);
|
||||
?>
|
||||
57
modules/EcmCalls/metadata/searchdefs.php
Executable file
57
modules/EcmCalls/metadata/searchdefs.php
Executable file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
$searchdefs['EcmCalls'] = array (
|
||||
'templateMeta' => array (
|
||||
'maxColumns' => '2',
|
||||
'widths' => array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
),
|
||||
'layout' => array (
|
||||
'basic_search' => array (
|
||||
array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
|
||||
),
|
||||
'advanced_search' => array (
|
||||
array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
87
modules/EcmCalls/metadata/settingsviewdefs.php
Executable file
87
modules/EcmCalls/metadata/settingsviewdefs.php
Executable file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
* *******************************************************************************/
|
||||
|
||||
global $sugar_config;
|
||||
|
||||
$viewdefs['EcmCalls']['SettingsView'] = array (
|
||||
|
||||
'templateMeta' => array (
|
||||
'form' => array (
|
||||
'buttons'=>array('SAVE', 'CANCEL',),
|
||||
),
|
||||
|
||||
'maxColumns' => '2',
|
||||
|
||||
'widths' => array (
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
|
||||
'includes' => array(
|
||||
array('file'=>'include/JSON.js'),
|
||||
array('file'=>'include/javascript/quicksearch.js'),
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
'panels' => array (
|
||||
array(
|
||||
array(
|
||||
'name' => 'name',
|
||||
'tabindex' => 'n',
|
||||
'customCode' => '<textarea id="name" name="name" maxlength="5120" cols="70" rows="3">{$fields.name.value}</textarea>',
|
||||
),
|
||||
'assigned_user_name'),
|
||||
array('code', 'purchase_price'),
|
||||
array('category_id', 'selling_price'),
|
||||
array('vat_id', 'unit_id'),
|
||||
array(
|
||||
'',
|
||||
array(
|
||||
'label' => 'LBL_CURRENCY',
|
||||
'tabindex' => 'c',
|
||||
'customCode' => '<select id="currency_id" name="currency_id">{$CURRENCY_OPTIONS}</select>'
|
||||
)
|
||||
),
|
||||
array('description'),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
68
modules/EcmCalls/metadata/studio.php
Executable file
68
modules/EcmCalls/metadata/studio.php
Executable file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$GLOBALS['studioDefs']['EcmCalls'] = array(
|
||||
'LBL_DETAILVIEW'=>array(
|
||||
'template' => 'xtpl',
|
||||
'meta_file' => 'modules/EcmCalls/detailviewdefs.php',
|
||||
'type' => 'DetailView',
|
||||
),
|
||||
'LBL_EDITVIEW'=>array(
|
||||
'template' => 'xtpl',
|
||||
'meta_file' => 'modules/EcmCalls/editviewdefs.php',
|
||||
'type' => 'EditView',
|
||||
),
|
||||
'LBL_LISTVIEW'=>array(
|
||||
'template' => 'xtpl',
|
||||
'meta_file' => 'modules/EcmCalls/listviewdefs.php',
|
||||
'type' => 'ListView',
|
||||
),
|
||||
|
||||
);
|
||||
55
modules/EcmCalls/metadata/subpaneldefs.php
Executable file
55
modules/EcmCalls/metadata/subpaneldefs.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* Layout definition for Accounts
|
||||
*
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
/*
|
||||
$layout_defs['EcmCalls']['subpanel_setup']['documents'] = array(
|
||||
'order' => 15,
|
||||
'module' => 'Documents',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'date_modified',
|
||||
'get_subpanel_data' => 'documents',
|
||||
'add_subpanel_data' => 'document_id',
|
||||
'subpanel_name' => 'ForEcmCalls',
|
||||
'title_key' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton'),
|
||||
),
|
||||
);
|
||||
*/
|
||||
?>
|
||||
122
modules/EcmCalls/metadata/subpanels/default.php
Executable file
122
modules/EcmCalls/metadata/subpanels/default.php
Executable file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
$no_in_modules = array("Studio", "ModuleBuilder");
|
||||
if(!in_array($_REQUEST['module'], $no_in_modules)) {
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
EcmCall::loadCallsSettings();
|
||||
}
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmCalls'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
'list_fields' => array(
|
||||
|
||||
'type_img' => array(
|
||||
'width' => '2%',
|
||||
'vname' => ' ',
|
||||
'sortable' => false,
|
||||
),
|
||||
|
||||
'disposition' => array(
|
||||
'width' => '5%',
|
||||
'vname' => 'LBL_DISPOSITION',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'calldate' => array(
|
||||
'width' => '10%',
|
||||
'vname' => 'LBL_CALLDATE',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'src' => array(
|
||||
'width' => '15%',
|
||||
'vname' => 'LBL_SRC',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'dst' => array(
|
||||
'width' => '15%',
|
||||
'vname' => 'LBL_DST',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'duration' => array(
|
||||
'width' => '5%',
|
||||
'align' => 'center',
|
||||
'vname' => 'LBL_DURATION',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'billsec' => array(
|
||||
'width' => '5%',
|
||||
'align' => 'center',
|
||||
'vname' => 'LBL_BILLSEC',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'hint' => array(
|
||||
'width' => '2%',
|
||||
'vname' => ' ',
|
||||
'sortable' => false,
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
|
||||
//$json = getJSONobj(); echo "<input type='hidden' id='EcmCallsSubPanelDefs' value='[".str_replace('"','\"',$json->encode($subpanel_layout['list_fields']))."]'>";
|
||||
|
||||
?>
|
||||
19
modules/EcmCalls/mysql.php
Executable file
19
modules/EcmCalls/mysql.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
// $query = "CREATE TRIGGER id_create BEFORE INSERT ON cdr FOR EACH ROW SET NEW.id = UUID();";
|
||||
// $result = $GLOBALS['db']->query($query);
|
||||
|
||||
$query = "SELECT COUNT(*) FROM `cdr` WHERE `id`=''";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
if($result) {
|
||||
$row = $GLOBALS['db']->fetchByAssoc($result);
|
||||
if($row) {
|
||||
for($i=0; $i<$row["COUNT(*)"]; $i++) {
|
||||
$query = "UPDATE `cdr` SET `id`='".create_guid()."' WHERE `id`='' LIMIT 1";
|
||||
$GLOBALS['db']->query($query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
13
modules/EcmCalls/trigger.php
Executable file
13
modules/EcmCalls/trigger.php
Executable file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$query = "CREATE TRIGGER id_create BEFORE INSERT ON cdr FOR EACH ROW SET NEW.id = UUID();";
|
||||
$query = "CREATE TRIGGER ecmcalls_assign AFTER INSERT ON cdr FOR EACH ROW INSERT INTO ecmcalls_beans (`id`, `ecmcall_id`, `bean_id`, `date_modified`, `deleted`) VALUES (UUID(), (SELECT `id` FROM contacts WHERE `phone_work` LIKE '%'+NEW.src LIMIT 1), NEW.id, NOW(), 0);";
|
||||
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
if($result)
|
||||
echo 'Trigger ustawiony :D';
|
||||
else
|
||||
echo 'Blad ustawienia triggera :(';
|
||||
|
||||
?>
|
||||
288
modules/EcmCalls/vardefs.php
Executable file
288
modules/EcmCalls/vardefs.php
Executable file
@@ -0,0 +1,288 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
$dictionary['EcmCall'] = array(
|
||||
|
||||
'table' => 'cdr',
|
||||
'comment' => 'EcmCalls',
|
||||
'duplicate_merge' => true,
|
||||
'unified_search' => true,
|
||||
|
||||
'fields' => array (
|
||||
|
||||
//STANDARD FIELDS SECTION
|
||||
|
||||
'id' => array (
|
||||
'name' => 'id',
|
||||
'vname' => 'LBL_ID',
|
||||
'type' => 'id',
|
||||
'required' => true,
|
||||
'reportable' => false,
|
||||
'comment' => 'Unique identifier'
|
||||
),
|
||||
|
||||
'deleted' => array (
|
||||
'name' => 'deleted',
|
||||
'vname' => 'LBL_DELETED',
|
||||
'type' => 'bool',
|
||||
'required' => true,
|
||||
'reportable' => false,
|
||||
'comment' => 'Record deletion indicator'
|
||||
),
|
||||
|
||||
'note' => array (
|
||||
'name' => 'note',
|
||||
'vname' => 'LBL_NOTE',
|
||||
'type' => 'varchar',
|
||||
'len' => 1000,
|
||||
),
|
||||
|
||||
//NEW FIELDS SECTION
|
||||
|
||||
'calldate' => array(
|
||||
'name' => 'calldate',
|
||||
'type' => 'datetime',
|
||||
'required' => true,
|
||||
'default' => '0000-00-00 00:00:00',
|
||||
'vname' => 'LBL_CALLDATE',
|
||||
'massupdate' => false,
|
||||
),
|
||||
|
||||
'clid' => array(
|
||||
'name' => 'clid',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_CLID',
|
||||
),
|
||||
|
||||
'src' => array(
|
||||
'name' => 'src',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_SRC',
|
||||
),
|
||||
|
||||
'dst' => array(
|
||||
'name' => 'dst',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_DST',
|
||||
),
|
||||
|
||||
'dcontext' => array(
|
||||
'name' => 'dcontext',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_DCONTEXT',
|
||||
),
|
||||
|
||||
'channel' => array(
|
||||
'name' => 'channel',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_CHANNEL',
|
||||
),
|
||||
|
||||
'dstchannel' => array(
|
||||
'name' => 'dstchannel',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_DSTCHANNEL',
|
||||
),
|
||||
|
||||
'lastapp' => array(
|
||||
'name' => 'lastapp',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_LASTAPP',
|
||||
),
|
||||
|
||||
'lastdata' => array(
|
||||
'name' => 'lastdata',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_LASTDATA',
|
||||
),
|
||||
|
||||
'duration' => array(
|
||||
'name' => 'duration',
|
||||
'type' => 'int',
|
||||
'len' => 11,
|
||||
'default' => 0,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_DURATION',
|
||||
),
|
||||
|
||||
'billsec' => array(
|
||||
'name' => 'billsec',
|
||||
'type' => 'int',
|
||||
'len' => 11,
|
||||
'default' => 0,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_BILLSEC',
|
||||
),
|
||||
|
||||
'disposition' => array(
|
||||
'name' => 'disposition',
|
||||
'type' => 'varchar',
|
||||
'len' => 45,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_DISPOSITION',
|
||||
),
|
||||
|
||||
'amaflags' => array(
|
||||
'name' => 'amaflags',
|
||||
'type' => 'int',
|
||||
'len' => 11,
|
||||
'default' => 0,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_AMAFLAGS',
|
||||
),
|
||||
|
||||
'accountcode' => array(
|
||||
'name' => 'accountcode',
|
||||
'type' => 'varchar',
|
||||
'len' => 20,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_ACCOUNTCODE',
|
||||
),
|
||||
|
||||
'userfield' => array(
|
||||
'name' => 'userfield',
|
||||
'type' => 'varchar',
|
||||
'len' => 255,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_USERFIELD',
|
||||
),
|
||||
|
||||
'parent_from' => array(
|
||||
'name' => 'parent_from',
|
||||
'type' => 'multienum',
|
||||
'vname' => 'LBL_PARENT_FROM',
|
||||
'source' => 'non-db'
|
||||
),
|
||||
|
||||
'call_type' => array(
|
||||
'name' => 'call_type',
|
||||
'vname' => 'LBL_CALL_TYPE',
|
||||
'type' => 'varchar',
|
||||
//'options' => 'ecmcalls_chart_call_type_dom',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
|
||||
'contacts' => array (
|
||||
'name' => 'contacts',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmcalls_contacts',
|
||||
'source' =>'non-db',
|
||||
),
|
||||
|
||||
'accounts' => array (
|
||||
'name' => 'accounts',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmcalls_accounts',
|
||||
'source' =>'non-db',
|
||||
),
|
||||
|
||||
'users' => array (
|
||||
'name' => 'users',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmcalls_users',
|
||||
'source' =>'non-db',
|
||||
),
|
||||
|
||||
'src_old' => array(
|
||||
'name' => 'src_old',
|
||||
'type' => 'varchar',
|
||||
'len' => 80,
|
||||
'required' => true,
|
||||
'vname' => 'LBL_SRC_OLD',
|
||||
),
|
||||
|
||||
//FOR SUBPANELS
|
||||
|
||||
),
|
||||
|
||||
//INDICES SECTION
|
||||
'indices' => array (
|
||||
array('name' => 'calldate', 'type' => 'index', 'fields' => array('calldate')),
|
||||
array('name' => 'dst', 'type' => 'index', 'fields' => array('dst')),
|
||||
array('name' => 'accountcode', 'type' => 'index', 'fields' => array('accountcode')),
|
||||
)
|
||||
|
||||
//RELATIONSHIPS SECTION
|
||||
, 'relationships' => array (
|
||||
'ecmcalls_assigned_user' => array(
|
||||
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'EcmCalls', 'rhs_table'=> 'ecmcalls', 'rhs_key' => 'assigned_user',
|
||||
'relationship_type'=>'one-to-many')
|
||||
|
||||
,'ecmcalls_modified_user' => array(
|
||||
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'EcmCalls', 'rhs_table'=> 'ecmcalls', 'rhs_key' => 'modified_user_id',
|
||||
'relationship_type'=>'one-to-many')
|
||||
|
||||
,'ecmcalls_created_by' => array(
|
||||
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'EcmCalls', 'rhs_table'=> 'ecmcalls', 'rhs_key' => 'created_by',
|
||||
'relationship_type'=>'one-to-many')
|
||||
|
||||
),
|
||||
//THIS FLAG ENABLES OPTIMISTIC LOCKING FOR SAVES FROM EDITVIEW
|
||||
'optimistic_locking'=>true,
|
||||
);
|
||||
?>
|
||||
245
modules/EcmCalls/views/ListView/view.list.my.php
Executable file
245
modules/EcmCalls/views/ListView/view.list.my.php
Executable file
@@ -0,0 +1,245 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
* *******************************************************************************/
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once ('XTemplate/xtpl.php');
|
||||
require_once('include/ListView/ListViewSmarty.php');
|
||||
require_once('modules/SavedSearch/SavedSearch.php');
|
||||
require_once('modules/MySettings/StoreQuery.php');
|
||||
class ViewListMy extends SugarView{
|
||||
var $type ='list';
|
||||
|
||||
function ViewListMy(){
|
||||
parent::SugarView();
|
||||
|
||||
}
|
||||
function processQuickSearch(){
|
||||
require_once('include/QuickSearchDefaults.php');
|
||||
$qsd = new QuickSearchDefaults();
|
||||
echo $qsd->GetQSScripts();
|
||||
}
|
||||
|
||||
function oldSearch(){
|
||||
|
||||
}
|
||||
function newSearch(){
|
||||
|
||||
}
|
||||
|
||||
function display(){
|
||||
if(!$this->bean->ACLAccess('list')){
|
||||
ACLController::displayNoAccess();
|
||||
return;
|
||||
}
|
||||
$module = $GLOBALS['module'];
|
||||
$metadataFile = null;
|
||||
$foundViewDefs = false;
|
||||
if(file_exists('custom/modules/' . $module. '/metadata/listviewdefs.php')){
|
||||
$metadataFile = 'custom/modules/' . $module . '/metadata/listviewdefs.php';
|
||||
$foundViewDefs = true;
|
||||
}else{
|
||||
if(file_exists('custom/modules/'.$module.'/metadata/metafiles.php')){
|
||||
require_once('custom/modules/'.$module.'/metadata/metafiles.php');
|
||||
if(!empty($metafiles[$module]['listviewdefs'])){
|
||||
$metadataFile = $metafiles[$module]['listviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}elseif(file_exists('modules/'.$module.'/metadata/metafiles.php')){
|
||||
require_once('modules/'.$module.'/metadata/metafiles.php');
|
||||
if(!empty($metafiles[$module]['listviewdefs'])){
|
||||
$metadataFile = $metafiles[$module]['listviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$foundViewDefs && file_exists('modules/'.$module.'/metadata/listviewdefs.php')){
|
||||
$metadataFile = 'modules/'.$module.'/metadata/listviewdefs.php';
|
||||
}
|
||||
require_once($metadataFile);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$storeQuery = new StoreQuery();
|
||||
if(!isset($_REQUEST['query'])){
|
||||
$storeQuery->loadQuery($this->module);
|
||||
$storeQuery->populateRequest();
|
||||
}else{
|
||||
$storeQuery->saveFromRequest($this->module);
|
||||
}
|
||||
|
||||
|
||||
$seed = $this->bean;
|
||||
$lv = new ListViewSmarty();
|
||||
$lv->quickViewLinks = false;
|
||||
$displayColumns = array();
|
||||
if(!empty($_REQUEST['displayColumns'])) {
|
||||
foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col) {
|
||||
if(!empty($listViewDefs[$module][$col]))
|
||||
$displayColumns[$col] = $listViewDefs[$module][$col];
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach($listViewDefs[$module] as $col => $params) {
|
||||
if(!empty($params['default']) && $params['default'])
|
||||
$displayColumns[$col] = $params;
|
||||
}
|
||||
}
|
||||
$params = array('massupdate' => false);
|
||||
if(!empty($_REQUEST['orderBy'])) {
|
||||
$params['orderBy'] = $_REQUEST['orderBy'];
|
||||
$params['overrideOrder'] = true;
|
||||
if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
|
||||
}
|
||||
|
||||
$lv->displayColumns = $displayColumns;
|
||||
|
||||
$this->seed = $seed;
|
||||
$this->module = $module;
|
||||
|
||||
$searchForm = null;
|
||||
|
||||
//search
|
||||
$view = 'basic_search';
|
||||
if(!empty($_REQUEST['search_form_view']))
|
||||
$view = $_REQUEST['search_form_view'];
|
||||
$headers = true;
|
||||
if(!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only'])
|
||||
$headers = false;
|
||||
elseif(!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
|
||||
if(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
|
||||
$view = 'advanced_search';
|
||||
}else {
|
||||
$view = 'basic_search';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$use_old_search = true;
|
||||
if(file_exists('modules/'.$this->module.'/SearchForm.html')){
|
||||
require_once('include/SearchForm/SearchForm.php');
|
||||
$searchForm = new SearchForm($this->module, $this->seed);
|
||||
}else{
|
||||
$use_old_search = false;
|
||||
require_once('include/SearchForm/SearchForm2.php');
|
||||
|
||||
|
||||
/* if(!empty($metafiles[$this->module]['searchdefs']))
|
||||
require_once($metafiles[$this->module]['searchdefs']);
|
||||
elseif(file_exists('modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
require_once('modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
*/
|
||||
|
||||
if (file_exists('custom/modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
{
|
||||
require_once('custom/modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
}
|
||||
elseif (!empty($metafiles[$this->module]['searchdefs']))
|
||||
{
|
||||
require_once($metafiles[$this->module]['searchdefs']);
|
||||
}
|
||||
elseif (file_exists('modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
{
|
||||
require_once('modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
}
|
||||
|
||||
|
||||
if(!empty($metafiles[$this->module]['searchfields']))
|
||||
require_once($metafiles[$this->module]['searchfields']);
|
||||
elseif(file_exists('modules/'.$this->module.'/metadata/SearchFields.php'))
|
||||
require_once('modules/'.$this->module.'/metadata/SearchFields.php');
|
||||
|
||||
|
||||
$searchForm = new SearchForm($this->seed, $this->module, $this->action);
|
||||
$searchForm->setup($searchdefs, $searchFields, 'include/SearchForm/tpls/SearchFormGeneric.tpl', $view, $listViewDefs);
|
||||
$searchForm->lv = $lv;
|
||||
}
|
||||
|
||||
if(isset($this->options['show_title']) && $this->options['show_title'] && $headers) {
|
||||
$moduleName = isset($this->seed->module_dir) ? $this->seed->module_dir : $GLOBALS['mod_strings']['LBL_MODULE_NAME'];
|
||||
echo "\n<p>\n";
|
||||
echo get_module_title($moduleName, $GLOBALS['mod_strings']['LBL_MODULE_TITLE'], true);
|
||||
echo "\n</p>\n";
|
||||
}
|
||||
|
||||
$where = '';
|
||||
if(isset($_REQUEST['query']))
|
||||
{
|
||||
// we have a query
|
||||
if(!empty($_SERVER['HTTP_REFERER']) && preg_match('/action=EditView/', $_SERVER['HTTP_REFERER'])) { // from EditView cancel
|
||||
$searchForm->populateFromArray($storeQuery->query);
|
||||
}
|
||||
else {
|
||||
$searchForm->populateFromRequest();
|
||||
}
|
||||
$where_clauses = $searchForm->generateSearchWhere(true, $this->seed->module_dir);
|
||||
if (count($where_clauses) > 0 )$where = '('. implode(' ) AND ( ', $where_clauses) . ')';
|
||||
$GLOBALS['log']->info("List View Where Clause: $where");
|
||||
}
|
||||
if($use_old_search){
|
||||
switch($view) {
|
||||
case 'basic_search':
|
||||
$searchForm->setup();
|
||||
$searchForm->displayBasic($headers);
|
||||
break;
|
||||
case 'advanced_search':
|
||||
$searchForm->setup();
|
||||
$searchForm->displayAdvanced($headers);
|
||||
break;
|
||||
case 'saved_views':
|
||||
echo $searchForm->displaySavedViews($listViewDefs, $lv, $headers);
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
echo $searchForm->display($headers);
|
||||
}
|
||||
if(!$headers)
|
||||
return;
|
||||
|
||||
if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
|
||||
$this->processQuickSearch();
|
||||
$lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where, $params);
|
||||
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
|
||||
echo get_form_header($GLOBALS['mod_strings']['LBL_LIST_FORM_TITLE'] . $savedSearchName, '', false);
|
||||
|
||||
echo $lv->display();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
281
modules/EcmCalls/views/view.list.php
Executable file
281
modules/EcmCalls/views/view.list.php
Executable file
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: This file is used to override the default Meta-data EditView behavior
|
||||
* to provide customization specific to the Calls module.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/MVC/View/views/view.list.php');
|
||||
|
||||
class EcmCallsViewList extends ViewList{
|
||||
|
||||
function EcmCallsViewList(){
|
||||
parent::ViewList();
|
||||
}
|
||||
|
||||
function display(){
|
||||
|
||||
//require_once 'modules/EcmCalls/EcmCall.php';
|
||||
//$this->bean = new EcmCall();
|
||||
|
||||
echo $this->bean;
|
||||
|
||||
|
||||
if(!$this->bean->ACLAccess('list')){
|
||||
ACLController::displayNoAccess();
|
||||
return;
|
||||
}
|
||||
|
||||
//var_dump($_REQUEST);
|
||||
/*
|
||||
if($_REQUEST["current_user_only_basic"] = "on" || $_REQUEST["current_user_only_advanced"] = "on") {
|
||||
$_REQUEST["current_user_only_basic"] = "1";
|
||||
$_REQUEST["current_user_only_advanced"] = "1";
|
||||
$_POST["current_user_only_basic"] = "1";
|
||||
$_POST["current_user_only_advanced"] = "1";
|
||||
}
|
||||
*/
|
||||
//var_dump(ACLController::checkAccess('EcmCalls', "list", false));
|
||||
if(ACLController::checkAccess('EcmCalls', "list", false) == false) {
|
||||
$_REQUEST["current_user_only_basic"] = "1";
|
||||
$_REQUEST["current_user_only_advanced"] = "1";
|
||||
$_REQUEST["current_user_only"] = "1";
|
||||
$_POST["current_user_only_basic"] = "1";
|
||||
$_POST["current_user_only_advanced"] = "1";
|
||||
$_POST["current_user_only"] = "1";
|
||||
}
|
||||
|
||||
echo '<script type="text/javascript" src="include/SugarFields/Fields/Datetimecombo/Datetimecombo.js"></script>';
|
||||
|
||||
|
||||
require_once('modules/EcmCalls/EcmCall.php');
|
||||
EcmCall::loadCentralPhonesToSession();
|
||||
|
||||
$_SESSION['ecmcalls_phones'] = null;
|
||||
|
||||
$module = $GLOBALS['module'];
|
||||
$metadataFile = null;
|
||||
$foundViewDefs = false;
|
||||
if(file_exists('custom/modules/' . $module. '/metadata/listviewdefs.php')){
|
||||
$metadataFile = 'custom/modules/' . $module . '/metadata/listviewdefs.php';
|
||||
$foundViewDefs = true;
|
||||
}else{
|
||||
if(file_exists('custom/modules/'.$module.'/metadata/metafiles.php')){
|
||||
require_once('custom/modules/'.$module.'/metadata/metafiles.php');
|
||||
if(!empty($metafiles[$module]['listviewdefs'])){
|
||||
$metadataFile = $metafiles[$module]['listviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}elseif(file_exists('modules/'.$module.'/metadata/metafiles.php')){
|
||||
require_once('modules/'.$module.'/metadata/metafiles.php');
|
||||
if(!empty($metafiles[$module]['listviewdefs'])){
|
||||
$metadataFile = $metafiles[$module]['listviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$foundViewDefs && file_exists('modules/'.$module.'/metadata/listviewdefs.php')){
|
||||
$metadataFile = 'modules/'.$module.'/metadata/listviewdefs.php';
|
||||
}
|
||||
require_once($metadataFile);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$seed = $this->bean;
|
||||
$lv = new ListViewSmarty();
|
||||
$displayColumns = array();
|
||||
if(!empty($_REQUEST['displayColumns'])) {
|
||||
foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col) {
|
||||
if(!empty($listViewDefs[$module][$col]))
|
||||
$displayColumns[$col] = $listViewDefs[$module][$col];
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach($listViewDefs[$module] as $col => $params) {
|
||||
if(!empty($params['default']) && $params['default'])
|
||||
$displayColumns[$col] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
global $current_user;
|
||||
|
||||
if (!is_admin($current_user)){
|
||||
$params = array( 'massupdate' => false );
|
||||
$lv->export = true;
|
||||
}
|
||||
else{
|
||||
$params = array( 'massupdate' => true, 'export' => true);
|
||||
}
|
||||
|
||||
$lv->quickViewLinks = false;
|
||||
|
||||
if(!empty($_REQUEST['orderBy'])) {
|
||||
$params['orderBy'] = $_REQUEST['orderBy'];
|
||||
$params['overrideOrder'] = true;
|
||||
if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
|
||||
}
|
||||
|
||||
$lv->displayColumns = $displayColumns;
|
||||
|
||||
$this->seed = $seed;
|
||||
$this->module = $module;
|
||||
|
||||
$searchForm = null;
|
||||
$storeQuery = new StoreQuery();
|
||||
if(!isset($_REQUEST['query'])){
|
||||
$storeQuery->loadQuery($this->module);
|
||||
$storeQuery->populateRequest();
|
||||
}else{
|
||||
$storeQuery->saveFromGet($this->module);
|
||||
}
|
||||
|
||||
//search
|
||||
$view = 'basic_search';
|
||||
if(!empty($_REQUEST['search_form_view']))
|
||||
$view = $_REQUEST['search_form_view'];
|
||||
$headers = true;
|
||||
if(!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only'])
|
||||
$headers = false;
|
||||
elseif(!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
|
||||
if(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
|
||||
$view = 'advanced_search';
|
||||
}else {
|
||||
$view = 'basic_search';
|
||||
}
|
||||
}
|
||||
|
||||
$use_old_search = true;
|
||||
if(file_exists('modules/'.$this->module.'/SearchForm.html')){
|
||||
require_once('modules/EcmCalls/SearchForm.php');
|
||||
$searchForm = new EcmCallsSearchForm($this->module, $this->seed);
|
||||
}else{
|
||||
$use_old_search = false;
|
||||
require_once('include/SearchForm/SearchForm2.php');
|
||||
|
||||
|
||||
if (file_exists('custom/modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
{
|
||||
require_once('custom/modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
}
|
||||
elseif (!empty($metafiles[$this->module]['searchdefs']))
|
||||
{
|
||||
require_once($metafiles[$this->module]['searchdefs']);
|
||||
}
|
||||
elseif (file_exists('modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
{
|
||||
require_once('modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
}
|
||||
|
||||
|
||||
if(!empty($metafiles[$this->module]['searchfields']))
|
||||
require_once($metafiles[$this->module]['searchfields']);
|
||||
elseif(file_exists('modules/'.$this->module.'/metadata/SearchFields.php'))
|
||||
require_once('modules/'.$this->module.'/metadata/SearchFields.php');
|
||||
|
||||
|
||||
$searchForm = new SearchForm($this->seed, $this->module, $this->action);
|
||||
$searchForm->setup($searchdefs, $searchFields, 'include/SearchForm/tpls/SearchFormGeneric.tpl', $view, $listViewDefs);
|
||||
$searchForm->lv = $lv;
|
||||
}
|
||||
|
||||
|
||||
if(isset($this->options['show_title']) && $this->options['show_title']) {
|
||||
$moduleName = isset($this->seed->module_dir) ? $this->seed->module_dir : $GLOBALS['mod_strings']['LBL_MODULE_NAME'];
|
||||
echo "\n<p>\n";
|
||||
echo get_module_title($moduleName, $GLOBALS['mod_strings']['LBL_MODULE_TITLE'], true);
|
||||
echo "\n</p>\n";
|
||||
}
|
||||
|
||||
$where = '';
|
||||
if(isset($_REQUEST['query']))
|
||||
{
|
||||
// we have a query
|
||||
if(!empty($_SERVER['HTTP_REFERER']) && preg_match('/action=EditView/', $_SERVER['HTTP_REFERER'])) { // from EditView cancel
|
||||
$searchForm->populateFromArray($storeQuery->query);
|
||||
}
|
||||
else {
|
||||
$searchForm->populateFromRequest();
|
||||
}
|
||||
$where_clauses = $searchForm->generateSearchWhere(true, $this->seed->module_dir);
|
||||
if (count($where_clauses) > 0 )$where = '('. implode(' ) AND ( ', $where_clauses) . ')';
|
||||
$GLOBALS['log']->info("List View Where Clause: $where");
|
||||
}
|
||||
|
||||
if($use_old_search){
|
||||
switch($view) {
|
||||
case 'basic_search':
|
||||
$searchForm->setup();
|
||||
$searchForm->displayBasic($headers);
|
||||
break;
|
||||
case 'advanced_search':
|
||||
$searchForm->setup();
|
||||
$searchForm->displayAdvanced($headers,false,$listViewDefs,$lv);
|
||||
break;
|
||||
case 'saved_views':
|
||||
echo $searchForm->displaySavedViews($listViewDefs, $lv, $headers);
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
echo $searchForm->display($headers);
|
||||
}
|
||||
if(!$headers)
|
||||
return;
|
||||
|
||||
if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
|
||||
//$this->processQuickSearch();
|
||||
if (!is_admin($current_user)){
|
||||
$lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', $where, $params);
|
||||
}
|
||||
else {
|
||||
$lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where, $params);
|
||||
}
|
||||
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
|
||||
echo get_form_header($GLOBALS['mod_strings']['LBL_LIST_FORM_TITLE'] . $savedSearchName, '', false);
|
||||
|
||||
echo $lv->display();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user