function action_activateapplication($eventData) { global $gLocale, $gLocale, $gStatus; $domainQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT domainid FROM domains WHERE id = ' . $eventData['domainid']); if ($domainQuery) { $domainData = $domainQuery->getFields(); $domain = new \Innomatic\Domain\Domain(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $domainData['domainid'], $null); if (!$domain->enableApplication($eventData['appid'])) { $unmetDeps = $domain->getLastActionUnmetDeps(); if (count($unmetDeps)) { while (list(, $dep) = each($unmetDeps)) { $unmetDepsStr .= ' ' . $dep; } $gStatus .= $gLocale->getStr('modnotenabled_status') . ' '; $gStatus .= $gLocale->getStr('unmetdeps_status') . $unmetDepsStr . '.'; } $unmetSuggs = $domain->getLastActionUnmetSuggs(); if (count($unmetSuggs)) { while (list(, $sugg) = each($unmetSuggs)) { $unmetSuggsStr .= ' ' . $sugg . ($gStatus .= $gLocale->getStr('unmetsuggs_status') . $unmetSuggsStr . '.'); } } } else { $gStatus .= $gLocale->getStr('modenabled_status'); } } }
print "Tenant {$argv['2']} not removed\n"; $script->cleanExit(1); } break; case 'applist': $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null); $list = $tenant->getEnabledApplications(); foreach ($list as $app) { print $app . "\n"; } $script->cleanExit(); break; case 'appenable': $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null); $appid = \Innomatic\Application\Application::getAppIdFromName($argv[3]); if ($tenant->enableApplication($appid)) { print "Application {$argv['3']} enabled to tenant {$argv['2']}\n"; $script->cleanExit(); } else { print "Application {$argv['3']} not enabled to tenant {$argv['2']}\n"; $script->cleanExit(1); } break; case 'appdisable': $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null); $appid = \Innomatic\Application\Application::getAppIdFromName($argv[3]); if ($tenant->disableApplication($appid)) { print "Application {$argv['3']} disabled from tenant {$argv['2']}\n"; $script->cleanExit(); } else { print "Application {$argv['3']} not disabled from tenant {$argv['2']}\n";
public function executeActivateapplication($eventData) { $domainQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT domainid FROM domains WHERE id = ' . $eventData['domainid']); if ($domainQuery) { $domainData = $domainQuery->getFields(); $null = null; $domain = new \Innomatic\Domain\Domain(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $domainData['domainid'], $null); if (!$domain->enableApplication($eventData['appid'])) { $unmetDeps = $domain->getLastActionUnmetDeps(); if (count($unmetDeps)) { while (list(, $dep) = each($unmetDeps)) { $unmetDepsStr .= ' ' . $dep; } $this->status .= $this->localeCatalog->getStr('modnotenabled_status') . ' '; $this->status .= $this->localeCatalog->getStr('unmetdeps_status') . $unmetDepsStr . '.'; } $unmetSuggestions = $domain->getLastActionUnmetSuggs(); if (count($unmetSuggestions)) { while (list(, $sugg) = each($unmetSuggestions)) { $unmetSuggestionsString .= ' ' . $sugg . ($this->status .= $this->localeCatalog->getStr('unmetsuggs_status') . $unmetSuggestionsString . '.'); } } } else { $this->status .= $this->localeCatalog->getStr('modenabled_status'); } } $this->setChanged(); $this->notifyObservers('status'); }