Beispiel #1
0
 public function indexpost()
 {
     // Log-in stuff
     $f3 = \Base::instance();
     $this->_requireLogin();
     $user = $f3->get('user');
     $activeOrganisation = User::getUserSelectedOrganisation($f3->get('PARAMS.id'));
     $listName = trim($f3->get('POST.listName'));
     if (strlen($listName) < 3) {
         $f3->set('error', 'List name must be at least 3 characters long');
     } else {
         $list = Lists::createList(['listName' => $listName, 'orgId' => $activeOrganisation->id]);
         if ($f3->exists('POST.redirectToList')) {
             $f3->reroute('/dashboard/lists/' . $list);
         } else {
             $f3->reroute($f3->get('PATH'));
         }
     }
     $lists = Lists::getOrganisationLists($activeOrganisation->id);
     $orgMap = new \Models\Organisation();
     $orgMap->load($activeOrganisation->id);
     $f3->set('user_org_selected', $orgMap->cast());
     $f3->set('lists', $lists);
     $f3->set('target', 'dashboard/organisations/lists/index.html');
     $this->_render('base.html');
 }
Beispiel #2
0
 public function create()
 {
     // Log-in stuff
     $f3 = \Base::instance();
     $this->_requireLogin();
     $user = $f3->get('user');
     $activeOrganisationId = User::getUserSelectedOrganisation();
     $lists = Lists::getOrganisationLists($activeOrganisationId);
     $f3->set('lists', $lists);
     $f3->set('target', 'dashboard/organisations/lists/index.html');
     $this->_render('base.html');
 }