Add php files
This commit is contained in:
123
modules/Leads/Capture.php
Executable file
123
modules/Leads/Capture.php
Executable file
@@ -0,0 +1,123 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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('modules/Leads/LeadFormBase.php');
|
||||
|
||||
global $app_strings, $app_list_strings;
|
||||
|
||||
$mod_strings = return_module_language($sugar_config['default_language'], 'Leads');
|
||||
|
||||
$app_list_strings['record_type_module'] = array('Contact'=>'Contacts', 'Account'=>'Accounts', 'Opportunity'=>'Opportunities', 'Case'=>'Cases', 'Note'=>'Notes', 'Call'=>'Calls', 'Email'=>'Emails', 'Meeting'=>'Meetings', 'Task'=>'Tasks', 'Lead'=>'Leads','Bug'=>'Bugs',
|
||||
);
|
||||
/**
|
||||
* To make your changes upgrade safe create a file called leadCapture_override.php and place the changes there
|
||||
*/
|
||||
$users = array(
|
||||
'PUT A RANDOM KEY FROM THE WEBSITE HERE' => array('name'=>'PUT THE USER_NAME HERE', 'pass'=>'PUT THE USER_HASH FOR THE RESPECTIVE USER HERE'),
|
||||
);
|
||||
if(file_exists('leadCapture_override.php')){
|
||||
include('leadCapture_override.php');
|
||||
}
|
||||
if (!empty($_POST['user']) && !empty($users[$_POST['user']])) {
|
||||
|
||||
$current_user = new User();
|
||||
$current_user->user_name = $users[$_POST['user']]['name'];
|
||||
|
||||
if($current_user->authenticate_user($users[$_POST['user']]['pass'])){
|
||||
$userid = $current_user->retrieve_user_id($users[$_REQUEST['user']]['name']);
|
||||
$current_user->retrieve($userid);
|
||||
$leadForm = new LeadFormBase();
|
||||
$prefix = '';
|
||||
if(!empty($_POST['prefix'])){
|
||||
$prefix = $_POST['prefix'];
|
||||
}
|
||||
|
||||
if( !isset($_POST['assigned_user_id']) || !empty($_POST['assigned_user_id']) ){
|
||||
$_POST['prefix'] = $userid;
|
||||
}
|
||||
|
||||
$_POST['record'] ='';
|
||||
|
||||
if( isset($_POST['_splitName']) ) {
|
||||
$name = explode(' ',$_POST['name']);
|
||||
if(sizeof($name) == 1) {
|
||||
$_POST['first_name'] = ''; $_POST['last_name'] = $name[0];
|
||||
}
|
||||
else {
|
||||
$_POST['first_name'] = $name[0]; $_POST['last_name'] = $name[1];
|
||||
}
|
||||
}
|
||||
|
||||
$return_val = $leadForm->handleSave($prefix, false, true);
|
||||
|
||||
if(isset($_POST['redirect']) && !empty($_POST['redirect'])){
|
||||
|
||||
//header("Location: ".$_POST['redirect']);
|
||||
echo '<html><head><title>SugarCRM</title></head><body>';
|
||||
echo '<form name="redirect" action="' .$_POST['redirect']. '" method="POST">';
|
||||
|
||||
foreach($_POST as $param => $value) {
|
||||
|
||||
if($param != 'redirect' && $param != 'submit') {
|
||||
echo '<input type="hidden" name="'.$param.'" value="'.$value.'">';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( ($return_val == '') || ($return_val == 0) || ($return_val < 0) ) {
|
||||
echo '<input type="hidden" name="error" value="1">';
|
||||
}
|
||||
echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
|
||||
echo '</body></html>';
|
||||
}
|
||||
else{
|
||||
echo "Thank You For Your Submission.";
|
||||
}
|
||||
sugar_cleanup();
|
||||
// die to keep code from running into redirect case below
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
echo "We're sorry, the server is currently unavailable, please try again later.";
|
||||
if (!empty($_POST['redirect'])) {
|
||||
echo '<html><head><title>SugarCRM</title></head><body>';
|
||||
echo '<form name="redirect" action="' .$_POST['redirect']. '" method="POST">';
|
||||
echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
|
||||
echo '</body></html>';
|
||||
}
|
||||
?>
|
||||
86
modules/Leads/Dashlets/MyLeadsDashlet/MyLeadsDashlet.data.php
Executable file
86
modules/Leads/Dashlets/MyLeadsDashlet/MyLeadsDashlet.data.php
Executable file
@@ -0,0 +1,86 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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['MyLeadsDashlet']['searchFields'] = array('date_entered' => array('default' => ''),
|
||||
'title' => array('default' => ''),
|
||||
'primary_address_country' => array('default' => ''),
|
||||
//'status' => array('default' => array('New', 'Assigned', 'In Process')),
|
||||
'assigned_user_id' => array('type' => 'assigned_user_name',
|
||||
'label' => 'LBL_ASSIGNED_TO',
|
||||
'default' => $current_user->name));
|
||||
|
||||
$dashletData['MyLeadsDashlet']['columns'] = array('name' => array('width' => '30',
|
||||
'label' => 'LBL_NAME',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
'related_fields' => array('first_name', 'last_name')),
|
||||
'title' => array('width' => '20',
|
||||
'label' => 'LBL_TITLE',
|
||||
'default' => true),
|
||||
'lead_source' => array('width' => '10',
|
||||
'label' => 'LBL_LEAD_SOURCE'),
|
||||
'status' => array('width' => '10',
|
||||
'label' => 'LBL_STATUS'),
|
||||
'phone_work' => array('width' => '20',
|
||||
'label' => 'LBL_OFFICE_PHONE',
|
||||
'default' => true),
|
||||
'email1' => array('width' => '30',
|
||||
'label' => 'LBL_EMAIL_ADDRESS',
|
||||
'sortable' => false,
|
||||
'customCode' => '{$EMAIL1_LINK}{$EMAIL1}</a>',
|
||||
'default' => true),
|
||||
'account_name' => array('width' => '40',
|
||||
'label' => 'LBL_ACCOUNT_NAME'),
|
||||
'phone_home' => array('width' => '10',
|
||||
'label' => 'LBL_HOME_PHONE'),
|
||||
'phone_mobile' => array('width' => '10',
|
||||
'label' => 'LBL_MOBILE_PHONE'),
|
||||
'phone_other' => array('width' => '10',
|
||||
'label' => 'LBL_OTHER_PHONE'),
|
||||
'date_entered' => array('width' => '15',
|
||||
'label' => 'LBL_LIST_DATE_ENTERED'),
|
||||
'date_modified' => array('width' => '15',
|
||||
'label' => 'LBL_DATE_MODIFIED'),
|
||||
'created_by' => array('width' => '8',
|
||||
'label' => 'LBL_CREATED'),
|
||||
'assigned_user_name' => array('width' => '8',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER'),
|
||||
);
|
||||
?>
|
||||
44
modules/Leads/Dashlets/MyLeadsDashlet/MyLeadsDashlet.meta.php
Executable file
44
modules/Leads/Dashlets/MyLeadsDashlet/MyLeadsDashlet.meta.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$dashletMeta['MyLeadsDashlet'] = array('module' => 'Leads',
|
||||
'title' => translate('LBL_LIST_MY_LEADS', 'Leads'),
|
||||
'description' => 'A customizable view into Leads',
|
||||
'category' => 'Module Views');
|
||||
?>
|
||||
59
modules/Leads/Dashlets/MyLeadsDashlet/MyLeadsDashlet.php
Executable file
59
modules/Leads/Dashlets/MyLeadsDashlet/MyLeadsDashlet.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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');
|
||||
|
||||
|
||||
class MyLeadsDashlet extends DashletGeneric {
|
||||
function MyLeadsDashlet($id, $def = null) {
|
||||
global $current_user, $app_strings;
|
||||
require('modules/Leads/Dashlets/MyLeadsDashlet/MyLeadsDashlet.data.php');
|
||||
|
||||
parent::DashletGeneric($id, $def);
|
||||
|
||||
if(empty($def['title'])) $this->title = translate('LBL_LIST_MY_LEADS', 'Leads');
|
||||
|
||||
$this->searchFields = $dashletData['MyLeadsDashlet']['searchFields'];
|
||||
$this->columns = $dashletData['MyLeadsDashlet']['columns'];
|
||||
$this->seedBean = new Lead();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
584
modules/Leads/Lead.php
Executable file
584
modules/Leads/Lead.php
Executable file
@@ -0,0 +1,584 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/SugarObjects/templates/person/Person.php');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
require_once('include/SugarObjects/templates/person/Person.php');
|
||||
|
||||
// Lead is used to store profile information for people who may become customers.
|
||||
class Lead extends Person {
|
||||
var $field_name_map;
|
||||
// Stored fields
|
||||
var $id;
|
||||
var $date_entered;
|
||||
var $date_modified;
|
||||
var $modified_user_id;
|
||||
var $assigned_user_id;
|
||||
var $created_by;
|
||||
var $created_by_name;
|
||||
var $modified_by_name;
|
||||
var $description;
|
||||
var $salutation;
|
||||
var $first_name;
|
||||
var $last_name;
|
||||
var $title;
|
||||
var $department;
|
||||
var $reports_to_id;
|
||||
var $do_not_call;
|
||||
var $phone_home;
|
||||
var $phone_mobile;
|
||||
var $phone_work;
|
||||
var $phone_other;
|
||||
var $phone_fax;
|
||||
var $refered_by;
|
||||
var $email1;
|
||||
var $email2;
|
||||
var $primary_address_street;
|
||||
var $primary_address_city;
|
||||
var $primary_address_state;
|
||||
var $primary_address_postalcode;
|
||||
var $primary_address_country;
|
||||
var $alt_address_street;
|
||||
var $alt_address_city;
|
||||
var $alt_address_state;
|
||||
var $alt_address_postalcode;
|
||||
var $alt_address_country;
|
||||
var $name;
|
||||
var $full_name;
|
||||
var $portal_name;
|
||||
var $portal_app;
|
||||
var $contact_id;
|
||||
var $contact_name;
|
||||
var $account_id;
|
||||
var $opportunity_id;
|
||||
var $opportunity_name;
|
||||
var $opportunity_amount;
|
||||
//used for vcard export only
|
||||
var $birthdate;
|
||||
var $status;
|
||||
var $status_description;
|
||||
|
||||
var $lead_source;
|
||||
var $lead_source_description;
|
||||
// These are for related fields
|
||||
var $account_name;
|
||||
var $acc_name_from_accounts;
|
||||
var $account_site;
|
||||
var $account_description;
|
||||
var $case_role;
|
||||
var $case_rel_id;
|
||||
var $case_id;
|
||||
var $task_id;
|
||||
var $note_id;
|
||||
var $meeting_id;
|
||||
var $call_id;
|
||||
var $email_id;
|
||||
var $assigned_user_name;
|
||||
var $campaign_id;
|
||||
var $campaign_name;
|
||||
var $alt_address_street_2;
|
||||
var $alt_address_street_3;
|
||||
var $primary_address_street_2;
|
||||
var $primary_address_street_3;
|
||||
|
||||
|
||||
var $table_name = "leads";
|
||||
var $object_name = "Lead";
|
||||
var $object_names = "Leads";
|
||||
var $module_dir = "Leads";
|
||||
var $new_schema = true;
|
||||
var $emailAddress;
|
||||
|
||||
var $importable = true;
|
||||
|
||||
// This is used to retrieve related fields from form posts.
|
||||
var $additional_column_fields = Array('assigned_user_name', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id');
|
||||
var $relationship_fields = Array('email_id'=>'emails','call_id'=>'calls','meeting_id'=>'meetings','task_id'=>'tasks',);
|
||||
|
||||
function Lead() {
|
||||
parent::Person();
|
||||
}
|
||||
|
||||
function get_account()
|
||||
{
|
||||
if(isset($this->account_id) && !empty($this->account_id)){
|
||||
$query = "SELECT name , assigned_user_id account_name_owner FROM accounts WHERE id='{$this->account_id}'";
|
||||
|
||||
//requireSingleResult has beeen deprecated.
|
||||
//$result = $this->db->requireSingleResult($query);
|
||||
$result = $this->db->limitQuery($query,0,1,true, "Want only a single row");
|
||||
|
||||
if(!empty($result)){
|
||||
$row = $this->db->fetchByAssoc($result);
|
||||
$this->account_name = $row['name'];
|
||||
$this->account_name_owner = $row['account_name_owner'];
|
||||
$this->account_name_mod = 'Accounts';
|
||||
}
|
||||
|
||||
}}
|
||||
function get_opportunity()
|
||||
{
|
||||
if(isset($this->opportunity_id) && !empty($this->opportunity_id)){
|
||||
$query = "SELECT name, assigned_user_id opportunity_name_owner FROM opportunities WHERE id='{$this->opportunity_id}'";
|
||||
|
||||
//requireSingleResult has beeen deprecated.
|
||||
//$result = $this->db->requireSingleResult($query);
|
||||
$result = $this->db->limitQuery($query,0,1,true, "Want only a single row");
|
||||
|
||||
if(!empty($result)){
|
||||
$row = $this->db->fetchByAssoc($result);
|
||||
$this->opportunity_name = $row['name'];
|
||||
$this->opportunity_name_owner = $row['opportunity_name_owner'];
|
||||
$this->opportunity_name_mod = 'Opportunities';
|
||||
}
|
||||
|
||||
}}
|
||||
function get_contact()
|
||||
{
|
||||
global $locale;
|
||||
if(isset($this->contact_id) && !empty($this->contact_id)){
|
||||
$query = "SELECT first_name, last_name, assigned_user_id contact_name_owner FROM contacts WHERE id='{$this->contact_id}'";
|
||||
|
||||
//requireSingleResult has beeen deprecated.
|
||||
//$result = $this->db->requireSingleResult($query);
|
||||
$result = $this->db->limitQuery($query,0,1,true, "Want only a single row");
|
||||
if(!empty($result)){
|
||||
$row= $this->db->fetchByAssoc($result);
|
||||
$this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name']);
|
||||
$this->contact_name_owner = $row['contact_name_owner'];
|
||||
$this->contact_name_mod = 'Contacts';
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
function create_list_query($order_by, $where, $show_deleted=0)
|
||||
{
|
||||
$custom_join = $this->custom_fields->getJOIN();
|
||||
$query = "SELECT ";
|
||||
|
||||
|
||||
$query .= "$this->table_name.*, users.user_name assigned_user_name";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['select'];
|
||||
}
|
||||
$query .= " FROM leads ";
|
||||
|
||||
$query .= " LEFT JOIN users
|
||||
ON leads.assigned_user_id=users.id ";
|
||||
$query .= "LEFT JOIN email_addr_bean_rel eabl ON eabl.bean_id = leads.id AND eabl.bean_module = 'Leads' and eabl.primary_address = 1 and eabl.deleted=0 ";
|
||||
$query .= "LEFT JOIN email_addresses ea ON (ea.id = eabl.email_address_id) ";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['join'];
|
||||
}
|
||||
$where_auto = '1=1';
|
||||
if($show_deleted == 0){
|
||||
$where_auto = " leads.deleted=0 ";
|
||||
}else if($show_deleted == 1){
|
||||
$where_auto = " leads.deleted=1 ";
|
||||
}
|
||||
|
||||
if($where != "")
|
||||
$query .= "where ($where) AND ".$where_auto;
|
||||
else
|
||||
$query .= "where ".$where_auto; //."and (leads.converted='0')";
|
||||
|
||||
if(!empty($order_by))
|
||||
$query .= " ORDER BY $order_by";
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function create_new_list_query($order_by, $where,$filter=array(),$params=array(), $show_deleted = 0,$join_type='', $return_array = false, $parentbean = null, $singleSelect = false){
|
||||
|
||||
$ret_array = parent::create_new_list_query($order_by, $where, $filter, $params, $show_deleted, $join_type, true, $parentbean, $singleSelect);
|
||||
if(strpos($ret_array['select'],"leads.account_name") == false && strpos($ret_array['select'],"leads.*") == false)
|
||||
$ret_array['select'] .= " ,leads.account_name";
|
||||
if ( !$return_array )
|
||||
return $ret_array['select'] . $ret_array['from'] . $ret_array['where']. $ret_array['order_by'];
|
||||
return $ret_array;
|
||||
}
|
||||
|
||||
function create_export_query(&$order_by, &$where, $relate_link_join='')
|
||||
{
|
||||
$custom_join = $this->custom_fields->getJOIN(true, true,$where);
|
||||
if($custom_join)
|
||||
$custom_join['join'] .= $relate_link_join;
|
||||
$query = "SELECT
|
||||
leads.*, email_addresses.email_address email1,
|
||||
users.user_name assigned_user_name";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['select'];
|
||||
}
|
||||
$query .= " FROM leads ";
|
||||
$query .= " LEFT JOIN users
|
||||
ON leads.assigned_user_id=users.id ";
|
||||
|
||||
//join email address table too.
|
||||
$query .= ' LEFT JOIN email_addr_bean_rel on leads.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module=\'Leads\' and email_addr_bean_rel.deleted=0 and email_addr_bean_rel.primary_address=1 ';
|
||||
$query .= ' LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id ' ;
|
||||
|
||||
|
||||
if($custom_join){
|
||||
$query .= $custom_join['join'];
|
||||
}
|
||||
|
||||
$where_auto = " leads.deleted=0 ";
|
||||
|
||||
if($where != "")
|
||||
$query .= "where ($where) AND ".$where_auto;
|
||||
else
|
||||
$query .= "where ".$where_auto;
|
||||
|
||||
if(!empty($order_by))
|
||||
$query .= " ORDER BY $order_by";
|
||||
return $query;
|
||||
}
|
||||
|
||||
function converted_lead($leadid, $contactid, $accountid, $opportunityid){
|
||||
$query = "UPDATE leads set converted='1', contact_id=$contactid, account_id=$accountid, opportunity_id=$opportunityid where id=$leadid and deleted=0";
|
||||
$this->db->query($query,true,"Error converting lead: ");
|
||||
|
||||
//we must move the status out here in order to be able to capture workflow conditions
|
||||
$leadid = str_replace("'","", $leadid);
|
||||
$lead = new Lead();
|
||||
$lead->retrieve($leadid);
|
||||
$lead->status='Converted';
|
||||
$lead->save();
|
||||
}
|
||||
|
||||
function fill_in_additional_list_fields()
|
||||
{
|
||||
parent::fill_in_additional_list_fields();
|
||||
$this->_create_proper_name_field();
|
||||
$this->get_account();
|
||||
|
||||
}
|
||||
|
||||
function fill_in_additional_detail_fields()
|
||||
{
|
||||
//Fill in the assigned_user_name
|
||||
//if(!empty($this->status))
|
||||
//$this->status = translate('lead_status_dom', '', $this->status);
|
||||
parent::fill_in_additional_detail_fields();
|
||||
$this->_create_proper_name_field();
|
||||
$this->get_contact();
|
||||
$this->get_opportunity();
|
||||
$this->get_account();
|
||||
|
||||
if(!empty($this->campaign_id)){
|
||||
|
||||
$camp = new Campaign();
|
||||
$where = "campaigns.id='$this->campaign_id'";
|
||||
$campaign_list = $camp->get_full_list("campaigns.name", $where, true);
|
||||
if(!empty($campaign_list))
|
||||
$this->campaign_name = $campaign_list[0]->name;
|
||||
}
|
||||
}
|
||||
|
||||
function get_list_view_data(){
|
||||
/*global $app_list_strings;
|
||||
global $current_user;
|
||||
|
||||
$temp_array = $this->get_list_view_array();
|
||||
$temp_array['STATUS'] = (empty($temp_array['STATUS'])) ? '' : $temp_array['STATUS'];
|
||||
$temp_array['ENCODED_NAME']=$this->name;
|
||||
$temp_array['NAME']=$this->name;
|
||||
$temp_array['EMAIL1'] = $this->emailAddress->getPrimaryAddress($this);
|
||||
$this->email1 = $temp_array['EMAIL1'];
|
||||
$temp_array['EMAIL1_LINK'] = $current_user->getEmailLink('email1', $this, '', '', 'ListView');
|
||||
$temp_array['ACC_NAME_FROM_ACCOUNTS'] = empty($temp_array['ACC_NAME_FROM_ACCOUNTS']) ? ($temp_array['ACCOUNT_NAME']) : ($temp_array['ACC_NAME_FROM_ACCOUNTS']);
|
||||
return $temp_array;
|
||||
*/
|
||||
$this->_create_proper_name_field();
|
||||
$temp_array = parent::get_list_view_data();
|
||||
$temp_array['ACC_NAME_FROM_ACCOUNTS'] = empty($temp_array['ACC_NAME_FROM_ACCOUNTS']) ? ($temp_array['ACCOUNT_NAME']) : ($temp_array['ACC_NAME_FROM_ACCOUNTS']);
|
||||
return $temp_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of fields that are of type link.
|
||||
*
|
||||
* @return array List of fields.
|
||||
*
|
||||
* Internal function, do not override.
|
||||
*/
|
||||
//fix for bug 27339 Shine
|
||||
function get_linked_fields()
|
||||
{
|
||||
$linked_fields=array();
|
||||
$fieldDefs = $this->getFieldDefinitions();
|
||||
|
||||
//find all definitions of type link.
|
||||
if (!empty($fieldDefs))
|
||||
{
|
||||
foreach ($fieldDefs as $name=>$properties)
|
||||
{
|
||||
if ($name == 'oldmeetings' || $name == 'oldcalls') { continue; }
|
||||
elseif (array_search('link',$properties) === 'type')
|
||||
{
|
||||
$linked_fields[$name]=$properties;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $linked_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
builds a generic search based on the query string using or
|
||||
do not include any $this-> because this is called on without having the class instantiated
|
||||
*/
|
||||
function build_generic_where_clause ($the_query_string) {
|
||||
$where_clauses = Array();
|
||||
$the_query_string = $GLOBALS['db']->quote($the_query_string);
|
||||
|
||||
array_push($where_clauses, "leads.last_name like '$the_query_string%'");
|
||||
array_push($where_clauses, "leads.account_name like '$the_query_string%'");
|
||||
array_push($where_clauses, "leads.first_name like '$the_query_string%'");
|
||||
array_push($where_clauses, "ea.email_address like '$the_query_string%'");
|
||||
|
||||
if (is_numeric($the_query_string)) {
|
||||
array_push($where_clauses, "leads.phone_home like '%$the_query_string%'");
|
||||
array_push($where_clauses, "leads.phone_mobile like '%$the_query_string%'");
|
||||
array_push($where_clauses, "leads.phone_work like '%$the_query_string%'");
|
||||
array_push($where_clauses, "leads.phone_other like '%$the_query_string%'");
|
||||
array_push($where_clauses, "leads.phone_fax like '%$the_query_string%'");
|
||||
|
||||
}
|
||||
|
||||
$the_where = "";
|
||||
foreach($where_clauses as $clause)
|
||||
{
|
||||
if($the_where != "") $the_where .= " or ";
|
||||
$the_where .= $clause;
|
||||
}
|
||||
|
||||
|
||||
return $the_where;
|
||||
}
|
||||
|
||||
function set_notification_body($xtpl, $lead)
|
||||
{
|
||||
global $app_list_strings;
|
||||
global $locale;
|
||||
|
||||
$xtpl->assign("LEAD_NAME", $locale->getLocaleFormattedName($lead->first_name, $lead->last_name, $lead->salutation));
|
||||
$xtpl->assign("LEAD_SOURCE", (isset($lead->lead_source) ? $app_list_strings['lead_source_dom'][$lead->lead_source] : ""));
|
||||
$xtpl->assign("LEAD_STATUS", (isset($lead->status)? $app_list_strings['lead_status_dom'][$lead->status]:""));
|
||||
$xtpl->assign("LEAD_DESCRIPTION", $lead->description);
|
||||
|
||||
return $xtpl;
|
||||
}
|
||||
|
||||
function bean_implements($interface){
|
||||
switch($interface){
|
||||
case 'ACL':return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function listviewACLHelper(){
|
||||
$array_assign = parent::listviewACLHelper();
|
||||
$is_owner = false;
|
||||
if(!empty($this->account_name)){
|
||||
|
||||
if(!empty($this->account_name_owner)){
|
||||
global $current_user;
|
||||
$is_owner = $current_user->id == $this->account_name_owner;
|
||||
}
|
||||
}
|
||||
if( ACLController::checkAccess('Accounts', 'view', $is_owner)){
|
||||
$array_assign['ACCOUNT'] = 'a';
|
||||
}else{
|
||||
$array_assign['ACCOUNT'] = 'span';
|
||||
}
|
||||
$is_owner = false;
|
||||
if(!empty($this->opportunity_name)){
|
||||
|
||||
if(!empty($this->opportunity_name_owner)){
|
||||
global $current_user;
|
||||
$is_owner = $current_user->id == $this->opportunity_name_owner;
|
||||
}
|
||||
}
|
||||
if( ACLController::checkAccess('Opportunities', 'view', $is_owner)){
|
||||
$array_assign['OPPORTUNITY'] = 'a';
|
||||
}else{
|
||||
$array_assign['OPPORTUNITY'] = 'span';
|
||||
}
|
||||
|
||||
|
||||
$is_owner = false;
|
||||
if(!empty($this->contact_name)){
|
||||
|
||||
if(!empty($this->contact_name_owner)){
|
||||
global $current_user;
|
||||
$is_owner = $current_user->id == $this->contact_name_owner;
|
||||
}
|
||||
}
|
||||
if( ACLController::checkAccess('Contacts', 'view', $is_owner)){
|
||||
$array_assign['CONTACT'] = 'a';
|
||||
}else{
|
||||
$array_assign['CONTACT'] = 'span';
|
||||
}
|
||||
|
||||
return $array_assign;
|
||||
}
|
||||
|
||||
//carrys forward custom lead fields to contacts, accounts, opportunities during Lead Conversion
|
||||
function convertCustomFieldsForm(&$form, &$tempBean, &$prefix) {
|
||||
|
||||
global $mod_strings, $app_list_strings, $app_strings, $lbl_required_symbol;
|
||||
|
||||
foreach($this->field_defs as $field => $value) {
|
||||
|
||||
if(!empty($value['source']) && $value['source'] == 'custom_fields') {
|
||||
if( !empty($tempBean->field_defs[$field]) AND isset($tempBean->field_defs[$field]) ) {
|
||||
$form .= "<tr><td nowrap colspan='4' class='dataLabel'>".$mod_strings[$tempBean->field_defs[$field]['vname']].":";
|
||||
|
||||
if( !empty($tempBean->custom_fields->avail_fields[$field]['required']) AND ( ($tempBean->custom_fields->avail_fields[$field]['required']== 1) OR ($tempBean->custom_fields->avail_fields[$field]['required']== '1') OR ($tempBean->custom_fields->avail_fields[$field]['required']== 'true') OR ($tempBean->custom_fields->avail_fields[$field]['required']== true) ) ) {
|
||||
$form .= " <span class='required'>".$lbl_required_symbol."</span>";
|
||||
}
|
||||
$form .= "</td></tr>";
|
||||
$form .= "<tr><td nowrap colspan='4' class='dataField' nowrap>";
|
||||
|
||||
if(isset($value['isMultiSelect']) && $value['isMultiSelect'] == 1){
|
||||
$this->$field = unencodeMultienum($this->$field);
|
||||
$multiple = "multiple";
|
||||
$array = '[]';
|
||||
} else {
|
||||
$multiple = null;
|
||||
$array = null;
|
||||
}
|
||||
|
||||
if(!empty($value['options']) AND isset($value['options']) ) {
|
||||
$form .= "<select " . $multiple . " name='".$prefix.$field.$array."'>";
|
||||
$form .= get_select_options_with_id($app_list_strings[$value['options']], $this->$field);
|
||||
$form .= "</select";
|
||||
} elseif($value['type'] == 'bool' ) {
|
||||
if( ($this->$field == 1) OR ($this->$field == '1') ) { $checked = 'checked'; } else { $checked = ''; }
|
||||
$form .= "<input type='checkbox' name='".$prefix.$field."' id='".$prefix.$field."' value='1' ".$checked."/>";
|
||||
} elseif($value['type'] == 'text' ) {
|
||||
$form .= "<textarea name='".$prefix.$field."' rows='6' cols='50'>".$this->$field."</textarea>";
|
||||
} elseif($value['type'] == 'date' ) {
|
||||
$form .= "<input name='".$prefix.$field."' id='jscal_field".$field."' type='text' size='11' maxlength='10' value='".$this->$field."'> <img src='".SugarThemeRegistry::current()->getImageURL('jscalendar.gif')."' alt='Enter Date' id='jscal_trigger".$field."' align='absmiddle'> <span class='dateFormat'>yyyy-mm-dd</span><script type='text/javascript'>Calendar.setup ({inputField : 'jscal_field".$field."', ifFormat : '%Y-%m-%d', showsTime : false, button : 'jscal_trigger".$field."', singleClick : true, step : 1, weekNumbers:false}); addToValidate('ConvertLead', '".$field."', 'date', false,'".$mod_strings[$tempBean->field_defs[$field]['vname']]."' );</script>";
|
||||
} else {
|
||||
$form .= "<input name='".$prefix.$field."' type='text' value='".$this->$field."'>";
|
||||
|
||||
if($this->custom_fields->avail_fields[$field]['type'] == 'int') {
|
||||
$form .= "<script>addToValidate('ConvertLead', '".$prefix.$field."', 'int', false,'".$prefix.":".$mod_strings[$tempBean->field_defs[$field]['vname']]."' );</script>";
|
||||
}
|
||||
elseif($this->custom_fields->avail_fields[$field]['type'] == 'float') {
|
||||
$form .= "<script>addToValidate('ConvertLead', '".$prefix.$field."', 'float', false,'".$prefix.":".$mod_strings[$tempBean->field_defs[$field]['vname']]."' );</script>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( !empty($tempBean->custom_fields->avail_fields[$field]['required']) AND ( ($tempBean->custom_fields->avail_fields[$field]['required']== 1) OR ($tempBean->custom_fields->avail_fields[$field]['required']== '1') OR ($tempBean->custom_fields->avail_fields[$field]['required']== 'true') OR ($tempBean->custom_fields->avail_fields[$field]['required']== true) ) ) {
|
||||
$form .= "<script>addToValidate('ConvertLead', '".$prefix.$field."', 'relate', true,'".$prefix.":".$mod_strings[$tempBean->field_defs[$field]['vname']]."' );</script>";
|
||||
}
|
||||
|
||||
$form .= "</td></tr>";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function save($check_notify = false) {
|
||||
if(empty($this->status))
|
||||
$this->status = 'New';
|
||||
// call save first so that $this->id will be set
|
||||
$value = parent::save($check_notify);
|
||||
return $value;
|
||||
}
|
||||
function get_unlinked_email_query($type=array()) {
|
||||
|
||||
return get_unlinked_email_query($type, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns query to find the related calls created pre-5.1
|
||||
*
|
||||
* @return string SQL statement
|
||||
*/
|
||||
public function get_old_related_calls()
|
||||
{
|
||||
$return_array['select']='SELECT calls.id ';
|
||||
$return_array['from']='FROM calls ';
|
||||
$return_array['where']=" WHERE calls.parent_id = '$this->id'
|
||||
AND calls.parent_type = 'Leads' AND calls.id NOT IN ( SELECT call_id FROM calls_leads ) ";
|
||||
$return_array['join'] = "";
|
||||
$return_array['join_tables'][0] = '';
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns query to find the related meetings created pre-5.1
|
||||
*
|
||||
* @return string SQL statement
|
||||
*/
|
||||
public function get_old_related_meetings()
|
||||
{
|
||||
$return_array['select']='SELECT meetings.id ';
|
||||
$return_array['from']='FROM meetings ';
|
||||
$return_array['where']=" WHERE meetings.parent_id = '$this->id'
|
||||
AND meetings.parent_type = 'Leads' AND meetings.id NOT IN ( SELECT meeting_id FROM meetings_leads ) ";
|
||||
$return_array['join'] = "";
|
||||
$return_array['join_tables'][0] = '';
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
378
modules/Leads/LeadFormBase.php
Executable file
378
modules/Leads/LeadFormBase.php
Executable file
@@ -0,0 +1,378 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
class LeadFormBase {
|
||||
|
||||
function checkForDuplicates($prefix, $id){
|
||||
require_once('include/formbase.php');
|
||||
|
||||
$focus = new Lead();
|
||||
if(!checkRequired($prefix, array_keys($focus->required_fields))){
|
||||
return null;
|
||||
}
|
||||
$query = '';
|
||||
$baseQuery = "select id,first_name, last_name,account_name, title from leads where deleted!=1 and id!='$id' and (status!='Converted' or status is NULL) and ";
|
||||
if(isset($_POST[$prefix.'first_name']) && !empty($_POST[$prefix.'first_name']) && isset($_POST[$prefix.'last_name']) && !empty($_POST[$prefix.'last_name'])){
|
||||
$query = $baseQuery ." (first_name='". $_POST[$prefix.'first_name'] . "' and last_name = '". $_POST[$prefix.'last_name'] ."')";
|
||||
}else{
|
||||
$query = $baseQuery ." last_name = '". $_POST[$prefix.'last_name'] ."'";
|
||||
}
|
||||
$rows = array();
|
||||
global $db;
|
||||
$result = $db->query($query);
|
||||
while (($row = $db->fetchByAssoc($result)) != null) {
|
||||
if(!isset($rows[$row['id']])) {
|
||||
$rows[]=$row;
|
||||
}
|
||||
}
|
||||
|
||||
$emailStr="";
|
||||
if(isset($_POST[$prefix.'email1']) && !empty($_POST[$prefix.'email1'])){
|
||||
$emailStr="'". strtoupper($_POST[$prefix.'email1']) ."'";
|
||||
}
|
||||
if(isset($_POST[$prefix.'email2']) && !empty($_POST[$prefix.'email2'])){
|
||||
if (!empty($emailStr)) $emailStr.=",";
|
||||
$emailStr="'". strtoupper($_POST[$prefix.'email2']) ."'";
|
||||
}
|
||||
|
||||
if(!empty($emailStr) > 0) {
|
||||
$query = 'SELECT DISTINCT er.bean_id AS id FROM email_addr_bean_rel er, ' .
|
||||
'email_addresses ea WHERE ea.id = er.email_address_id ' .
|
||||
'AND ea.deleted = 0 AND er.deleted = 0 AND er.bean_module = \'Contacts\' ' .
|
||||
'AND email_address_caps IN (' . $emailStr . ')';
|
||||
$result = $db->query($query);
|
||||
while (($row= $db->fetchByAssoc($result)) != null) {
|
||||
if(!isset($rows[$row['id']])) {
|
||||
$query2 = "SELECT id, first_name, last_name, title FROM contacts WHERE deleted = 0 AND id = '" . $row['id'] . "'";
|
||||
$result2 = $db->query($query2);
|
||||
$r = $db->fetchByAssoc($result2);
|
||||
if(isset($r['id'])) {
|
||||
$rows[]=$r;
|
||||
}
|
||||
} //if
|
||||
}
|
||||
} //if
|
||||
|
||||
return !empty($rows) ? $rows : null;
|
||||
}
|
||||
|
||||
|
||||
function buildTableForm($rows, $mod=''){
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}else global $mod_strings;
|
||||
global $app_strings;
|
||||
$cols = sizeof($rows[0]) * 2 + 1;
|
||||
$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
|
||||
$form .= "<form action='index.php' method='post' name='dupLeads'><input type='hidden' name='selectedLead' value=''>";
|
||||
$form .= get_form_header($mod_strings['LBL_DUPLICATE'],"", '');
|
||||
$form .= "<table width='100%' cellpadding='0' cellspacing='0'> <tr > <td ></td>";
|
||||
|
||||
|
||||
require_once('include/formbase.php');
|
||||
$form .= getPostToForm();
|
||||
|
||||
if(isset($rows[0])){
|
||||
foreach ($rows[0] as $key=>$value){
|
||||
if($key != 'id'){
|
||||
|
||||
|
||||
$form .= "<td scope='col' >". $mod_strings[$mod_strings['db_'.$key]]. "</td>";
|
||||
}
|
||||
}
|
||||
$form .= "</tr>";
|
||||
}
|
||||
$rowColor = 'oddListRowS1';
|
||||
foreach($rows as $row){
|
||||
|
||||
|
||||
$form .= "<tr class='$rowColor'>";
|
||||
$form .= "<td width='1%' nowrap='nowrap' align='center'><input type='checkbox' name='selectedLeads[]' value='{$row['id']}'></td>";
|
||||
$wasSet = false;
|
||||
|
||||
foreach ($row as $key=>$value){
|
||||
if($key != 'id'){
|
||||
|
||||
if(!$wasSet){
|
||||
$form .= "<td scope='row'><a target='_blank' href='index.php?module=Leads&action=DetailView&record=${row['id']}'>$value</a></td>";
|
||||
$wasSet = true;
|
||||
}else{
|
||||
$form .= "<td><a target='_blank' href='index.php?module=Leads&action=DetailView&record=${row['id']}'>$value</a></td>";
|
||||
}}
|
||||
}
|
||||
if($rowColor == 'evenListRowS1'){
|
||||
$rowColor = 'oddListRowS1';
|
||||
}else{
|
||||
$rowColor = 'evenListRowS1';
|
||||
}
|
||||
$form .= "</tr>";
|
||||
}
|
||||
$form .= "<tr ><td colspan='$cols' ></td></tr>";
|
||||
$form .= "</table><br><input type='submit' class='button' name='ContinueLead' value='${app_strings['LBL_NEXT_BUTTON_LABEL']}'></form>";
|
||||
return $form;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
function getWideFormBody($prefix, $mod='', $formname=''){
|
||||
if(!ACLController::checkAccess('Leads', 'edit', true)){
|
||||
return '';
|
||||
}
|
||||
global $mod_strings;
|
||||
$temp_strings = $mod_strings;
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}
|
||||
global $app_strings;
|
||||
global $current_user;
|
||||
global $app_list_strings;
|
||||
$primary_address_country_options = get_select_options_with_id($app_list_strings['countries_dom'], '');
|
||||
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
|
||||
$lbl_first_name = $mod_strings['LBL_FIRST_NAME'];
|
||||
$lbl_last_name = $mod_strings['LBL_LAST_NAME'];
|
||||
$lbl_phone = $mod_strings['LBL_OFFICE_PHONE'];
|
||||
$lbl_address = $mod_strings['LBL_PRIMARY_ADDRESS'];
|
||||
$user_id = $current_user->id;
|
||||
$lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS'];
|
||||
$form = <<<EOQ
|
||||
<input type="hidden" name="${prefix}record" value="">
|
||||
<input type="hidden" name="${prefix}status" value="New">
|
||||
<input type="hidden" name="${prefix}assigned_user_id" value='${user_id}'>
|
||||
<table class='evenListRow' border='0' width='100%'><tr><td nowrap cospan='1'>$lbl_first_name<br><input name="${prefix}first_name" type="text" value=""></td><td colspan='1'><FONT class="required">$lbl_required_symbol</FONT> $lbl_last_name<br><input name='${prefix}last_name' type="text" value=""></td></tr>
|
||||
<tr><td colspan='4'><hr></td></tr>
|
||||
<tr><td nowrap colspan='1'>${mod_strings['LBL_TITLE']}<br><input name='${prefix}title' type="text" value=""></td><td nowrap colspan='1'>${mod_strings['LBL_DEPARTMENT']}<br><input name='${prefix}department' type="text" value=""></td></tr>
|
||||
<tr><td colspan='4'><hr></td></tr>
|
||||
<tr><td nowrap colspan='4'>$lbl_address<br><input type='text' name='${prefix}primary_address_street' size='80'></td></tr>
|
||||
<tr><td> ${mod_strings['LBL_CITY']}<BR><input name='${prefix}primary_address_city' maxlength='100' value=''></td><td>${mod_strings['LBL_STATE']}<BR><input name='${prefix}primary_address_state' maxlength='100' value=''></td><td>${mod_strings['LBL_POSTAL_CODE']}<BR><input name='${prefix}primary_address_postalcode' maxlength='100' value=''></td><td>${mod_strings['LBL_COUNTRY']}<BR><select name='${prefix}primary_address_country' size='1'>{$primary_address_country_options}</select></td></tr>
|
||||
<tr><td colspan='4'><hr></td></tr>
|
||||
<tr><td nowrap >$lbl_phone<br><input name='${prefix}phone_work' type="text" value=""></td><td nowrap >${mod_strings['LBL_MOBILE_PHONE']}<br><input name='${prefix}phone_mobile' type="text" value=""></td><td nowrap >${mod_strings['LBL_FAX_PHONE']}<br><input name='${prefix}phone_fax' type="text" value=""></td><td nowrap >${mod_strings['LBL_HOME_PHONE']}<br><input name='${prefix}phone_home' type="text" value=""></td></tr>
|
||||
<tr><td colspan='4'><hr></td></tr>
|
||||
<tr><td nowrap colspan='1'>$lbl_email_address<br><input name='${prefix}email1' type="text" value=""></td><td nowrap colspan='1'>${mod_strings['LBL_OTHER_EMAIL_ADDRESS']}<br><input name='${prefix}email2' type="text" value=""></td></tr>
|
||||
<tr><td nowrap colspan='4'>${mod_strings['LBL_DESCRIPTION']}<br><textarea cols='80' rows='4' name='${prefix}description' ></textarea></td></tr></table>
|
||||
|
||||
EOQ;
|
||||
|
||||
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName($formname);
|
||||
$javascript->setSugarBean(new Lead());
|
||||
$javascript->addField('email1','false',$prefix);
|
||||
$javascript->addField('email2','false',$prefix);
|
||||
$javascript->addRequiredFields($prefix);
|
||||
$form .=$javascript->getScript();
|
||||
$mod_strings = $temp_strings;
|
||||
return $form;
|
||||
}
|
||||
|
||||
function getFormBody($prefix, $mod='', $formname=''){
|
||||
if(!ACLController::checkAccess('Leads', 'edit', true)){
|
||||
return '';
|
||||
}
|
||||
global $mod_strings;
|
||||
$temp_strings = $mod_strings;
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}
|
||||
global $app_strings;
|
||||
global $current_user;
|
||||
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
|
||||
$lbl_first_name = $mod_strings['LBL_FIRST_NAME'];
|
||||
$lbl_last_name = $mod_strings['LBL_LAST_NAME'];
|
||||
$lbl_phone = $mod_strings['LBL_PHONE'];
|
||||
$user_id = $current_user->id;
|
||||
$lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS'];
|
||||
$form = <<<EOQ
|
||||
<input type="hidden" name="${prefix}record" value="">
|
||||
<input type="hidden" name="${prefix}email2" value="">
|
||||
<input type="hidden" name="${prefix}status" value="New">
|
||||
<input type="hidden" name="${prefix}assigned_user_id" value='${user_id}'>
|
||||
<p> $lbl_first_name<br>
|
||||
<input name="${prefix}first_name" type="text" value=""><br>
|
||||
$lbl_last_name <span class="required">$lbl_required_symbol</span><br>
|
||||
<input name='${prefix}last_name' type="text" value=""><br>
|
||||
$lbl_phone<br>
|
||||
<input name='${prefix}phone_work' type="text" value=""><br>
|
||||
$lbl_email_address<br>
|
||||
<input name='${prefix}email1' type="text" value=""></p>
|
||||
|
||||
EOQ;
|
||||
|
||||
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName($formname);
|
||||
$javascript->setSugarBean(new Lead());
|
||||
$javascript->addField('email1','false',$prefix);
|
||||
$javascript->addField('email2','false',$prefix);
|
||||
$javascript->addRequiredFields($prefix);
|
||||
$form .=$javascript->getScript();
|
||||
$mod_strings = $temp_strings;
|
||||
return $form;
|
||||
|
||||
}
|
||||
function getForm($prefix, $mod='Leads'){
|
||||
if(!ACLController::checkAccess('Leads', 'edit', true)){
|
||||
return '';
|
||||
}
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}else global $mod_strings;
|
||||
global $app_strings;
|
||||
|
||||
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
|
||||
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
|
||||
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
|
||||
|
||||
|
||||
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
|
||||
$the_form .= <<<EOQ
|
||||
|
||||
<form name="${prefix}LeadSave" onSubmit="return check_form('${prefix}LeadSave')" method="POST" action="index.php">
|
||||
<input type="hidden" name="${prefix}module" value="Leads">
|
||||
<input type="hidden" name="${prefix}action" value="Save">
|
||||
EOQ;
|
||||
$the_form .= $this->getFormBody($prefix, $mod, "${prefix}LeadSave");
|
||||
$the_form .= <<<EOQ
|
||||
<p><input title="$lbl_save_button_title" accessKey="$lbl_save_button_key" class="button" type="submit" name="${prefix}button" value=" $lbl_save_button_label " ></p>
|
||||
</form>
|
||||
|
||||
EOQ;
|
||||
$the_form .= get_left_form_footer();
|
||||
$the_form .= get_validate_record_js();
|
||||
|
||||
return $the_form;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function handleSave($prefix,$redirect=true, $useRequired=false, $do_save=true, $exist_lead=null){
|
||||
|
||||
require_once('modules/Campaigns/utils.php');
|
||||
require_once('include/formbase.php');
|
||||
|
||||
|
||||
|
||||
if(empty($exist_lead)) {
|
||||
$focus = new Lead();
|
||||
}
|
||||
else {
|
||||
$focus = $exist_lead;
|
||||
}
|
||||
|
||||
if($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))){
|
||||
return null;
|
||||
}
|
||||
$focus = populateFromPost($prefix, $focus);
|
||||
if(!$focus->ACLAccess('Save')){
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
if (!isset($_POST[$prefix.'email_opt_out'])) $focus->email_opt_out = 0;
|
||||
if (!isset($_POST[$prefix.'do_not_call'])) $focus->do_not_call = 0;
|
||||
|
||||
if($do_save) {
|
||||
if(!empty($GLOBALS['check_notify'])) {
|
||||
$focus->save($GLOBALS['check_notify']);
|
||||
}
|
||||
else {
|
||||
$focus->save(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
$return_id = $focus->id;
|
||||
|
||||
if (isset($_POST[$prefix.'prospect_id']) && !empty($_POST[$prefix.'prospect_id'])) {
|
||||
$prospect=new Prospect();
|
||||
$prospect->retrieve($_POST[$prefix.'prospect_id']);
|
||||
$prospect->lead_id=$focus->id;
|
||||
$prospect->save();
|
||||
|
||||
//if prospect id exists, make sure we are coming from prospect detail
|
||||
if(strtolower($_POST['return_module']) =='prospects' && strtolower($_POST['return_action']) == 'detailview'){
|
||||
//create campaing_log entry
|
||||
|
||||
if(isset($focus->campaign_id) && $focus->campaign_id != null){
|
||||
campaign_log_lead_entry($focus->campaign_id,$prospect, $focus,'lead');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// INBOUND EMAIL HANDLING
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
if(isset($_REQUEST['inbound_email_id']) && !empty($_REQUEST['inbound_email_id'])) {
|
||||
if(!isset($current_user)) {
|
||||
global $current_user;
|
||||
}
|
||||
|
||||
// fake this case like it's already saved.
|
||||
|
||||
$email = new Email();
|
||||
$email->retrieve($_REQUEST['inbound_email_id']);
|
||||
$email->parent_type = 'Leads';
|
||||
$email->parent_id = $focus->id;
|
||||
$email->assigned_user_id = $current_user->id;
|
||||
$email->status = 'read';
|
||||
$email->save();
|
||||
$email->load_relationship('leads');
|
||||
$email->leads->add($focus->id);
|
||||
|
||||
header("Location: index.php?&module=Emails&action=EditView&type=out&inbound_email_id=".$_REQUEST['inbound_email_id']."&parent_id=".$email->parent_id."&parent_type=".$email->parent_type.'&start='.$_REQUEST['start']);
|
||||
exit();
|
||||
}
|
||||
//// END INBOUND EMAIL HANDLING
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
|
||||
if($redirect){
|
||||
handleRedirect($return_id, 'Leads');
|
||||
}else{
|
||||
return $focus;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
73
modules/Leads/LeadsQuickCreate.php
Executable file
73
modules/Leads/LeadsQuickCreate.php
Executable file
@@ -0,0 +1,73 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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/EditView/QuickCreate.php');
|
||||
|
||||
|
||||
|
||||
class LeadsQuickCreate extends QuickCreate {
|
||||
|
||||
var $javascript;
|
||||
|
||||
function process() {
|
||||
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
|
||||
$mod_strings = return_module_language($current_language, 'Leads');
|
||||
|
||||
parent::process();
|
||||
|
||||
|
||||
$this->ss->assign("SALUTATION_OPTIONS", get_select_options_with_id($app_list_strings['salutation_dom'], ''));
|
||||
$this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['lead_status_dom'], ''));
|
||||
$this->ss->assign("LEAD_SOURCE_OPTIONS", get_select_options_with_id($app_list_strings['lead_source_dom'], ''));
|
||||
if($this->viaAJAX) { // override for ajax call
|
||||
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"leadsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"leads\"); else return false;'");
|
||||
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_leads\")';");
|
||||
}
|
||||
|
||||
$this->ss->assign('viaAJAX', $this->viaAJAX);
|
||||
|
||||
$this->javascript = new javascript();
|
||||
$this->javascript->setFormName('leadsQuickCreate');
|
||||
|
||||
$focus = new Lead();
|
||||
$this->javascript->setSugarBean($focus);
|
||||
$this->javascript->addAllFields('');
|
||||
|
||||
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
|
||||
}
|
||||
}
|
||||
?>
|
||||
50
modules/Leads/Menu.php
Executable file
50
modules/Leads/Menu.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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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: TODO To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
global $mod_strings, $app_strings, $sugar_config;
|
||||
if(ACLController::checkAccess('Leads', 'edit', true))$module_menu[]=Array("index.php?module=Leads&action=EditView&return_module=Leads&return_action=DetailView", $mod_strings['LNK_NEW_LEAD'],"CreateLeads", 'Leads');
|
||||
|
||||
if(ACLController::checkAccess('Leads', 'list', true))$module_menu[]=Array("index.php?module=Leads&action=index&return_module=Leads&return_action=DetailView", $mod_strings['LNK_LEAD_LIST'],"Leads", 'Leads');
|
||||
|
||||
?>
|
||||
59
modules/Leads/MyLeads.php
Executable file
59
modules/Leads/MyLeads.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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;
|
||||
global $app_list_strings;
|
||||
global $current_language;
|
||||
$current_module_strings = return_module_language($current_language, 'Leads');
|
||||
|
||||
$ListView = new ListView();
|
||||
$seedLeads = new Lead();
|
||||
$header_text = '';
|
||||
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
|
||||
$header_text = " <a href='index.php?action=index&module=DynamicLayout&from_action=MyLeads&from_module=Leads'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
|
||||
}
|
||||
$where = "assigned_user_id='". $current_user->id ."' and (leads.status is NULL or (leads.status!='Converted' and leads.status!='Dead' and leads.status!='recycled')) ";
|
||||
$ListView->initNewXTemplate( 'modules/Leads/MyLeads.html',$current_module_strings);
|
||||
$ListView->setHeaderTitle($current_module_strings['LBL_LIST_MY_LEADS'] . $header_text);
|
||||
$ListView->setQuery($where, "", "leads.date_entered desc", "LEAD");
|
||||
$ListView->processListView($seedLeads, "main", "LEAD");
|
||||
?>
|
||||
48
modules/Leads/Save.php
Executable file
48
modules/Leads/Save.php
Executable file
@@ -0,0 +1,48 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
require_once('modules/Leads/LeadFormBase.php');
|
||||
$leadForm = new LeadFormBase();
|
||||
$leadForm->handleSave('', true, false);
|
||||
|
||||
?>
|
||||
76
modules/Leads/SubPanelView.php
Executable file
76
modules/Leads/SubPanelView.php
Executable file
@@ -0,0 +1,76 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
global $app_strings;
|
||||
//we don't want the parent module's string file, but rather the string file specifc to this subpanel
|
||||
global $current_language;
|
||||
$current_module_strings = return_module_language($current_language, 'Leads');
|
||||
|
||||
global $currentModule;
|
||||
global $theme;
|
||||
global $focus;
|
||||
global $action;
|
||||
|
||||
|
||||
|
||||
|
||||
// focus_list is the means of passing data to a SubPanelView.
|
||||
global $focus_list;
|
||||
|
||||
global $current_user;
|
||||
$header_text = '';
|
||||
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
|
||||
$header_text = " <a href='index.php?action=index&module=DynamicLayout&from_action=SubPanelView&from_module=Leads&record=". $_REQUEST['record']."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
|
||||
}
|
||||
$ListView = new ListView();
|
||||
$ListView->initNewXTemplate( 'modules/Leads/SubPanelView.html',$current_module_strings);
|
||||
$ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME'] . $header_text);
|
||||
//$ListView->setHeaderText($button);
|
||||
$ListView->processListView($focus_list, "main", "LEAD");
|
||||
|
||||
?>
|
||||
65
modules/Leads/SugarFeeds/LeadFeed.php
Executable file
65
modules/Leads/SugarFeeds/LeadFeed.php
Executable file
@@ -0,0 +1,65 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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('modules/SugarFeed/feedLogicBase.php');
|
||||
|
||||
|
||||
class LeadFeed extends FeedLogicBase {
|
||||
var $module = 'Leads';
|
||||
function pushFeed($bean, $event, $arguments){
|
||||
global $locale;
|
||||
|
||||
$text = '';
|
||||
if(empty($bean->fetched_row)){
|
||||
$full_name = $locale->getLocaleFormattedName($bean->first_name, $bean->last_name, '');
|
||||
|
||||
$text = '{SugarFeed.CREATED_LEAD} [' . $bean->module_dir . ':' . $bean->id . ':' . $full_name . ']';
|
||||
}else{
|
||||
if(!empty($bean->fetched_row['status'] ) && $bean->fetched_row['status'] != $bean->status && $bean->status == 'Converted'){
|
||||
// Repeated here so we don't format the name on "uninteresting" events
|
||||
$full_name = $locale->getLocaleFormattedName($bean->first_name, $bean->last_name, '');
|
||||
|
||||
$text = '{SugarFeed.CONVERTED_LEAD} [' . $bean->module_dir . ':' . $bean->id . ':' . $full_name . ']';
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($text)){
|
||||
SugarFeed::pushFeed2($text, $bean);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
41
modules/Leads/action_view_map.php
Executable file
41
modules/Leads/action_view_map.php
Executable file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
//format '<action_name>' => '<view_name>',
|
||||
$action_view_map['editconvert'] = 'editConvert';
|
||||
$action_view_map['editconvertlayout'] = 'editConvertLayout';
|
||||
$action_view_map['saveandpublishlayout'] = 'editConvert';
|
||||
$action_view_map['savelayout'] = 'editConvert';
|
||||
?>
|
||||
84
modules/Leads/controller.php
Executable file
84
modules/Leads/controller.php
Executable file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
class LeadsController extends SugarController{
|
||||
function LeadsController(){
|
||||
parent::SugarController();
|
||||
}
|
||||
function pre_editview(){
|
||||
//IF we have a prospect id leads convert it to a lead
|
||||
if (empty($this->bean->id) && !empty($_REQUEST['return_module']) &&$_REQUEST['return_module'] == 'Prospects' ) {
|
||||
|
||||
$prospect=new Prospect();
|
||||
$prospect->retrieve($_REQUEST['return_id']);
|
||||
foreach($prospect->field_defs as $key=>$value)
|
||||
{
|
||||
if ($key == 'id' or $key=='deleted' )continue;
|
||||
if (isset($this->bean->field_defs[$key])) {
|
||||
$this->bean->$key = $prospect->$key;
|
||||
}
|
||||
}
|
||||
$_POST['is_converted']=true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function action_editview(){
|
||||
$this->view = 'edit';
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function callLegacyCode(){
|
||||
if(strtolower($this->do_action) == 'convertlead'){
|
||||
if(file_exists('modules/Leads/ConvertLead.php') && !file_exists('custom/modules/Leads/metadata/convertdefs.php')){
|
||||
if(!empty($_REQUEST['emailAddressWidget'])) {
|
||||
foreach($_REQUEST as $key=>$value) {
|
||||
if(preg_match('/^Leads.*?emailAddress[\d]+$/', $key)) {
|
||||
$_REQUEST['Leads_email_widget_id'] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->action_default();
|
||||
$this->_processed = true;
|
||||
}else{
|
||||
$this->view = 'convertlead';
|
||||
$this->_processed = true;
|
||||
}
|
||||
}else{
|
||||
parent::callLegacyCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
99
modules/Leads/field_arrays.php
Executable file
99
modules/Leads/field_arrays.php
Executable file
@@ -0,0 +1,99 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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: Contains field arrays that are used for caching
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
$fields_array['Lead'] = array ('column_fields' => Array("id"
|
||||
,"refered_by"
|
||||
,"date_entered"
|
||||
,"date_modified"
|
||||
,"modified_user_id"
|
||||
,"assigned_user_id"
|
||||
, "created_by"
|
||||
,"salutation"
|
||||
,"first_name"
|
||||
,"last_name"
|
||||
,"lead_source"
|
||||
,"lead_source_description"
|
||||
,"title"
|
||||
,"department"
|
||||
,"reports_to_id"
|
||||
,"do_not_call"
|
||||
,"phone_home"
|
||||
,"phone_mobile"
|
||||
,"phone_work"
|
||||
,"phone_other"
|
||||
,"phone_fax"
|
||||
,"email1"
|
||||
,"email2"
|
||||
,"email_opt_out"
|
||||
,"primary_address_street"
|
||||
,"primary_address_city"
|
||||
,"primary_address_state"
|
||||
,"primary_address_postalcode"
|
||||
,"primary_address_country"
|
||||
,"alt_address_street"
|
||||
,"alt_address_city"
|
||||
,"alt_address_state"
|
||||
,"alt_address_postalcode"
|
||||
,"alt_address_country"
|
||||
,"description"
|
||||
,"status"
|
||||
,"status_description"
|
||||
,"account_name"
|
||||
,"account_description"
|
||||
,"account_id"
|
||||
,"opportunity_id"
|
||||
,"contact_id"
|
||||
,"opportunity_amount"
|
||||
,"opportunity_name"
|
||||
,"portal_name"
|
||||
,"portal_app"
|
||||
,"invalid_email"
|
||||
,"campaign_id"
|
||||
),
|
||||
'list_fields' => Array('id', 'first_name', 'last_name', 'account_name', 'title', 'email1', 'phone_work', 'assigned_user_name', 'assigned_user_id', 'lead_source', 'lead_source_description', 'refered_by', 'opportunity_name', 'opportunity_amount', 'date_entered', 'status'
|
||||
,'invalid_email'
|
||||
, "campaign_id"
|
||||
),
|
||||
'required_fields' => array("last_name"=>1),
|
||||
);
|
||||
?>
|
||||
253
modules/Leads/language/en_us.lang.php
Executable file
253
modules/Leads/language/en_us.lang.php
Executable file
@@ -0,0 +1,253 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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: Defines the English language pack for the base application.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
//DON'T CONVERT THESE THEY ARE MAPPINGS
|
||||
'db_last_name' => 'LBL_LIST_LAST_NAME',
|
||||
'db_first_name' => 'LBL_LIST_FIRST_NAME',
|
||||
'db_title' => 'LBL_LIST_TITLE',
|
||||
'db_email1' => 'LBL_LIST_EMAIL_ADDRESS',
|
||||
'db_account_name' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'db_email2' => 'LBL_LIST_EMAIL_ADDRESS',
|
||||
|
||||
//END DON'T CONVERT
|
||||
'ERR_DELETE_RECORD' => 'en_us A record number must be specified to delete the lead.',
|
||||
'LBL_ACCOUNT_DESCRIPTION'=> 'Account Description',
|
||||
'LBL_ACCOUNT_ID'=>'Account ID',
|
||||
'LBL_ACCOUNT_NAME' => 'Account Name:',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE'=>'Activities',
|
||||
'LBL_ADD_BUSINESSCARD' => 'Add Business Card',
|
||||
'LBL_ADDRESS_INFORMATION' => 'Address Information',
|
||||
'LBL_ALT_ADDRESS_CITY' => 'Alt Address City',
|
||||
'LBL_ALT_ADDRESS_COUNTRY' => 'Alt Address Country',
|
||||
'LBL_ALT_ADDRESS_POSTALCODE' => 'Alt Address Postalcode',
|
||||
'LBL_ALT_ADDRESS_STATE' => 'Alt Address State',
|
||||
'LBL_ALT_ADDRESS_STREET_2' => 'Alt Address Street 2',
|
||||
'LBL_ALT_ADDRESS_STREET_3' => 'Alt Address Street 3',
|
||||
'LBL_ALT_ADDRESS_STREET' => 'Alt Address Street',
|
||||
'LBL_ALTERNATE_ADDRESS' => 'Other Address:',
|
||||
'LBL_ALT_ADDRESS' => 'Other Address:',
|
||||
'LBL_ANY_ADDRESS' => 'Any Address:',
|
||||
'LBL_ANY_EMAIL' => 'Any Email:',
|
||||
'LBL_ANY_PHONE' => 'Any Phone:',
|
||||
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',
|
||||
'LBL_ASSIGNED_TO_ID' => 'Assigned User:',
|
||||
'LBL_BACKTOLEADS' => 'Back To Leads',
|
||||
'LBL_BUSINESSCARD' => 'Convert Lead',
|
||||
'LBL_CITY' => 'City:',
|
||||
'LBL_CONTACT_ID' => 'Contact ID',
|
||||
'LBL_CONTACT_INFORMATION' => 'Lead Overview',
|
||||
'LBL_CONTACT_NAME' => 'Lead Name:',
|
||||
'LBL_CONTACT_OPP_FORM_TITLE' => 'Lead-Opportunity:',
|
||||
'LBL_CONTACT_ROLE' => 'Role:',
|
||||
'LBL_CONTACT' => 'Lead:',
|
||||
'LBL_CONVERTED_ACCOUNT'=>'Converted Account:',
|
||||
'LBL_CONVERTED_CONTACT' => 'Converted Contact:',
|
||||
'LBL_CONVERTED_OPP'=>'Converted Opportunity:',
|
||||
'LBL_CONVERTED'=> 'Converted',
|
||||
'LBL_CONVERTLEAD_BUTTON_KEY' => 'V',
|
||||
'LBL_CONVERTLEAD_TITLE' => 'Convert Lead [Alt+V]',
|
||||
'LBL_CONVERTLEAD' => 'Convert Lead',
|
||||
'LBL_CONVERTLEAD_WARNING' => 'Warning: The status of the Lead you are about to convert is "Converted". Contact and/or Account records may already have been created from the Lead. If you wish to continue with converting the Lead, click Save. To go back to the Lead without converting it, click Cancel.',
|
||||
'LBL_CONVERTLEAD_WARNING_INTO_RECORD' => ' Possible Contact: ',
|
||||
'LBL_COUNTRY' => 'Country:',
|
||||
'LBL_CREATED_NEW' => 'Created a new ',
|
||||
'LBL_CREATED_ACCOUNT' => 'Created a new account',
|
||||
'LBL_CREATED_CALL' => 'Created a new call',
|
||||
'LBL_CREATED_CONTACT' => 'Created a new contact',
|
||||
'LBL_CREATED_MEETING' => 'Created a new meeting',
|
||||
'LBL_CREATED_OPPORTUNITY' => 'Created a new opportunity',
|
||||
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Leads',
|
||||
'LBL_DEPARTMENT' => 'Department:',
|
||||
'LBL_DESCRIPTION_INFORMATION' => 'Description Information',
|
||||
'LBL_DESCRIPTION' => 'Description:',
|
||||
'LBL_DO_NOT_CALL' => 'Do Not Call:',
|
||||
'LBL_DUPLICATE' => 'Similar Leads',
|
||||
'LBL_EMAIL_ADDRESS' => 'Email Address:',
|
||||
'LBL_EMAIL_OPT_OUT' => 'Email Opt Out:',
|
||||
'LBL_EXISTING_ACCOUNT' => 'Used an existing account',
|
||||
'LBL_EXISTING_CONTACT' => 'Used an existing contact',
|
||||
'LBL_EXISTING_OPPORTUNITY' => 'Used an existing opportunity',
|
||||
'LBL_FAX_PHONE' => 'Fax:',
|
||||
'LBL_FIRST_NAME' => 'First Name:',
|
||||
'LBL_FULL_NAME' => 'Full Name:',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE'=>'History',
|
||||
'LBL_HOME_PHONE' => 'Home Phone:',
|
||||
'LBL_IMPORT_VCARD' => 'Import vCard',
|
||||
'LBL_VCARD' => 'vCard',
|
||||
'LBL_IMPORT_VCARDTEXT' => 'Automatically create a new lead by importing a vCard from your file system.',
|
||||
'LBL_INVALID_EMAIL'=>'Invalid Email:',
|
||||
'LBL_INVITEE' => 'Direct Reports',
|
||||
'LBL_LAST_NAME' => 'Last Name:',
|
||||
'LBL_LEAD_SOURCE_DESCRIPTION' => 'Lead Source Description:',
|
||||
'LBL_LEAD_SOURCE' => 'Lead Source:',
|
||||
'LBL_LIST_ACCEPT_STATUS' => 'Accept Status',
|
||||
'LBL_LIST_ACCOUNT_NAME' => 'Account Name',
|
||||
'LBL_LIST_CONTACT_NAME' => 'Lead Name',
|
||||
'LBL_LIST_CONTACT_ROLE' => 'Role',
|
||||
'LBL_LIST_DATE_ENTERED' => 'Date Created',
|
||||
'LBL_LIST_EMAIL_ADDRESS' => 'Email',
|
||||
'LBL_LIST_FIRST_NAME' => 'First Name',
|
||||
'LBL_VIEW_FORM_TITLE' => 'Lead View',
|
||||
'LBL_LIST_FORM_TITLE' => 'Lead List',
|
||||
'LBL_LIST_LAST_NAME' => 'Last Name',
|
||||
'LBL_LIST_LEAD_SOURCE_DESCRIPTION' => 'Lead Source Description',
|
||||
'LBL_LIST_LEAD_SOURCE' => 'Lead Source',
|
||||
'LBL_LIST_MY_LEADS' => 'My Leads',
|
||||
'LBL_LIST_NAME' => 'Name',
|
||||
'LBL_LIST_PHONE' => 'Office Phone',
|
||||
'LBL_LIST_REFERED_BY' => 'Referred By',
|
||||
'LBL_LIST_STATUS' => 'Status',
|
||||
'LBL_LIST_TITLE' => 'Title',
|
||||
'LBL_MOBILE_PHONE' => 'Mobile:',
|
||||
'LBL_MODULE_NAME' => 'Leads',
|
||||
'LBL_MODULE_TITLE' => 'Leads: Home',
|
||||
'LBL_NAME' => 'Name:',
|
||||
'LBL_NEW_FORM_TITLE' => 'New Lead',
|
||||
'LBL_NEW_PORTAL_PASSWORD' => 'New Portal Password:',
|
||||
'LBL_OFFICE_PHONE' => 'Office Phone:',
|
||||
'LBL_OPP_NAME' => 'Opportunity Name:',
|
||||
'LBL_OPPORTUNITY_AMOUNT' => 'Opportunity Amount:',
|
||||
'LBL_OPPORTUNITY_ID'=>'Opportunity ID',
|
||||
'LBL_OPPORTUNITY_NAME' => 'Opportunity Name:',
|
||||
'LBL_OTHER_EMAIL_ADDRESS' => 'Other Email:',
|
||||
'LBL_OTHER_PHONE' => 'Other Phone:',
|
||||
'LBL_PHONE' => 'Phone:',
|
||||
'LBL_PORTAL_ACTIVE' => 'Portal Active:',
|
||||
'LBL_PORTAL_APP'=> 'Portal Application',
|
||||
'LBL_PORTAL_INFORMATION' => 'Portal Information',
|
||||
'LBL_PORTAL_NAME' => 'Portal Name:',
|
||||
'LBL_PORTAL_PASSWORD_ISSET' => 'Portal Password Is Set:',
|
||||
'LBL_POSTAL_CODE' => 'Postal Code:',
|
||||
'LBL_STREET' => 'Street',
|
||||
'LBL_PRIMARY_ADDRESS_CITY' => 'Primary Address City',
|
||||
'LBL_PRIMARY_ADDRESS_COUNTRY' => 'Primary Address Country',
|
||||
'LBL_PRIMARY_ADDRESS_POSTALCODE' => 'Primary Address Postalcode',
|
||||
'LBL_PRIMARY_ADDRESS_STATE' => 'Primary Address State',
|
||||
'LBL_PRIMARY_ADDRESS_STREET_2'=>'Primary Address Street 2',
|
||||
'LBL_PRIMARY_ADDRESS_STREET_3'=>'Primary Address Street 3',
|
||||
'LBL_PRIMARY_ADDRESS_STREET' => 'Primary Address Street',
|
||||
'LBL_PRIMARY_ADDRESS' => 'Primary Address:',
|
||||
'LBL_REFERED_BY' => 'Referred By:',
|
||||
'LBL_REPORTS_TO_ID'=>'Reports To ID',
|
||||
'LBL_REPORTS_TO' => 'Reports To:',
|
||||
'LBL_SALUTATION' => 'Salutation',
|
||||
'LBL_MODIFIED'=>'Modified By',
|
||||
'LBL_MODIFIED_ID'=>'Modified By Id',
|
||||
'LBL_CREATED'=>'Created By',
|
||||
'LBL_CREATED_ID'=>'Created By Id',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Lead Search',
|
||||
'LBL_SELECT_CHECKED_BUTTON_LABEL' => 'Select Checked Leads',
|
||||
'LBL_SELECT_CHECKED_BUTTON_TITLE' => 'Select Checked Leads',
|
||||
'LBL_STATE' => 'State:',
|
||||
'LBL_STATUS_DESCRIPTION' => 'Status Description:',
|
||||
'LBL_STATUS' => 'Status:',
|
||||
'LBL_TITLE' => 'Title:',
|
||||
'LNK_IMPORT_VCARD' => 'Create Lead From vCard',
|
||||
'LNK_LEAD_LIST' => 'View Leads',
|
||||
'LNK_NEW_ACCOUNT' => 'Create Account',
|
||||
'LNK_NEW_APPOINTMENT' => 'Create Appointment',
|
||||
'LNK_NEW_CONTACT' => 'Create Contact',
|
||||
'LNK_NEW_LEAD' => 'Create Lead',
|
||||
'LNK_NEW_NOTE' => 'Create Note',
|
||||
'LNK_NEW_TASK' => 'Create Task',
|
||||
'LNK_NEW_CASE' => 'Create Case',
|
||||
'LNK_NEW_CALL' => 'Log Call',
|
||||
'LNK_NEW_MEETING' => 'Schedule Meeting',
|
||||
'LNK_NEW_OPPORTUNITY' => 'Create Opportunity',
|
||||
'LNK_SELECT_ACCOUNT' => ' <b>OR</b> Select Account',
|
||||
'LNK_SELECT_ACCOUNTS' => ' <b>OR</b> Select Account',
|
||||
'MSG_DUPLICATE' => 'Similar leads have been found. Please check the box of any leads you would like to associate with the Records that will be created from this conversion. Once you are done, please press next.',
|
||||
'NTC_COPY_ALTERNATE_ADDRESS' => 'Copy alternate address to primary address',
|
||||
'NTC_COPY_PRIMARY_ADDRESS' => 'Copy primary address to alternate address',
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to delete this record?',
|
||||
'NTC_OPPORTUNITY_REQUIRES_ACCOUNT' => 'Creating an opportunity requires an account.\n Please either create a new one or select an existing one.',
|
||||
'NTC_REMOVE_CONFIRMATION' => 'Are you sure you want to remove this lead from this case?',
|
||||
'NTC_REMOVE_DIRECT_REPORT_CONFIRMATION' => 'Are you sure you want to remove this record as a direct report?',
|
||||
'LBL_CAMPAIGN_LIST_SUBPANEL_TITLE'=>'Campaigns',
|
||||
'LBL_TARGET_OF_CAMPAIGNS'=>'Successful Campaign:',
|
||||
'LBL_TARGET_BUTTON_LABEL'=>'Targeted',
|
||||
'LBL_TARGET_BUTTON_TITLE'=>'Targeted',
|
||||
'LBL_TARGET_BUTTON_KEY'=>'T',
|
||||
'LBL_CAMPAIGN_ID'=>'Campaign Id',
|
||||
'LBL_CAMPAIGN' => 'Campaign:',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
|
||||
'LBL_PROSPECT_LIST' => 'Prospect List',
|
||||
'LBL_CAMPAIGN_LEAD' => 'Campaigns',
|
||||
'LBL_BIRTHDATE' => 'Birthdate:',
|
||||
'LBL_THANKS_FOR_SUBMITTING_LEAD' =>'Thank You For Your Submission.',
|
||||
'LBL_SERVER_IS_CURRENTLY_UNAVAILABLE' =>'We are sorry, the server is currently unavailable, please try again later.',
|
||||
'LBL_ASSISTANT_PHONE' => 'Assistant Phone',
|
||||
'LBL_ASSISTANT' => 'Assistant',
|
||||
'LBL_REGISTRATION' => 'Registration',
|
||||
'LBL_MESSAGE' => 'Please enter your information below. Information and/or an account will be created for you pending approval.',
|
||||
'LBL_SAVED' => 'Thank you for registering. Your account will be created and someone will contact you shortly.',
|
||||
'LBL_CLICK_TO_RETURN' => 'Return to Portal',
|
||||
'LBL_CREATED_USER' => 'Created User',
|
||||
'LBL_MODIFIED_USER' => 'Modified User',
|
||||
'LBL_CAMPAIGNS' => 'Campaigns',
|
||||
'LBL_CAMPAIGNS_SUBPANEL_TITLE' => 'Campaigns',
|
||||
'LBL_CONVERT_MODULE_NAME' => 'Module',
|
||||
'LBL_CONVERT_REQUIRED' => 'Required',
|
||||
'LBL_CONVERT_SELECT' => 'Allow Selection',
|
||||
'LBL_CONVERT_COPY' => 'Copy Data',
|
||||
'LBL_CONVERT_EDIT' => 'Edit',
|
||||
'LBL_CONVERT_DELETE' => 'Delete',
|
||||
'LBL_CONVERT_ADD_MODULE' => 'Add Module',
|
||||
'LBL_CREATE' => 'Create',
|
||||
'LBL_SELECT' => ' <b>OR</b> Select',
|
||||
'LBL_WEBSITE' => 'Website',
|
||||
'LNK_IMPORT_LEADS' => 'Import Leads',
|
||||
'LBL_NOTICE_OLD_LEAD_CONVERT_OVERRIDE' => 'Notice: The current Convert Lead screen contains custom fields. When you customize the Convert Lead screen in Studio for the first time, you will need to add custom fields to the layout, as necessary. The custom fields will not automatically appear in the layout, as they did previously.',
|
||||
//Convert lead tooltips
|
||||
'LBL_MODULE_TIP' => 'The module to create a new record in.',
|
||||
'LBL_REQUIRED_TIP' => 'Required modules must be created or selected before the lead can be converted.',
|
||||
'LBL_COPY_TIP' => 'If checked, fields from the lead will be copied to fields with the same name in the newly created records.',
|
||||
'LBL_SELECTION_TIP' => 'Modules with a relate field in Contacts can be selected rather than created during the convert lead process.',
|
||||
'LBL_EDIT_TIP' => 'Modify the convert layout for this module.',
|
||||
'LBL_DELETE_TIP' => 'Remove this module from the convert layout.',
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
219
modules/Leads/language/pl_pl.lang.php
Executable file
219
modules/Leads/language/pl_pl.lang.php
Executable file
@@ -0,0 +1,219 @@
|
||||
<?PHP
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version
|
||||
* 1.1.3 ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
* pl_pl.lang.php,v for SugarCRM 4.5.1-->>
|
||||
* Translator: Krzysztof Morawski
|
||||
* All Rights Reserved.
|
||||
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
//DON'T CONVERT THESE THEY ARE MAPPINGS
|
||||
'db_last_name' => 'LBL_LIST_LAST_NAME',
|
||||
'db_first_name' => 'LBL_LIST_FIRST_NAME',
|
||||
'db_title' => 'LBL_LIST_TITLE',
|
||||
'db_email1' => 'LBL_LIST_EMAIL_ADDRESS',
|
||||
'db_account_name' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'db_email2' => 'LBL_LIST_EMAIL_ADDRESS',
|
||||
|
||||
//END DON'T CONVERT
|
||||
'ERR_DELETE_RECORD' => 'pl_pl Numer rekordu musi być określony, aby usunąć tego potencjalnego klienta.',
|
||||
'LBL_ACCOUNT_DESCRIPTION'=> 'Opis klienta',
|
||||
'LBL_ACCOUNT_ID'=>'ID klienta',
|
||||
'LBL_ACCOUNT_NAME' => 'Nazwa klienta:',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE'=>'Działania',
|
||||
'LBL_ADD_BUSINESSCARD' => 'Dodaj wizytówkę',
|
||||
'LBL_ADDRESS_INFORMATION' => 'Informacje adresowe',
|
||||
'LBL_ALT_ADDRESS_CITY' => 'Inne miasto',
|
||||
'LBL_ALT_ADDRESS_COUNTRY' => 'Inny kraj',
|
||||
'LBL_ALT_ADDRESS_POSTALCODE' => 'Inny kod pocztowy',
|
||||
'LBL_ALT_ADDRESS_STATE' => 'Inne województwo',
|
||||
'LBL_ALT_ADDRESS_STREET_2' => 'Ulica 2',
|
||||
'LBL_ALT_ADDRESS_STREET_3' => 'Ulica 3',
|
||||
'LBL_ALT_ADDRESS_STREET' => 'Ulica',
|
||||
'LBL_ALTERNATE_ADDRESS' => 'Inny adres:',
|
||||
'LBL_ALT_ADDRESS' => 'Inny adres:',
|
||||
'LBL_ANY_ADDRESS' => 'Adres dowolny:',
|
||||
'LBL_ANY_EMAIL' => 'Dowolny adres email:',
|
||||
'LBL_ANY_PHONE' => 'Dowolny mumer telefonu:',
|
||||
'LBL_ASSIGNED_TO_NAME' => 'Przydzielone do:',
|
||||
'LBL_ASSIGNED_TO_ID' => 'Przydzielone do:',
|
||||
'LBL_BACKTOLEADS' => 'Wróć do adresów',
|
||||
'LBL_BUSINESSCARD' => 'Konwertuj adres',
|
||||
'LBL_CITY' => 'Miasto:',
|
||||
'LBL_CONTACT_ID' => 'ID Kontaktu',
|
||||
'LBL_CONTACT_INFORMATION' => 'Informacje o adresie',
|
||||
'LBL_CONTACT_NAME' => 'Nazwa adresu:',
|
||||
'LBL_CONTACT_OPP_FORM_TITLE' => 'Adres - Okazja:',
|
||||
'LBL_CONTACT_ROLE' => 'Rola:',
|
||||
'LBL_CONTACT' => 'Adres:',
|
||||
'LBL_CONVERTED_ACCOUNT'=>'Przekonwertowani klienci:',
|
||||
'LBL_CONVERTED_CONTACT' => 'Przekonwertowane kontakty:',
|
||||
'LBL_CONVERTED_OPP'=>'Przekonwertowane okazje:',
|
||||
'LBL_CONVERTED'=> 'Przekonwertowane',
|
||||
'LBL_CONVERTLEAD_BUTTON_KEY' => 'V',
|
||||
'LBL_CONVERTLEAD_TITLE' => 'Przekonwertowane adresy [Alt+V]',
|
||||
'LBL_CONVERTLEAD' => 'Konwertuj adresy',
|
||||
'LBL_COUNTRY' => 'Kraj:',
|
||||
'LBL_CREATED_ACCOUNT' => 'Utwórz nowego klienta',
|
||||
'LBL_CREATED_CALL' => 'Utwórz nową rozmowę telefoniczną',
|
||||
'LBL_CREATED_CONTACT' => 'Utworzono nowy kontakt',
|
||||
'LBL_CREATED_MEETING' => 'Utworzono nowe spotkanie',
|
||||
'LBL_CREATED_OPPORTUNITY' => 'Utworzono nową okazje',
|
||||
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Potencjalni klienci',
|
||||
'LBL_DEPARTMENT' => 'Departament:',
|
||||
'LBL_DESCRIPTION_INFORMATION' => 'Informacje opisowe',
|
||||
'LBL_DESCRIPTION' => 'Opis:',
|
||||
'LBL_DO_NOT_CALL' => 'Nie dzwonić:',
|
||||
'LBL_DUPLICATE' => 'Podobne adresy',
|
||||
'LBL_EMAIL_ADDRESS' => 'Email:',
|
||||
'LBL_EMAIL_OPT_OUT' => 'Email opcjonalny wychodzący:',
|
||||
'LBL_EXISTING_ACCOUNT' => 'Użyto istniejącego klienta',
|
||||
'LBL_EXISTING_CONTACT' => 'Użyto istniejący kontakt',
|
||||
'LBL_EXISTING_OPPORTUNITY' => 'Użyto istniejącej okazja',
|
||||
'LBL_FAX_PHONE' => 'Fax:',
|
||||
'LBL_FIRST_NAME' => 'Imię:',
|
||||
'LBL_FULL_NAME' => 'Pełna Nazwa:',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE'=>'Historia',
|
||||
'LBL_HOME_PHONE' => 'Telefon domowy:',
|
||||
'LBL_IMPORT_VCARD' => 'Zaimportuj vCard',
|
||||
'LBL_VCARD' => 'vCard',
|
||||
'LBL_IMPORT_VCARDTEXT' => 'Automatycznie tworzy nową wizytówkę, korzystając z pliku na Twoim komputerze.',
|
||||
'LBL_INVALID_EMAIL'=>'Niepoprawny adres email:',
|
||||
'LBL_INVITEE' => 'Raportownanie bezpośrednie',
|
||||
'LBL_LAST_NAME' => 'Nazwisko:',
|
||||
'LBL_LEAD_SOURCE_DESCRIPTION' => 'Opis źródła pozyskania:',
|
||||
'LBL_LEAD_SOURCE' => 'Źródło pozyskania:',
|
||||
'LBL_LIST_ACCEPT_STATUS' => 'Zaakceptuj status',
|
||||
'LBL_LIST_ACCOUNT_NAME' => 'Nazwa klienta',
|
||||
'LBL_LIST_CONTACT_NAME' => 'Nazwa kontaktu',
|
||||
'LBL_LIST_CONTACT_ROLE' => 'Rola',
|
||||
'LBL_LIST_DATE_ENTERED' => 'Data utworzenia',
|
||||
'LBL_LIST_EMAIL_ADDRESS' => 'Email',
|
||||
'LBL_LIST_FIRST_NAME' => 'Imię',
|
||||
'LBL_VIEW_FORM_TITLE' => 'Widok',
|
||||
'LBL_LIST_FORM_TITLE' => 'Lista',
|
||||
'LBL_LIST_LAST_NAME' => 'Nazwisko',
|
||||
'LBL_LIST_LEAD_SOURCE_DESCRIPTION' => 'Opis źródła pozyskania',
|
||||
'LBL_LIST_LEAD_SOURCE' => 'Źródło pozyskania',
|
||||
'LBL_LIST_MY_LEADS' => 'Moi potencjalni klienci',
|
||||
'LBL_LIST_NAME' => 'Nazwa',
|
||||
'LBL_LIST_PHONE' => 'Telefon do biura',
|
||||
'LBL_LIST_REFERED_BY' => 'Przeniesione przez:',
|
||||
'LBL_LIST_STATUS' => 'Status',
|
||||
'LBL_LIST_TITLE' => 'Tytuł',
|
||||
'LBL_MOBILE_PHONE' => 'Telefon komórkowy:',
|
||||
'LBL_MODULE_NAME' => 'Potencjalni klienci',
|
||||
'LBL_MODULE_TITLE' => 'Potencjalni klienci: Strona główna',
|
||||
'LBL_NAME' => 'Nazwa:',
|
||||
'LBL_NEW_FORM_TITLE' => 'Nowy potencjalny klient',
|
||||
'LBL_NEW_PORTAL_PASSWORD' => 'Nowe hasło portalu:',
|
||||
'LBL_OFFICE_PHONE' => 'Telefon do biura:',
|
||||
'LBL_OPP_NAME' => 'Nazwa Okazji:',
|
||||
'LBL_OPPORTUNITY_AMOUNT' => 'Kwota Okazji:',
|
||||
'LBL_OPPORTUNITY_ID'=>'ID Okazji',
|
||||
'LBL_OPPORTUNITY_NAME' => 'Nazwa Okazji:',
|
||||
'LBL_OTHER_EMAIL_ADDRESS' => 'Inny email:',
|
||||
'LBL_OTHER_PHONE' => 'Inny telefon:',
|
||||
'LBL_PHONE' => 'Telefon:',
|
||||
'LBL_PORTAL_ACTIVE' => 'Portal aktywny:',
|
||||
'LBL_PORTAL_APP'=> 'Aplikacje portalu',
|
||||
'LBL_PORTAL_INFORMATION' => 'Informacje portalu',
|
||||
'LBL_PORTAL_NAME' => 'Nazwa portalu:',
|
||||
'LBL_PORTAL_PASSWORD_ISSET' => 'Hasło portalu jest ustawione:',
|
||||
'LBL_POSTAL_CODE' => 'Kod Pocztowy:',
|
||||
'LBL_PRIMARY_ADDRESS_CITY' => 'Adres podstawowy - miasto',
|
||||
'LBL_PRIMARY_ADDRESS_COUNTRY' => 'Adres podstawowy - kraj',
|
||||
'LBL_PRIMARY_ADDRESS_POSTALCODE' => 'Adres podstawowy - kod pocztowy',
|
||||
'LBL_PRIMARY_ADDRESS_STATE' => 'Adres podstawowy - województwo',
|
||||
'LBL_PRIMARY_ADDRESS_STREET_2'=>'Adres podstawowy - ulica 2',
|
||||
'LBL_PRIMARY_ADDRESS_STREET_3'=>'Adres podstawowy - ulica 3',
|
||||
'LBL_PRIMARY_ADDRESS_STREET' => 'Adres podstawowy - ulica',
|
||||
'LBL_PRIMARY_ADDRESS' => 'Adres podstawowy:',
|
||||
'LBL_REFERED_BY' => 'Przeniesione przez:',
|
||||
'LBL_REPORTS_TO_ID'=>'Raportuje do ID',
|
||||
'LBL_REPORTS_TO' => 'Raportuje do:',
|
||||
'LBL_SALUTATION' => 'Pozdrowienie',
|
||||
'LBL_MODIFIED'=>'Zmodyfikowane przez',
|
||||
'LBL_MODIFIED_ID'=>'Zmodyfikowane przez (Id)',
|
||||
'LBL_CREATED'=>'Utworzone przez',
|
||||
'LBL_CREATED_ID'=>'Utworzone przez (Id)',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Szukaj adresu',
|
||||
'LBL_SELECT_CHECKED_BUTTON_LABEL' => 'Wybierz zaznaczone elementy',
|
||||
'LBL_SELECT_CHECKED_BUTTON_TITLE' => 'Wybierz zaznaczone elementy',
|
||||
'LBL_STATE' => 'Województwo:',
|
||||
'LBL_STATUS_DESCRIPTION' => 'Opis statusu:',
|
||||
'LBL_STATUS' => 'Status:',
|
||||
'LBL_TITLE' => 'Tytuł:',
|
||||
'LNK_IMPORT_VCARD' => 'Import z vCard',
|
||||
'LNK_LEAD_LIST' => 'Lista Potencjalnych kontrahentów',
|
||||
'LNK_NEW_ACCOUNT' => 'Utwórz klienta',
|
||||
'LNK_NEW_APPOINTMENT' => 'Utwórz spotkanie',
|
||||
'LNK_NEW_CONTACT' => 'Utwórz kontakt',
|
||||
'LNK_NEW_LEAD' => 'Utwórz Potencjalnego kontrahenta',
|
||||
'LNK_NEW_NOTE' => 'Utwórz notatkę',
|
||||
'LNK_NEW_OPPORTUNITY' => 'Utwórz Okazję',
|
||||
'LNK_SELECT_ACCOUNT' => 'Wybierz klienta',
|
||||
'MSG_DUPLICATE' => 'Znaleziono podobne adresy. Sprawdź czy wybrane do konwersji adresy nie istnieją w systemie. Możesz kontynuować konwersję klikając [Dalej].',
|
||||
'NTC_COPY_ALTERNATE_ADDRESS' => 'Kopiuj adres alternatywny do podstawowego',
|
||||
'NTC_COPY_PRIMARY_ADDRESS' => 'Kopiuj adres podstawowy do alternatywnego',
|
||||
'NTC_DELETE_CONFIRMATION' => 'Czy na pewno chcesz usunąć ten rekord?',
|
||||
'NTC_OPPORTUNITY_REQUIRES_ACCOUNT' => 'Dodanie Okazji wymaga posiadania klienta.\n Utwórz nowego klienta, lub wykorzystaj już istniejącego.',
|
||||
'NTC_REMOVE_CONFIRMATION' => 'Czy na pewno chcesz usunąć tę adres z tej sprawy?',
|
||||
'NTC_REMOVE_DIRECT_REPORT_CONFIRMATION' => 'Czy na pewno chcesz usunąć ten zapis jako bezpośredni raport?',
|
||||
'LBL_CAMPAIGN_LIST_SUBPANEL_TITLE'=>'Kampanie',
|
||||
'LBL_TARGET_OF_CAMPAIGNS'=>'Udane kampanie:',
|
||||
'LBL_TARGET_BUTTON_LABEL'=>'Docelowi',
|
||||
'LBL_TARGET_BUTTON_TITLE'=>'Docelowi',
|
||||
'LBL_TARGET_BUTTON_KEY'=>'T',
|
||||
'LBL_CAMPAIGN_ID'=>'Id Kampanii',
|
||||
'LBL_CAMPAIGN' => 'Kampanie:',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przydzielony użytkownik',
|
||||
'LBL_PROSPECT_LIST' => 'Lista odbiorców',
|
||||
'LBL_CAMPAIGN_LEAD' => 'Kampanie',
|
||||
|
||||
'LNK_LEAD_REPORTS' => 'Raporty z adresów',
|
||||
|
||||
'LBL_THANKS_FOR_SUBMITTING_LEAD' =>'Dziękujemy za Twoją propozycję..',
|
||||
'LBL_SERVER_IS_CURRENTLY_UNAVAILABLE' =>'Przepraszamy, ale serwer jest niedostępny w tej chwili. Spróbuj później.',
|
||||
'LBL_ASSISTANT_PHONE' => 'Telefon asystenta',
|
||||
'LBL_ASSISTANT' => 'Asystent',
|
||||
'LBL_REGISTRATION' => 'Rejestracja',
|
||||
'LBL_MESSAGE' => 'Wprowadź poniżej informacje o sobie. Informacje i/lub konta klienta będą oczekiwać przed wprowadzeniem na Twoją akceptację.',
|
||||
'LBL_SAVED' => 'Dziękujemy za rejestrację. Twoje konto zostanie utworzone i ktoś skontaktuje się z Tobą niezwłocznie.',
|
||||
'LBL_CLICK_TO_RETURN' => 'Powrót do portalu',
|
||||
'LBL_CREATED_USER' => 'Użytkownik tworzący',
|
||||
'LBL_MODIFIED_USER' => 'Użytkownik modyfikujący',
|
||||
'LBL_CAMPAIGNS' => 'Kampanie',
|
||||
'LBL_CAMPAIGNS_SUBPANEL_TITLE' => 'Kampanie',
|
||||
// 'LBL_ASSIGNED_TO' => 'Przydzielone do:',
|
||||
|
||||
//add 16.09.2011
|
||||
'LBL_WEBSITE' => 'Strona www:',
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
66
modules/Leads/metadata/SearchFields.php
Executable file
66
modules/Leads/metadata/SearchFields.php
Executable file
@@ -0,0 +1,66 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$searchFields['Leads'] =
|
||||
array (
|
||||
'first_name' => array( 'query_type'=>'default'),
|
||||
'last_name'=> array('query_type'=>'default'),
|
||||
'search_name'=> array('query_type'=>'default','db_field'=>array('first_name','last_name'),'force_unifiedsearch'=>true),
|
||||
'account_name'=> array('query_type'=>'default','db_field'=>array('leads.account_name')),
|
||||
/*'acc_name_from_accounts' => array('query_type'=>'default','related_field'=>'account_name'),*/
|
||||
'lead_source'=> array('query_type'=>'default','operator'=>'=', 'options'=>'lead_source_dom', 'template_var' => 'LEAD_SOURCE_OPTIONS'),
|
||||
'do_not_call'=> array('query_type'=>'default', 'operator'=>'=', 'input_type' => 'checkbox'),
|
||||
'phone'=> array('query_type'=>'default','db_field'=>array('phone_mobile','phone_work','phone_other','phone_fax','phone_home')),
|
||||
'email'=> array(
|
||||
'query_type' => 'default',
|
||||
'operator' => 'subquery',
|
||||
'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE',
|
||||
'db_field' => array(
|
||||
'id',
|
||||
),
|
||||
),
|
||||
'assistant'=> array('query_type'=>'default'),
|
||||
'website'=> array('query_type'=>'default'),
|
||||
'address_street'=> array('query_type'=>'default','db_field'=>array('primary_address_street','alt_address_street')),
|
||||
'address_city'=> array('query_type'=>'default','db_field'=>array('primary_address_city','alt_address_city')),
|
||||
'address_state'=> array('query_type'=>'default','db_field'=>array('primary_address_state','alt_address_state')),
|
||||
'address_postalcode'=> array('query_type'=>'default','db_field'=>array('primary_address_postalcode','alt_address_postalcode')),
|
||||
'address_country'=> array('query_type'=>'default','db_field'=>array('primary_address_country','alt_address_country')),
|
||||
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
|
||||
'assigned_user_id'=> array('query_type'=>'default'),
|
||||
'status'=> array('query_type'=>'default', 'options'=>'lead_status_dom', 'template_var' => 'STATUS_OPTIONS'),
|
||||
);
|
||||
?>
|
||||
82
modules/Leads/metadata/additionalDetails.php
Executable file
82
modules/Leads/metadata/additionalDetails.php
Executable file
@@ -0,0 +1,82 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
function additionalDetailsLead($fields) {
|
||||
static $mod_strings;
|
||||
if(empty($mod_strings)) {
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, 'Leads');
|
||||
}
|
||||
|
||||
$overlib_string = '';
|
||||
if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) ||
|
||||
!empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) ||
|
||||
!empty($fields['PRIMARY_ADDRESS_COUNTRY']))
|
||||
$overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>';
|
||||
if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>';
|
||||
if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', ';
|
||||
if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' ';
|
||||
if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' ';
|
||||
if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>';
|
||||
if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4))
|
||||
$overlib_string .= '<br>';
|
||||
if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> ' . $fields['PHONE_MOBILE'] . '<br>';
|
||||
if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> ' . $fields['PHONE_HOME'] . '<br>';
|
||||
if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> ' . $fields['PHONE_OTHER'] . '<br>';
|
||||
if(!empty($fields['LEAD_SOURCE'])) $overlib_string .= '<b>'. $mod_strings['LBL_LEAD_SOURCE'] . '</b> ' . $fields['LEAD_SOURCE'] . '<br>';
|
||||
|
||||
if(!empty($fields['EMAIL2']))
|
||||
$overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' .
|
||||
"<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" .
|
||||
"parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" .
|
||||
"={$fields['FIRST_NAME']} {$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&" .
|
||||
"to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>") .
|
||||
"&return_module=Contacts&return_action=ListView'>{$fields['EMAIL2']}</a><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 .= '...';
|
||||
}
|
||||
|
||||
return array('fieldToAddTo' => 'NAME',
|
||||
'string' => $overlib_string,
|
||||
'editLink' => "index.php?action=EditView&module=Leads&return_module=Leads&record={$fields['ID']}",
|
||||
'viewLink' => "index.php?action=DetailView&module=Leads&return_module=Leads&record={$fields['ID']}");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
350
modules/Leads/metadata/convertdefs.php
Executable file
350
modules/Leads/metadata/convertdefs.php
Executable file
@@ -0,0 +1,350 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$viewdefs['Contacts']['ConvertLead'] = array(
|
||||
'copyData' => true,
|
||||
'required' => true,
|
||||
'templateMeta' => array(
|
||||
'form'=>array(
|
||||
'hidden'=>array(
|
||||
'<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
|
||||
'<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
|
||||
'<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
|
||||
'<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
|
||||
'<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'LNK_NEW_CONTACT' => array (
|
||||
array (
|
||||
array (
|
||||
'name' => 'first_name',
|
||||
'customCode' => '{html_options name="Contactssalutation" options=$fields.salutation.options selected=$fields.salutation.value} <input name="Contactsfirst_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
|
||||
),
|
||||
'title',
|
||||
),
|
||||
array (
|
||||
|
||||
'last_name',
|
||||
'department',
|
||||
),
|
||||
array (
|
||||
array('name' => 'primary_address_street', 'label' => 'LBL_PRIMARY_ADDRESS'),
|
||||
'phone_work',
|
||||
|
||||
),
|
||||
array (
|
||||
array('name'=>'primary_address_state', 'label' => 'LBL_STATE'),
|
||||
'phone_mobile',
|
||||
),
|
||||
array (
|
||||
array('name'=>'primary_address_postalcode', 'label' => 'LBL_POSTAL_CODE'),
|
||||
'phone_other',
|
||||
),
|
||||
array (
|
||||
array('name'=>'primary_address_country', 'label' => 'LBL_COUNTRY'),
|
||||
'phone_fax',
|
||||
),
|
||||
array (
|
||||
'email1',
|
||||
'lead_source',
|
||||
),
|
||||
array(
|
||||
'description'
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
$viewdefs['Accounts']['ConvertLead'] = array(
|
||||
'copyData' => true,
|
||||
'required' => true,
|
||||
'select' => "account_name",
|
||||
'default_action' => 'create',
|
||||
'relationship' => 'accounts_contacts',
|
||||
'templateMeta' => array(
|
||||
'form'=>array(
|
||||
'hidden'=>array(
|
||||
'<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
|
||||
'<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
|
||||
'<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
|
||||
'<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
|
||||
'<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'LNK_NEW_ACCOUNT' => array (
|
||||
array (
|
||||
'name',
|
||||
'phone_office',
|
||||
),
|
||||
array (
|
||||
'website',
|
||||
),
|
||||
array(
|
||||
'description'
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
$viewdefs['Opportunities']['ConvertLead'] = array(
|
||||
'copyData' => false,
|
||||
'required' => false,
|
||||
'templateMeta' => array(
|
||||
'form'=>array(
|
||||
'hidden'=>array(
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'LNK_NEW_OPPORTUNITY' => array (
|
||||
array (
|
||||
'name',
|
||||
'currency_id'
|
||||
),
|
||||
array (
|
||||
'sales_stage',
|
||||
'amount'
|
||||
),
|
||||
array (
|
||||
'date_closed',
|
||||
''
|
||||
),
|
||||
array (
|
||||
'description'
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
$viewdefs['Notes']['ConvertLead'] = array(
|
||||
'copyData' => false,
|
||||
'required' => false,
|
||||
'templateMeta' => array(
|
||||
'form'=>array(
|
||||
'hidden'=>array(
|
||||
'<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
|
||||
'<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
|
||||
'<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
|
||||
'<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
|
||||
'<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'LNK_NEW_NOTE' => array (
|
||||
array (
|
||||
array('name'=>'name', 'displayParams'=>array('size'=>90)),
|
||||
),
|
||||
array (
|
||||
array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$viewdefs['Calls']['ConvertLead'] = array(
|
||||
'copyData' => false,
|
||||
'required' => false,
|
||||
'templateMeta' => array(
|
||||
'form'=>array(
|
||||
'hidden'=>array(
|
||||
'<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
|
||||
'<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
|
||||
'<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
|
||||
'<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
|
||||
'<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">',
|
||||
'<input type="hidden" name="Callsstatus" value="{sugar_translate label=\'call_status_default\'}">',
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'LNK_NEW_CALL' => array (
|
||||
array (
|
||||
array('name'=>'name', 'displayParams'=>array('size'=>90)),
|
||||
),
|
||||
array (
|
||||
'date_start',
|
||||
array (
|
||||
'name' => 'duration_hours',
|
||||
'label' => 'LBL_DURATION',
|
||||
'customCode' => '{literal}
|
||||
<script type="text/javascript">
|
||||
function isValidCallsDuration() {
|
||||
form = document.getElementById(\'ConvertLead\');
|
||||
if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) {
|
||||
alert(\'{/literal}{sugar_translate label="NOTICE_DURATION_TIME" module="Calls"}{literal}\');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>{/literal}
|
||||
<input name="Callsduration_hours" tabindex="1" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}"/>
|
||||
{php}$this->_tpl_vars["minutes_values"] = $this->_tpl_vars["bean"]->minutes_values;{/php}
|
||||
{html_options name="Callsduration_minutes" options=$minutes_values selected=$fields.duration_minutes.value}
|
||||
<span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
|
||||
'displayParams' =>
|
||||
array (
|
||||
'required' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
array (
|
||||
array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$viewdefs['Meetings']['ConvertLead'] = array(
|
||||
'copyData' => false,
|
||||
'required' => false,
|
||||
'templateMeta' => array(
|
||||
'form'=>array(
|
||||
'hidden'=>array(
|
||||
'<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
|
||||
'<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
|
||||
'<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
|
||||
'<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
|
||||
'<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">',
|
||||
'<input type="hidden" name="Meetingsstatus" value="{sugar_translate label=\'meeting_status_default\'}">',
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'LNK_NEW_MEETING' => array (
|
||||
array (
|
||||
array('name'=>'name', 'displayParams'=>array('size'=>90)),
|
||||
),
|
||||
array (
|
||||
'date_start',
|
||||
array (
|
||||
'name' => 'duration_hours',
|
||||
'label' => 'LBL_DURATION',
|
||||
'customCode' => '{literal}
|
||||
<script type="text/javascript">
|
||||
function isValidMeetingsDuration() {
|
||||
form = document.getElementById(\'ConvertLead\');
|
||||
if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) {
|
||||
alert(\'{/literal}{sugar_translate label="NOTICE_DURATION_TIME" module="Calls"}{literal}\');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>{/literal}
|
||||
<input name="Meetingsduration_hours" tabindex="1" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}" />
|
||||
{php}$this->_tpl_vars["minutes_values"] = $this->_tpl_vars["bean"]->minutes_values;{/php}
|
||||
{html_options name="Meetingsduration_minutes" options=$minutes_values selected=$fields.duration_minutes.value}
|
||||
<span class="dateFormat">{sugar_translate label="LBL_HOURS_MINUTES" module="Calls"}',
|
||||
'displayParams' =>
|
||||
array (
|
||||
'required' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
array (
|
||||
array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$viewdefs['Tasks']['ConvertLead'] = array(
|
||||
'copyData' => false,
|
||||
'required' => false,
|
||||
'templateMeta' => array(
|
||||
'form'=>array(
|
||||
'hidden'=>array(
|
||||
'<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
|
||||
'<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
|
||||
'<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
|
||||
'<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
|
||||
'<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'LNK_NEW_TASK' => array (
|
||||
array (
|
||||
array('name'=>'name', 'displayParams'=>array('size'=>90)),
|
||||
),
|
||||
array (
|
||||
'status', 'priority'
|
||||
),
|
||||
|
||||
array (
|
||||
array('name' => 'description', 'displayParams' => array('rows'=>10, 'cols'=>90) ),
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
183
modules/Leads/metadata/detailviewdefs.php
Executable file
183
modules/Leads/metadata/detailviewdefs.php
Executable file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$viewdefs['Leads']['DetailView'] = array (
|
||||
'templateMeta' => array (
|
||||
'form' => array (
|
||||
'buttons' => array (
|
||||
'EDIT',
|
||||
'DUPLICATE',
|
||||
'DELETE',
|
||||
array (
|
||||
'customCode' => '<input title="{$MOD.LBL_CONVERTLEAD_TITLE}" accessKey="{$MOD.LBL_CONVERTLEAD_BUTTON_KEY}" type="button" class="button" onClick="document.location=\'index.php?module=Leads&action=ConvertLead&record={$fields.id.value}\'" name="convert" value="{$MOD.LBL_CONVERTLEAD}">'
|
||||
),
|
||||
array (
|
||||
'customCode' => '<input title="{$APP.LBL_DUP_MERGE}" accessKey="M" class="button" onclick="this.form.return_module.value=\'Leads\'; this.form.return_action.value=\'DetailView\';this.form.return_id.value=\'{$fields.id.value}\'; this.form.action.value=\'Step1\'; this.form.module.value=\'MergeRecords\';" type="submit" name="Merge" value="{$APP.LBL_DUP_MERGE}">'
|
||||
),
|
||||
array (
|
||||
'customCode' => '<input title="{$APP.LBL_MANAGE_SUBSCRIPTIONS}" class="button" onclick="this.form.return_module.value=\'Leads\'; this.form.return_action.value=\'DetailView\';this.form.return_id.value=\'{$fields.id.value}\'; this.form.action.value=\'Subscriptions\'; this.form.module.value=\'Campaigns\'; this.form.module_tab.value=\'Leads\';" type="submit" name="Manage Subscriptions" value="{$APP.LBL_MANAGE_SUBSCRIPTIONS}">'
|
||||
),
|
||||
|
||||
),
|
||||
'headerTpl'=>'modules/Leads/tpls/DetailViewHeader.tpl',
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array (
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
'includes'=> array(
|
||||
array('file'=>'modules/Leads/Lead.js'),
|
||||
),
|
||||
),
|
||||
'panels' => array (
|
||||
|
||||
'LBL_CONTACT_INFORMATION' =>
|
||||
array (
|
||||
array (
|
||||
array (
|
||||
'name' => 'full_name',
|
||||
'label' => 'LBL_NAME',
|
||||
),
|
||||
'phone_work',
|
||||
),
|
||||
|
||||
array (
|
||||
'title',
|
||||
'phone_mobile',
|
||||
),
|
||||
|
||||
array (
|
||||
'department',
|
||||
'phone_fax'
|
||||
),
|
||||
|
||||
array (
|
||||
'account_name',
|
||||
'website'
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'primary_address_street',
|
||||
'label' => 'LBL_PRIMARY_ADDRESS',
|
||||
'type' => 'address',
|
||||
'displayParams' => array (
|
||||
'key' => 'primary'
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => 'alt_address_street',
|
||||
'label' => 'LBL_ALTERNATE_ADDRESS',
|
||||
'type' => 'address',
|
||||
'displayParams' => array (
|
||||
'key' => 'alt'
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
array (
|
||||
'email1',
|
||||
),
|
||||
|
||||
array (
|
||||
'description',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
'LBL_PANEL_ADVANCED' =>
|
||||
array (
|
||||
|
||||
array (
|
||||
'status',
|
||||
'lead_source'
|
||||
),
|
||||
|
||||
array (
|
||||
'status_description',
|
||||
'lead_source_description',
|
||||
),
|
||||
|
||||
array (
|
||||
'opportunity_amount',
|
||||
'refered_by',
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'campaign_name',
|
||||
'label' => 'LBL_CAMPAIGN',
|
||||
|
||||
),
|
||||
'do_not_call'
|
||||
)
|
||||
|
||||
),
|
||||
|
||||
'LBL_PANEL_ASSIGNMENT' =>
|
||||
array(
|
||||
array (
|
||||
array (
|
||||
'name' => 'assigned_user_name',
|
||||
'label' => 'LBL_ASSIGNED_TO',
|
||||
),
|
||||
array (
|
||||
'name' => 'date_modified',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'date_entered',
|
||||
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
)
|
||||
);
|
||||
?>
|
||||
151
modules/Leads/metadata/editviewdefs.php
Executable file
151
modules/Leads/metadata/editviewdefs.php
Executable file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$viewdefs['Leads']['EditView'] = array(
|
||||
'templateMeta' => array('form' => array('hidden'=>array('<input type="hidden" name="prospect_id" value="{if isset($smarty.request.prospect_id)}{$smarty.request.prospect_id}{else}{$bean->prospect_id}{/if}">',
|
||||
'<input type="hidden" name="account_id" value="{if isset($smarty.request.account_id)}{$smarty.request.account_id}{else}{$bean->account_id}{/if}">',
|
||||
'<input type="hidden" name="contact_id" value="{if isset($smarty.request.contact_id)}{$smarty.request.contact_id}{else}{$bean->contact_id}{/if}">',
|
||||
'<input type="hidden" name="opportunity_id" value="{if isset($smarty.request.opportunity_id)}{$smarty.request.opportunity_id}{else}{$bean->opportunity_id}{/if}">'),
|
||||
'buttons' => array(
|
||||
'SAVE',
|
||||
'CANCEL',
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30')
|
||||
),
|
||||
'javascript' => '<script type="text/javascript" language="Javascript">function copyAddressRight(form) {ldelim} form.alt_address_street.value = form.primary_address_street.value;form.alt_address_city.value = form.primary_address_city.value;form.alt_address_state.value = form.primary_address_state.value;form.alt_address_postalcode.value = form.primary_address_postalcode.value;form.alt_address_country.value = form.primary_address_country.value;return true; {rdelim} function copyAddressLeft(form) {ldelim} form.primary_address_street.value =form.alt_address_street.value;form.primary_address_city.value = form.alt_address_city.value;form.primary_address_state.value = form.alt_address_state.value;form.primary_address_postalcode.value =form.alt_address_postalcode.value;form.primary_address_country.value = form.alt_address_country.value;return true; {rdelim} </script>',
|
||||
),
|
||||
'panels' =>array (
|
||||
'LBL_CONTACT_INFORMATION' =>
|
||||
array (
|
||||
|
||||
array (
|
||||
|
||||
array (
|
||||
'name' => 'first_name',
|
||||
'customCode' => '{html_options id="salutation" name="salutation" options=$fields.salutation.options selected=$fields.salutation.value} <input id="first_name" name="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
array (
|
||||
array('name'=>'last_name',
|
||||
'displayParams'=>array('required'=>true),
|
||||
),
|
||||
'phone_work',
|
||||
),
|
||||
|
||||
array (
|
||||
'title',
|
||||
'phone_mobile'
|
||||
),
|
||||
|
||||
array (
|
||||
'department',
|
||||
'phone_fax'
|
||||
),
|
||||
|
||||
array (
|
||||
array('name'=>'account_name', 'type'=>'varchar', 'validateDependency'=>false,'customCode' => '<input name="account_name" {if ($fields.converted.value == 1)}disabled="true"{/if} size="30" maxlength="255" type="text" value="{$fields.account_name.value}">'),
|
||||
'website',
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'primary_address_street',
|
||||
'hideLabel' => true,
|
||||
'type' => 'address',
|
||||
'displayParams'=>array('key'=>'primary', 'rows'=>2, 'cols'=>30, 'maxlength'=>150),
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => 'alt_address_street',
|
||||
'hideLabel'=>true,
|
||||
'type' => 'address',
|
||||
'displayParams'=>array('key'=>'alt', 'copy'=>'primary', 'rows'=>2, 'cols'=>30, 'maxlength'=>150),
|
||||
),
|
||||
),
|
||||
|
||||
array (
|
||||
'email1',
|
||||
),
|
||||
|
||||
array (
|
||||
'description',
|
||||
),
|
||||
),
|
||||
|
||||
'LBL_PANEL_ADVANCED' =>
|
||||
array(
|
||||
|
||||
array(
|
||||
'status',
|
||||
'lead_source',
|
||||
),
|
||||
|
||||
array (
|
||||
array('name'=>'status_description'),
|
||||
array('name'=>'lead_source_description'),
|
||||
),
|
||||
|
||||
array(
|
||||
'opportunity_amount',
|
||||
'refered_by'
|
||||
),
|
||||
|
||||
array (
|
||||
'campaign_name',
|
||||
'do_not_call',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
'LBL_PANEL_ASSIGNMENT' =>
|
||||
array (
|
||||
array (
|
||||
array (
|
||||
'name' => 'assigned_user_name',
|
||||
'label' => 'LBL_ASSIGNED_TO',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
?>
|
||||
225
modules/Leads/metadata/listviewdefs.php
Executable file
225
modules/Leads/metadata/listviewdefs.php
Executable file
@@ -0,0 +1,225 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$listViewDefs ['Leads'] =
|
||||
array (
|
||||
'NAME' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_LIST_NAME',
|
||||
'link' => true,
|
||||
'orderBy' => 'name',
|
||||
'default' => true,
|
||||
'related_fields' =>
|
||||
array (
|
||||
0 => 'first_name',
|
||||
1 => 'last_name',
|
||||
2 => 'salutation',
|
||||
),
|
||||
),
|
||||
'STATUS' =>
|
||||
array (
|
||||
'width' => '7%',
|
||||
'label' => 'LBL_LIST_STATUS',
|
||||
'default' => true,
|
||||
),
|
||||
'ACCOUNT_NAME' =>
|
||||
array (
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'default' => true,
|
||||
'related_fields' =>
|
||||
array (
|
||||
0 => 'account_id',
|
||||
),
|
||||
),
|
||||
'PHONE_WORK' =>
|
||||
array (
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_LIST_PHONE',
|
||||
'default' => true,
|
||||
),
|
||||
'EMAIL1' =>
|
||||
array (
|
||||
'width' => '16%',
|
||||
'label' => 'LBL_LIST_EMAIL_ADDRESS',
|
||||
'sortable' => false,
|
||||
'customCode' => '{$EMAIL1_LINK}{$EMAIL1}</a>',
|
||||
'default' => true,
|
||||
),
|
||||
'ASSIGNED_USER_NAME' =>
|
||||
array (
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER',
|
||||
'default' => true,
|
||||
),
|
||||
'TITLE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_TITLE',
|
||||
'default' => false,
|
||||
),
|
||||
'REFERED_BY' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_REFERED_BY',
|
||||
'default' => false,
|
||||
),
|
||||
'LEAD_SOURCE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_LEAD_SOURCE',
|
||||
'default' => false,
|
||||
),
|
||||
'DEPARTMENT' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_DEPARTMENT',
|
||||
'default' => false,
|
||||
),
|
||||
'DO_NOT_CALL' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_DO_NOT_CALL',
|
||||
'default' => false,
|
||||
),
|
||||
'PHONE_HOME' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_HOME_PHONE',
|
||||
'default' => false,
|
||||
),
|
||||
'PHONE_MOBILE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_MOBILE_PHONE',
|
||||
'default' => false,
|
||||
),
|
||||
'PHONE_OTHER' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_OTHER_PHONE',
|
||||
'default' => false,
|
||||
),
|
||||
'PHONE_FAX' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_FAX_PHONE',
|
||||
'default' => false,
|
||||
),
|
||||
'PRIMARY_ADDRESS_COUNTRY' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_PRIMARY_ADDRESS_COUNTRY',
|
||||
'default' => false,
|
||||
),
|
||||
'PRIMARY_ADDRESS_STREET' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_PRIMARY_ADDRESS_STREET',
|
||||
'default' => false,
|
||||
),
|
||||
'PRIMARY_ADDRESS_CITY' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_PRIMARY_ADDRESS_CITY',
|
||||
'default' => false,
|
||||
),
|
||||
'PRIMARY_ADDRESS_STATE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_PRIMARY_ADDRESS_STATE',
|
||||
'default' => false,
|
||||
),
|
||||
'PRIMARY_ADDRESS_POSTALCODE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_PRIMARY_ADDRESS_POSTALCODE',
|
||||
'default' => false,
|
||||
),
|
||||
'ALT_ADDRESS_COUNTRY' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_ALT_ADDRESS_COUNTRY',
|
||||
'default' => false,
|
||||
),
|
||||
'ALT_ADDRESS_STREET' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_ALT_ADDRESS_STREET',
|
||||
'default' => false,
|
||||
),
|
||||
'ALT_ADDRESS_CITY' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_ALT_ADDRESS_CITY',
|
||||
'default' => false,
|
||||
),
|
||||
'ALT_ADDRESS_STATE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_ALT_ADDRESS_STATE',
|
||||
'default' => false,
|
||||
),
|
||||
'ALT_ADDRESS_POSTALCODE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_ALT_ADDRESS_POSTALCODE',
|
||||
'default' => false,
|
||||
),
|
||||
'DATE_ENTERED' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_DATE_ENTERED',
|
||||
'default' => false,
|
||||
),
|
||||
'CREATED_BY' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_CREATED',
|
||||
'default' => false,
|
||||
),
|
||||
'MODIFIED_BY_NAME' =>
|
||||
array (
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_MODIFIED',
|
||||
'default' => false,
|
||||
),
|
||||
);
|
||||
?>
|
||||
147
modules/Leads/metadata/popupdefs.php
Executable file
147
modules/Leads/metadata/popupdefs.php
Executable file
@@ -0,0 +1,147 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
$popupMeta = array (
|
||||
'moduleMain' => 'Lead',
|
||||
'varName' => 'LEAD',
|
||||
'orderBy' => 'last_name, first_name',
|
||||
'whereClauses' => array (
|
||||
'first_name' => 'leads.first_name',
|
||||
'last_name' => 'leads.last_name',
|
||||
'lead_source' => 'leads.lead_source',
|
||||
'status' => 'leads.status',
|
||||
'account_name' => 'leads.account_name',
|
||||
'assigned_user_id' => 'leads.assigned_user_id',
|
||||
),
|
||||
'searchInputs' => array (
|
||||
0 => 'first_name',
|
||||
1 => 'last_name',
|
||||
2 => 'lead_source',
|
||||
3 => 'status',
|
||||
4 => 'account_name',
|
||||
5 => 'assigned_user_id',
|
||||
),
|
||||
'searchdefs' => array (
|
||||
'first_name' =>
|
||||
array (
|
||||
'name' => 'first_name',
|
||||
'width' => '10%',
|
||||
),
|
||||
'last_name' =>
|
||||
array (
|
||||
'name' => 'last_name',
|
||||
'width' => '10%',
|
||||
),
|
||||
'account_name' =>
|
||||
array (
|
||||
'type' => 'varchar',
|
||||
'label' => 'LBL_ACCOUNT_NAME',
|
||||
'width' => '10%',
|
||||
'name' => 'account_name',
|
||||
),
|
||||
'lead_source' =>
|
||||
array (
|
||||
'name' => 'lead_source',
|
||||
'width' => '10%',
|
||||
),
|
||||
'status' =>
|
||||
array (
|
||||
'name' => 'status',
|
||||
'width' => '10%',
|
||||
),
|
||||
'assigned_user_id' =>
|
||||
array (
|
||||
'name' => 'assigned_user_id',
|
||||
'type' => 'enum',
|
||||
'label' => 'LBL_ASSIGNED_TO',
|
||||
'function' =>
|
||||
array (
|
||||
'name' => 'get_user_array',
|
||||
'params' =>
|
||||
array (
|
||||
0 => false,
|
||||
),
|
||||
),
|
||||
'width' => '10%',
|
||||
),
|
||||
),
|
||||
'listviewdefs' => array (
|
||||
'NAME' =>
|
||||
array (
|
||||
'width' => '30%',
|
||||
'label' => 'LBL_LIST_NAME',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
'related_fields' =>
|
||||
array (
|
||||
0 => 'first_name',
|
||||
1 => 'last_name',
|
||||
2 => 'salutation',
|
||||
),
|
||||
'name' => 'name',
|
||||
),
|
||||
'ACCOUNT_NAME' =>
|
||||
array (
|
||||
'type' => 'varchar',
|
||||
'label' => 'LBL_ACCOUNT_NAME',
|
||||
'width' => '10%',
|
||||
'default' => true,
|
||||
'name' => 'account_name',
|
||||
),
|
||||
'STATUS' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_LIST_STATUS',
|
||||
'default' => true,
|
||||
'name' => 'status',
|
||||
),
|
||||
'LEAD_SOURCE' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_LEAD_SOURCE',
|
||||
'default' => true,
|
||||
'name' => 'lead_source',
|
||||
),
|
||||
'ASSIGNED_USER_NAME' =>
|
||||
array (
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER',
|
||||
'default' => true,
|
||||
'name' => 'assigned_user_name',
|
||||
),
|
||||
),
|
||||
);
|
||||
173
modules/Leads/metadata/quickcreatedefs.php
Executable file
173
modules/Leads/metadata/quickcreatedefs.php
Executable file
@@ -0,0 +1,173 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
$viewdefs ['Leads'] =
|
||||
array (
|
||||
'QuickCreate' =>
|
||||
array (
|
||||
'templateMeta' =>
|
||||
array (
|
||||
'form' =>
|
||||
array (
|
||||
'hidden' =>
|
||||
array (
|
||||
0 => '<input type="hidden" name="prospect_id" value="{if isset($smarty.request.prospect_id)}{$smarty.request.prospect_id}{else}{$bean->prospect_id}{/if}">',
|
||||
1 => '<input type="hidden" name="contact_id" value="{if isset($smarty.request.contact_id)}{$smarty.request.contact_id}{else}{$bean->contact_id}{/if}">',
|
||||
2 => '<input type="hidden" name="opportunity_id" value="{if isset($smarty.request.opportunity_id)}{$smarty.request.opportunity_id}{else}{$bean->opportunity_id}{/if}">',
|
||||
3 => '<input type="hidden" name="account_id" value="{if isset($smarty.request.account_id)}{$smarty.request.account_id}{else}{$bean->account_id}{/if}">',
|
||||
),
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
'javascript' => '<script type="text/javascript" language="Javascript">function copyAddressRight(form) {ldelim} form.alt_address_street.value = form.primary_address_street.value;form.alt_address_city.value = form.primary_address_city.value;form.alt_address_state.value = form.primary_address_state.value;form.alt_address_postalcode.value = form.primary_address_postalcode.value;form.alt_address_country.value = form.primary_address_country.value;return true; {rdelim} function copyAddressLeft(form) {ldelim} form.primary_address_street.value =form.alt_address_street.value;form.primary_address_city.value = form.alt_address_city.value;form.primary_address_state.value = form.alt_address_state.value;form.primary_address_postalcode.value =form.alt_address_postalcode.value;form.primary_address_country.value = form.alt_address_country.value;return true; {rdelim} </script>',
|
||||
'useTabs' => false,
|
||||
),
|
||||
'panels' =>
|
||||
array (
|
||||
'lbl_contact_information' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'first_name',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'status',
|
||||
),
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'last_name',
|
||||
'displayParams' =>
|
||||
array (
|
||||
'required' => true,
|
||||
),
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'phone_work',
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'title',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'phone_mobile',
|
||||
),
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'department',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'phone_fax',
|
||||
),
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'account_name',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'do_not_call',
|
||||
),
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'email1',
|
||||
),
|
||||
),
|
||||
6 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'lead_source',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'refered_by',
|
||||
),
|
||||
),
|
||||
7 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'assigned_user_name',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'team_name',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
164
modules/Leads/metadata/searchdefs.php
Executable file
164
modules/Leads/metadata/searchdefs.php
Executable file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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 ['Leads'] =
|
||||
array (
|
||||
'layout' =>
|
||||
array (
|
||||
'basic_search' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'search_name',
|
||||
'label' => 'LBL_NAME',
|
||||
'type' => 'name',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'current_user_only',
|
||||
'label' => 'LBL_CURRENT_USER_FILTER',
|
||||
'type' => 'bool',
|
||||
),
|
||||
),
|
||||
'advanced_search' =>
|
||||
array (
|
||||
'first_name' =>
|
||||
array (
|
||||
'name' => 'first_name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'email' =>
|
||||
array (
|
||||
'name' => 'email',
|
||||
'label' => 'LBL_ANY_EMAIL',
|
||||
'type' => 'name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'phone' =>
|
||||
array (
|
||||
'name' => 'phone',
|
||||
'label' => 'LBL_ANY_PHONE',
|
||||
'type' => 'name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'last_name' =>
|
||||
array (
|
||||
'name' => 'last_name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'address_street' =>
|
||||
array (
|
||||
'name' => 'address_street',
|
||||
'label' => 'LBL_ANY_ADDRESS',
|
||||
'type' => 'name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'address_city' =>
|
||||
array (
|
||||
'name' => 'address_city',
|
||||
'label' => 'LBL_CITY',
|
||||
'type' => 'name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'account_name' =>
|
||||
array (
|
||||
'name' => 'account_name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'primary_address_country' =>
|
||||
array (
|
||||
'name' => 'primary_address_country',
|
||||
'label' => 'LBL_COUNTRY',
|
||||
'type' => 'name',
|
||||
'options' => 'countries_dom',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'address_state' =>
|
||||
array (
|
||||
'name' => 'address_state',
|
||||
'label' => 'LBL_STATE',
|
||||
'type' => 'name',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'status' =>
|
||||
array (
|
||||
'name' => 'status',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'lead_source' =>
|
||||
array (
|
||||
'name' => 'lead_source',
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
'assigned_user_id' =>
|
||||
array (
|
||||
'name' => 'assigned_user_id',
|
||||
'type' => 'enum',
|
||||
'label' => 'LBL_ASSIGNED_TO',
|
||||
'function' =>
|
||||
array (
|
||||
'name' => 'get_user_array',
|
||||
'params' =>
|
||||
array (
|
||||
0 => false,
|
||||
),
|
||||
),
|
||||
'default' => true,
|
||||
'width' => '10%',
|
||||
),
|
||||
),
|
||||
),
|
||||
'templateMeta' =>
|
||||
array (
|
||||
'maxColumns' => '3',
|
||||
'widths' =>
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
65
modules/Leads/metadata/studio.php
Executable file
65
modules/Leads/metadata/studio.php
Executable file
@@ -0,0 +1,65 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$GLOBALS['studioDefs']['Leads'] = array(
|
||||
'LBL_DETAILVIEW'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/Leads/DetailView.html',
|
||||
'php_file'=>'modules/Leads/DetailView.php',
|
||||
'type'=>'DetailView',
|
||||
),
|
||||
'LBL_EDITVIEW'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/Leads/EditView.html',
|
||||
'php_file'=>'modules/Leads/EditView.php',
|
||||
'type'=>'EditView',
|
||||
),
|
||||
'LBL_LISTVIEW'=>array(
|
||||
'template'=>'listview',
|
||||
'meta_file'=>'modules/Leads/listviewdefs.php',
|
||||
'type'=>'ListView',
|
||||
),
|
||||
'LBL_SEARCHFORM'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/Leads/SearchForm.html',
|
||||
'php_file'=>'modules/Leads/ListView.php',
|
||||
'type'=>'SearchForm',
|
||||
),
|
||||
|
||||
);
|
||||
170
modules/Leads/metadata/subpaneldefs.php
Executable file
170
modules/Leads/metadata/subpaneldefs.php
Executable file
@@ -0,0 +1,170 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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['Leads'] = array(
|
||||
// sets up which panels to show, in which order, and with what linked_fields
|
||||
'subpanel_setup' => array(
|
||||
'activities' => array(
|
||||
'order' => 20,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'date_start',
|
||||
'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
|
||||
'type' => 'collection',
|
||||
'subpanel_name' => 'activities', //this values is not associated with a physical file.
|
||||
'module'=>'Activities',
|
||||
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateTaskButton'),
|
||||
array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
|
||||
array('widget_class' => 'SubPanelTopScheduleCallButton'),
|
||||
array('widget_class' => 'SubPanelTopComposeEmailButton'),
|
||||
),
|
||||
|
||||
'collection_list' => array(
|
||||
'meetings' => array(
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'meetings',
|
||||
),
|
||||
'oldmeetings' => array(
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'function:get_old_related_meetings',
|
||||
'set_subpanel_data' => 'oldmeetings',
|
||||
'generate_select'=>true,
|
||||
),
|
||||
'tasks' => array(
|
||||
'module' => 'Tasks',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'tasks',
|
||||
),
|
||||
'calls' => array(
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'calls',
|
||||
),
|
||||
'oldcalls' => array(
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'function:get_old_related_calls',
|
||||
'set_subpanel_data' => 'oldcalls',
|
||||
'generate_select'=>true,
|
||||
),
|
||||
)
|
||||
),
|
||||
'history' => array(
|
||||
'order' => 30,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'date_modified',
|
||||
'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
|
||||
'type' => 'collection',
|
||||
'subpanel_name' => 'history', //this values is not associated with a physical file.
|
||||
'module'=>'History',
|
||||
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateNoteButton'),
|
||||
array('widget_class' => 'SubPanelTopArchiveEmailButton'),
|
||||
array('widget_class' => 'SubPanelTopSummaryButton'),
|
||||
),
|
||||
|
||||
'collection_list' => array(
|
||||
'meetings' => array(
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'meetings',
|
||||
),
|
||||
'oldmeetings' => array(
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'function:get_old_related_meetings',
|
||||
'generate_select'=>true,
|
||||
'set_subpanel_data' => 'oldmeetings',
|
||||
),
|
||||
'tasks' => array(
|
||||
'module' => 'Tasks',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'tasks',
|
||||
),
|
||||
'calls' => array(
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'calls',
|
||||
),
|
||||
'oldcalls' => array(
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'function:get_old_related_calls',
|
||||
'set_subpanel_data' => 'oldcalls',
|
||||
'generate_select'=>true,
|
||||
),
|
||||
'notes' => array(
|
||||
'module' => 'Notes',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'notes',
|
||||
),
|
||||
'emails' => array(
|
||||
'module' => 'Emails',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'emails',
|
||||
),
|
||||
'linkedemails' => array(
|
||||
'module' => 'Emails',
|
||||
'subpanel_name' => 'ForUnlinkedEmailHistory',
|
||||
'get_subpanel_data' => 'function:get_unlinked_email_query',
|
||||
'generate_select'=>true,
|
||||
'function_parameters' => array('return_as_array'=>'true'),
|
||||
),
|
||||
)
|
||||
),
|
||||
'campaigns' => array(
|
||||
'order' => 40,
|
||||
'module' => 'CampaignLog',
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'activity_date',
|
||||
'get_subpanel_data'=>'campaigns',
|
||||
'subpanel_name' => 'ForTargets',
|
||||
'title_key' => 'LBL_CAMPAIGN_LIST_SUBPANEL_TITLE',
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateCampaignLogEntryButton'),
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
116
modules/Leads/metadata/subpanels/ForCalls.php
Executable file
116
modules/Leads/metadata/subpanels/ForCalls.php
Executable file
@@ -0,0 +1,116 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Leads'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields' => array(
|
||||
'accept_status_name'=>array (
|
||||
'vname' => 'LBL_LIST_ACCEPT_STATUS',
|
||||
'width' => '11%',
|
||||
'sortable'=>false
|
||||
),
|
||||
'c_accept_status_fields'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'accept_status_id'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'first_name'=>array(
|
||||
'name'=>'first_name',
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'last_name'=>array(
|
||||
'name'=>'last_name',
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'name'=>array(
|
||||
'name'=>'name',
|
||||
'vname' => 'LBL_LIST_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'module' => 'Leads',
|
||||
'width' => '23%',
|
||||
),
|
||||
'account_name'=>array(
|
||||
'name'=>'account_name',
|
||||
'module' => 'Accounts',
|
||||
'target_record_key' => 'account_id',
|
||||
'target_module' => 'Accounts',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'vname' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'width' => '22%',
|
||||
'sortable'=>false,
|
||||
),
|
||||
'account_id'=>array(
|
||||
'usage'=>'query_only',
|
||||
|
||||
),
|
||||
'email1'=>array(
|
||||
'name'=>'email1',
|
||||
'vname' => 'LBL_LIST_EMAIL',
|
||||
'widget_class' => 'SubPanelEmailLink',
|
||||
'width' => '30%',
|
||||
'sortable' => false,
|
||||
),
|
||||
'phone_work'=>array (
|
||||
'name'=>'phone_work',
|
||||
'vname' => 'LBL_LIST_PHONE',
|
||||
'width' => '15%',
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '5%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
91
modules/Leads/metadata/subpanels/ForEmails.php
Executable file
91
modules/Leads/metadata/subpanels/ForEmails.php
Executable file
@@ -0,0 +1,91 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Accounts'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields' => array(
|
||||
'first_name'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'last_name'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'name'=>array(
|
||||
'vname' => 'LBL_LIST_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'module' => 'Leads',
|
||||
'width' => '20%',
|
||||
),
|
||||
'lead_source'=>array(
|
||||
'vname' => 'LBL_LIST_LEAD_SOURCE',
|
||||
'width' => '13%',
|
||||
),
|
||||
'email1'=>array(
|
||||
'vname' => 'LBL_LIST_EMAIL_ADDRESS',
|
||||
'width' => '25%',
|
||||
'widget_class' => 'SubPanelEmailLink',
|
||||
),
|
||||
'lead_source_description'=>array(
|
||||
'name' => 'lead_source_description',
|
||||
'vname' => 'LBL_LIST_LEAD_SOURCE_DESCRIPTION',
|
||||
'width' => '26%',
|
||||
'sortable'=>false,
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '4%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '4%',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
100
modules/Leads/metadata/subpanels/ForMeetings.php
Executable file
100
modules/Leads/metadata/subpanels/ForMeetings.php
Executable file
@@ -0,0 +1,100 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Leads'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields'=> array(
|
||||
'accept_status_name' => array(
|
||||
'vname' => 'LBL_LIST_ACCEPT_STATUS',
|
||||
'width' => '11%',
|
||||
'sortable' => false,
|
||||
),
|
||||
'm_accept_status_fields'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'accept_status_id'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'first_name'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'last_name'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'name'=>array(
|
||||
'vname' => 'LBL_LIST_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'module' => 'Leads',
|
||||
'width' => '25%',
|
||||
),
|
||||
'user_name'=>array(
|
||||
'vname' => 'LBL_LIST_USER_NAME',
|
||||
'width' => '25%',
|
||||
),
|
||||
'email1'=>array(
|
||||
'vname' => 'LBL_LIST_EMAIL',
|
||||
'width' => '25%',
|
||||
'widget_class' => 'SubPanelEmailLink',
|
||||
),
|
||||
'phone_work'=>array (
|
||||
'vname' => 'LBL_LIST_PHONE',
|
||||
'width' => '21%',
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '5%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
107
modules/Leads/metadata/subpanels/default.php
Executable file
107
modules/Leads/metadata/subpanels/default.php
Executable file
@@ -0,0 +1,107 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Accounts'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields' => array(
|
||||
'first_name'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'last_name'=>array(
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
'name'=>array(
|
||||
'vname' => 'LBL_LIST_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'last_name',
|
||||
'module' => 'Leads',
|
||||
'width' => '20%',
|
||||
),
|
||||
'refered_by'=>array(
|
||||
'vname' => 'LBL_LIST_REFERED_BY',
|
||||
'width' => '13%',
|
||||
),
|
||||
'lead_source'=>array(
|
||||
'vname' => 'LBL_LIST_LEAD_SOURCE',
|
||||
'width' => '13%',
|
||||
),
|
||||
'phone_work'=>array(
|
||||
'vname' => 'LBL_LIST_PHONE',
|
||||
'width' => '10%',
|
||||
),
|
||||
'email1'=>array(
|
||||
'vname' => 'LBL_LIST_EMAIL_ADDRESS',
|
||||
'width' => '10%',
|
||||
'widget_class' => 'SubPanelEmailLink',
|
||||
'sortable'=>false,
|
||||
),
|
||||
'lead_source_description'=>array(
|
||||
'name' => 'lead_source_description',
|
||||
'vname' => 'LBL_LIST_LEAD_SOURCE_DESCRIPTION',
|
||||
'width' => '26%',
|
||||
'sortable'=>false,
|
||||
),
|
||||
'assigned_user_name' => array (
|
||||
'name' => 'assigned_user_name',
|
||||
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '4%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'Leads',
|
||||
'width' => '4%',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
544
modules/Leads/vardefs.php
Executable file
544
modules/Leads/vardefs.php
Executable file
@@ -0,0 +1,544 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$dictionary['Lead'] = array('table' => 'leads','audited'=>true, 'unified_search' => true,'duplicate_merge'=>true,
|
||||
'comment' => 'Leads are persons of interest early in a sales cycle', 'fields' => array (
|
||||
|
||||
|
||||
'converted' =>
|
||||
array (
|
||||
'name' => 'converted',
|
||||
'vname' => 'LBL_CONVERTED',
|
||||
'type' => 'bool',
|
||||
'default' => '0',
|
||||
'comment' => 'Has Lead been converted to a Contact (and other Sugar objects)'
|
||||
),
|
||||
'refered_by' =>
|
||||
array (
|
||||
'name' => 'refered_by',
|
||||
'vname' => 'LBL_REFERED_BY',
|
||||
'type' => 'varchar',
|
||||
'len' => '100',
|
||||
'comment' => 'Identifies who refered the lead',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'lead_source' =>
|
||||
array (
|
||||
'name' => 'lead_source',
|
||||
'vname' => 'LBL_LEAD_SOURCE',
|
||||
'type' => 'enum',
|
||||
'options'=> 'lead_source_dom',
|
||||
'len' => '100',
|
||||
'audited'=>true,
|
||||
'comment' => 'Lead source (ex: Web, print)',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'lead_source_description' =>
|
||||
array (
|
||||
'name' => 'lead_source_description',
|
||||
'vname' => 'LBL_LEAD_SOURCE_DESCRIPTION',
|
||||
'type' => 'text',
|
||||
'group'=>'lead_source',
|
||||
'comment' => 'Description of the lead source'
|
||||
),
|
||||
'status' =>
|
||||
array (
|
||||
'name' => 'status',
|
||||
'vname' => 'LBL_STATUS',
|
||||
'type' => 'enum',
|
||||
'len' => '100',
|
||||
'options' => 'lead_status_dom',
|
||||
'audited'=>true,
|
||||
'comment' => 'Status of the lead',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'status_description' =>
|
||||
array (
|
||||
'name' => 'status_description',
|
||||
'vname' => 'LBL_STATUS_DESCRIPTION',
|
||||
'type' => 'text',
|
||||
'group'=>'status',
|
||||
'comment' => 'Description of the status of the lead'
|
||||
),
|
||||
'department' =>
|
||||
array (
|
||||
'name' => 'department',
|
||||
'vname' => 'LBL_DEPARTMENT',
|
||||
'type' => 'varchar',
|
||||
'len' => '100',
|
||||
'comment' => 'Department the lead belongs to',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'reports_to_id' =>
|
||||
array (
|
||||
'name' => 'reports_to_id',
|
||||
'vname' => 'LBL_REPORTS_TO_ID',
|
||||
'type' => 'id',
|
||||
'reportable'=>false,
|
||||
'comment' => 'ID of Contact the Lead reports to'
|
||||
),
|
||||
'report_to_name' =>
|
||||
array (
|
||||
'name' => 'report_to_name',
|
||||
'rname' => 'name',
|
||||
'id_name' => 'reports_to_id',
|
||||
'vname' => 'LBL_REPORTS_TO',
|
||||
'type' => 'relate',
|
||||
// 'link'=>'reports_to_link',
|
||||
'table' => 'contacts',
|
||||
'isnull' => 'true',
|
||||
'module' => 'Contacts',
|
||||
'dbType' => 'varchar',
|
||||
'len' => 'id',
|
||||
'source'=>'non-db',
|
||||
'reportable'=>false,
|
||||
'massupdate' => false,
|
||||
),
|
||||
'reports_to_link' =>
|
||||
array (
|
||||
'name' => 'reports_to_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'lead_direct_reports',
|
||||
'link_type'=>'one',
|
||||
'side'=>'right',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_REPORTS_TO',
|
||||
),
|
||||
/*'acc_name_from_accounts' =>
|
||||
array (
|
||||
'name' => 'acc_name_from_accounts',
|
||||
'rname' => 'name',
|
||||
'id_name' => 'account_id',
|
||||
'vname' => 'LBL_ACCOUNT_NAME_1',
|
||||
'type' => 'relate',
|
||||
'link' => 'accounts',
|
||||
'table' => 'accounts',
|
||||
'join_name'=>'accounts',
|
||||
'isnull' => 'true',
|
||||
'module' => 'Accounts',
|
||||
'dbType' => 'varchar',
|
||||
'len' => '255',
|
||||
'source' => 'non-db',
|
||||
'unified_search' => false,
|
||||
'massupdate' => false,
|
||||
'studio' => 'false',
|
||||
),
|
||||
*/
|
||||
'account_name' =>
|
||||
array (
|
||||
'name' => 'account_name',
|
||||
'vname' => 'LBL_ACCOUNT_NAME',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'unified_search' => true,
|
||||
'comment' => 'Account name for lead',
|
||||
),
|
||||
|
||||
|
||||
'accounts' =>
|
||||
array (
|
||||
'name' => 'accounts',
|
||||
'type' => 'link',
|
||||
'relationship' => 'account_leads',
|
||||
'link_type' => 'one',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_ACCOUNT',
|
||||
'duplicate_merge'=> 'disabled',
|
||||
),
|
||||
|
||||
'account_description' =>
|
||||
array (
|
||||
'name' => 'account_description',
|
||||
'vname' => 'LBL_ACCOUNT_DESCRIPTION',
|
||||
'type' => 'text',
|
||||
'group'=>'account_name',
|
||||
'unified_search' => true,
|
||||
'comment' => 'Description of lead account'
|
||||
),
|
||||
'contact_id' =>
|
||||
array (
|
||||
'name' => 'contact_id',
|
||||
'type' => 'id',
|
||||
'reportable'=>false,
|
||||
'vname'=>'LBL_CONTACT_ID',
|
||||
'comment' => 'If converted, Contact ID resulting from the conversion'
|
||||
),
|
||||
'account_id' =>
|
||||
array (
|
||||
'name' => 'account_id',
|
||||
'type' => 'id',
|
||||
'reportable'=>false,
|
||||
'vname'=>'LBL_ACCOUNT_ID',
|
||||
'comment' => 'If converted, Account ID resulting from the conversion'
|
||||
),
|
||||
'opportunity_id' =>
|
||||
array (
|
||||
'name' => 'opportunity_id',
|
||||
'type' => 'id',
|
||||
'reportable'=>false,
|
||||
'vname'=>'LBL_OPPORTUNITY_ID',
|
||||
'comment' => 'If converted, Opportunity ID resulting from the conversion'
|
||||
),
|
||||
'opportunity_name' =>
|
||||
array (
|
||||
'name' => 'opportunity_name',
|
||||
'vname' => 'LBL_OPPORTUNITY_NAME',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'comment' => 'Opportunity name associated with lead'
|
||||
),
|
||||
'opportunity_amount' =>
|
||||
array (
|
||||
'name' => 'opportunity_amount',
|
||||
'vname' => 'LBL_OPPORTUNITY_AMOUNT',
|
||||
'type' => 'varchar',
|
||||
'group'=>'opportunity_name',
|
||||
'len' => '50',
|
||||
'comment' => 'Amount of the opportunity'
|
||||
),
|
||||
'campaign_id' =>
|
||||
array (
|
||||
'name' => 'campaign_id',
|
||||
'type' => 'id',
|
||||
'reportable'=>false,
|
||||
'vname'=>'LBL_CAMPAIGN_ID',
|
||||
'comment' => 'Campaign that generated lead'
|
||||
),
|
||||
|
||||
'campaign_name' =>
|
||||
array (
|
||||
'name' => 'campaign_name',
|
||||
'rname' => 'name',
|
||||
'id_name' => 'campaign_id',
|
||||
'vname' => 'LBL_CAMPAIGN',
|
||||
'type' => 'relate',
|
||||
'link' => 'campaign_leads',
|
||||
'table' => 'campaigns',
|
||||
'isnull' => 'true',
|
||||
'module' => 'Campaigns',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
'campaign_leads' =>
|
||||
array (
|
||||
'name' => 'campaign_leads',
|
||||
'type' => 'link',
|
||||
'vname' => 'LBL_CAMPAIGN_LEAD',
|
||||
'relationship' => 'campaign_leads',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
'c_accept_status_fields' =>
|
||||
array (
|
||||
'name' => 'c_accept_status_fields',
|
||||
'rname' => 'id',
|
||||
'relationship_fields'=>array('id' => 'accept_status_id', 'accept_status' => 'accept_status_name'),
|
||||
'vname' => 'LBL_LIST_ACCEPT_STATUS',
|
||||
'type' => 'relate',
|
||||
'link' => 'calls',
|
||||
'link_type' => 'relationship_info',
|
||||
'source' => 'non-db',
|
||||
'importable' => 'false',
|
||||
'duplicate_merge'=> 'disabled',
|
||||
),
|
||||
'm_accept_status_fields' =>
|
||||
array (
|
||||
'name' => 'm_accept_status_fields',
|
||||
'rname' => 'id',
|
||||
'relationship_fields'=>array('id' => 'accept_status_id', 'accept_status' => 'accept_status_name'),
|
||||
'vname' => 'LBL_LIST_ACCEPT_STATUS',
|
||||
'type' => 'relate',
|
||||
'link' => 'meetings',
|
||||
'link_type' => 'relationship_info',
|
||||
'source' => 'non-db',
|
||||
'importable' => 'false',
|
||||
'hideacl'=>true,
|
||||
'duplicate_merge'=> 'disabled',
|
||||
),
|
||||
'accept_status_id' =>
|
||||
array(
|
||||
'name' => 'accept_status_id',
|
||||
'type' => 'varchar',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_LIST_ACCEPT_STATUS',
|
||||
),
|
||||
'accept_status_name' =>
|
||||
array(
|
||||
'massupdate' => false,
|
||||
'name' => 'accept_status_name',
|
||||
'type' => 'enum',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_LIST_ACCEPT_STATUS',
|
||||
'options' => 'dom_meeting_accept_status',
|
||||
'importable' => 'false',
|
||||
),
|
||||
'webtolead_email1' =>
|
||||
array (
|
||||
'name' => 'webtolead_email1',
|
||||
'vname' => 'LBL_EMAIL_ADDRESS',
|
||||
'type' => 'email',
|
||||
'len' => '100',
|
||||
'source' => 'non-db',
|
||||
'comment' => 'Main email address of lead',
|
||||
'importable' => 'false',
|
||||
'studio' => 'false',
|
||||
),
|
||||
'webtolead_email2' =>
|
||||
array (
|
||||
'name' => 'webtolead_email2',
|
||||
'vname' => 'LBL_OTHER_EMAIL_ADDRESS',
|
||||
'type' => 'email',
|
||||
'len' => '100',
|
||||
'source' => 'non-db',
|
||||
'comment' => 'Secondary email address of lead',
|
||||
'importable' => 'false',
|
||||
'studio' => 'false',
|
||||
),
|
||||
'webtolead_email_opt_out' =>
|
||||
array (
|
||||
'name' => 'webtolead_email_opt_out',
|
||||
'vname' => 'LBL_EMAIL_OPT_OUT',
|
||||
'type' => 'bool',
|
||||
'source' => 'non-db',
|
||||
'comment' => 'Indicator signaling if lead elects to opt out of email campaigns',
|
||||
'importable' => 'false',
|
||||
'massupdate' => false,
|
||||
'studio'=>'false',
|
||||
),
|
||||
'webtolead_invalid_email' =>
|
||||
array (
|
||||
'name' => 'webtolead_invalid_email',
|
||||
'vname' => 'LBL_INVALID_EMAIL',
|
||||
'type' => 'bool',
|
||||
'source' => 'non-db',
|
||||
'comment' => 'Indicator that email address for lead is invalid',
|
||||
'importable' => 'false',
|
||||
'massupdate' => false,
|
||||
'studio'=>'false',
|
||||
),
|
||||
'birthdate' =>
|
||||
array (
|
||||
'name' => 'birthdate',
|
||||
'vname' => 'LBL_BIRTHDATE',
|
||||
'massupdate' => false,
|
||||
'type' => 'date',
|
||||
'comment' => 'The birthdate of the contact'
|
||||
),
|
||||
|
||||
'portal_name' =>
|
||||
array (
|
||||
'name' => 'portal_name',
|
||||
'vname' => 'LBL_PORTAL_NAME',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'group'=>'portal',
|
||||
'comment' => 'Portal user name when lead created via lead portal',
|
||||
//BEGIN SUGARCRM flav!=ent
|
||||
'studio' => 'false',
|
||||
//END SUGARCRM
|
||||
),
|
||||
'portal_app' =>
|
||||
array (
|
||||
'name' => 'portal_app',
|
||||
'vname' => 'LBL_PORTAL_APP',
|
||||
'type' => 'varchar',
|
||||
'group'=>'portal',
|
||||
'len' => '255',
|
||||
'comment' => 'Portal application that resulted in created of lead',
|
||||
//BEGIN SUGARCRM flav!=ent
|
||||
'studio' => 'false',
|
||||
),
|
||||
'website' =>
|
||||
array (
|
||||
'name' => 'website',
|
||||
'vname' => 'LBL_WEBSITE',
|
||||
'type' => 'varchar',
|
||||
'len' => 255,
|
||||
'comment' => 'URL of website for the company',
|
||||
),
|
||||
|
||||
'tasks' =>
|
||||
array (
|
||||
'name' => 'tasks',
|
||||
'type' => 'link',
|
||||
'relationship' => 'lead_tasks',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_TASKS',
|
||||
),
|
||||
'notes' =>
|
||||
array (
|
||||
'name' => 'notes',
|
||||
'type' => 'link',
|
||||
'relationship' => 'lead_notes',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_NOTES',
|
||||
),
|
||||
'meetings' =>
|
||||
array (
|
||||
'name' => 'meetings',
|
||||
'type' => 'link',
|
||||
'relationship' => 'meetings_leads',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_MEETINGS',
|
||||
),
|
||||
'calls' =>
|
||||
array (
|
||||
'name' => 'calls',
|
||||
'type' => 'link',
|
||||
'relationship' => 'calls_leads',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_CALLS',
|
||||
),
|
||||
'oldmeetings' =>
|
||||
array (
|
||||
'name' => 'oldmeetings',
|
||||
'type' => 'link',
|
||||
'relationship' => 'lead_meetings',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_MEETINGS',
|
||||
),
|
||||
'oldcalls' =>
|
||||
array (
|
||||
'name' => 'oldcalls',
|
||||
'type' => 'link',
|
||||
'relationship' => 'lead_calls',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_CALLS',
|
||||
),
|
||||
'emails' =>
|
||||
array (
|
||||
'name' => 'emails',
|
||||
'type' => 'link',
|
||||
'relationship' => 'emails_leads_rel',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_EMAILS',
|
||||
'unified_search'=>true,
|
||||
),
|
||||
'email_addresses' =>
|
||||
array (
|
||||
'name' => 'email_addresses',
|
||||
'type' => 'link',
|
||||
'relationship' => 'leads_email_addresses',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_EMAIL_ADDRESSES',
|
||||
'reportable'=>false,
|
||||
),
|
||||
'email_addresses_primary' =>
|
||||
array (
|
||||
'name' => 'email_addresses_primary',
|
||||
'type' => 'link',
|
||||
'relationship' => 'leads_email_addresses_primary',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
|
||||
'duplicate_merge'=> 'disabled',
|
||||
),
|
||||
'campaigns' =>
|
||||
array (
|
||||
'name' => 'campaigns',
|
||||
'type' => 'link',
|
||||
'relationship' => 'lead_campaign_log',
|
||||
'module'=>'CampaignLog',
|
||||
'bean_name'=>'CampaignLog',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_CAMPAIGNLOG',
|
||||
),
|
||||
'prospect_lists' =>
|
||||
array (
|
||||
'name' => 'prospect_lists',
|
||||
'type' => 'link',
|
||||
'relationship' => 'prospect_list_leads',
|
||||
'module'=>'ProspectLists',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_PROSPECT_LIST',
|
||||
),
|
||||
|
||||
)
|
||||
, 'indices' => array (
|
||||
array('name' =>'idx_lead_acct_name_first', 'type'=>'index', 'fields'=>array('account_name','deleted')),
|
||||
array('name' =>'idx_lead_last_first', 'type'=>'index', 'fields'=>array('last_name','first_name','deleted')),
|
||||
array('name' =>'idx_lead_del_stat', 'type'=>'index', 'fields'=>array('last_name','status','deleted','first_name')),
|
||||
array('name' =>'idx_lead_opp_del', 'type'=>'index', 'fields'=>array('opportunity_id','deleted',)),
|
||||
array('name' =>'idx_leads_acct_del', 'type'=>'index', 'fields'=>array('account_id','deleted',)),
|
||||
array('name' => 'idx_del_user', 'type' => 'index', 'fields'=> array('deleted', 'assigned_user_id')),
|
||||
array('name' =>'idx_lead_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
|
||||
array('name' =>'idx_lead_contact', 'type'=>'index', 'fields'=>array('contact_id')),
|
||||
|
||||
)
|
||||
, 'relationships' => array (
|
||||
'lead_direct_reports' => array('lhs_module'=> 'Leads', 'lhs_table'=> 'leads', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'Leads', 'rhs_table'=> 'leads', 'rhs_key' => 'reports_to_id',
|
||||
'relationship_type'=>'one-to-many'),
|
||||
'lead_tasks' => array('lhs_module'=> 'Leads', 'lhs_table'=> 'leads', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
|
||||
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
|
||||
'relationship_role_column_value'=>'Leads')
|
||||
,'lead_notes' => array('lhs_module'=> 'Leads', 'lhs_table'=> 'leads', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
|
||||
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
|
||||
'relationship_role_column_value'=>'Leads')
|
||||
|
||||
,'lead_meetings' => array('lhs_module'=> 'Leads', 'lhs_table'=> 'leads', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
|
||||
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
|
||||
'relationship_role_column_value'=>'Leads')
|
||||
|
||||
,'lead_calls' => array('lhs_module'=> 'Leads', 'lhs_table'=> 'leads', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
|
||||
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
|
||||
'relationship_role_column_value'=>'Leads')
|
||||
|
||||
,'lead_emails' => array('lhs_module'=> 'Leads', 'lhs_table'=> 'leads', 'lhs_key' => 'id',
|
||||
'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
|
||||
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
|
||||
'relationship_role_column_value'=>'Leads'),
|
||||
'lead_campaign_log' => array(
|
||||
'lhs_module' => 'Leads',
|
||||
'lhs_table' => 'leads',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'CampaignLog',
|
||||
'rhs_table' => 'campaign_log',
|
||||
'rhs_key' => 'target_id',
|
||||
'relationship_type' =>'one-to-many'
|
||||
)
|
||||
|
||||
)
|
||||
//This enables optimistic locking for Saves From EditView
|
||||
,'optimistic_locking'=>true,
|
||||
);
|
||||
|
||||
VardefManager::createVardef('Leads','Lead', array('default', 'assignable',
|
||||
'person'));
|
||||
|
||||
|
||||
?>
|
||||
686
modules/Leads/views/view.convertlead.php
Executable file
686
modules/Leads/views/view.convertlead.php
Executable file
@@ -0,0 +1,686 @@
|
||||
<?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-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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/EditView/EditView2.php");
|
||||
|
||||
class ViewConvertLead extends SugarView
|
||||
{
|
||||
protected $fileName = "modules/Leads/metadata/convertdefs.php";
|
||||
|
||||
public function __construct(
|
||||
$bean = null,
|
||||
$view_object_map = array()
|
||||
)
|
||||
{
|
||||
parent::SugarView($bean, $view_object_map);
|
||||
$this->medataDataFile = $this->fileName;
|
||||
if (file_exists("custom/$this->fileName"))
|
||||
{
|
||||
$this->medataDataFile = "custom/$this->fileName";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SugarView::display()
|
||||
*/
|
||||
public function display()
|
||||
{
|
||||
if (!empty($_REQUEST['handle']) && $_REQUEST['handle'] == 'save')
|
||||
{
|
||||
return $this->handleSave();
|
||||
}
|
||||
|
||||
global $beanList;
|
||||
|
||||
$this->medataDataFile = $this->fileName;
|
||||
if (file_exists("custom/$this->fileName"))
|
||||
{
|
||||
$this->medataDataFile = "custom/$this->fileName";
|
||||
}
|
||||
$this->loadDefs();
|
||||
$this->getRecord();
|
||||
$this->checkForDuplicates($this->focus);
|
||||
$smarty = new Sugar_Smarty();
|
||||
$ev = new EditView();
|
||||
$ev->ss = $smarty;
|
||||
$ev->view = "ConvertLead";
|
||||
echo $this->getModuleTitle();
|
||||
|
||||
require_once("include/QuickSearchDefaults.php");
|
||||
$qsd = new QuickSearchDefaults();
|
||||
$qsd->setFormName("ConvertLead");
|
||||
|
||||
$this->contact = new Contact();
|
||||
$smarty->assign("contact_def", $this->contact->field_defs);
|
||||
$smarty->assign("form_name", "ConvertLead");
|
||||
$smarty->assign("form_id", "ConvertLead");
|
||||
$smarty->assign("module", "Leads");
|
||||
$smarty->assign("view", "convertlead");
|
||||
$smarty->assign("bean", $this->focus);
|
||||
$smarty->assign("record_id", $this->focus->id);
|
||||
$smarty->display("modules/Leads/tpls/ConvertLeadHeader.tpl");
|
||||
|
||||
echo "<div class='edit view' style='width:auto;'>";
|
||||
|
||||
foreach($this->defs as $module => $vdef)
|
||||
{
|
||||
$bean = $beanList[$module];
|
||||
$focus = new $bean();
|
||||
$focus->fill_in_additional_detail_fields();
|
||||
foreach($focus->field_defs as $field => $def)
|
||||
{
|
||||
|
||||
if(isset($vdef[$ev->view]['copyData']) && $vdef[$ev->view]['copyData'])
|
||||
{
|
||||
if ($module == "Accounts" && $field == 'name')
|
||||
{
|
||||
$focus->name = $this->focus->account_name;
|
||||
}
|
||||
else if ($module == "Opportunities" && $field == 'amount')
|
||||
{
|
||||
$focus->amount = unformat_number($this->focus->opportunity_amount);
|
||||
}
|
||||
else if ($field == "id")
|
||||
{
|
||||
//If it is not a contact, don't copy the ID from the lead
|
||||
if ($module == "Contacts") {
|
||||
$focus->$field = $this->focus->$field;
|
||||
}
|
||||
} else if (is_a($focus, "Company") && $field == 'phone_office')
|
||||
{
|
||||
//Special case where company and person have the same field with a different name
|
||||
$focus->phone_office = $this->focus->phone_work;
|
||||
}
|
||||
else if (isset($this->focus->$field))
|
||||
{
|
||||
$focus->$field = $this->focus->$field;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Copy over email data
|
||||
$ev->setup($module, $focus, $this->medataDataFile, "modules/Leads/tpls/ConvertLead.tpl", false);
|
||||
$ev->process();
|
||||
echo($ev->display(false));
|
||||
echo($this->getValidationJS($module, $focus, $vdef[$ev->view]));
|
||||
}
|
||||
echo "</div>";
|
||||
echo ($qsd->getQSScriptsJSONAlreadyDefined());
|
||||
$smarty->display("modules/Leads/tpls/ConvertLeadFooter.tpl");
|
||||
}
|
||||
|
||||
protected function getRecord()
|
||||
{
|
||||
$this->focus = new Lead();
|
||||
if (isset($_REQUEST['record']))
|
||||
{
|
||||
$this->focus->retrieve($_REQUEST['record']);
|
||||
}
|
||||
}
|
||||
|
||||
protected function loadDefs()
|
||||
{
|
||||
$viewdefs = array();
|
||||
include($this->medataDataFile);
|
||||
$this->defs = $viewdefs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the javascript to enable/disable validation of each module's sub-form
|
||||
* //TODO: This should probably be on the smarty template
|
||||
* @param $module String the target module name.
|
||||
* @param $focus SugarBean instance of the target module.
|
||||
* @param $focus EditView def for the module.
|
||||
* @return String, javascript to echo to page.
|
||||
*/
|
||||
protected function getValidationJS(
|
||||
$module,
|
||||
$focus,
|
||||
$viewdef
|
||||
)
|
||||
{
|
||||
$validateSelect = isset($viewdef['required']) && $viewdef['required'] && !empty($viewdef['select']);
|
||||
$jsOut = "
|
||||
<script type='text/javascript'>
|
||||
if (!SUGAR.convert) SUGAR.convert = {requiredFields: {}};
|
||||
SUGAR.convert.toggle$module = function(){
|
||||
clear_all_errors();
|
||||
inputsWithErrors = [];
|
||||
if(!SUGAR.convert.{$module}Enabled)
|
||||
{
|
||||
for(var i in SUGAR.convert.requiredFields.$module)
|
||||
{
|
||||
addToValidate('ConvertLead', '$module' + i, 'varchar', true, SUGAR.convert.requiredFields.{$module}[i]);
|
||||
}
|
||||
";
|
||||
if ($validateSelect) {
|
||||
$jsOut .= "
|
||||
removeFromValidate('ConvertLead', '{$viewdef['select']}');";
|
||||
}
|
||||
|
||||
$jsOut .= "
|
||||
SUGAR.convert.{$module}Enabled = true;
|
||||
} else {
|
||||
for(var i in SUGAR.convert.requiredFields.$module)
|
||||
{
|
||||
removeFromValidate('ConvertLead', '$module' + i);
|
||||
}";
|
||||
if ($validateSelect) {
|
||||
$jsOut .= "
|
||||
addToValidate('ConvertLead', '{$viewdef['select']}', 'varchar', true, '"
|
||||
. translate($this->contact->field_defs[$viewdef['select']]['vname']) . "');";
|
||||
}
|
||||
$jsOut .= "
|
||||
SUGAR.convert.{$module}Enabled = false;
|
||||
}
|
||||
YAHOO.util.Dom.get('convert_create_{$module}').value = SUGAR.convert.{$module}Enabled;
|
||||
};\n";
|
||||
|
||||
if (isset($viewdef['required']) && $viewdef['required'])
|
||||
{
|
||||
if (!empty($viewdef['select']) && (empty($viewdef['default_action']) || $viewdef['default_action'] != 'create'))
|
||||
{
|
||||
$jsOut .= "
|
||||
SUGAR.convert.{$module}Enabled = true;";
|
||||
}
|
||||
$jsOut .= "
|
||||
YAHOO.util.Event.onDOMReady(SUGAR.convert.toggle$module);";
|
||||
}
|
||||
$jsOut .= "
|
||||
YAHOO.util.Event.addListener('new$module', 'click', SUGAR.convert.toggle$module);
|
||||
SUGAR.convert.requiredFields.$module = {};";
|
||||
foreach($focus->field_defs as $field => $def)
|
||||
{
|
||||
if (isset($def['required']) && $def['required'])
|
||||
{
|
||||
$jsOut .= "
|
||||
SUGAR.convert.requiredFields.$module.$field = '". translate($def['vname'], $module) . "';\n";
|
||||
}
|
||||
}
|
||||
|
||||
$jsOut .= "
|
||||
</script>";
|
||||
|
||||
return $jsOut;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a new Contact as well as any related items passed in.
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
protected function handleSave()
|
||||
{
|
||||
require_once("include/formbase.php");
|
||||
$lead = false;
|
||||
if (!empty($_REQUEST['record']))
|
||||
{
|
||||
$lead = new Lead();
|
||||
$lead->retrieve($_REQUEST['record']);
|
||||
}
|
||||
|
||||
global $beanList;
|
||||
$this->loadDefs();
|
||||
$beans = array();
|
||||
$selectedBeans = array();
|
||||
$selects = array();
|
||||
//Make sure the contact object is availible for relationships.
|
||||
$beans['Contacts'] = new Contact();
|
||||
$beans['Contacts']->id = create_guid();
|
||||
$beans['Contacts']->new_with_id = true;
|
||||
|
||||
// Bug 39287 - Check for Duplicates on selected modules before save
|
||||
if ( !empty($_REQUEST['selectedContact']) ) {
|
||||
$beans['Contacts']->retrieve($_REQUEST['selectedContact']);
|
||||
if ( !empty($beans['Contacts']->id) ) {
|
||||
$beans['Contacts']->new_with_id = false;
|
||||
unset($_REQUEST["convert_create_Contacts"]);
|
||||
unset($_POST["convert_create_Contacts"]);
|
||||
}
|
||||
}
|
||||
elseif (!empty($_REQUEST["convert_create_Contacts"]) && $_REQUEST["convert_create_Contacts"] != "false" && !isset($_POST['ContinueContact'])) {
|
||||
require_once('modules/Contacts/ContactFormBase.php');
|
||||
$contactForm = new ContactFormBase();
|
||||
$duplicateContacts = $contactForm->checkForDuplicates('Contacts');
|
||||
if(isset($duplicateContacts)){
|
||||
echo $contactForm->buildTableForm($duplicateContacts, 'Contacts');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( !empty($_REQUEST['selectedAccount']) ) {
|
||||
$_REQUEST['account_id'] = $_REQUEST['selectedAccount'];
|
||||
unset($_REQUEST["convert_create_Accounts"]);
|
||||
unset($_POST["convert_create_Accounts"]);
|
||||
}
|
||||
elseif (!empty($_REQUEST["convert_create_Accounts"]) && $_REQUEST["convert_create_Accounts"] != "false" && empty($_POST['ContinueAccount'])){
|
||||
require_once('modules/Accounts/AccountFormBase.php');
|
||||
$accountForm = new AccountFormBase();
|
||||
$duplicateAccounts = $accountForm->checkForDuplicates('Accounts');
|
||||
if(isset($duplicateAccounts)){
|
||||
echo $accountForm->buildTableForm($duplicateAccounts);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->defs as $module => $vdef)
|
||||
{
|
||||
//Create a new record if "create" was selected
|
||||
if (!empty($_REQUEST["convert_create_$module"]) && $_REQUEST["convert_create_$module"] != "false")
|
||||
{
|
||||
//Save the new record
|
||||
$bean = $beanList[$module];
|
||||
if (empty($beans[$module]))
|
||||
$beans[$module] = new $bean();
|
||||
|
||||
$this->populateNewBean($module, $beans[$module], $beans['Contacts'], $lead);
|
||||
|
||||
}
|
||||
//If an existing bean was selected, relate it to the contact
|
||||
else if (!empty($vdef['ConvertLead']['select'])) {
|
||||
//Save the new record
|
||||
$select = $vdef['ConvertLead']['select'];
|
||||
$fieldDef = $beans['Contacts']->field_defs[$select];
|
||||
if (!empty($fieldDef['id_name']) && !empty($_REQUEST[$fieldDef['id_name']]))
|
||||
{
|
||||
$beans['Contacts']->$fieldDef['id_name'] = $_REQUEST[$fieldDef['id_name']];
|
||||
$selects[$module] = $_REQUEST[$fieldDef['id_name']];
|
||||
if (!empty($_REQUEST[$select]))
|
||||
{
|
||||
$beans['Contacts']->$select = $_REQUEST[$select];
|
||||
}
|
||||
// Bug 39268 - Add the existing beans to a list of beans we'll potentially add the lead's activities to
|
||||
$bean = loadBean($module);
|
||||
$bean->retrieve($_REQUEST[$fieldDef['id_name']]);
|
||||
$selectedBeans[$module] = $bean;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->handleActivities($lead, $beans);
|
||||
// Bug 39268 - Add the lead's activities to the selected beans
|
||||
$this->handleActivities($lead, $selectedBeans);
|
||||
|
||||
//Handle non-contacts relationships
|
||||
foreach($beans as $bean)
|
||||
{
|
||||
if (!empty($lead))
|
||||
{
|
||||
if (empty($bean->assigned_user_id))
|
||||
{
|
||||
$bean->assigned_user_id = $lead->assigned_user_id;
|
||||
}
|
||||
$leadsRel = $this->findRelationship($bean, $lead);
|
||||
if (!empty($leadsRel))
|
||||
{
|
||||
|
||||
$bean->load_relationship ($leadsRel) ;
|
||||
$relObject = $bean->$leadsRel->getRelationshipObject();
|
||||
if ($relObject->relationship_type == "one-to-many" && $bean->$leadsRel->_get_bean_position())
|
||||
{
|
||||
$id_field = $relObject->rhs_key;
|
||||
$lead->$id_field = $bean->id;
|
||||
} else {
|
||||
$bean->$leadsRel->add($lead->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Special case code for opportunities->Accounts
|
||||
if ($bean->object_name == "Opportunity" && empty($bean->account_id))
|
||||
{
|
||||
if( isset($beans['Accounts'])) {
|
||||
$bean->account_id = $beans['Accounts']->id;
|
||||
$bean->account_name = $beans['Accounts']->name;
|
||||
}
|
||||
else if (!empty($selects['Accounts'])){
|
||||
$bean->account_id = $selects['Accounts'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->copyAddressFields($bean, $beans['Contacts']);
|
||||
|
||||
$bean->save();
|
||||
}
|
||||
if (!empty($lead))
|
||||
{ //Mark the original Lead converted
|
||||
$lead->status = "Converted";
|
||||
$lead->converted = '1';
|
||||
$lead->in_workflow = true;
|
||||
$lead->save();
|
||||
}
|
||||
|
||||
$this->displaySaveResults($beans);
|
||||
}
|
||||
|
||||
protected function displaySaveResults(
|
||||
$beans
|
||||
)
|
||||
{
|
||||
global $beanList;
|
||||
echo "<div><ul>";
|
||||
foreach($beans as $bean)
|
||||
{
|
||||
$beanName = $bean->object_name;
|
||||
if ( $beanName == 'Contact' && !$bean->new_with_id ) {
|
||||
echo "<li>" . translate("LBL_EXISTING_CONTACT") . " -
|
||||
<a href='index.php?module={$bean->module_dir}&action=DetailView&record={$bean->id}'>
|
||||
{$bean->get_summary_text()}
|
||||
</a></li>";
|
||||
}
|
||||
else {
|
||||
echo "<li>" . translate("LBL_CREATED_NEW") . translate($beanName) . " -
|
||||
<a href='index.php?module={$bean->module_dir}&action=DetailView&record={$bean->id}'>
|
||||
{$bean->get_summary_text()}
|
||||
</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</ul></div>";
|
||||
}
|
||||
|
||||
protected function handleActivities(
|
||||
$lead,
|
||||
$beans
|
||||
)
|
||||
{
|
||||
global $app_list_strings;
|
||||
$parent_types = $app_list_strings['record_type_display'];
|
||||
|
||||
$activities = $this->getActivitiesFromLead($lead);
|
||||
|
||||
foreach($beans as $module => $bean)
|
||||
{
|
||||
if (isset($parent_types[$module]))
|
||||
{
|
||||
foreach($activities as $activity)
|
||||
{
|
||||
$this->copyActivityAndRelateToBean($activity, $bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of activities related to the lead
|
||||
* @param Lead $lead Lead to get activities from
|
||||
* @return Array of Activity SugarBeans .
|
||||
*/
|
||||
protected function getActivitiesFromLead(
|
||||
$lead
|
||||
)
|
||||
{
|
||||
if (!$lead) return;
|
||||
|
||||
global $beanList, $db;
|
||||
|
||||
$activitesList = array("Calls", "Tasks", "Meetings", "Emails", "Notes");
|
||||
$activities = array();
|
||||
|
||||
foreach($activitesList as $module)
|
||||
{
|
||||
$beanName = $beanList[$module];
|
||||
$activity = new $beanName();
|
||||
$query = "SELECT id FROM {$activity->table_name} WHERE parent_id = '{$lead->id}' AND parent_type = 'Leads'";
|
||||
$result = $db->query($query,true);
|
||||
while($row = $db->fetchByAssoc($result))
|
||||
{
|
||||
$activity = new $beanName();
|
||||
$activity->retrieve($row['id']);
|
||||
$activity->fixUpFormatting();
|
||||
$activities[] = $activity;
|
||||
}
|
||||
}
|
||||
|
||||
return $activities;
|
||||
}
|
||||
|
||||
protected function copyActivityAndRelateToBean(
|
||||
$activity,
|
||||
$bean
|
||||
)
|
||||
{
|
||||
global $beanList;
|
||||
|
||||
$newActivity = clone $activity;
|
||||
$newActivity->id = create_guid();
|
||||
$newActivity->new_with_id = true;
|
||||
|
||||
//Special case to prevent duplicated tasks from appearing under Contacts multiple times
|
||||
if ($newActivity->module_dir == "Tasks" && $bean->module_dir != "Contacts")
|
||||
{
|
||||
$newActivity->contact_id = $activity->contact_name = "";
|
||||
}
|
||||
|
||||
if ($rel = $this->findRelationship($newActivity, $bean))
|
||||
{
|
||||
$newActivity->load_relationship ($rel) ;
|
||||
$relObj = $newActivity->$rel->getRelationshipObject();
|
||||
if ( $relObj->relationship_type=='one-to-one' || $relObj->relationship_type == 'one-to-many' )
|
||||
{
|
||||
$key = $relObj->rhs_key;
|
||||
$newActivity->$key = $bean->id;
|
||||
}
|
||||
$newActivity->$rel->add($bean->id);
|
||||
$newActivity->parent_id = $bean->id;
|
||||
$newActivity->parent_type = $bean->module_dir;
|
||||
$newActivity->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the passed in Bean fron the contact and the $_REQUEST
|
||||
* @param String $module Module of new bean
|
||||
* @param SugarBean $bean SugarBean to be populated.
|
||||
* @param Contact $contact Contact to relate the bean to.
|
||||
*/
|
||||
protected function populateNewBean(
|
||||
$module,
|
||||
$bean,
|
||||
$contact,
|
||||
$lead
|
||||
)
|
||||
{
|
||||
populateFromPost($module, $bean, true);
|
||||
|
||||
//Copy data from the contact to new bean
|
||||
foreach($bean->field_defs as $field => $def)
|
||||
{
|
||||
if(!isset($_REQUEST[$module . $field]) && isset($lead->$field) && $field != 'id')
|
||||
{
|
||||
$bean->$field = $lead->$field;
|
||||
}
|
||||
}
|
||||
//Try to link to the new contact
|
||||
$contactRel = "";
|
||||
if (!empty($vdef['ConvertLead']['select']))
|
||||
{
|
||||
$select = $vdef['ConvertLead']['select'];
|
||||
$fieldDef = $contact->field_defs[$select];
|
||||
if (!empty($fieldDef['id_name']))
|
||||
{
|
||||
$bean->id = create_guid();
|
||||
$bean->new_with_id = true;
|
||||
$contact->$fieldDef['id_name'] = $bean->id ;
|
||||
if ($fieldDef['id_name'] != $select) {
|
||||
$rname = isset($fieldDef['rname']) ? $fieldDef['rname'] : "";
|
||||
if (!empty($rname) && isset($bean->$rname))
|
||||
$contact->$select = $bean->$rname;
|
||||
else
|
||||
$contact->$select = $bean->name;
|
||||
}
|
||||
}
|
||||
} else if ($module != "Contacts"){
|
||||
$contactRel = $this->findRelationship($contact, $bean);
|
||||
if (!empty($contactRel))
|
||||
{
|
||||
$bean->id = create_guid();
|
||||
$bean->new_with_id = true;
|
||||
$contact->load_relationship ($contactRel) ;
|
||||
$relObject = $contact->$contactRel->getRelationshipObject();
|
||||
if ($relObject->relationship_type == "one-to-many" && $contact->$contactRel->_get_bean_position())
|
||||
{
|
||||
$id_field = $relObject->rhs_key;
|
||||
$bean->$id_field = $contact->id;
|
||||
} else {
|
||||
$contact->$contactRel->add($bean->id);
|
||||
}
|
||||
//Set the parent of activites to the new Contact
|
||||
if (isset($bean->field_defs['parent_id']) && isset($bean->field_defs['parent_type']))
|
||||
{
|
||||
$bean->parent_id = $contact->id;
|
||||
$bean->parent_type = "Contacts";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function copyAddressFields($bean, $contact)
|
||||
{
|
||||
//Copy over address info from the contact to any beans with address not set
|
||||
foreach($bean->field_defs as $field => $def)
|
||||
{
|
||||
if(!isset($_REQUEST[$bean->module_dir . $field]) && strpos($field, "_address_") !== false)
|
||||
{
|
||||
$set = "primary";
|
||||
if (strpos($field, "alt_") !== false || strpos($field, "shipping_") !== false)
|
||||
$set = "alt";
|
||||
$type = "";
|
||||
|
||||
if(strpos($field, "_address_street_2") !== false)
|
||||
$type = "_address_street_2";
|
||||
else if(strpos($field, "_address_street_3") !== false)
|
||||
$type = "_address_street_3";
|
||||
else if(strpos($field, "_address_street_4") !== false)
|
||||
$type = "";
|
||||
else if(strpos($field, "_address_street") !== false)
|
||||
$type = "_address_street";
|
||||
else if(strpos($field, "_address_city") !== false)
|
||||
$type = "_address_city";
|
||||
else if(strpos($field, "_address_state") !== false)
|
||||
$type = "_address_state";
|
||||
else if(strpos($field, "_address_postalcode") !== false)
|
||||
$type = "_address_postalcode";
|
||||
else if(strpos($field, "_address_country") !== false)
|
||||
$type = "_address_country";
|
||||
|
||||
$var = $set.$type;
|
||||
if (isset($contact->$var))
|
||||
$bean->$field = $contact->$var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function findRelationship(
|
||||
$from,
|
||||
$to
|
||||
)
|
||||
{
|
||||
global $dictionary;
|
||||
require_once("modules/TableDictionary.php");
|
||||
foreach ($from->field_defs as $field=>$def)
|
||||
{
|
||||
if (isset($def['type']) && $def['type'] == "link" && isset($def['relationship'])) {
|
||||
$rel_name = $def['relationship'];
|
||||
$rel_def = "";
|
||||
if (isset($dictionary[$from->object_name]['relationships']) && isset($dictionary[$from->object_name]['relationships'][$rel_name]))
|
||||
{
|
||||
$rel_def = $dictionary[$from->object_name]['relationships'][$rel_name];
|
||||
}
|
||||
else if (isset($dictionary[$to->object_name]['relationships']) && isset($dictionary[$to->object_name]['relationships'][$rel_name]))
|
||||
{
|
||||
$rel_def = $dictionary[$to->object_name]['relationships'][$rel_name];
|
||||
}
|
||||
else if (isset($dictionary[$rel_name]) && isset($dictionary[$rel_name]['relationships'])
|
||||
&& isset($dictionary[$rel_name]['relationships'][$rel_name]))
|
||||
{
|
||||
$rel_def = $dictionary[$rel_name]['relationships'][$rel_name];
|
||||
}
|
||||
if (!empty($rel_def)) {
|
||||
if ($rel_def['lhs_module'] == $from->module_dir && $rel_def['rhs_module'] == $to->module_dir )
|
||||
{
|
||||
return $field;
|
||||
}
|
||||
else if ($rel_def['rhs_module'] == $from->module_dir && $rel_def['lhs_module'] == $to->module_dir )
|
||||
{
|
||||
return $field;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SugarView::_getModuleTitleParams()
|
||||
*/
|
||||
protected function _getModuleTitleParams()
|
||||
{
|
||||
global $mod_strings;
|
||||
$params = parent::_getModuleTitleParams();
|
||||
$params[] = "<a href='index.php?module=Leads&action=DetailView&record={$this->bean->id}'>{$this->bean->name}</a>";
|
||||
$params[] = $mod_strings['LBL_CONVERTLEAD'];
|
||||
return $params;
|
||||
}
|
||||
|
||||
|
||||
protected function checkForDuplicates(
|
||||
$lead
|
||||
)
|
||||
{
|
||||
if ($lead->status == "Converted")
|
||||
{
|
||||
echo ("<span class='error'>" . translate('LBL_CONVERTLEAD_WARNING'));
|
||||
$dupes = array();
|
||||
$q = "SELECT id, first_name, last_name FROM contacts WHERE first_name LIKE '{$lead->first_name}' AND last_name LIKE '{$lead->last_name}'";
|
||||
$result = $lead->db->query($q);
|
||||
while($row = $lead->db->fetchByAssoc($result)) {
|
||||
$contact = new Contact();
|
||||
$contact->retrieve($row['id']);
|
||||
$dupes[$row['id']] = $contact->name;
|
||||
}
|
||||
if (!empty($dupes))
|
||||
{
|
||||
foreach($dupes as $id => $name)
|
||||
{
|
||||
echo (translate('LBL_CONVERTLEAD_WARNING_INTO_RECORD') . "<a href='index.php?module=Contacts&action=DetailView&record=$id'>$name</a>");
|
||||
break;
|
||||
}
|
||||
}
|
||||
echo "</span>";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user