/** * Add and Remove fields from all the list views * * @param array $fieldMap How are we going to change the fields * @return array The Modules which had their subpanels affected */ public function processListViews(array $fieldMap) { // get the views for the module $mm = MetadataManager::getManager(); $views = $mm->getModuleViews('Opportunities'); // fix the selected-list view $this->processSelectedListView($fieldMap); // fix the dupecheck-list view $this->processDupeCheckListView($fieldMap); // get the generic list view $this->processListView($fieldMap); // get the mobile list view now $this->processMobileListView($fieldMap); $subpanel_modules = array('Opportunities'); $links = $this->bean->get_linked_fields(); foreach ($links as $link => $def) { if ($this->bean->load_relationship($link) && $this->bean->{$link} instanceof Link2) { $linkname = $this->bean->{$link}->getRelatedModuleLinkName(); if (!empty($linkname)) { $this->processListView($fieldMap, $this->bean->{$link}->getRelatedModuleName(), $linkname); $subpanel_modules[] = $this->bean->{$link}->getRelatedModuleName(); } } } return $subpanel_modules; }