PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/Products/updateRelations.php

https://bitbucket.org/yousef_fadila/vtiger
PHP | 39 lines | 24 code | 6 blank | 9 comment | 6 complexity | 8eef935ae1c9af7bccf62c47bc86956c 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. @include_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. $parenttab = getParentTab();
  16. $forCRMRecord = vtlib_purify($_REQUEST['parentid']);
  17. if($singlepane_view == 'true')
  18. $action = "DetailView";
  19. else
  20. $action = "CallRelatedList";
  21. $storearray = array();
  22. if(!empty($_REQUEST['idlist'])) {
  23. // Split the string of ids
  24. $storearray = explode (";",trim($idlist,";"));
  25. } else if(!empty($_REQUEST['entityid'])){
  26. $storearray = array($_REQUEST['entityid']);
  27. }
  28. $focus = CRMEntity::getInstance($currentModule);
  29. if(!empty($storearray)) {
  30. relateEntities($focus, $currentModule, $forCRMRecord, $dest_mod, $storearray);
  31. }
  32. header("Location: index.php?action=$action&module=$currentModule&record=".$forCRMRecord."&parenttab=".$parenttab);
  33. ?>