init
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,
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
47
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.meta.php
Executable file
47
modules/EcmCalls/Dashlets/MyEcmCallsDashlet/MyEcmCallsDashlet.meta.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?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',
|
||||
'hidden' => true);
|
||||
?>
|
||||
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();
|
||||
|
||||
?>
|
||||
31
modules/EcmCalls/DoCall.js
Executable file
31
modules/EcmCalls/DoCall.js
Executable file
@@ -0,0 +1,31 @@
|
||||
var EcmCalls_DOCALL = true;
|
||||
function CALL(number) {
|
||||
if(!EcmCalls_DOCALL) { EcmCalls_DOCALL = true; return true; }
|
||||
|
||||
YAHOO.util.Connect.asyncRequest(
|
||||
'GET',
|
||||
'index.php?module=EcmCalls&action=DoCall&to_pdf=1&number='+number,
|
||||
{
|
||||
success: function(result) {
|
||||
if(result.responseText == '') return;
|
||||
var iframe = document.getElementById('doCallIFrame');
|
||||
if(!iframe) {
|
||||
iframe = document.createElement('iframe');
|
||||
iframe.id = 'doCallIFrame';
|
||||
iframe.style.display = 'none';
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
if(iframe && result.responseText != '') {
|
||||
//alert('>'+result.responseText+'<');
|
||||
//document.location = result.responseText;
|
||||
iframe.src = result.responseText;
|
||||
}
|
||||
},
|
||||
failure: function () {
|
||||
alert('error');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// if(iframe) iframe.src = 'index.php?module=EcmCalls&action=DoCall&to_pdf=1&number='+number;
|
||||
}
|
||||
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.'';
|
||||
?>
|
||||
1645
modules/EcmCalls/EcmCall.php
Executable file
1645
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 />';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
257
modules/EcmCalls/Hint.js
Executable file
257
modules/EcmCalls/Hint.js
Executable file
@@ -0,0 +1,257 @@
|
||||
|
||||
//Ajax Request - Begin
|
||||
function doRequest(where,post,succes,fail) {
|
||||
this.succes = function(result) { succes(result.responseText); }
|
||||
this.fail = function(result) { fail(result.responseText); }
|
||||
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.succes,failure:this.fail},post);
|
||||
}
|
||||
//Ajax Request - End
|
||||
var lastLockedGuid = '';
|
||||
|
||||
function findPos(obj) {
|
||||
var nleft = 0;
|
||||
var ntop = 0;
|
||||
if (obj.offsetParent) {
|
||||
nleft = obj.offsetLeft
|
||||
ntop = obj.offsetTop
|
||||
while (obj = obj.offsetParent) {
|
||||
nleft += obj.offsetLeft
|
||||
ntop += obj.offsetTop
|
||||
}
|
||||
}
|
||||
return [nleft,ntop];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function showCallHint(ev,guid,id,img,title,call,record,module,id2,chi) {
|
||||
//lock_unlock_Position();
|
||||
//if(lastLockedGuid == guid) return;
|
||||
var div = document.getElementById('hint_div_'+guid);
|
||||
|
||||
if(div.lockPosition == true && div.ec_call_record == record) return;
|
||||
else lock_unlock_Position();
|
||||
div.ec_call_record = record;
|
||||
|
||||
div = ShowAdditionalDetails(title, div, call, module);
|
||||
div.ec_number = call;
|
||||
div.ec_record = record;
|
||||
div.ec_module = module;
|
||||
div.ec_id = id2;
|
||||
div.ec_name = title;
|
||||
div.ec_chi = chi;
|
||||
|
||||
if(!div.ec_number) {
|
||||
document.getElementById("EcmCallsStatusPhoneIcon").style.display = "none";
|
||||
} else {
|
||||
document.getElementById("EcmCallsStatusPhoneIcon").style.display = "";
|
||||
}
|
||||
|
||||
if(!div.ec_module || !div.ec_id) {
|
||||
document.getElementById("EcmCalls_search_img").style.display = "none";
|
||||
document.getElementById("EcmCalls_view_detail_img").style.display = "none";
|
||||
} else {
|
||||
document.getElementById("EcmCalls_view_detail_img").style.display = "";
|
||||
document.getElementById("EcmCalls_search_img").style.display = "";
|
||||
}
|
||||
|
||||
if(chi && chi != '') {
|
||||
var chi_span = document.getElementById('EcmCallsCallHintIcon_'+chi);
|
||||
if(chi_span) {
|
||||
document.getElementById("EcmCallsStatusPhoneIcon").innerHTML = chi_span.innerHTML;
|
||||
}
|
||||
}
|
||||
|
||||
if(!div) return;
|
||||
//if(div.parentNode !== document.body) { div.parentNode_ = div.parentNode; document.body.appendChild(div); }
|
||||
|
||||
div.style.display = '';
|
||||
|
||||
|
||||
|
||||
/* if(typeof(img) != "undefined") {
|
||||
var position = findPos(img);
|
||||
div.style.left = position[0]-div.offsetWidth;
|
||||
div.style .top = position[1];
|
||||
} else {
|
||||
*/
|
||||
ev = ev || window.event;
|
||||
var x = 0; var y = 0;
|
||||
if(ev.pageX || ev.pageY) {
|
||||
x = ev.pageX;
|
||||
y = ev.pageY;
|
||||
} else {
|
||||
x = ev.clientX + document.body.scrollLeft - document.body.clientLeft,
|
||||
y = ev.clientY + document.body.scrollTop - document.body.clientTop
|
||||
}
|
||||
|
||||
|
||||
var ws = getWindowVisibleSize();
|
||||
var sc = getScrollXY();
|
||||
var container = document.getElementById("EcmCallsAdditionalDetailsContainer");
|
||||
var ofw = x-sc[0]+div.offsetWidth+5;
|
||||
|
||||
if(typeof(img) != "undefined" || ofw > ws[0] ) {
|
||||
x = x-10-div.offsetWidth;
|
||||
document.getElementById("EcmCallsAdditionalInfoTopButtons").style.cssFloat = "right";
|
||||
document.getElementById("EcmCallsAdditionalInfoTopButtons").style.styleFloat = "right";
|
||||
} else {
|
||||
x = x+10;
|
||||
document.getElementById("EcmCallsAdditionalInfoTopButtons").style.cssFloat = "left";
|
||||
document.getElementById("EcmCallsAdditionalInfoTopButtons").style.styleFloat = "left";
|
||||
}
|
||||
|
||||
var table1 = document.getElementById("EcmCallsAdditionalDetailsHeader");
|
||||
var table1td = document.getElementById("EcmCallsAdditionalDetailsHeaderTD");
|
||||
var table1div = document.getElementById("EcmCallsAdditionalDetailsHeaderDIV");
|
||||
var table2 = document.getElementById("EcmCallsAdditionalDetailsFooter");
|
||||
var table2td = document.getElementById("EcmCallsAdditionalDetailsFooterTD");
|
||||
var table2div = document.getElementById("EcmCallsAdditionalDetails_description");
|
||||
|
||||
if((y-sc[1]+div.offsetHeight+5) > ws[1]) {
|
||||
if(table1) container.appendChild(table1);
|
||||
table1.className = "olFgClass";
|
||||
// table1td.className = "olFgClass";
|
||||
// table1div.className = "olFontClass";
|
||||
table2.className = "olCgClass";
|
||||
// table2td.className = "olCgClass";
|
||||
// table2div.className = "olCapFontClass";
|
||||
y = y + 5 - div.offsetHeight;
|
||||
} else {
|
||||
if(table2) container.appendChild(table2);
|
||||
table2.className = "olFgClass";
|
||||
// table2td.className = "olFgClass";
|
||||
// table2div.className = "olFontClass";
|
||||
table1.className = "olCgClass";
|
||||
// table1td.className = "olCgClass";
|
||||
// table1div.className = "olCapFontClass";
|
||||
y = y - 5;
|
||||
}
|
||||
|
||||
div.style.left = x;
|
||||
div.style.top = y;
|
||||
|
||||
|
||||
// var tds = div.getElementsByTagName('td');
|
||||
// for(var i=0; i<tds.length; i++) tds[i].style.backgroundColor = div.style.backgroundColor;
|
||||
|
||||
}
|
||||
|
||||
function lock_unlock_Position(guid,img) {
|
||||
if(lastLockedGuid != '') { var tmp = lastLockedGuid; lastLockedGuid = ''; lock_unlock_Position(tmp); }
|
||||
if(typeof(guid) == "undefined") return;
|
||||
var div = document.getElementById('EcmCallsAdditionalDetails');
|
||||
if(div) {
|
||||
var div_guid = document.getElementById('hint_div_'+guid);
|
||||
if(div_guid && img) div_guid.imgNote = img;
|
||||
if(typeof(div_guid.lockPosition) == "undefined") div_guid.lockPosition = false;
|
||||
div_guid.lockPosition = !div_guid.lockPosition;
|
||||
if(div_guid.lockPosition) {
|
||||
if(typeof(div_guid.old_note) == "undefined") {
|
||||
var ttt = div_guid.getElementsByTagName('textarea');
|
||||
if(ttt[0])
|
||||
div_guid.old_note = ttt[0].value;
|
||||
lastLockedGuid = guid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
hideCallHint(null,guid); lastLockedGuid = ''; div_guid.ec_call_record = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function show_hide_Position(guid,img) {
|
||||
var div = document.getElementById('EcmCallsAdditionalDetails');
|
||||
var div_guid = document.getElementById('hint_div_'+guid);
|
||||
if(div) {
|
||||
if(div.style.display == "" && div_guid.lockPosition == true) {
|
||||
div.style.display = "none";
|
||||
} else if(div.style.display == "none") {
|
||||
div.style.display = "";
|
||||
}
|
||||
if(div_guid) {
|
||||
if(typeof(div_guid.lockPosition) == "undefined" || div_guid.lockPosition == false) {
|
||||
lock_unlock_Position(guid, img);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hideCallHint(ev,guid,id,img) {
|
||||
var div = document.getElementById('EcmCallsAdditionalDetails');
|
||||
var div_guid = document.getElementById('hint_div_'+guid);
|
||||
|
||||
if(div && div_guid && div_guid.lockPosition != true) {
|
||||
div = ShowAdditionalDetails("");
|
||||
//if(div.parentNode === document.body) div.parentNode_.appendChild(div);// = div.parentNode; document.body.appendChild(div); }
|
||||
div.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function saveNote(guid,id) {
|
||||
var div = document.getElementById('hint_div_'+guid);
|
||||
var note = div.getElementsByTagName('textarea')[0].value;
|
||||
var guid = guid;
|
||||
if(note != div.old_note)
|
||||
doRequest(
|
||||
'index.php',
|
||||
'&to_pdf=1&module=EcmCalls&action=AjaxSave&record='+id+'¬e='+note,
|
||||
function(result) {
|
||||
lock_unlock_Position();
|
||||
var div = document.getElementById('hint_div_'+guid);
|
||||
var cell = div.parentNode_;//.parentNode;
|
||||
div.old_note = note;
|
||||
if(note == '') img = "modules/EcmCalls/images/hint_grey.gif"; else img = "modules/EcmCalls/images/hint_black.gif";
|
||||
if(div.imgNote) div.imgNote.src = img;
|
||||
//alert(cell);
|
||||
//cell.getElementsByTagName('img')[0].src = img; var img = '';
|
||||
},
|
||||
function(result) {}
|
||||
);
|
||||
else lock_unlock_Position();
|
||||
}
|
||||
|
||||
function cancelNote(guid) {
|
||||
var div = document.getElementById('hint_div_'+guid);
|
||||
if(div) {
|
||||
div.getElementsByTagName('textarea')[0].value = div.old_note;
|
||||
lock_unlock_Position();
|
||||
}
|
||||
}
|
||||
|
||||
function getWindowVisibleSize() {
|
||||
var myWidth = 0, myHeight = 0;
|
||||
if( typeof( window.innerWidth ) == 'number' ) {
|
||||
//Non-IE
|
||||
myWidth = window.innerWidth;
|
||||
myHeight = window.innerHeight;
|
||||
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
|
||||
//IE 6+ in 'standards compliant mode'
|
||||
myWidth = document.documentElement.clientWidth;
|
||||
myHeight = document.documentElement.clientHeight;
|
||||
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
|
||||
//IE 4 compatible
|
||||
myWidth = document.body.clientWidth;
|
||||
myHeight = document.body.clientHeight;
|
||||
}
|
||||
return [ myWidth, myHeight ];
|
||||
}
|
||||
|
||||
function getScrollXY() {
|
||||
var scrOfX = 0, scrOfY = 0;
|
||||
if( typeof( window.pageYOffset ) == 'number' ) {
|
||||
//Netscape compliant
|
||||
scrOfY = window.pageYOffset;
|
||||
scrOfX = window.pageXOffset;
|
||||
} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
|
||||
//DOM compliant
|
||||
scrOfY = document.body.scrollTop;
|
||||
scrOfX = document.body.scrollLeft;
|
||||
} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
|
||||
//IE6 standards compliant mode
|
||||
scrOfY = document.documentElement.scrollTop;
|
||||
scrOfX = document.documentElement.scrollLeft;
|
||||
}
|
||||
return [ scrOfX, scrOfY ];
|
||||
}
|
||||
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>
|
||||
184
modules/EcmCalls/ListView.js
Executable file
184
modules/EcmCalls/ListView.js
Executable file
@@ -0,0 +1,184 @@
|
||||
// JavaScript Document
|
||||
|
||||
var EcmCalls_image_assign = document.getElementById('EcmCalls_image_assign');
|
||||
var EcmCalls_image_search = document.getElementById('EcmCalls_image_search');
|
||||
|
||||
function EcmCalls_viewAnMenu(img, number, record, module, id, name) {
|
||||
var anMenu = document.getElementById('anMenu');
|
||||
if(typeof(anMenu) == "object") {
|
||||
var imgPos = YAHOO.util.Dom.getXY(img);
|
||||
if(imgPos) {
|
||||
anMenuClear();
|
||||
if(module && module != '') {
|
||||
document.forms.anMenuEdit.an_menu_parent.value = module;
|
||||
document.forms.anMenuEdit.an_menu_old_parent.value = module;
|
||||
} else {
|
||||
document.forms.anMenuEdit.an_menu_old_parent.value = '';
|
||||
}
|
||||
if(id && id != '') {
|
||||
document.forms.anMenuEdit.an_menu_parent_id.value = id;
|
||||
document.forms.anMenuEdit.an_menu_old_parent_id.value = id;
|
||||
} else {
|
||||
document.forms.anMenuEdit.an_menu_parent_id.value = '';
|
||||
document.forms.anMenuEdit.an_menu_old_parent_id.value = '';
|
||||
}
|
||||
if(name && name != '')
|
||||
document.forms.anMenuEdit.an_menu_parent_name.value = name;
|
||||
else
|
||||
document.forms.anMenuEdit.an_menu_parent_name.value = '';
|
||||
|
||||
if(record && record != '')
|
||||
document.forms.anMenuEdit.an_menu_ecmcall_record.value = record;
|
||||
else
|
||||
document.forms.anMenuEdit.an_menu_ecmcall_record.value = '';
|
||||
|
||||
if(number && number != '')
|
||||
document.forms.anMenuEdit.an_menu_old_parent_phone.value = number;
|
||||
else
|
||||
document.forms.anMenuEdit.an_menu_old_parent_phone.value = '';
|
||||
|
||||
document.forms.anMenuEdit.an_menu_new_phone.value = number;
|
||||
//document.forms.anMenuEdit.an_menu_update_all_old_records.checked = true;
|
||||
anMenu.style.display = '';
|
||||
var left = imgPos[0]+8-anMenu.offsetWidth/2;
|
||||
|
||||
if((document.body.offsetWidth - imgPos[0] - anMenu.offsetWidth/2 - 25) < 0)
|
||||
left = document.body.offsetWidth - 25 - anMenu.offsetWidth;
|
||||
|
||||
anMenu.style.left = left;
|
||||
anMenu.style.top = imgPos[1]-12-anMenu.offsetHeight;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function EcmCalls_showAssignImage(span, number, record, module, id, name) {
|
||||
if(typeof(span) == "object") {
|
||||
|
||||
span.parentNode.appendChild(EcmCalls_image_assign);
|
||||
EcmCalls_image_assign.style.display = '';
|
||||
EcmCalls_image_assign.onclick = function() { EcmCalls_viewAnMenu(this, number, record, module, id, name); };
|
||||
|
||||
if(typeof(module) != "undefined" && typeof(id) != "undefined") {
|
||||
span.parentNode.appendChild(EcmCalls_image_search);
|
||||
EcmCalls_image_search.style.display = '';
|
||||
EcmCalls_image_search.onclick = function() {
|
||||
var url = 'index.php?searchFormTab=advanced_search&module=EcmCalls&action=index&query=true&parent_from_advanced='+module+'&parent_from_id_advanced[]='+id+'&orderBy=CALLDATE&sortOrder=DESC';
|
||||
if(document.getElementById('call_date_from_ecmcalls_tmp')) url += '&call_date_from_advanced='+document.getElementById('call_date_from_ecmcalls_tmp').value;
|
||||
if(document.getElementById('call_date_to_ecmcalls_tmp')) url += '&call_date_to_advanced='+document.getElementById('call_date_to_ecmcalls_tmp').value;
|
||||
if(document.getElementById('calldate_ecmcalls_tmp')) url += '&calldate_advanced='+document.getElementById('calldate_ecmcalls_tmp').value;
|
||||
window.location = url;
|
||||
};
|
||||
} else {
|
||||
EcmCalls_image_search.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function EcmCalls_hideAssignImage(span, number) {
|
||||
|
||||
if(typeof(span) == "object") {
|
||||
//EcmCalls_image_assign.style.display = 'none';
|
||||
//document.body.appendChild(EcmCalls_image_assign);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function EcmCallsSearchRecord() {
|
||||
var div = document.getElementById("EcmCallsAdditionalDetails");
|
||||
if(div) {
|
||||
var url = 'index.php?searchFormTab=advanced_search&module=EcmCalls&action=index&query=true&parent_from_advanced='+div.ec_module+'&parent_from_id_advanced[]='+div.ec_id+'&orderBy=CALLDATE&sortOrder=DESC';
|
||||
if(document.getElementById('call_date_from_ecmcalls_tmp')) url += '&call_date_from_advanced='+document.getElementById('call_date_from_ecmcalls_tmp').value;
|
||||
if(document.getElementById('call_date_to_ecmcalls_tmp')) url += '&call_date_to_advanced='+document.getElementById('call_date_to_ecmcalls_tmp').value;
|
||||
if(document.getElementById('calldate_ecmcalls_tmp')) url += '&calldate_advanced='+document.getElementById('calldate_ecmcalls_tmp').value;
|
||||
window.location = url;
|
||||
}
|
||||
}
|
||||
function EcmCallsAssignRecord(img) {
|
||||
var div = document.getElementById("EcmCallsAdditionalDetails");
|
||||
if(div) {
|
||||
EcmCalls_viewAnMenu(img, div.ec_number, div.ec_record, div.ec_module, div.ec_id, div.ec_name);
|
||||
}
|
||||
}
|
||||
function EcmCallsViewDetailRecord(img) {
|
||||
var div = document.getElementById("EcmCallsAdditionalDetails");
|
||||
if(div) {
|
||||
window.location = "index.php?module="+(div.ec_module == "Users" ? "Employees" : div.ec_module)+"&action=DetailView&record="+div.ec_id+"&return_module=EcmCalls&return_action=ListView";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ShowAdditionalDetails(title,obj,call,module)
|
||||
{
|
||||
var div = document.getElementById("EcmCallsAdditionalDetails");
|
||||
|
||||
if(!div) {
|
||||
div = document.createElement("div");
|
||||
div.style.background="#ffffff";
|
||||
div.style.position="absolute";
|
||||
div.style.left = '10px';
|
||||
div.style.top = '10px';
|
||||
div.id="EcmCallsAdditionalDetails";
|
||||
|
||||
var divi ='<div id="" class="olBgClass" style="background-image: none;"><table class="olBgClass" width="300" border="0" cellpadding="0" style="border:none;" cellspacing="0"><tbody><tr><td><div id="EcmCallsAdditionalDetailsContainer"><table id="EcmCallsAdditionalDetailsHeader" class="olCgClass" width="100%" border="0" cellpadding="2" cellspacing="0"><tbody><tr><td id="EcmCallsAdditionalDetailsHeaderTD" class="olCgClass" width="100%" style="margin-left:2px; padding-left:2px;"><div id="EcmCallsAdditionalDetailsHeaderDIV" class="olCapFontClass">';
|
||||
|
||||
divi += '<div style="float: left;" id="EcmCallsAdditionalInfoTopButtons">';
|
||||
divi += '<img id="EcmCalls_search_img" onClick="EcmCallsSearchRecord();" src="modules/EcmCalls/images/search.gif" border="0" style="cursor:pointer;">';
|
||||
divi += '<img id="EcmCalls_assign_img" onClick="EcmCallsAssignRecord(this);" style="margin-left: 2px; cursor:pointer;" src="modules/EcmCalls/images/assign.gif" border="0">';
|
||||
divi += '<img id="EcmCalls_view_detail_img" onClick="EcmCallsViewDetailRecord(this);" style="margin-left: 2px; cursor:pointer;" src="modules/EcmCalls/images/view_detail.gif" border="0">';
|
||||
divi += '<span id="EcmCallsStatusPhoneIcon" style="margin-left: 2px;"><img src="include/ECM/EcmFormatPhoneNumber/images/additional_details_phone.gif" border="0" style="cursor:pointer;"></span>';
|
||||
divi += '<img style="margin-left:2px;margin-right: 2px; cursor:pointer;" onClick="lock_unlock_Position();" src="modules/EcmCalls/images/close.gif" border="0" style="cursor:pointer;">';
|
||||
divi += '</div>';
|
||||
|
||||
divi += '<div style="float:left;margin-left:2px;padding-left:2px;" id="EcmCallsAdditionalDetails_title" ></div>';
|
||||
|
||||
divi += '</div></td></tr></tbody></table><table id="EcmCallsAdditionalDetailsFooter" class="olFgClass" width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td id="EcmCallsAdditionalDetailsFooterTD" class="olFgClass" valign="top"><div id="EcmCallsAdditionalDetails_description" class="olFontClass"></div></td></tr></tbody></table></div></td></tr></tbody></table></div>';
|
||||
div.innerHTML = divi;
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
|
||||
if(div) {
|
||||
if(call) {
|
||||
document.getElementById("EcmCalls_search_img").style.display = "";
|
||||
document.getElementById("EcmCalls_assign_img").style.display = "";
|
||||
} else {
|
||||
document.getElementById("EcmCalls_search_img").style.display = "none";
|
||||
document.getElementById("EcmCalls_assign_img").style.display = "none";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var title_tmp = "";
|
||||
if(typeof(title) == "undefined")
|
||||
title_tmp = call;
|
||||
else
|
||||
title_tmp = title;
|
||||
|
||||
if(typeof(module) == "undefined" && typeof(call) != "undefined") module = "Others";
|
||||
|
||||
if(typeof(module) != "undefined")
|
||||
title_tmp = SUGAR.language.get('EcmCalls','LBL_NUMBER_OWNER_TYPE_'+module.toUpperCase()) + ": " + title_tmp;
|
||||
|
||||
document.getElementById("EcmCallsAdditionalDetails_title").innerHTML = title_tmp;
|
||||
var ddd = document.getElementById("EcmCallsAdditionalDetails_description");
|
||||
if(ddd.firstChild) {
|
||||
ddd.firstChild.style.display = 'none';
|
||||
if(ddd.firstChild.parentNode_)
|
||||
ddd.firstChild.parentNode_.appendChild(ddd.firstChild);
|
||||
else
|
||||
document.body.appendChild(ddd.firstChild);
|
||||
}
|
||||
if(obj) {
|
||||
obj.style.position = 'relative';
|
||||
obj.style.left = 0;
|
||||
obj.style.top = 0;
|
||||
obj.parentNode_ = obj.parentNode;
|
||||
ddd.appendChild(obj);
|
||||
obj.style.display = '';
|
||||
obj.parentNode_.appendChild(div);
|
||||
}
|
||||
return div;
|
||||
}
|
||||
}
|
||||
1916
modules/EcmCalls/ListView/EcmCallsListView.php
Executable file
1916
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');
|
||||
|
||||
?>
|
||||
367
modules/EcmCalls/MyTable.js
Executable file
367
modules/EcmCalls/MyTable.js
Executable file
@@ -0,0 +1,367 @@
|
||||
|
||||
|
||||
function keyPressedNumber(e) {
|
||||
var keynum;
|
||||
if(window.event) //IE
|
||||
keynum = e.keyCode;
|
||||
else
|
||||
keynum = e.which;
|
||||
return keynum;
|
||||
}
|
||||
|
||||
function isEnterOrTabPressed(e) {
|
||||
var keynum = keyPressedNumber(e);
|
||||
if(keynum == 9 || keynum == 13) return true; else return false;
|
||||
}
|
||||
|
||||
function setSelectionRange(obj) {
|
||||
if(obj && typeof(obj) == "object" && (obj.type == "text" || obj.type == "textarea")) {
|
||||
if(obj.createTextRange) {
|
||||
var range = obj.createTextRange();
|
||||
range.moveStart("character", 0);
|
||||
range.moveEnd("character", obj.value.lengh-1);
|
||||
range.select();
|
||||
} else {
|
||||
if(obj.setSelectionRange) {
|
||||
obj.setSelectionRange(0,obj.value.length);
|
||||
}
|
||||
}
|
||||
obj.focus();
|
||||
}
|
||||
if(obj && typeof(obj) == "object" && obj.options) { obj.focus(); }
|
||||
|
||||
}
|
||||
|
||||
function MyTable(name) {
|
||||
|
||||
this.myTableName = name;
|
||||
this.table = document.getElementById(this.myTableName);
|
||||
|
||||
this.thead = this.table.tHead;
|
||||
this.tbody = this.table.tBodies.item(0);
|
||||
|
||||
this.cellSelectedClass = 'selectedCell';
|
||||
this.rowSelectedClass = 'selectedRow';
|
||||
|
||||
this.selectedRow;
|
||||
this.selectedCell;
|
||||
|
||||
this.rowCount = function() {
|
||||
return this.tbody.rows.length;
|
||||
}
|
||||
|
||||
this.colCount = function() {
|
||||
return this.thead.rows.item(0).cells.length;
|
||||
};
|
||||
|
||||
this.colWidth = function(i) {
|
||||
return this.thead.rows.item(0).cells.item(i).width;
|
||||
};
|
||||
|
||||
this.moveUpRow = function() {
|
||||
if(this.selectedRow) this.selectedRow.moveUp();
|
||||
};
|
||||
|
||||
this.moveDownRow = function() {
|
||||
if(this.selectedRow) this.selectedRow.moveDown();
|
||||
};
|
||||
|
||||
this.insertRow = function(row, newRow) {
|
||||
if(!row)
|
||||
if(this.rowCount())
|
||||
if(typeof(row) == "number")
|
||||
row = this.tbody.rows.item(row);
|
||||
else
|
||||
row = this.tbody.rows.item(this.tbody.rows.length-1);
|
||||
|
||||
var row_tmp;
|
||||
if((newRow) && (row)) row_tmp = newRow; else { row_tmp = this.createRow(); this.fillWithDefaultData(row_tmp); }
|
||||
|
||||
if(this.rowCount() > 0 && row.nextSibling)
|
||||
this.tbody.insertBefore(row_tmp, row.nextSibling);
|
||||
else
|
||||
this.tbody.appendChild(row_tmp);
|
||||
|
||||
return row_tmp;
|
||||
};
|
||||
|
||||
this.refreshRowIndex = function() {
|
||||
for(var i=0; i<this.rowCount(); i++) {
|
||||
this.tbody.rows.item(i).index = i;
|
||||
if(this.onRefreshRowIndex) this.onRefreshRowIndex(this.tbody.rows.item(i));
|
||||
}
|
||||
}
|
||||
this.onRefreshRowIndex;
|
||||
|
||||
this.addRow = function(i,data) {
|
||||
var row = this.createRow();
|
||||
if(this.selectedRow) this.selectedRow.deselect();
|
||||
if(this.selectedCell) this.selectedCell.deselect();
|
||||
row.myTable = this;
|
||||
if(i || i===0)
|
||||
this.tbody.insertBefore(row,this.tbody.rows.item(i));
|
||||
else
|
||||
this.tbody.appendChild(row);
|
||||
this.refreshRowIndex();
|
||||
this.setRowData(row, data);
|
||||
for(var i=0; i<this.colCount(); i++) row.cells.item(i).afterCreate();
|
||||
return row;
|
||||
}
|
||||
|
||||
this.createRow = function(row) {
|
||||
var row = document.createElement('tr');
|
||||
row.myTable = this;
|
||||
row.isnew = false;
|
||||
row.onclick = function() { this.select(); }
|
||||
row.select = function() {
|
||||
if(!this.myTable.selectedRow || this.myTable.selectedRow !== this) {
|
||||
if(this.myTable.selectedRow) this.myTable.selectedRow.deselect();
|
||||
this.myTable.selectedRow = this;
|
||||
this.className = this.myTable.rowSelectedClass;
|
||||
if(row.onSelect) row.onSelect();
|
||||
}
|
||||
}
|
||||
row.deselect = function() {
|
||||
if(this.myTable.selectedRow === this) {
|
||||
this.className = '';
|
||||
this.myTable.selectedRow = '';
|
||||
if(row.onDeselect) row.onDeselect();
|
||||
}
|
||||
};
|
||||
|
||||
row.selectNext = function() {
|
||||
this.deselect();
|
||||
if(this.index == this.myTable.rowCount()) { this.nextSibling.select(); return this.nextSibling; }
|
||||
else {
|
||||
var row = this.myTable.addRow(); return row;
|
||||
}
|
||||
}
|
||||
row.selectPrevious = function() {
|
||||
this.deselect();
|
||||
if(this.previousSibling && this.index > 0) { this.previousSibling.select(); return this.previousSibling; }else return this;
|
||||
}
|
||||
row.deleteRow = function(noNew) {
|
||||
if(this.myTable.selectedCell) this.myTable.selectedCell.deselect();
|
||||
if(this.myTable.selectedRow) this.myTable.selectedRow.deselect();
|
||||
if(this.myTable.rowCount() == 1 && !noNew) {
|
||||
var MyTaBlE = this.myTable;
|
||||
setTimeout( function() { MyTaBlE.addRow(); } , 1000);
|
||||
}
|
||||
this.myTable.tbody.removeChild(this);
|
||||
this.myTable.refreshRowIndex();
|
||||
}
|
||||
row.moveUp = function() {
|
||||
if(!this.previousSibling) return;
|
||||
this.myTable.tbody.insertBefore(this,this.previousSibling);
|
||||
this.myTable.refreshRowIndex();
|
||||
}
|
||||
row.moveDown = function() {
|
||||
if(!this.nextSibling) this.myTable.addRow(row);
|
||||
this.myTable.tbody.insertBefore(this.nextSibling,this);
|
||||
this.myTable.refreshRowIndex();
|
||||
}
|
||||
row.setData = function(data) {
|
||||
if(!data || typeof(data) != "object") { return; };
|
||||
for(var i=0; i<this.myTable.colCount(); i++) {
|
||||
this.cells.item(i).setData(data);
|
||||
}
|
||||
}
|
||||
row.getData = function() {
|
||||
var data = new Object();
|
||||
for(var i=0; i<this.myTable.colCount(); i++) {
|
||||
if(this.cells.item(i).getData) this.cells.item(i).getData(data,true);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
for(var i=0; i<this.colCount(); i++) {
|
||||
var cell = this.createCell(i);
|
||||
row.appendChild(cell);
|
||||
}
|
||||
if(this.onCreateRow) this.onCreateRow(row);
|
||||
return row;
|
||||
|
||||
};
|
||||
|
||||
|
||||
this.onCreateRow; //function(row) {}
|
||||
|
||||
this.createCell = function(i) {
|
||||
var cell = document.createElement('td');
|
||||
cell.index = i;
|
||||
cell.myTable = this;
|
||||
cell.onclick = function() { this.select(); }
|
||||
cell.select = function() {
|
||||
if(!this.myTable.selectedCell || this.myTable.selectedCell !== this) {
|
||||
if(this.myTable.selectedCell) this.myTable.selectedCell.deselect();
|
||||
this.myTable.selectedCell = this;
|
||||
if(this.firstChild.focus && !this.noSelect) setSelectionRange(this.firstChild);
|
||||
if(this.onSelect) this.onSelect();
|
||||
this.className = this.myTable.cellSelectedClass;
|
||||
}
|
||||
}
|
||||
cell.deselect = function() {
|
||||
if(this.myTable.selectedCell === this) {
|
||||
if(cell.onDeselect) cell.onDeselect();
|
||||
this.className = '';
|
||||
this.selected = false;
|
||||
this.myTable.selectedCell = '';
|
||||
}
|
||||
};
|
||||
cell.selectNext = function() {
|
||||
this.deselect();
|
||||
if(this.nextSibling) this.nextSibling.select();
|
||||
else {
|
||||
if(!this.parentNode.nextSibling) this.myTable.addRow();
|
||||
this.parentNode.nextSibling.select();
|
||||
this.parentNode.nextSibling.firstChild.select();
|
||||
}
|
||||
}
|
||||
cell.afterCreate = function() {}
|
||||
cell.setData = function(data) {}
|
||||
cell.getData = function(data) {}
|
||||
if(this.onCreateCell) this.onCreateCell(cell);
|
||||
return cell;
|
||||
};
|
||||
this.onCreateCell; //function(cell) {}
|
||||
|
||||
|
||||
this.setRowData = function(row,data) {
|
||||
for(var i=0; i<this.colCount(); i++) {
|
||||
this.setCellData(row,row.cells.item(i),data);
|
||||
}
|
||||
}
|
||||
|
||||
this.setCellData = function(row,cell,data) {
|
||||
if(typeof(row) == "number")
|
||||
if(this.tbody.rows.item(row)) row = this.tbody.rows.item(row);
|
||||
if(typeof(cell) != "object")
|
||||
if(typeof(cell) == "number" && typeof(row) == "object") {
|
||||
if(row.cells.item(cell))
|
||||
cell = row.cells.item(cell);
|
||||
else return;
|
||||
}
|
||||
else return;
|
||||
if(this.onSetCellData) this.onSetCellData(row,cell,data);
|
||||
}
|
||||
|
||||
this.onSetCellData; //function(row,cell,data) {}
|
||||
|
||||
|
||||
|
||||
|
||||
this.selectRow = function(row) {
|
||||
|
||||
|
||||
if(this.selectedRow === row) return;
|
||||
|
||||
|
||||
if(this.selectedRow) this.deselectRow();
|
||||
|
||||
|
||||
this.selectedRow = row;
|
||||
|
||||
|
||||
this.selectedRow.className = this.rowSelectedClass;
|
||||
|
||||
|
||||
this.setEditNames(this.selectedRow,!this.selectedRow.isnew);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.selectNextRow = function() {
|
||||
|
||||
|
||||
if(!this.selectedRow) return;
|
||||
|
||||
|
||||
if(!this.selectedRow.nextSibling) this.insertRow();
|
||||
|
||||
|
||||
var cell_id = this.selectedCell.lp;
|
||||
|
||||
|
||||
this.selectRow(this.selectedRow.nextSibling);
|
||||
|
||||
|
||||
this.selectCell(this.selectedRow.cells.item(cell_id));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.selectPreviousRow = function() {
|
||||
|
||||
|
||||
if(!this.selectedRow) return;
|
||||
|
||||
|
||||
if(!this.selectedRow.previousSibling) return;
|
||||
|
||||
|
||||
if(this.selectedRow === this.tbody.rows.item(0)) return;
|
||||
|
||||
|
||||
var cell_id = this.selectedCell.lp;
|
||||
|
||||
|
||||
this.selectRow(this.selectedRow.previousSibling);
|
||||
|
||||
|
||||
this.selectCell(this.selectedRow.cells.item(cell_id));
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.refreshNumeration = function() {
|
||||
for(var i=0; i<this.tbody.rows.length; i++)
|
||||
this.tbody.rows.item(i).cells.item(0).firstChild.value = i+1;
|
||||
}
|
||||
|
||||
this.KeyPressedNumber = function(e) {
|
||||
var keynum;
|
||||
if(window.event) //IE
|
||||
keynum = e.keyCode;
|
||||
else
|
||||
keynum = e.which;
|
||||
return keynum;
|
||||
}
|
||||
|
||||
this.KeyPressed = function(e, cell, method) {
|
||||
var keynum;
|
||||
if(window.event) //IE
|
||||
keynum = e.keyCode;
|
||||
else
|
||||
keynum = e.which;
|
||||
if((keynum == 9) || (keynum == 13)) {
|
||||
cell.selectNext();
|
||||
return false;
|
||||
}
|
||||
if(keynum == 40) { var id = cell.index; var row = cell.parentNode.selectNext(); if(row) { row.select(); row.cells.item(id).select(); } }
|
||||
if(keynum == 38) { var id = cell.index; var row = cell.parentNode.selectPrevious(); if(row) { row.select(); row.cells.item(id).select(); } }
|
||||
if(e.shiftKey && (method == "decimalNumber" || method == "onlyNumber")) return false;
|
||||
if(method == "decimalNumber") return this.OnlyNumbers(keynum);
|
||||
if(method == "onlyNumber") return this.OnlyNumbers(keynum, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
this.OnlyNumbers = function(e, noQuote) { var keynum = e, keychar, numcheck;
|
||||
keychar = String.fromCharCode(keynum);
|
||||
numcheck = /\d/;
|
||||
return numcheck.test(keychar) || ((!noQuote)?(keynum == 190):false)
|
||||
|| (keynum == 8) //backspace
|
||||
|| (keynum == 46) //delete
|
||||
|| (keynum == 13) //enter || (keynum == 0) //special keys with FF
|
||||
|| (keynum == 37) //left arrow
|
||||
|| (keynum == 39) //right arrow
|
||||
|| (keynum == 188); //,
|
||||
}
|
||||
|
||||
this.row = function(i) { if(this.tbody.rows.item(i)) return this.tbody.rows.item(i); }
|
||||
this.cells = function(i,j) { if(this.tbody.rows.item(i).cells.item(i)) return this.tbody.rows.item(i).cells.item(i); }
|
||||
}
|
||||
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();
|
||||
|
||||
?>
|
||||
156
modules/EcmCalls/Popup_picker.html
Executable file
156
modules/EcmCalls/Popup_picker.html
Executable file
@@ -0,0 +1,156 @@
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* 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.
|
||||
********************************************************************************/
|
||||
-->
|
||||
|
||||
<!-- BEGIN: main -->
|
||||
<!-- BEGIN: SearchHeader -->
|
||||
|
||||
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<form action="index.php" method="post" name="popup_query_form" id="the_form">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="dataLabel" nowrap="nowrap">{MOD.LBL_CODE} <input type="text" name="code" size="20" class="dataField" value="{CODE}" /></td>
|
||||
<td class="dataLabel" nowrap="nowrap">{MOD.LBL_NAME} <input type="text" name="name" size="20" class="dataField" value="{NAME}" /></td>
|
||||
|
||||
<td width="20%" align="right">
|
||||
<input type="hidden" name="module" value="{MODULE_NAME}" />
|
||||
<input type="hidden" name="action" value="Popup" />
|
||||
<input type="hidden" name="query" value="true" />
|
||||
<input type="hidden" name="request_data" value="{request_data}" />
|
||||
<input type="hidden" name="record_id" value="" />
|
||||
<input type="submit" name="button" class="button"
|
||||
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
|
||||
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
|
||||
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
|
||||
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
/* initialize the popup request from the parent */
|
||||
|
||||
if(window.document.forms['popup_query_form'].request_data.value == "")
|
||||
{
|
||||
window.document.forms['popup_query_form'].request_data.value
|
||||
= JSON.stringify(window.opener.get_popup_request_data());
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
<!-- END: SearchHeader -->
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="listView">
|
||||
<!-- BEGIN: list_nav_row -->
|
||||
{PAGINATION}
|
||||
<!-- END: list_nav_row -->
|
||||
<tr height="20" class="listViewThS1">
|
||||
<td scope="col" width="5%" class="listViewThS1" NOWRAP>{CHECKALL}</td>
|
||||
<td scope="col" scope="col" width="15%" class="listViewThS1" NOWRAP>
|
||||
<slot>
|
||||
<a href="{ORDER_BY}code" class="listViewThLinkS1">{MOD.LBL_CODE}{arrow_start}{name_arrow}{arrow_end}</a>
|
||||
</slot>
|
||||
</td>
|
||||
<td scope="col" scope="col" width="50%" class="listViewThS1" NOWRAP>
|
||||
<slot>
|
||||
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_NAME}{arrow_start}{name_arrow}{arrow_end}</a>
|
||||
</slot>
|
||||
</td>
|
||||
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
|
||||
<slot>
|
||||
<a href="{ORDER_BY}selling_price" class="listViewThLinkS1">{MOD.LBL_SELLING_PRICE}{arrow_start}{name_arrow}{arrow_end}</a>
|
||||
</slot>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20"
|
||||
onmouseover="setPointer(this, '{ECMCALL.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmouseout="setPointer(this, '{ECMCALL.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmousedown="setPointer(this, '{ECMCALL.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
|
||||
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
|
||||
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
|
||||
<slot>
|
||||
<{TAG.MAIN} href="#"
|
||||
onclick="send_back('EcmCall','{ECMCALL.ID}');"
|
||||
class="listViewTdLinkS1">{ECMCALL.CODE}</{TAG.MAIN}>
|
||||
</slot>
|
||||
</td>
|
||||
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
|
||||
<slot>
|
||||
<{TAG.MAIN} href="#"
|
||||
onclick="send_back('EcmCall','{ECMCALL.ID}');"
|
||||
class="listViewTdLinkS1">{ECMCALL.NAME}</{TAG.MAIN}>
|
||||
</slot>
|
||||
</td>
|
||||
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
|
||||
<slot>
|
||||
<{TAG.MAIN} href="#"
|
||||
onclick="send_back('EcmCall','{ECMCALL.ID}');"
|
||||
class="listViewTdLinkS1">{ECMCALL.SELLING_PRICE}</{TAG.MAIN}>
|
||||
</slot>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="20" class="listViewHRS1"></td>
|
||||
</tr>
|
||||
<!-- END: row -->
|
||||
</table>
|
||||
{ASSOCIATED_JAVASCRIPT_DATA}
|
||||
<!-- END: main -->
|
||||
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');
|
||||
|
||||
?>
|
||||
263
modules/EcmCalls/SearchForm.html
Executable file
263
modules/EcmCalls/SearchForm.html
Executable file
@@ -0,0 +1,263 @@
|
||||
<!-- BEGIN: main -->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="border-top: 0px none; margin-bottom: 4px" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="dataLabel">{APP.LBL_CURRENT_USER_FILTER}
|
||||
</td>
|
||||
<td valign="top" class="dataField">
|
||||
<span sugar='slot1b'>
|
||||
<input name='current_user_only_basic' class="checkbox" type="checkbox" {CURRENT_USER_ONLY}>
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
<td class="dataLabel" noWrap>
|
||||
<span sugar='slot1'>{MOD.LBL_CALLDATE}</span sugar='slot'>
|
||||
</td>
|
||||
<td valign="top" class="dataField">
|
||||
<span sugar='slot1b'>
|
||||
<select id="calldate_basic" name="calldate_basic">{CALLDATE_BASIC}</select>
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END: main -->
|
||||
|
||||
<!-- BEGIN: advanced -->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="border-top: 0px none; margin-bottom: 4px" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="dataLabel" width="15%" noWrap>
|
||||
<span sugar='slot1'>{MOD.LBL_CALLDATE_FROM}</span sugar='slot'>
|
||||
</td>
|
||||
<td valign="top" width="35%" class="dataField">
|
||||
<span sugar='slot1b'>
|
||||
|
||||
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr valign="middle">
|
||||
<td nowrap>
|
||||
<input autocomplete="off" type="text" id="call_date_from_advanced_date" value="{CALLDATEFROMADVANCED}" size="11" maxlength="10" title='{HELP}' tabindex="f" onblur="combo_call_date_from_advanced.update();">
|
||||
<input type="hidden" id="call_date_from_advanced" name="call_date_from_advanced" value="{CALLDATEFROMADVANCED}">
|
||||
<img border="0" src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="call_date_from_advanced_trigger" align="absmiddle">
|
||||
</td>
|
||||
<td nowrap>
|
||||
<div id="call_date_from_advanced_time_section"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="middle">
|
||||
<td nowrap>
|
||||
<span class="dateFormat">{USER_DATEFORMAT}</span>
|
||||
</td>
|
||||
<td nowrap>
|
||||
<span class="dateFormat">{TIME_FORMAT}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript" src="include/SugarFields/Fields/Datetimecombo/Datetimecombo.js"></script>
|
||||
<script type="text/javascript">
|
||||
var combo_call_date_from_advanced = new Datetimecombo("{CALLDATEFROMADVANCED}", "call_date_from_advanced", "{TIME_FORMAT}", 'f', '', '');
|
||||
//Render the remaining widget fields
|
||||
text = combo_call_date_from_advanced.html('');
|
||||
document.getElementById('call_date_from_advanced_time_section').innerHTML = text;
|
||||
//Call eval on the update function to handle updates to calendar picker object
|
||||
eval(combo_call_date_from_advanced.jsscript(''));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
Calendar.setup ({
|
||||
onClose : update_call_date_from_advanced,
|
||||
inputField : "call_date_from_advanced_date",
|
||||
ifFormat : "{CALENDAR_FORMAT}",
|
||||
daFormat : "{CALENDAR_FORMAT}",
|
||||
button : "call_date_from_advanced_trigger",
|
||||
singleClick : true,
|
||||
step : 1
|
||||
});
|
||||
|
||||
//Call update for first time to round hours and minute values
|
||||
combo_call_date_from_advanced.update();
|
||||
</script>
|
||||
|
||||
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
<td class="dataLabel" width="15%" noWrap>
|
||||
<span sugar='slot1'>{MOD.LBL_CALLDATE_TO}</span sugar='slot'>
|
||||
</td>
|
||||
<td valign="top" width="35%" class="dataField">
|
||||
<span sugar='slot1b'>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr valign="middle">
|
||||
<td nowrap>
|
||||
<input autocomplete="off" type="text" id="call_date_to_advanced_date" value="{CALLDATETOADVANCED}" size="11" maxlength="10" title='{HELP}' tabindex="f" onblur="combo_call_date_to_advanced.update();">
|
||||
<input type="hidden" id="call_date_to_advanced" name="call_date_to_advanced" value="{CALLDATETOADVANCED}">
|
||||
<img border="0" src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="call_date_to_advanced_trigger" align="absmiddle">
|
||||
</td>
|
||||
<td nowrap>
|
||||
<div id="call_date_to_advanced_time_section"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="middle">
|
||||
<td nowrap>
|
||||
<span class="dateFormat">{USER_DATEFORMAT}</span>
|
||||
</td>
|
||||
<td nowrap>
|
||||
<span class="dateFormat">{TIME_FORMAT}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript" src="include/SugarFields/Fields/Datetimecombo/Datetimecombo.js"></script>
|
||||
<script type="text/javascript">
|
||||
var combo_call_date_to_advanced = new Datetimecombo("{CALLDATETOADVANCED}", "call_date_to_advanced", "{TIME_FORMAT}", 'f', '', '');
|
||||
//Render the remaining widget fields
|
||||
text = combo_call_date_to_advanced.html('');
|
||||
document.getElementById('call_date_to_advanced_time_section').innerHTML = text;
|
||||
//Call eval on the update function to handle updates to calendar picker object
|
||||
eval(combo_call_date_to_advanced.jsscript(''));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
Calendar.setup ({
|
||||
onClose : update_call_date_to_advanced,
|
||||
inputField : "call_date_to_advanced_date",
|
||||
ifFormat : "{CALENDAR_FORMAT}",
|
||||
daFormat : "{CALENDAR_FORMAT}",
|
||||
button : "call_date_to_advanced_trigger",
|
||||
singleClick : true,
|
||||
step : 1
|
||||
});
|
||||
|
||||
//Call update for first time to round hours and minute values
|
||||
combo_call_date_to_advanced.update();
|
||||
</script>
|
||||
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="dataLabel" valign="top" style="vertical-align:top;" width="15%" noWrap>
|
||||
<span sugar='slot1'>{MOD.LBL_FROM}</span sugar='slot'>
|
||||
</td>
|
||||
<td valign="top" width="35%" class="dataField" valign="top" style="vertical-align:top;">
|
||||
|
||||
|
||||
<script language="javascript">
|
||||
var parent_info = {PARENT_IDS_OBJECTS};
|
||||
function clearSelectWithIds(select) {
|
||||
if(!select) return;
|
||||
while(select.options.length > 0) select.remove(0);
|
||||
}
|
||||
function addFieldToSelect(select,value,id,selected) {
|
||||
var elOptNew = document.createElement('option');
|
||||
elOptNew.text = value;
|
||||
elOptNew.value = id;
|
||||
if(selected && selected == 1) elOptNew.selected = true;
|
||||
try {
|
||||
return select.add(elOptNew,null); // standards compliant; doesn't work in IE
|
||||
}
|
||||
catch(ex) {
|
||||
return select.add(elOptNew); // IE only
|
||||
}
|
||||
}
|
||||
function fillSelectWithIds(select1,select2) {
|
||||
clearSelectWithIds(select2);
|
||||
if(select1.value == '') return;
|
||||
for(x in parent_info['ids'][select1.value]) addFieldToSelect(select2,parent_info['ids'][select1.value][x],x,false);
|
||||
}
|
||||
</script>
|
||||
<div style="height:10px;"></div>
|
||||
<span sugar='slot1b' style="vertical-align:top;">
|
||||
<select id="parent_from_advanced" name="parent_from_advanced" onchange="fillSelectWithIds(this,document.getElementById('parent_from_id_advanced'));">{PARENT_FROM_ADVANCED}</select>
|
||||
|
||||
</span sugar='slot'>
|
||||
<span sugar='slot1b'>
|
||||
<select multiple="multiple" size="8" id="parent_from_id_advanced" name="parent_from_id_advanced[]">{PARENT_FROM_ID_ADVANCED}</select>
|
||||
|
||||
</span sugar='slot'>
|
||||
<span sugar='slot1b' style="vertical-align:top;">
|
||||
<input type="checkbox" id="in_out_advanced" name="in_out_advanced" onclick="if(this.checked) { document.getElementById('parent_to_advanced').value = ''; document.getElementById('parent_to_advanced').onchange(); document.getElementById('parent_to_advanced').disabled=true; document.getElementById('parent_to_id_advanced').disabled=true; } else { document.getElementById('parent_to_advanced').disabled=false; document.getElementById('parent_to_id_advanced').disabled=false; }" {IN_OUT_ADVANCED} /> {MOD.LBL_IN_OUT_FROM}
|
||||
</span sugar='slot'>
|
||||
<div style="height:10px;"></div>
|
||||
</td>
|
||||
<td class="dataLabel" width="15%" valign="top" noWrap>
|
||||
<span sugar='slot1'>{MOD.LBL_TO}</span sugar='slot'>
|
||||
</td>
|
||||
<td valign="top" width="35%" class="dataField">
|
||||
<div style="height:10px;"></div>
|
||||
<span sugar='slot1b'>
|
||||
<select style="vertical-align:top;" id="parent_to_advanced" name="parent_to_advanced" onchange="fillSelectWithIds(this,document.getElementById('parent_to_id_advanced'));">{PARENT_TO_ADVANCED}</select>
|
||||
|
||||
</span sugar='slot'>
|
||||
<span sugar='slot1b'>
|
||||
<select multiple="multiple" size="8" id="parent_to_id_advanced" name="parent_to_id_advanced[]">{PARENT_TO_ID_ADVANCED}</select>
|
||||
</span sugar='slot'>
|
||||
<div style="height:10px;"></div>
|
||||
<script language="javascript">
|
||||
document.getElementById('in_out_advanced').onclick();
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="15%" class="dataLabel">{APP.LBL_CURRENT_USER_FILTER}
|
||||
</td>
|
||||
<td valign="top" width="35%" class="dataField">
|
||||
<span sugar='slot1b'>
|
||||
<input name='current_user_only_advanced' class="checkbox" type="checkbox" {CURRENT_USER_ONLY_ADVANCED}>
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
<td width="15%" class="dataLabel" noWrap>
|
||||
<span sugar='slot1'>{MOD.LBL_CALLDATE}</span sugar='slot'>
|
||||
</td>
|
||||
<td width="35%" valign="top" class="dataField">
|
||||
<span sugar='slot1b'>
|
||||
<select id="calldate_advanced" name="calldate_advanced">{CALLDATE_ADVANCED}</select>
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<tr>
|
||||
<td colspan='20'>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan='6'>
|
||||
<a class='listViewTdLinkS1' onhover href='javascript:toggleInlineSearch()'><img src='{IMG_PATH}/advanced_search.gif' id='up_down_img' border=0>{APP.LNK_SAVED_VIEWS}</a><br>
|
||||
<input type='hidden' id='showSSDIV' name='showSSDIV' value='{SHOWSSDIV}'><p>
|
||||
<div style='{DISPLAYSS}' id='inlineSavedSearch' >
|
||||
{SAVED_SEARCH}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='5'> </td>
|
||||
<td align=right><img border='0' src='{IMG_PATH}help.gif' onmouseover="return overlib(SUGAR.language.get('app_strings', 'LBL_SEARCH_HELP_TEXT'), STICKY, MOUSEOFF,1000,WIDTH, 700, LEFT,CAPTION,'<div style=\'float:left\'>Working with Multiselects and Saved Searches</div>', CLOSETEXT, '<div style=\'float: right\'><img border=0 style=\'margin-left:2px; margin-right: 2px;\' src={IMG_PATH}close.gif></div>',CLOSETITLE, 'Close', CLOSECLICK,FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass');" ></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
if(typeof(loadSSL_Scripts)=='function'){
|
||||
loadSSL_Scripts();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<!-- END: advanced -->
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
90
modules/EcmCalls/Settings.html
Executable file
90
modules/EcmCalls/Settings.html
Executable file
@@ -0,0 +1,90 @@
|
||||
<!-- BEGIN: main -->
|
||||
|
||||
<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
|
||||
<script type="text/javascript" src="modules/EcmCalls/MyTable.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmCalls/MyTable.css" />
|
||||
|
||||
<script type="text/javascript" src="modules/EcmCalls/Settings.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<form name="Settings" onsubmit="return ItemListSave(true);" method="POST" action="index.php">
|
||||
<input type="hidden" name="module" value="EcmCalls">
|
||||
<input type="hidden" name="action" value="SettingsSave">
|
||||
<input type="hidden" name="return_module" value="{RETURN_MODULE}">
|
||||
<input type="hidden" name="return_id" value="{RETURN_ID}">
|
||||
<input type="hidden" name="return_action" value="{RETURN_ACTION}">
|
||||
<input type="hidden" id="phone_list" name="phone_list" value='{PHONE_LIST}' >
|
||||
|
||||
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" tabindex="1" class="button"
|
||||
onclick="this.form.action.value='SettingsSave';return check_form('Settings');"
|
||||
type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
|
||||
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" tabindex="1" class="button"
|
||||
onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'"
|
||||
type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
|
||||
</td>
|
||||
|
||||
<td align="right" nowrap><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
|
||||
<td align='right'>{ADMIN_EDIT}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<!--
|
||||
<tr>
|
||||
<td width="15%" class="dataLabel" valign="top"><span sugar='slot1'>{MOD.LBL_CENTRAL_AREACODE} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span sugar='slot'></td>
|
||||
<td width="35%" class="dataField"><span sugar='slot1b'><input name='central_areacode' tabindex="1" maxlength='10' value="{CENTRAL_AREACODE}"></span sugar='slot'></td>
|
||||
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<td width="15%" valign="top" class="dataLabel">
|
||||
<span sugar="slot4">{MOD.LBL_CENTRAL_TIMEZONE} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>
|
||||
</span sugar="slot"></td>
|
||||
<td width="35%" class="dataField">
|
||||
<span sugar="slot4b">
|
||||
<select tabindex='1' name='central_timezone'>{CENTRAL_TIMEZONE_OPTIONS}</select>
|
||||
</span sugar="slot"></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%" class="dataLabel" valign="top" colspan="4"><span sugar='slot1'>{MOD.LBL_OWN_PHONES} </span sugar='slot'>
|
||||
<div style="width:50%;border: 1px solid rgb(48,192,255);background-color:white;height:400px;max-height:400px;overflow:auto;">
|
||||
<table class="positions" style="width:100%;" id="phonesTable">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="10%">No.</td>
|
||||
<td width="20%">Number</td>
|
||||
<td width="60%">Description</td>
|
||||
<td width="10%">Options</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<div style="padding-top: 2px">
|
||||
<input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" tabindex="1" class="button" onclick="this.form.action.value='SettingsSave';return check_form('Settings');" type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
|
||||
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" tabindex="1" class="button" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
|
||||
</div>
|
||||
</form>
|
||||
{JAVASCRIPT}
|
||||
<!-- END: main -->
|
||||
186
modules/EcmCalls/Settings.js
Executable file
186
modules/EcmCalls/Settings.js
Executable file
@@ -0,0 +1,186 @@
|
||||
function doRequest(where,post,doFunction,error) {
|
||||
this.Display = function(result) { doFunction(result.responseText); }
|
||||
this.Fail = function(result){ if(error) alert(error);}
|
||||
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
|
||||
}
|
||||
|
||||
function changeValidateRequired(formname,name,required) {
|
||||
for(var i=0; i<validate[formname].length; i++)
|
||||
if(validate[formname][i][0] == name) { validate[formname][i][2] = required; break; }
|
||||
}
|
||||
|
||||
//function set_focus() { document.getElementById('name').focus(); }
|
||||
|
||||
function my_popup(module, field_array, call_back_function, form_name) {
|
||||
if(!call_back_function) call_back_function = "set_return";
|
||||
if(!form_name) form_name = "EditView";
|
||||
return open_popup(module, 600, 400, "", true, false, {"call_back_function":call_back_function,"form_name":form_name,"field_to_name_array":field_array});
|
||||
}
|
||||
|
||||
function addEvent(object,eventName,do_function) {
|
||||
if(typeof(object) == "string") object = document.getElementById(object);
|
||||
if(!object) { alert('No object in function addEvent!'); return; }
|
||||
if(object.addEventListener) {
|
||||
object.addEventListener(eventName, do_function, false);
|
||||
} else {
|
||||
object.attachEvent('on'+eventName, do_function);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var tbody_;
|
||||
var ItemListSave;
|
||||
var ItemListClear;
|
||||
var ItemListFil;
|
||||
|
||||
addEvent(
|
||||
window,
|
||||
'load',
|
||||
function() {
|
||||
|
||||
var phonesTable = new MyTable('phonesTable');
|
||||
|
||||
phonesTable.onRefreshRowIndex = function(row) {
|
||||
var data = new Object();
|
||||
data['index'] = (row.index+1).toString();
|
||||
row.cells.item(0).setData(data);
|
||||
}
|
||||
|
||||
phonesTable.onCreateRow = function(row) {
|
||||
row.newPos = false;
|
||||
row.ondblclick = function() {}
|
||||
row.onSelect = function() {
|
||||
for(var i=0; i<this.myTable.colCount(); i++)
|
||||
this.cells.item(i).change(!this.newPos);
|
||||
}
|
||||
row.onDeselect = function() {
|
||||
for(var i=0; i<this.myTable.colCount(); i++)
|
||||
this.cells.item(i).change(false);
|
||||
}
|
||||
}
|
||||
|
||||
phonesTable.onCreateCell = function(cell) {
|
||||
|
||||
var i = cell.index;
|
||||
cell.change = function(select) {};
|
||||
|
||||
if(i == 0) {
|
||||
cell.setData = function(data) {
|
||||
if(data.index) cell.firstChild.value = data.index;
|
||||
};
|
||||
cell.getData = function(data) {
|
||||
data.index = cell.firstChild.value;
|
||||
}
|
||||
cell.select = function() { this.selectNext(); }
|
||||
var edit = document.createElement('input');
|
||||
edit.setAttribute('type','text');
|
||||
edit.setAttribute('readOnly','readonly');
|
||||
edit.setAttribute('tabIndex',1);
|
||||
edit.className = 'inputs';
|
||||
cell.appendChild(edit);
|
||||
}
|
||||
|
||||
if(i == 1) {
|
||||
cell.change = function(select) {}
|
||||
cell.getData = function(data) {
|
||||
var cn = this.getElementsByTagName('input');
|
||||
data.phone = cn[0].value;
|
||||
}
|
||||
cell.setData = function(data) {
|
||||
var cn = this.getElementsByTagName('input');
|
||||
if(data.phone) cn[0].value = data.phone;
|
||||
}
|
||||
var edit = '<input type="text" onFocus="this.parentNode.select();" tabindex="1" class="inputs" style="height:16px;" autocomplete="off" onKeyDown="return this.parentNode.myTable.KeyPressed(event,this.parentNode);">';
|
||||
cell.innerHTML = edit;
|
||||
}
|
||||
|
||||
if(i == 2) {
|
||||
cell.change = function(select) {}
|
||||
cell.selectNext = function() { this.nextSibling.selectNext(); }
|
||||
cell.getData = function(data) {
|
||||
var cn = this.getElementsByTagName('input');
|
||||
data.note = cn[0].value;
|
||||
}
|
||||
cell.setData = function(data) {
|
||||
var cn = this.getElementsByTagName('input');
|
||||
if(data.note) cn[0].value = data.note;
|
||||
}
|
||||
var edit = '<input type="text" onFocus="this.parentNode.select();" tabindex="1" class="inputs" style="height:16px;" autocomplete="off" onKeyDown="return this.parentNode.myTable.KeyPressed(event,this.parentNode);">';
|
||||
cell.innerHTML = edit;
|
||||
}
|
||||
|
||||
if(i == 3) {
|
||||
var img;
|
||||
//insert
|
||||
img = document.createElement('img');
|
||||
img.setAttribute('alt',MOD['LBL_INSERT_NEW_ROW']);
|
||||
img.setAttribute('src','modules/EcmCalls/images/insertrow.gif');
|
||||
img.style.cursor = 'pointer';
|
||||
img.onclick = function() {
|
||||
this.parentNode.myTable.addRow(this.parentNode.parentNode.index+1);
|
||||
};
|
||||
//delete
|
||||
cell.appendChild(img);
|
||||
cell.appendChild(document.createTextNode(" "));
|
||||
img = document.createElement('img');
|
||||
img.setAttribute('alt',MOD['LBL_DELETE_ROW']);
|
||||
img.setAttribute('src','modules/EcmCalls/images/deleterow.gif');
|
||||
img.style.cursor = 'pointer';
|
||||
img.onclick = function() { this.parentNode.parentNode.deleteRow(); };
|
||||
cell.appendChild(img);
|
||||
cell.appendChild(document.createTextNode(" "));
|
||||
//move up
|
||||
img = document.createElement('img');
|
||||
img.setAttribute('alt',MOD['LBL_MOVE_ROW_UP']);
|
||||
img.setAttribute('src','modules/EcmCalls/images/moverowup.gif');
|
||||
img.style.cursor = 'pointer';
|
||||
img.onclick = function() { this.parentNode.parentNode.moveUp(); };
|
||||
cell.appendChild(img);
|
||||
cell.appendChild(document.createTextNode(" "));
|
||||
//move down
|
||||
img = document.createElement('img');
|
||||
img.setAttribute('alt',MOD['LBL_MOVE_ROW_DOWN']);
|
||||
img.setAttribute('src','modules/EcmCalls/images/moverowdown.gif');
|
||||
img.style.cursor = 'pointer';
|
||||
img.onclick = function() { this.parentNode.parentNode.moveDown(); }
|
||||
cell.appendChild(img);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
phonesTable.onSetCellData = function(row,cell,data) {
|
||||
if(cell.innerHTML == '') cell.innerHTML = ' ';
|
||||
}
|
||||
|
||||
|
||||
ItemListSave = function(json) {
|
||||
var data = new Object();
|
||||
var tmp;
|
||||
for(var i=0; i<phonesTable.rowCount(); i++) {
|
||||
var tmp_data = phonesTable.row(i).getData();
|
||||
if(tmp_data['phone'] != '' && tmp_data['note'] != '') data[i.toString()] = tmp_data;
|
||||
}
|
||||
var r = json ? JSON.stringifyNoSecurity(data) : data;
|
||||
document.getElementById('phone_list').value = r;
|
||||
}
|
||||
|
||||
ItemListClear = function(noNew) {
|
||||
while(phonesTable.rowCount()>0) phonesTable.row(0).deleteRow(noNew);
|
||||
}
|
||||
|
||||
ItemListFill = function() {
|
||||
var pl = document.getElementById('phone_list').value;
|
||||
if(pl && pl != '') {
|
||||
try {
|
||||
pl = eval(pl);
|
||||
for(x in pl) if(typeof(pl[x]) == "object") { var pl_row = pl[x]; phonesTable.addRow().setData(pl_row); }
|
||||
} catch(err) { pl = null; };
|
||||
}
|
||||
|
||||
if(phonesTable.rowCount() == 0) phonesTable.addRow();
|
||||
}
|
||||
|
||||
ItemListFill();
|
||||
|
||||
}
|
||||
);
|
||||
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");
|
||||
|
||||
?>
|
||||
104
modules/EcmCalls/SubPanel.js
Executable file
104
modules/EcmCalls/SubPanel.js
Executable file
@@ -0,0 +1,104 @@
|
||||
|
||||
//my standard functions - begin
|
||||
function doRequest(where,post,success,fail) {
|
||||
this.Display = function(result) { success(result.responseText); }
|
||||
this.Fail = function(result){ if(typeof(fail) != "undefined") { if(typeof(fail) == "string") alert(fail); else fail(result.responseText); } }
|
||||
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
|
||||
}
|
||||
function addEvent(object,eventName,do_function) {
|
||||
if(typeof(object) == "string") object = document.getElementById(object);
|
||||
if(!object) { alert('No object in function addEvent!'); return; }
|
||||
if(object.addEventListener) {
|
||||
object.addEventListener(eventName, do_function, false);
|
||||
} else {
|
||||
object.attachEvent('on'+eventName, do_function);
|
||||
}
|
||||
}
|
||||
//my standard functions - end
|
||||
|
||||
var EcmCallsPage = 0;
|
||||
var EcmCallsRowLook = new Object()
|
||||
var EcmCallsColors = new Object();
|
||||
|
||||
|
||||
function loadEcmCalls(page) {
|
||||
var b = findSubpanel('subpanel_ecmcalls');
|
||||
if(b) {
|
||||
doRequest(
|
||||
'index.php',
|
||||
'module=EcmCalls&action=SubPanel&to_pdf=1&page='+page+'&searchModule='+document.forms.DetailView.module.value+'&searchRecord='+document.forms.DetailView.record.value,
|
||||
function(result) {
|
||||
b.slotCount = 0;
|
||||
var arr = eval(result);
|
||||
if(arr[0]) {
|
||||
arr = arr[0];
|
||||
EcmCallsColors = arr['colors'];
|
||||
for(x in arr['positions']) addEcmCall(b,arr['positions'][x]);
|
||||
}
|
||||
b.slotCount = 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function addEcmCall(body_,ecmcall) {
|
||||
|
||||
var tr = document.createElement('tr');
|
||||
tr.height = "20";
|
||||
tr.scope = "row";
|
||||
tr.onmouseover = function() { setPointer(this, '', 'over', EcmCallsColors['even_bg'], EcmCallsColors['hilite_bg'] , ''); }
|
||||
tr.onmouseout = function() { setPointer(this, '', 'out', EcmCallsColors['even_bg'], EcmCallsColors['hilite_bg'] , ''); }
|
||||
|
||||
|
||||
for(x in EcmCallsRowLook) {
|
||||
var td = document.createElement('td');
|
||||
td.className = ((body_.slotCount%2) ? 'oddListRowS1' : 'evenListRowS1');
|
||||
td.bgcolor = EcmCallsColors['odd_bg'];
|
||||
td.valign = "top";
|
||||
td.noWrap = "noWrap";
|
||||
|
||||
var span = document.createElement('span');
|
||||
span.sugar = "slot"+(body_.slotCount++)+"b";
|
||||
span.innerHTML = ecmcall[x];
|
||||
td.appendChild(span);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
|
||||
body_.appendChild(tr);
|
||||
|
||||
var tr = document.createElement('tr');
|
||||
var td = document.createElement('td');
|
||||
td.colSpan = 20;
|
||||
td.className = 'listViewHRS1';
|
||||
tr.appendChild(td);
|
||||
body_.appendChild(tr);
|
||||
}
|
||||
|
||||
function findSubpanel(name) {
|
||||
var div = document.getElementById(name);
|
||||
if(div) {
|
||||
var table = div.getElementsByTagName('table');
|
||||
if(table && table[0]) {
|
||||
var body_ = table[0].getElementsByTagName('tbody');
|
||||
if(body_) {
|
||||
return body_[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
addEvent(
|
||||
window,
|
||||
'load',
|
||||
function(result) {
|
||||
/*
|
||||
var tmp = document.getElementById('EcmCallsSubPanelDefs');
|
||||
var spd = eval(tmp.value);
|
||||
if(spd && spd[0]) spd = spd[0];
|
||||
EcmCallsRowLook = spd;
|
||||
*/
|
||||
showSubPanel('ecmcalls','/index.php?module=EcmCalls&spModule='+document.forms.DetailView.module.value+'&record='+document.forms.DetailView.record.value+'&'+document.forms.DetailView.module.value+'_CELL_offset=0&to_pdf=true&action=SubPanelViewerMy&subpanel=ecmcalls&EcmCalls_CELL_offset=0&EcmCalls_CELL_ORDER_BY=&sort_order=desc&to_pdf=true',true);
|
||||
//loadEcmCalls();
|
||||
}
|
||||
);
|
||||
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
293
modules/EcmCalls/anMenu/anMenu.html
Executable file
293
modules/EcmCalls/anMenu/anMenu.html
Executable file
@@ -0,0 +1,293 @@
|
||||
<!-- BEGIN: main -->
|
||||
|
||||
<script type="text/javascript" src="modules/EcmCalls/anMenu/anMenu.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmCalls/anMenu/anMenu.css" />
|
||||
|
||||
<div id="anMenu" class="anMenu" style="display:none;">
|
||||
<form name="anMenuEdit">
|
||||
<div id="anMenuHeader" class="anMenuHeader">
|
||||
{MOD.LBL_ASSIGN_MENU_TITLE}
|
||||
<img src="modules/EcmCalls/anMenu/close.gif" width="12" height="12" onClick="anMenuClose();" />
|
||||
</div>
|
||||
<div id="anMenuBody" class="anMenuBody">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
{MOD.LBL_ASSIGN_MENU_PARENT_NAME}:
|
||||
</td>
|
||||
<td>
|
||||
<select id="an_menu_parent" name="an_menu_parent">
|
||||
{AN_MENU_PARENT_OPTIONS}
|
||||
</select>
|
||||
|
||||
<input type="text" name="an_menu_parent_name" id="an_menu_parent_name" class="sqsEnabled" autocomplete="off" />
|
||||
<input type="hidden" name="an_menu_parent_id" id="an_menu_parent_id" />
|
||||
<input type="button" id="an_menu_parent_select_button" value="{MOD.LBL_ASSIGN_MENU_SELECT_BUTTON}" />
|
||||
<input type="button" id="an_menu_parent_clear_button" value="{MOD.LBL_ASSIGN_MENU_CLEAR_BUTTON}" />
|
||||
<input type="button" id="an_menu_parent_create_button" value="{MOD.LBL_ASSIGN_MENU_CREATE_BUTTON}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{MOD.LBL_ASSIGN_MENU_PARENT_PHONE}:
|
||||
</td>
|
||||
<td>
|
||||
<span id="an_menu_parent_phones_select">
|
||||
{AN_MENU_PARENT_PHONES_OPTIONS}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{MOD.LBL_ASSIGN_MENU_NEW_NUMBER}:
|
||||
</td>
|
||||
<td>
|
||||
<span id="an_menu_parent_phones_select">
|
||||
<input type="text" name="an_menu_new_phone" id="an_menu_new_phone" style="width:250px" />
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{MOD.LBL_ASSIGN_MENU_UPDATE_RECORDS}:
|
||||
</td>
|
||||
<td>
|
||||
<span id="an_menu_parent_uaor">
|
||||
<select name="an_menu_update_records" id="an_menu_update_records">{AN_MENU_UPDATE_RECORDS_OPTIONS}</select>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div id="anMenuFooter" class="anMenuFooter">
|
||||
<div style="text-align:right;">
|
||||
<span>
|
||||
|
||||
<input type="hidden" name="an_menu_old_parent" id="an_menu_old_parent" />
|
||||
<input type="hidden" name="an_menu_old_parent_id" id="an_menu_old_parent_id" />
|
||||
<input type="hidden" name="an_menu_old_parent_phone" id="an_menu_old_parent_phone" />
|
||||
|
||||
<input type="hidden" name="an_menu_ecmcall_record" id="an_menu_ecmcall_record" />
|
||||
|
||||
<input type="button" class="button" value="{MOD.LBL_ASSIGN_MENU_SAVE_BUTTON}" id="an_menu_parent_save_button" />
|
||||
<input type="button" class="button" value="{MOD.LBL_ASSIGN_MENU_CANCEL_BUTTON}" onClick="anMenuClose();" />
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript" src="include/JSON.js"></script>
|
||||
<script language="javascript">sqsWaitGif = "themes/default/images/sqsWait.gif";</script>
|
||||
<script language="javascript">
|
||||
|
||||
if(typeof(sqs_objects) != "object") {
|
||||
sqs_objects = new Object();
|
||||
}
|
||||
|
||||
</script>
|
||||
<script language="javascript" src="include/javascript/quicksearch.js"></script>
|
||||
<script language="javascript" src="modules/EcmCalls/formloader.js"></script>
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
function anMenuClose() {
|
||||
anMenuClear();
|
||||
var am = document.getElementById('anMenu');
|
||||
if(am && am.style) am.style.display = 'none';
|
||||
}
|
||||
|
||||
function anMenuClear() {
|
||||
document.forms.anMenuEdit.an_menu_parent_name.value = "";
|
||||
document.forms.anMenuEdit.an_menu_parent_id.value = "";
|
||||
enableQS(false);
|
||||
}
|
||||
|
||||
function anMenuParentIdChange() {
|
||||
if(an_menu_parent_old_id != document.forms.anMenuEdit.an_menu_parent_id.value) {
|
||||
an_menu_parent_old_id = document.forms.anMenuEdit.an_menu_parent_id.value;
|
||||
anMenuParentChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function anMenuParentChange(noClear) {
|
||||
var an_menu_parent = document.getElementById('an_menu_parent');
|
||||
if(an_menu_parent.value == "Users") {
|
||||
sqs_objects["an_menu_parent_name"] = sqs_objects_employee;
|
||||
}
|
||||
else {
|
||||
sqs_objects["an_menu_parent_name"] = sqs_objects_other;
|
||||
sqs_objects["an_menu_parent_name"]["modules"][0] = an_menu_parent.value;
|
||||
}
|
||||
enableQS(false);
|
||||
YAHOO.util.Connect.asyncRequest(
|
||||
'POST',
|
||||
'index.php',
|
||||
{
|
||||
success: function(results) {
|
||||
//alert(results.responseText);
|
||||
if(results.responseText) {
|
||||
var an_menu_parent_phones_select = document.getElementById('an_menu_parent_phones_select');
|
||||
if(an_menu_parent_phones_select) {
|
||||
an_menu_parent_phones_select.innerHTML = results.responseText;
|
||||
}
|
||||
}
|
||||
},
|
||||
failure: function(results) {}
|
||||
},
|
||||
'module=EcmCalls&action=AnMenu&anMenuAction=get'+an_menu_parent.value+'Select&to_pdf=1&an_menu_parent_id='+document.forms.anMenuEdit.an_menu_parent_id.value
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
var an_menu_parentFL;
|
||||
var an_menu_dd;
|
||||
var an_menu_parent_old_id = '';
|
||||
|
||||
YAHOO.util.Event.addListener(window, 'load', function() {
|
||||
|
||||
sqs_objects_other = {
|
||||
"method":"query",
|
||||
"modules":["Accounts"],
|
||||
"group":"or",
|
||||
"field_list":["name", "id"],
|
||||
"populate_list":["an_menu_parent_name", "an_menu_parent_id"],
|
||||
"conditions":[{"name":"name","op":"like_custom","end":"%","value":""}],
|
||||
"limit":"30",
|
||||
"order":"name",
|
||||
"no_match_text":"No Match"
|
||||
}
|
||||
|
||||
sqs_objects_employee = {
|
||||
"method":"get_employee_array",
|
||||
"modules":["Users"],
|
||||
"group":"or",
|
||||
"field_list":["name", "id"],
|
||||
"populate_list":["an_menu_parent_name", "an_menu_parent_id"],
|
||||
"conditions":[{"name":"name","op":"like_custom","end":"%","value":""}],
|
||||
"limit":"30",
|
||||
"order":"name",
|
||||
"no_match_text":"No Match"
|
||||
}
|
||||
|
||||
sqs_objects["an_menu_parent_name"] = sqs_objects_other;
|
||||
enableQS(false);
|
||||
|
||||
var an_menu_parent = document.getElementById('an_menu_parent');
|
||||
YAHOO.util.Event.addListener(an_menu_parent, 'change', function() { anMenuClear(); an_menu_parent_old_id = ''; anMenuParentChange(); } );
|
||||
|
||||
var an_menu_parent_select_button = document.getElementById('an_menu_parent_select_button');
|
||||
YAHOO.util.Event.addListener(an_menu_parent_select_button, 'click', function() {
|
||||
var sb = document.getElementById('an_menu_parent');
|
||||
if(sb) {
|
||||
|
||||
var user_obj = {"call_back_function":"set_return","form_name":"anMenuEdit","field_to_name_array":{"id":"an_menu_parent_id","full_name":"an_menu_parent_name"}};
|
||||
var other_obj = {"call_back_function":"set_return","form_name":"anMenuEdit","field_to_name_array":{"id":"an_menu_parent_id","name":"an_menu_parent_name"}};
|
||||
|
||||
if(sb.value == "Users") var select_obj = user_obj; else var select_obj = other_obj;
|
||||
open_popup((sb.value == "Users" ? "Employees" : sb.value), 600, 400, "", true, false, select_obj, "single", true);
|
||||
}
|
||||
});
|
||||
|
||||
var an_menu_parent_clear_button = document.getElementById('an_menu_parent_clear_button');
|
||||
YAHOO.util.Event.addListener(an_menu_parent_clear_button, 'click', function() {
|
||||
anMenuClear();
|
||||
});
|
||||
|
||||
an_menu_parentFL = new FormLoader();
|
||||
an_menu_parentFL.load('EcmCalls','Parents','an_menu_parentFL');
|
||||
an_menu_parentFL.onResponseData = function(data) {
|
||||
//hideSmartInputFloater(true);
|
||||
document.forms.anMenuEdit.an_menu_parent_id.value = data['id'];
|
||||
if(document.forms.anMenuEdit.an_menu_parent.value == "Users")
|
||||
data['name'] = data['user_name'];
|
||||
|
||||
document.forms.anMenuEdit.an_menu_parent_name.value = data['name'];
|
||||
};
|
||||
an_menu_parentFL.setEditDblClick(document.forms.anMenuEdit.an_menu_parent_name);
|
||||
an_menu_parentFL.onEditDblClick = function() {
|
||||
an_menu_parentFL.createModule=document.forms.anMenuEdit.an_menu_parent.value;
|
||||
return "&fl_record="+document.forms.anMenuEdit.an_menu_parent_id.value+'&fl_'+document.forms.anMenuEdit.an_menu_parent_phone.value+'='+document.forms.anMenuEdit.an_menu_new_phone.value;
|
||||
}
|
||||
an_menu_parentFL.onButtonClick = function() {
|
||||
an_menu_parentFL.createModule = document.forms.anMenuEdit.an_menu_parent.value;
|
||||
if(document.forms.anMenuEdit.an_menu_parent.value == "Users") var nn = "sugar_user_name"; else var nn= "name";
|
||||
return "&fl_"+nn+"="+document.forms.anMenuEdit.an_menu_parent_name.value+'&fl_'+document.forms.anMenuEdit.an_menu_parent_phone.value+'='+document.forms.anMenuEdit.an_menu_new_phone.value;
|
||||
}
|
||||
|
||||
var an_menu_parent_create_button = document.getElementById('an_menu_parent_create_button');
|
||||
YAHOO.util.Event.addListener(an_menu_parent_create_button, 'click', function() {
|
||||
var sb = document.getElementById('an_menu_parent');
|
||||
var cc_ = '';
|
||||
if(sb) {
|
||||
if(document.forms.anMenuEdit.an_menu_parent.value == "Users") var nn = "sugar_user_name"; else var nn= "name";
|
||||
if(document.forms.anMenuEdit.an_menu_parent.value == "Contacts") {
|
||||
var ccc = document.forms.anMenuEdit.an_menu_parent_name.value;
|
||||
var cc_pos = ccc.indexOf(" ");
|
||||
if(cc_pos != -1) {
|
||||
var cc_ = '&fl_first_name='+ccc.substr(0,cc_pos)+'&fl_last_name='+ccc.substr(cc_pos+1,ccc.length);
|
||||
}
|
||||
}
|
||||
|
||||
window.open("index.php?module=EcmCalls&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName=an_menu_parentFL&createModule="+sb.value+"&fl_"+nn+"="+document.forms.anMenuEdit.an_menu_parent_name.value+'&fl_'+document.forms.anMenuEdit.an_menu_parent_phone.value+'='+document.forms.anMenuEdit.an_menu_new_phone.value+cc_,"Create30","resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
|
||||
}
|
||||
});
|
||||
|
||||
an_menu_dd = new YAHOO.util.DD("anMenu");
|
||||
an_menu_dd.setHandleElId("anMenuHeader");
|
||||
|
||||
var an_menu_parent_save_button = document.getElementById('an_menu_parent_save_button');
|
||||
YAHOO.util.Event.addListener(an_menu_parent_save_button, 'click', function() {
|
||||
|
||||
var data = new Object();
|
||||
data.an_menu_parent = document.forms.anMenuEdit.an_menu_parent.value;
|
||||
data.an_menu_parent_phone = document.forms.anMenuEdit.an_menu_parent_phone.value;
|
||||
data.an_menu_parent_id = document.forms.anMenuEdit.an_menu_parent_id.value;
|
||||
data.an_menu_new_phone = document.forms.anMenuEdit.an_menu_new_phone.value;
|
||||
data.an_menu_update_records = document.forms.anMenuEdit.an_menu_update_records.value;
|
||||
|
||||
data.an_menu_ecmcall_record = document.forms.anMenuEdit.an_menu_ecmcall_record.value;
|
||||
data.an_menu_old_parent = document.forms.anMenuEdit.an_menu_old_parent.value;
|
||||
data.an_menu_old_parent_id = document.forms.anMenuEdit.an_menu_old_parent_id.value;
|
||||
data.an_menu_old_parent_phone = document.forms.anMenuEdit.an_menu_old_parent_phone.value;
|
||||
|
||||
data = JSON.stringifyNoSecurity(data);
|
||||
|
||||
var an_menu_parent = document.getElementById('an_menu_parent');
|
||||
|
||||
YAHOO.util.Connect.asyncRequest(
|
||||
'POST',
|
||||
'index.php',
|
||||
{
|
||||
success: function(results) {
|
||||
//alert('>'+results.responseText+'<');
|
||||
if(results.responseText) {
|
||||
var ampid = document.getElementById('an_menu_parent_id');
|
||||
if(results.responseText.indexOf(ampid.value) != -1) {
|
||||
alert('{MOD.LBL_ASSIGN_MENU_SAVE_SUCCESS}');
|
||||
anMenuClose();
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
},
|
||||
failure: function(results) { alert('{MOD.LBL_ASSIGN_MENU_SAVE_FAILURE}'); }
|
||||
},
|
||||
'module=EcmCalls&action=AnMenu&anMenuAction=Save&to_pdf=1&an_menu_data='+data
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
setInterval(anMenuParentIdChange,500);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!-- END: main -->
|
||||
1
modules/EcmCalls/anMenu/anMenu.js
Executable file
1
modules/EcmCalls/anMenu/anMenu.js
Executable file
@@ -0,0 +1 @@
|
||||
// JavaScript Document
|
||||
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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
44
modules/EcmCalls/chart/PredefinedChartDashletScript.tpl
Executable file
44
modules/EcmCalls/chart/PredefinedChartDashletScript.tpl
Executable file
@@ -0,0 +1,44 @@
|
||||
{*
|
||||
|
||||
/**
|
||||
* 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".
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
*}
|
||||
|
||||
<script>
|
||||
SUGAR.mySugar.addToChartsArray('{$chartName}', '{$chartXMLFile}', '100%', '480', '{$chartStyleCSS}', '{$chartColorsXML}', '{$chartStringsXML}');
|
||||
</script>
|
||||
67
modules/EcmCalls/chart/chart.tpl
Executable file
67
modules/EcmCalls/chart/chart.tpl
Executable file
@@ -0,0 +1,67 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
<div id="{$chartName}_div" style="width:{$width};height:{$height}px;z-index:80;{$style}">
|
||||
<img id="{$chartName}_img" src="index.php?module=EcmCalls&action=EcmCallsChartImg&to_pdf=1&chartName={$chartName}" width="{$width}" height="{$height}" />
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
{literal}
|
||||
function refreshMyEcmCallsChartDashlet(chartName) {
|
||||
var div = document.getElementById(chartName+'_div');
|
||||
if(div) {
|
||||
var time = new Date();
|
||||
var ofs = time.getHours()+time.getMinutes()+time.getSeconds();
|
||||
var img = document.getElementById(chartName+'_img');
|
||||
img.src = 'index.php?module=EcmCalls&action=EcmCallsChartImg&to_pdf=1&chartName='+chartName+'&imgWidth='+div.offsetWidth+'&imgHeight='+div.offsetHeight+'&ofs='+ofs;
|
||||
}
|
||||
}
|
||||
{/literal}
|
||||
|
||||
YAHOO.util.Event.addListener(
|
||||
window,
|
||||
'load',
|
||||
{literal}
|
||||
function() {
|
||||
{/literal}
|
||||
refreshMyEcmCallsChartDashlet('{$chartName}');
|
||||
{literal}
|
||||
}
|
||||
{/literal}
|
||||
);
|
||||
|
||||
</script>
|
||||
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
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
164
modules/EcmCalls/formloader.js
Executable file
164
modules/EcmCalls/formloader.js
Executable file
@@ -0,0 +1,164 @@
|
||||
|
||||
|
||||
function doRequest(where,post,doFunction,error) {
|
||||
|
||||
this.Display = function(result) { doFunction(result.responseText); }
|
||||
|
||||
this.Fail = function(result){ if(error) alert(error);}
|
||||
|
||||
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function changeValidateRequired(formname,name,required) {
|
||||
|
||||
for(var i=0; i<validate[formname].length; i++)
|
||||
|
||||
if(validate[formname][i][0] == name) { validate[formname][i][2] = required; break; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function my_popup(module, field_array, call_back_function, form_name) {
|
||||
|
||||
if(!call_back_function) call_back_function = "set_return";
|
||||
|
||||
if(!form_name) form_name = "EditView";
|
||||
|
||||
return open_popup(module, 600, 400, "", true, false, {"call_back_function":call_back_function,"form_name":form_name,"field_to_name_array":field_array});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function addEvent(object,eventName,do_function) {
|
||||
|
||||
if(typeof(object) == "string") object = document.getElementById(object);
|
||||
|
||||
if(!object) { alert('No object in function addEvent!'); return; }
|
||||
|
||||
if(object.addEventListener) {
|
||||
|
||||
object.addEventListener(eventName, do_function, false);
|
||||
|
||||
} else {
|
||||
|
||||
object.attachEvent('on'+eventName, do_function);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function FormLoader() {
|
||||
|
||||
|
||||
|
||||
this.module;
|
||||
|
||||
this.createModule;
|
||||
|
||||
this.fieldName;
|
||||
|
||||
this.buttonName = 'FormLoaderButton';
|
||||
|
||||
|
||||
|
||||
this.load = function(module,createModule,fieldName) {
|
||||
|
||||
this.module = module;
|
||||
|
||||
this.createModule = createModule;
|
||||
|
||||
this.fieldName = fieldName;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.createButton = function() {
|
||||
|
||||
var b = document.createElement('input');
|
||||
|
||||
b.type = 'button';
|
||||
|
||||
b.className = 'button';
|
||||
|
||||
b.name = this.buttonName;
|
||||
|
||||
b.value = 'Create';
|
||||
|
||||
b.FL = this;
|
||||
|
||||
b.onclick = function() {
|
||||
|
||||
if(this.FL.createModule == '') return;
|
||||
|
||||
if(this.FL.onButtonClick) var data = this.FL.onButtonClick();
|
||||
|
||||
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
|
||||
|
||||
}
|
||||
|
||||
return b;
|
||||
|
||||
}
|
||||
|
||||
this.setEditDblClick = function(edit) { edit.FL=this; edit.ondblclick=this.editDblClick; }
|
||||
|
||||
this.editDblClick = function() {
|
||||
|
||||
if(this.FL.createModule == '') return;
|
||||
|
||||
if(this.FL.onEditDblClick) var data = this.FL.onEditDblClick();
|
||||
|
||||
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.responseData = function(data) {
|
||||
|
||||
if(this.onResponseData) this.onResponseData(data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.onResponseData;
|
||||
|
||||
|
||||
|
||||
this.addPostData = function() {
|
||||
|
||||
if(this.onAddPostData)
|
||||
|
||||
return this.onAddPostData();
|
||||
|
||||
else
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.onAddPostData;
|
||||
|
||||
this.onButtonClick;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
8861
modules/EcmCalls/yui/2.6.0/build/container/container-debug.js
Executable file
8861
modules/EcmCalls/yui/2.6.0/build/container/container-debug.js
Executable file
File diff suppressed because it is too large
Load Diff
19
modules/EcmCalls/yui/2.6.0/build/container/container-min.js
vendored
Executable file
19
modules/EcmCalls/yui/2.6.0/build/container/container-min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
8837
modules/EcmCalls/yui/2.6.0/build/container/container.js
Executable file
8837
modules/EcmCalls/yui/2.6.0/build/container/container.js
Executable file
File diff suppressed because it is too large
Load Diff
5059
modules/EcmCalls/yui/2.6.0/build/container/container_core-debug.js
Executable file
5059
modules/EcmCalls/yui/2.6.0/build/container/container_core-debug.js
Executable file
File diff suppressed because it is too large
Load Diff
13
modules/EcmCalls/yui/2.6.0/build/container/container_core-min.js
vendored
Executable file
13
modules/EcmCalls/yui/2.6.0/build/container/container_core-min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
5049
modules/EcmCalls/yui/2.6.0/build/container/container_core.js
Executable file
5049
modules/EcmCalls/yui/2.6.0/build/container/container_core.js
Executable file
File diff suppressed because it is too large
Load Diff
9667
modules/EcmCalls/yui/2.6.0/build/menu/menu-debug.js
Executable file
9667
modules/EcmCalls/yui/2.6.0/build/menu/menu-debug.js
Executable file
File diff suppressed because it is too large
Load Diff
15
modules/EcmCalls/yui/2.6.0/build/menu/menu-min.js
vendored
Executable file
15
modules/EcmCalls/yui/2.6.0/build/menu/menu-min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
9619
modules/EcmCalls/yui/2.6.0/build/menu/menu.js
Executable file
9619
modules/EcmCalls/yui/2.6.0/build/menu/menu.js
Executable file
File diff suppressed because it is too large
Load Diff
12
modules/EcmCalls/yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js
vendored
Executable file
12
modules/EcmCalls/yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user