/modules/Contacts/updateRelations.php
PHP | 43 lines | 29 code | 5 blank | 9 comment | 6 complexity | 1a0e7d5658c61e194b58c4f12b9ac036 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
- <?php
- /*+********************************************************************************
- * The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is: vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
- ********************************************************************************/
- require_once('include/database/PearDatabase.php');
- require_once('user_privileges/default_module_view.php');
- global $singlepane_view, $currentModule;
- $idlist = vtlib_purify($_REQUEST['idlist']);
- $dest_mod = vtlib_purify($_REQUEST['destination_module']);
- $record = vtlib_purify($_REQUEST['record']);
- $parenttab = getParentTab();
- $forCRMRecord = vtlib_purify($_REQUEST['parentid']);
- if($singlepane_view == 'true')
- $action = "DetailView";
- else
- $action = "CallRelatedList";
- $storearray = array();
- if(!empty($_REQUEST['idlist'])) {
- // Split the string of ids
- $storearray = explode (";",trim($idlist,";"));
- } else if(!empty($_REQUEST['entityid'])){
- $storearray = array($_REQUEST['entityid']);
- }elseif(!empty($_REQUEST['pot_id'])) {
- $forCRMRecord = $record;
- $storearray = array(vtlib_purify($_REQUEST["pot_id"]));
- $dest_mod = 'Potentials';
- }
- $focus = CRMEntity::getInstance($currentModule);
- if(!empty($storearray)) {
- relateEntities($focus, $currentModule, $forCRMRecord, $dest_mod, $storearray);
- }
- header("Location: index.php?action=$action&module=$currentModule&record=".$forCRMRecord."&parenttab=".$parenttab);
- ?>