init
This commit is contained in:
50
modules/PContacts/views/view.closepcontactaddresspopup.php
Executable file
50
modules/PContacts/views/view.closepcontactaddresspopup.php
Executable file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can pcontact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address pcontact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/MVC/View/views/view.list.php');
|
||||
|
||||
class PContactsViewCloseContactAddressPopup extends ViewList {
|
||||
|
||||
function ClosePContactAddressPopup(){
|
||||
parent::ViewList();
|
||||
}
|
||||
|
||||
function display() {
|
||||
if(isset($_REQUEST['close_window'])) echo "<script>window.close();</script>";
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
?>
|
||||
65
modules/PContacts/views/view.detail.php
Executable file
65
modules/PContacts/views/view.detail.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 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can pcontact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address pcontact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/json_config.php');
|
||||
require_once('include/MVC/View/views/view.detail.php');
|
||||
|
||||
class PContactsViewDetail extends ViewDetail {
|
||||
|
||||
|
||||
function PContactsViewDetail(){
|
||||
parent::ViewDetail();
|
||||
}
|
||||
|
||||
/**
|
||||
* display
|
||||
*
|
||||
* We are overridding the display method to manipulate the portal information.
|
||||
* If portal is not enabled then don't show the portal fields.
|
||||
*/
|
||||
function display() {
|
||||
$admin = new Administration();
|
||||
$admin->retrieveSettings();
|
||||
if(isset($admin->settings['portal_on']) && $admin->settings['portal_on']) {
|
||||
$this->ss->assign("PORTAL_ENABLED", true);
|
||||
}
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
91
modules/PContacts/views/view.edit.php
Executable file
91
modules/PContacts/views/view.edit.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 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can pcontact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address pcontact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: This file is used to override the default Meta-data EditView behavior
|
||||
* to provide customization specific to the PContacts module.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/json_config.php');
|
||||
require_once('include/MVC/View/views/view.edit.php');
|
||||
|
||||
class PContactsViewEdit extends ViewEdit {
|
||||
|
||||
function PContactsViewEdit(){
|
||||
parent::ViewEdit();
|
||||
$this->useForSubpanel = true;
|
||||
$this->useModuleQuickCreateTemplate = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* display
|
||||
*
|
||||
* We are overridding the display method to manipulate the sectionPanels.
|
||||
* If portal is not enabled then don't show the Portal Information panel.
|
||||
*/
|
||||
function display() {
|
||||
$this->ev->process();
|
||||
if ( !empty($_REQUEST['pcontact_name']) && !empty($_REQUEST['contact_id'])
|
||||
&& $this->ev->fieldDefs['report_to_name']['value'] == ''
|
||||
&& $this->ev->fieldDefs['reports_to_id']['value'] == '') {
|
||||
$this->ev->fieldDefs['report_to_name']['value'] = $_REQUEST['pcontact_name'];
|
||||
$this->ev->fieldDefs['reports_to_id']['value'] = $_REQUEST['pcontact_id'];
|
||||
}
|
||||
$admin = new Administration();
|
||||
$admin->retrieveSettings();
|
||||
if(empty($admin->settings['portal_on']) || !$admin->settings['portal_on']) {
|
||||
unset($this->ev->sectionPanels[strtoupper('lbl_portal_information')]);
|
||||
} else {
|
||||
echo '<script src="modules/PContacts/Contact.js"></script>';
|
||||
echo '<script language="javascript">';
|
||||
echo 'addToValidateComparison(\'EditView\', \'portal_password\', \'varchar\', false, SUGAR.language.get(\'app_strings\', \'ERR_SQS_NO_MATCH_FIELD\') + SUGAR.language.get(\'PContacts\', \'LBL_PORTAL_PASSWORD\'), \'portal_password1\');';
|
||||
echo 'addToValidateVerified(\'EditView\', \'portal_name_verified\', \'bool\', false, SUGAR.language.get(\'app_strings\', \'ERR_EXISTING_PORTAL_USERNAME\'));';
|
||||
echo 'YAHOO.util.Event.on(\'portal_name\', \'blur\', validatePortalName);';
|
||||
echo 'YAHOO.util.Event.on(\'portal_name\', \'keydown\', handleKeyDown);';
|
||||
echo '</script>';
|
||||
}
|
||||
|
||||
echo $this->ev->display($this->showTitle);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
61
modules/PContacts/views/view.mailmergepopup.php
Executable file
61
modules/PContacts/views/view.mailmergepopup.php
Executable file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can pcontact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address pcontact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* PContactsViewContactAddressPopup
|
||||
*
|
||||
* */
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('modules/PContacts/Popup_picker.php');
|
||||
|
||||
class PContactsViewMailMergePopup extends SugarView {
|
||||
|
||||
function PContactAddressPopup(){
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function process() {
|
||||
$this->display();
|
||||
}
|
||||
|
||||
function display() {
|
||||
|
||||
$popup = new Popup_Picker();
|
||||
echo $popup->process_page_for_merge();
|
||||
}
|
||||
}
|
||||
?>
|
||||
62
modules/PContacts/views/view.pcontactaddresspopup.php
Executable file
62
modules/PContacts/views/view.pcontactaddresspopup.php
Executable file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can pcontact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address pcontact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* PContactsViewContactAddressPopup
|
||||
*
|
||||
* */
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('modules/PContacts/Popup_picker.php');
|
||||
|
||||
class PContactsViewContactAddressPopup extends SugarView {
|
||||
|
||||
function PContactAddressPopup(){
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function process() {
|
||||
$this->display();
|
||||
}
|
||||
|
||||
function display() {
|
||||
$this->displayJavascript();
|
||||
echo '<script type="text/javascript" src="' . getJSPath('themes/'.$GLOBALS['theme'].'/menu.js') . '"></script>';
|
||||
$popup = new Popup_Picker();
|
||||
echo $popup->process_page_for_address();
|
||||
}
|
||||
}
|
||||
?>
|
||||
76
modules/PContacts/views/view.retrieveemail.php
Executable file
76
modules/PContacts/views/view.retrieveemail.php
Executable file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can pcontact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address pcontact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* PContactsViewRetrieveEmailUsername.php
|
||||
*
|
||||
* This class overrides SugarView and provides an implementation for the RetrieveEmailUsername
|
||||
* method used for returning the information about an email address
|
||||
*
|
||||
* @author Collin Lee
|
||||
* */
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once("include/JSON.php");
|
||||
|
||||
class PContactsViewRetrieveEmail extends SugarView {
|
||||
|
||||
function PContactsViewRetrieveEmail(){
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function process() {
|
||||
$this->display();
|
||||
}
|
||||
|
||||
function display(){
|
||||
$data = array();
|
||||
$data['target'] = $_REQUEST['target'];
|
||||
if(!empty($_REQUEST['email'])) {
|
||||
$db = DBManagerFactory::getInstance();
|
||||
$email = $GLOBALS['db']->quote(strtoupper(trim($_REQUEST['email'])));
|
||||
$result = $db->query("SELECT * FROM email_addresses WHERE email_address_caps = '$email' AND deleted = 0");
|
||||
if($row = $db->fetchByAssoc($result)) {
|
||||
$data['email'] = $row;
|
||||
} else {
|
||||
$data['email'] = '';
|
||||
}
|
||||
}
|
||||
$json = new JSON(JSON_LOOSE_TYPE);
|
||||
echo $json->encode($data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
75
modules/PContacts/views/view.validportalusername.php
Executable file
75
modules/PContacts/views/view.validportalusername.php
Executable file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can pcontact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address pcontact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* PContactsViewValidPortalUsername.php
|
||||
*
|
||||
* This class overrides SugarView and provides an implementation for the ValidPortalUsername
|
||||
* method used for checking whether or not an existing portal user_name has already been assigned.
|
||||
* We take advantage of the MVC framework to provide this action which is invoked from
|
||||
* a javascript AJAX request.
|
||||
*
|
||||
* @author Collin Lee
|
||||
* */
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
|
||||
class PContactsViewValidPortalUsername extends SugarView {
|
||||
|
||||
function ValidPortalUsername(){
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function process() {
|
||||
$this->display();
|
||||
}
|
||||
|
||||
function display(){
|
||||
if(!empty($_REQUEST['portal_name'])) {
|
||||
$db = DBManagerFactory::getInstance();
|
||||
$portalUsername = $_REQUEST['portal_name'];
|
||||
$result = $db->query("Select count(id) as total from pcontacts where portal_name = '$portalUsername'");
|
||||
$total = 0;
|
||||
while($row = $db->fetchByAssoc($result)) {
|
||||
$total = $row['total'];
|
||||
}
|
||||
echo $total;
|
||||
} else {
|
||||
echo '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user