PageRenderTime 49ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/Contacts/updateRelations.php

https://bitbucket.org/yousef_fadila/vtiger
PHP | 43 lines | 29 code | 5 blank | 9 comment | 6 complexity | 1a0e7d5658c61e194b58c4f12b9ac036 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
  1. <?php
  2. /*+********************************************************************************
  3. * The contents of this file are subject to the vtiger CRM Public License Version 1.0
  4. * ("License"); You may not use this file except in compliance with the License
  5. * The Original Code is: vtiger CRM Open Source
  6. * The Initial Developer of the Original Code is vtiger.
  7. * Portions created by vtiger are Copyright (C) vtiger.
  8. * All Rights Reserved.
  9. ********************************************************************************/
  10. require_once('include/database/PearDatabase.php');
  11. require_once('user_privileges/default_module_view.php');
  12. global $singlepane_view, $currentModule;
  13. $idlist = vtlib_purify($_REQUEST['idlist']);
  14. $dest_mod = vtlib_purify($_REQUEST['destination_module']);
  15. $record = vtlib_purify($_REQUEST['record']);
  16. $parenttab = getParentTab();
  17. $forCRMRecord = vtlib_purify($_REQUEST['parentid']);
  18. if($singlepane_view == 'true')
  19. $action = "DetailView";
  20. else
  21. $action = "CallRelatedList";
  22. $storearray = array();
  23. if(!empty($_REQUEST['idlist'])) {
  24. // Split the string of ids
  25. $storearray = explode (";",trim($idlist,";"));
  26. } else if(!empty($_REQUEST['entityid'])){
  27. $storearray = array($_REQUEST['entityid']);
  28. }elseif(!empty($_REQUEST['pot_id'])) {
  29. $forCRMRecord = $record;
  30. $storearray = array(vtlib_purify($_REQUEST["pot_id"]));
  31. $dest_mod = 'Potentials';
  32. }
  33. $focus = CRMEntity::getInstance($currentModule);
  34. if(!empty($storearray)) {
  35. relateEntities($focus, $currentModule, $forCRMRecord, $dest_mod, $storearray);
  36. }
  37. header("Location: index.php?action=$action&module=$currentModule&record=".$forCRMRecord."&parenttab=".$parenttab);
  38. ?>