From 65ccfe23f7b87024d35923c1969fb287b9cf3493 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Mon, 3 Jun 2019 14:39:09 +0200 Subject: [PATCH] Corrected all views to the structure --- src/admin/common/abstract/model.php | 2 +- src/admin/common/models/club.php | 2 +- .../common/models/factory/offerassoc.php | 2 +- src/admin/common/models/offerassoc.php | 2 +- src/admin/views/club/tmpl/default.php | 49 +++++++++++++---- src/admin/views/club/view.html.php | 25 +++------ src/admin/views/offer/view.html.php | 15 +++--- src/admin/views/position/view.html.php | 17 +++--- src/admin/views/user/tmpl/default.php | 18 +++---- src/admin/views/user/view.html.php | 52 +++++-------------- 10 files changed, 89 insertions(+), 95 deletions(-) diff --git a/src/admin/common/abstract/model.php b/src/admin/common/abstract/model.php index 65b4fac..bdb0224 100644 --- a/src/admin/common/abstract/model.php +++ b/src/admin/common/abstract/model.php @@ -306,7 +306,7 @@ abstract class AbstractCommonClubsModel return $factory->loadElements($allConstraints, $sorting); } else - $factory->loadElements($condition, $sorting); + return $factory->loadElements($condition, $sorting); } protected function filterPackData($values) diff --git a/src/admin/common/models/club.php b/src/admin/common/models/club.php index 94eea67..a41e52b 100644 --- a/src/admin/common/models/club.php +++ b/src/admin/common/models/club.php @@ -63,7 +63,7 @@ class CommonClubsModelClub extends AbstractCommonClubsModel public function getOffers() { - $assocs = $this->fetchAssociatedElements(new CommonClubsModelFactoryOfferassocs(), 'clubid'); + $assocs = $this->fetchAssociatedElements(new CommonClubsModelFactoryOfferassoc(), 'clubid'); $offersFactory = new CommonClubsModelFactoryOffer(); $allOffers = $offersFactory->loadElements(); diff --git a/src/admin/common/models/factory/offerassoc.php b/src/admin/common/models/factory/offerassoc.php index a17d6e8..14688b0 100644 --- a/src/admin/common/models/factory/offerassoc.php +++ b/src/admin/common/models/factory/offerassoc.php @@ -3,7 +3,7 @@ // No direct access. defined('_JEXEC') or die; -class CommonClubsModelFactoryOfferassocs extends AbstractCommonClubsModelFactory +class CommonClubsModelFactoryOfferassoc extends AbstractCommonClubsModelFactory { protected function fetchAttributes() { diff --git a/src/admin/common/models/offerassoc.php b/src/admin/common/models/offerassoc.php index 066c1b9..5f59cd8 100644 --- a/src/admin/common/models/offerassoc.php +++ b/src/admin/common/models/offerassoc.php @@ -7,7 +7,7 @@ class CommonClubsModelOfferassoc extends AbstractCommonClubsModel { protected function getFactory() { - return new CommonClubsModelFactoryOfferassocs(); + return new CommonClubsModelFactoryOfferassoc(); } /** diff --git a/src/admin/views/club/tmpl/default.php b/src/admin/views/club/tmpl/default.php index 59167e6..e66f5b7 100644 --- a/src/admin/views/club/tmpl/default.php +++ b/src/admin/views/club/tmpl/default.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die;
+

Stammdaten

@@ -66,15 +67,6 @@ defined('_JEXEC') or die; isNew): ?> - - - - @@ -82,6 +74,45 @@ defined('_JEXEC') or die;
Bezeichnung
Angebote - offers as $o): ?> - getId(); ?>' > - getName()); ?>
- -
ID object->getId(); ?>
+ +isNew): ?> +

Angebote

+object->getOffers() as $oconf): ?> + getId(); ?>' > + getName()); ?>
+ +

Posten

+ + + + + + + + + + object->getUsers() as $ua): ?> + + + + + + + + + +
RolleNameStadtAdmin?ID
getPosition()->getName()); ?>getUser()->getName()); ?>getUser()->getCity()); ?>isAdmin()) echo ""; ?> + + + getId(); ?>
+

Neuen Posten einfügen

