Index: branches/RC/core/units/modules/modules_event_handler.php =================================================================== diff -u -N -r10832 -r10846 --- branches/RC/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 10832) +++ branches/RC/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 10846) @@ -45,21 +45,47 @@ function moduleAction(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - return; + return ; } $object =& $event->getObject( Array('skip_autoload' => true) ); $ids = $this->StoreSelectedIDs($event); - if (!$ids) return true; + if (!$ids) { + return true; + } $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); - foreach($ids as $id) - { + if ($event->Name == 'OnMassDecline') { + $interface_modules = Array ('In-Portal', 'Proj-Base'); + + foreach ($interface_modules as $module_index => $interface_module) { + if (!$this->Application->findModule('Name', $interface_module)) { + // remove already disabled interface modules + unset($interface_modules[$module_index]); + } + } + } + + foreach ($ids as $id) { + if ($event->Name == 'OnMassDecline') { + if (in_array($id, $interface_modules) && count($interface_modules) == 1) { + // don't allow to disable both interface modules + continue; + } + + unset($interface_modules[ array_search($id, $interface_modules) ]); + } + + if ($id == 'Core') { + // don't allow any kind of manupulations with kernel + continue; + } + $object->Load($id); - if ($object->GetID() == 'In-Portal') continue; + $object->SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0); if ($object->Update()) {