grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026generateSearchWhere($_REQUEST['module'], $_REQUEST['current_query_by_page']); $ret_array = create_export_query_relate_link_patch($_REQUEST['module'], $mass->searchFields, $mass->where_clauses); /* BEGIN - SECURITY GROUPS */ //need to hijack the $ret_array['where'] of securitygorup required if ($focus->bean_implements('ACL') && ACLController::requireSecurityGroup($focus->module_dir, 'list')) { require_once('modules/SecurityGroups/SecurityGroup.php'); global $current_user; $owner_where = $focus->getOwnerWhere($current_user->id); $group_where = SecurityGroup::getGroupWhere($focus->table_name, $focus->module_dir, $current_user->id); if (!empty($owner_where)) { if (empty($ret_array['where'])) { $ret_array['where'] = " (". $owner_where." or ".$group_where.") "; } else { $ret_array['where'] .= " AND (". $owner_where." or ".$group_where.") "; } } else { $ret_array['where'] .= ' AND '. $group_where; } } /* END - SECURITY GROUPS */ $query = $focus->create_export_query($order_by, $ret_array['where'], $ret_array['join']); $result = DBManagerFactory::getInstance()->query($query, true); $uids = array(); while ($val = DBManagerFactory::getInstance()->fetchByAssoc($result, false)) { array_push($uids, $val['id']); } } else { $uids = explode(',', $_POST['uids']); } // find the relationship to use $relationship = ''; foreach ($focus->get_linked_fields() as $field => $def) { if ($focus->load_relationship($field)) { if ($focus->$field->getRelatedModuleName() == 'ProspectLists') { $relationship = $field; break; $relationship =''; foreach ($focus->get_linked_fields() as $field => $def) { if ($focus->load_relationship($field)) { if ($focus->$field->getRelatedModuleName() == 'ProspectLists') { $relationship = $field; } break; } } } } } if ($relationship != '') { foreach ($uids as $id) { $focus->retrieve($id); $focus->load_relationship($relationship); $focus->prospect_lists->add($_REQUEST['prospect_list']); } } if ($relationship != '') { foreach ($uids as $id) { $focus->retrieve($id); if ($_REQUEST['do_contacts']) { $contacts = $focus->get_linked_beans('contacts', 'Contacts3'); foreach ($contacts as $contact) { $contact->load_relationship('prospect_lists'); $contact->prospect_lists->add($_REQUEST['prospect_list']); } } else { $focus->load_relationship($relationship); $focus->prospect_lists->add($_REQUEST['prospect_list']); } } } handleRedirect(); exit;