app = $app; if ($intern) { return; } $this->app->ActionHandlerInit($this); // ab hier alle Action Handler definieren die das Modul hat $this->app->ActionHandler("list", "LearningdashboardList"); $this->app->ActionHandler("ajax", "LearningdashboardAjax"); $this->app->ActionHandlerListen($app); } public function LearningdashboardMenu(): void { $this->app->erp->MenuEintrag('index.php?module=appstore&action=list', 'Zurück zur Übersicht'); } public function LearningdashboardList(): void { $this->LearningdashboardMenu(); $this->app->erp->Headlines('Learning Dashboard'); $this->app->Tpl->Parse('PAGE', 'learningdashboard_list.tpl'); } /** * @return JsonResponse */ public function LearningdashboardAjax(): JsonResponse { $userId = $this->app->User->GetID(); $cmd = $this->app->Secure->GetGET('cmd'); switch ($cmd) { case 'get_content': $data = $this->getLearningDashboardContent(); break; default: $data = ['success' => false, 'error' => 'Incomplete request']; break; } return new JsonResponse( $data, $data['success'] === false ? JsonResponse::HTTP_BAD_REQUEST : JsonResponse::HTTP_OK ); } /** * @return array */ private function getLearningDashboardContent(): array { $userId = $this->app->User->GetID(); /** @var WizardService $wizardService */ $wizardService = $this->app->Container->get('WizardService'); $recommendationLesson = new Lesson('Für dich empfohlen'); $recommendationLesson->addTask(new Task($wizardService->getWizard('shopify', $userId))); $recommendationLesson->addTask(new Task($wizardService->getWizard('basic_settings', $userId))); $recommendationLesson->addTask(new Task($wizardService->getWizard('production', $userId))); //$recommendationLesson->addTask(new Task($wizardService->getWizard('fulfiller', $userId))); //steps klaeren $initialSetupLesson = new Lesson('Grundeinrichtung'); //demodaten laden $initialSetupLesson->addTask(new Task($wizardService->getWizard('basic_settings', $userId))); $initialSetupLesson->addTask(new Task($wizardService->getWizard('parts_list', $userId))); $shopConnectionLesson = new Lesson('Shopanbindung'); $shopConnectionLesson->addTask(new Task($wizardService->getWizard('shopify', $userId))); $shopConnectionLesson->addTask(new Task($wizardService->getWizard('amazon', $userId))); $shopConnectionLesson->addTask(new Task($wizardService->getWizard('ebay', $userId))); $shopConnectionLesson->addTask(new Task($wizardService->getWizard('shopware5', $userId))); $shopConnectionLesson->addTask(new Task($wizardService->getWizard('shopware6', $userId))); $shopConnectionLesson->addTask(new Task($wizardService->getWizard('additional_shops', $userId))); $xentralTourLesson = new Lesson('Tour durch xentral'); //$xentralTourLesson->addTask(new Task($wizardService->getWizard('fulfiller', $userId))); //steps klaeren $xentralTourLesson->addTask(new Task($wizardService->getWizard('batches_bestbefore_serials', $userId))); $xentralTourLesson->addTask(new Task($wizardService->getWizard('crm', $userId))); $xentralTourLesson->addTask(new Task($wizardService->getWizard('accounting', $userId))); $xentralTourLesson->addTask(new Task($wizardService->getWizard('storage', $userId))); $xentralTourLesson->addTask(new Task($wizardService->getWizard('return_and_credit', $userId))); $tab = new Tab('Tab_one'); $tab->addLesson($recommendationLesson); $tab->addLesson($initialSetupLesson); $tab->addLesson($shopConnectionLesson); $tab->addLesson($xentralTourLesson); return [ "wording" => [ "task" => [ "cta" => [ "completed" => "Nochmal", "incomplete" => "Start" ], "details" => [ "info" => "Um diesen Wizard starten zu können benötigst du:", "missing" => [ "modules" => [ "headline" => "Module" ], "permissions" => [ "headline" => "Berechtigungen" ] ] ] ], "header" => [ "headline" => "Learning Dashboard", "subline" => "xentral Schritt-für-Schritt einrichten", "content" => "In unserem Learning Dashboard zeigen wir euch mit unserem Klick-by-Klick Assistenten und vielen Videos wie ihr euch einrichten und direkt mit xentral durchstarten könnt. Welche Funktionen sind für euch interessant? Klick dich einfach durch unsere Kacheln und erfahre was xentral ERP für euer Business tun kann.", "progress" => "Fertig" ], "tabs" => [ "hideCompleted" => "Abgeschlossene verbergen" ] ], "tabs" => [ $tab ] ]; } public function Install() { $this->app->erp->RegisterHook('welcome_start', 'learningdashboard', 'LearningDashboardStartsite'); } public function LearningDashboardStartsite(Welcome $welcomeObject): void { if($this->app->User->GetType() !== 'admin') { return; } $this->app->Tpl->Set('LEARNINGDASHBOARDTILE', '');//@todo Add Tile for Sartsite } }