diff --git a/controllers/Index.php b/controllers/Index.php index e94ceda..fc62c59 100644 --- a/controllers/Index.php +++ b/controllers/Index.php @@ -6,6 +6,7 @@ namespace Modules\RadioHoererCharts\Controllers; +use Modules\User\Mappers\User as UserMapper; use Modules\RadioHoererCharts\Mappers\HoererCharts as HoererChartsMapper; use Modules\RadioHoererCharts\Models\HoererCharts as HoererChartsModel; use Modules\RadioHoererCharts\Mappers\HoererChartsSuggestion as HoererChartsSuggestionMapper; @@ -19,6 +20,7 @@ public function indexAction() { $hoererchartsMapper = new HoererChartsMapper(); $hoererchartsuservotesMapper = new HoererChartsUserVotesMapper(); + $userMapper = new UserMapper; $this->getLayout()->getTitle() ->add($this->getTranslator()->trans('hoerercharts')); @@ -47,6 +49,7 @@ public function indexAction() 'Star5'=>$this->getConfig()->get('radio_hoerercharts_Star5'), 'Program_Name'=>(($this->getConfig()->get('radio_hoerercharts_Program_Name'))?$this->getConfig()->get('radio_hoerercharts_Program_Name'):$this->getTranslator()->trans('notset'))); $this->getView()->set('config', $hoererchartsconfig); + $this->getView()->set('userMapper', $userMapper); $this->getView()->set('votedatetime', ((!$hoererchartsconfig['start_datetime'] and !$hoererchartsconfig['end_datetime'])?'':$this->getTranslator()->trans('votedatetime').(($hoererchartsconfig['start_datetime'] and $hoererchartsconfig['end_datetime'])?call_user_func_array([$this->getTranslator(), 'trans'], array('fromto', $hoererchartsconfig['start_datetime']->format($formatdatetime),$hoererchartsconfig['end_datetime']->format($formatdatetime))):(($hoererchartsconfig['start_datetime'])?$this->getTranslator()->trans('from').' '.$hoererchartsconfig['start_datetime']->format($formatdatetime):$this->getTranslator()->trans('to').' '.$hoererchartsconfig['end_datetime']->format($formatdatetime)))."

")); if ($hoererchartsMapper->checkDB()){ diff --git a/controllers/admin/Index.php b/controllers/admin/Index.php index 1418cdd..d72d483 100644 --- a/controllers/admin/Index.php +++ b/controllers/admin/Index.php @@ -113,9 +113,11 @@ public function indexAction() $this->redirect(['action' => 'index']); } } + $suggestionentries = $hoererchartssuggestionMapper->getEntries([]); - if ($this->getRequest()->getParam('suggestion')) $this->getView()->set('entries', $hoererchartssuggestionMapper->getEntries([])); + if ($this->getRequest()->getParam('suggestion')) $this->getView()->set('entries', $suggestionentries); else $this->getView()->set('entries', $hoererchartsMapper->getEntries([])); + $this->getView()->set('badgeSuggestion', count($suggestionentries)); } } @@ -253,5 +255,7 @@ public function resetAction() $this->redirect(['action' => 'index']); } } + + $this->getView()->set('entries', $hoererchartsuservotesMapper->getEntries([])); } } diff --git a/translations/de.php b/translations/de.php index 8045ee3..4f1392f 100644 --- a/translations/de.php +++ b/translations/de.php @@ -66,4 +66,7 @@ 'enable' => 'Freischalten', 'user' => 'Username', 'guest' => 'Gast', + + 'registered_by' => 'Eingetragen von', + 'suggestionenable' => 'Vorschlag aktivieren', ]; diff --git a/translations/en.php b/translations/en.php index c16cbb6..8273c60 100644 --- a/translations/en.php +++ b/translations/en.php @@ -66,4 +66,7 @@ 'enable' => 'Freischalten', 'user' => 'Username', 'guest' => 'Gast', + + 'registered_by' => 'Registered by', + 'suggestionenable' => 'Suggestion enable', ]; diff --git a/views/admin/index/index.php b/views/admin/index/index.php index 81c8990..070bb9b 100644 --- a/views/admin/index/index.php +++ b/views/admin/index/index.php @@ -33,7 +33,7 @@ getTrans('index') ?>
  • - getTrans('suggestion') ?> + getTrans('suggestion') ?> get('badgeSuggestion') ?>
  • diff --git a/views/admin/index/reset.php b/views/admin/index/reset.php index 657e327..14310e9 100644 --- a/views/admin/index/reset.php +++ b/views/admin/index/reset.php @@ -2,3 +2,42 @@
    getTrans('reset') ?>
    + +
    + + + + + + + + + + + + get('entries') as $entry): ?> + + + + + + + +
    getTrans('user') ?>getTrans('datecreate') ?>
    + getUser_Id(); + $user = $userMapper->getUserById($user_id); + if ($user) + echo $this->escape($user->getName()); + else + echo $this->getTrans('guest'); + ?> + + getLast_Activity()); + echo $datenow->format('d.m.Y H:i'); + ?> +
    +
    diff --git a/views/index/index.php b/views/index/index.php index c645d32..b893c53 100644 --- a/views/index/index.php +++ b/views/index/index.php @@ -1,5 +1,6 @@ get('config'); +$userMapper = $this->get('userMapper'); ?>

    getTrans('hoerercharts').$this->get('gettext') ?> @@ -31,7 +32,8 @@ - + + @@ -39,6 +41,7 @@ getTrans('interpret') ?> getTrans('songtitel') ?> getTrans('vote') ?> + @@ -48,6 +51,8 @@ escape($entry->getInterpret()) ?> escape($entry->getSongTitel()) ?> get('hoererchartsMapper')->getStars($entry->getVotes(), $hoererchartsconfig) ?> + getUserById($entry->getUser_Id()); ?> + - + +   getTrans('interpret') ?> getTrans('songtitel') ?> + @@ -89,6 +96,8 @@ escape($entry->getInterpret()) ?> escape($entry->getSongTitel()) ?> + getUserById($entry->getUser_Id()); ?> + @@ -107,4 +116,7 @@ - \ No newline at end of file + + \ No newline at end of file