+ +
'>Zurück zur Übersicht
+
+
+
Ein Test
+
+ diff --git a/src/admin/views/club/view.html.php b/src/admin/views/club/view.html.php index 9b0b323..77934d5 100644 --- a/src/admin/views/club/view.html.php +++ b/src/admin/views/club/view.html.php @@ -11,39 +11,26 @@ class ClubsViewClub extends AbstractClubsViewSingle { function display($tpl = null) { - ToolbarHelper::title('Club-Management - Verein'); + ToolbarHelper::title('Club-Management - Verein', 'cube'); $this->prepareDisplay(); $userFactory = new CommonClubsModelFactoryUser(); $this->users = $userFactory->loadElements(); - if($this->isNew) - { - - } - else - { -// $offers = ClubsOffer::loadOffers(); -// $currentOffers = $this->object->getOffers(); - -// $this->offers = array_map(function($offer) use ($currentOffers){ -// $mark = False; -// return array('offer'=>$offer, 'mark'=>$mark); -// }, $offers); - } - parent::display($tpl); } - protected function getViewName() + protected function getControllerName() { return 'club'; } - protected function getElementController() + + protected function getFactory() { - return new ClubsControllerClub(); + return new CommonClubsModelFactoryClub(); } + } diff --git a/src/admin/views/offer/view.html.php b/src/admin/views/offer/view.html.php index aa35699..e1a2bad 100644 --- a/src/admin/views/offer/view.html.php +++ b/src/admin/views/offer/view.html.php @@ -11,19 +11,20 @@ class ClubsViewOffer extends AbstractClubsViewSingle { function display($tpl = null) { - - ToolbarHelper::title('Club-Management - Angebot'); + ToolbarHelper::title('Club-Management - Angebot', 'file'); parent::display($tpl); } - protected function getViewName() + protected function getFactory() + { + return new CommonClubsModelFactoryOffer(); + } + protected function getControllerName() { return 'offer'; } - protected function getElementController() - { - return new ClubsControllerOffer(); - } + + } diff --git a/src/admin/views/position/view.html.php b/src/admin/views/position/view.html.php index bfd13a0..150fedc 100644 --- a/src/admin/views/position/view.html.php +++ b/src/admin/views/position/view.html.php @@ -9,19 +9,20 @@ JLoader::register("ClubsControllerPosition", JPATH_ROOT . "/administrator/compon class ClubsViewPosition extends AbstractClubsViewSingle { - protected function getViewName() + + function display($tpl = null) + { + ToolbarHelper::title('Club-Management - Position', 'users'); + parent::display($tpl); + } + protected function getControllerName() { return 'position'; } - protected function getElementController() + protected function getFactory() { - return new ClubsControllerPosition(); + return new CommonClubsModelFactoryPosition(); } - function display($tpl = null) - { - ToolbarHelper::title('Club-Management - Position'); - parent::display($tpl); - } } diff --git a/src/admin/views/user/tmpl/default.php b/src/admin/views/user/tmpl/default.php index cf6632b..13467ec 100644 --- a/src/admin/views/user/tmpl/default.php +++ b/src/admin/views/user/tmpl/default.php @@ -8,11 +8,11 @@ defined('_JEXEC') or die; ?>
- + - + @@ -24,33 +24,33 @@ defined('_JEXEC') or die; - + - + - + - + - + isNew): ?> - +
Username
Passwort
Bürgerlicher Name
Adresse - +
Stadt
E-Mail
Telefon
Handy
IDuser->getId(); ?>object->getId(); ?>
diff --git a/src/admin/views/user/view.html.php b/src/admin/views/user/view.html.php index 1fc6cd1..553b2e7 100644 --- a/src/admin/views/user/view.html.php +++ b/src/admin/views/user/view.html.php @@ -1,54 +1,28 @@ input; - $id = $input->get->get('id'); - - if($id === 'new') - { - $this->address = Route::_('index.php?option=com_clubs&task=user.new'); - $this->user = ClubsUser::createUser(); - $this->isNew = true; - } - else if(is_numeric($id)) - { - $this->address = Route::_('index.php?option=com_clubs&task=user.change'); - $this->user = ClubsUser::loadUser((int) $id); - $this->isNew = false; - } - else - throw new Exception('Need a user id.'); - - if($input->get->get('data', null, 'json') != null) - { - // Restore previous data - $dataurl = $input->get->get('data', null, 'json'); - $data = json_decode($dataurl, true); - - $this->user->setUser($data['user'], true); - $this->user->setName($data['name']); - $this->user->setAddress($data['address']); - $this->user->setCity($data['city']); - $this->user->setMail($data['mail']); - $this->user->setPhone($data['phone']); - $this->user->setMobile($data['mobile']); - - } - - ToolbarHelper::title('Club-Management - Person'); + ToolbarHelper::title('Club-Management - Person', 'user'); parent::display($tpl); } + protected function getControllerName() + { + return 'user'; + } + + protected function getFactory() + { + return new CommonClubsModelFactoryUser(); + } + + }