Skip to content

Commit

Permalink
translation fixes. seats now directly from server.
Browse files Browse the repository at this point in the history
  • Loading branch information
Praesidiarius committed Feb 20, 2020
1 parent ed274de commit 48bfb74
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 22 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "onePlace User Module",
"type": "oneplace-module",
"license": "BSD-3-Clause",
"version": "1.0.16",
"version": "1.0.17",
"keywords": [
"laminas",
"mvc",
Expand Down
1 change: 1 addition & 0 deletions data/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ CREATE TABLE `user_search` (
`Search_ID` int(11) NOT NULL,
`user_idfs` int(11) NOT NULL,
`filters` text NOT NULL,
`label` varchar(150) NOT NULL,
`list_name` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Expand Down
Binary file modified language/de_DE.mo
Binary file not shown.
45 changes: 45 additions & 0 deletions language/de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,48 @@ msgstr "Alle Rechte vorbehalten"

msgid "Featured Image"
msgstr "Hauptbild"

msgid "Add"
msgstr "Erstellen"

msgid "View"
msgstr "Anzeigen"

msgid "Index"
msgstr "Übersicht"

msgid "Edit"
msgstr "Bearbeiten"

msgid "Columns"
msgstr "Spalten"

msgid "Index Info"
msgstr "Übersichtstabellen"

msgid "Fields"
msgstr "Felder"

msgid "Form fields"
msgstr "Formulare"

msgid "Permissions"
msgstr "Berechtigungen"

msgid "What is allowed"
msgstr "Benutzerrechte"

msgid "Change theme"
msgstr "Design wechseln"

msgid "Change language"
msgstr "Sprache wechseln"

msgid "Choose Language"
msgstr "Sprache wählen"

msgid "Set Language"
msgstr "Sprache wählen"

msgid "My Settings"
msgstr "Meine Einstellungen"
1 change: 1 addition & 0 deletions src/Controller/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public function logoutAction()
# Remove User from Session
unset(CoreController::$oSession->oUser);
unset(CoreController::$oSession->aLicences);
unset(CoreController::$oSession->aSeats);

# Back to Login
return $this->redirect()->toRoute('login');
Expand Down
10 changes: 8 additions & 2 deletions src/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public function __construct(AdapterInterface $oDbAdapter, UserTable $oTableGatew
*/
public function indexAction()
{
# Check license
if(!$this->checkLicense('user')) {
$this->flashMessenger()->addErrorMessage('You have no active license for user');
$this->redirect()->toRoute('home');
}

# Set Layout based on users theme
$this->setThemeBasedLayout('user');

Expand Down Expand Up @@ -89,8 +95,8 @@ public function indexAction()

# set to -1 to disable
$iSeatsLeft = -1;
if (isset(CoreController::$aGlobalSettings['user-limit'])) {
$iLimit = CoreController::$aGlobalSettings['user-limit'];
if (isset(CoreController::$oSession->aSeats['user'])) {
$iLimit = (int)CoreController::$oSession->aSeats['user'];
$iSeatsUsed = count($this->oTableGateway->fetchAll(false, $aWhere));
$iSeatsLeft = $iLimit - $iSeatsUsed;
}
Expand Down
6 changes: 5 additions & 1 deletion src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Module
*
* @since 1.0.0
*/
const VERSION = '1.0.16';
const VERSION = '1.0.17';

/**
* Load module config file
Expand Down Expand Up @@ -66,6 +66,10 @@ public function onBootstrap(\Laminas\EventManager\EventInterface $e)
$app->getEventManager()->attach(
'route',
function ($e) {

echo 'OMG?!!!!!';
return;

# get basic info from application
$app = $e->getApplication();
$routeMatch = $e->getRouteMatch();
Expand Down
2 changes: 1 addition & 1 deletion view/one-place/user/user/languages.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if($aLangs != '') {
?>
<form action="" method="POST">
<div class="row">
<div class="col-md-12">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h2 class="card-title">
Expand Down
2 changes: 1 addition & 1 deletion view/partial/formfields-add.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-formfields[]" value="<?=$oField->Field_ID?>_<?=$oForm->form_key?>" />
<?=$oField->label?>
<?=$this->translate($oField->label)?>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/formfields-edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ foreach(array_keys($aFieldsByForm) as $sForm) {
?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-formfields[]" value="<?=$oField->Field_ID?>_<?=$oForm->form_key?>" />
<?=$oField->label?>
<?=$this->translate($oField->label)?>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/formfields-view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ foreach(array_keys($aFieldsByForm) as $sForm) {
?>
<div class="col-md-4">
<?=($bHasPerm) ? ' <i class="fas fa-check"></i>' : ''?>
<?=$oField->label?>
<?=$this->translate($oField->label)?>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/indexcolumns-add.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ foreach(array_keys($aColumnsByTable) as $sTable) {
?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-indexcolumns[]" value="<?=$oField->Field_ID?>-<?=$oTbl->table_name?>" />
<?=$oField->label?>
<?=$this->translate($oField->label)?>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/indexcolumns-edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ foreach(array_keys($aColumnsByTable) as $sTable) {
?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-indexcolumns[]" value="<?=$oField->Field_ID?>-<?=$oTbl->table_name?>" />
<?=$oField->label?>
<?=$this->translate($oField->label)?>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/indexcolumns-view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ foreach(array_keys($aColumnsByTable) as $sTable) {
?>
<div class="col-md-4">
<?=($bHasPerm) ? ' <i class="fas fa-check"></i>' : ''?>
<?=$oField->label?>
<?=$this->translate($oField->label)?>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/permissions-add.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$bHasPerm = false; ?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-permissions[]" value="<?=$oPerm->permission_key?>-<?=$sModule?>" />
<?=$oPerm->label?>
<?=$this->translate($oPerm->label)?>
</div>
<?php } ?>
</div>
Expand Down
10 changes: 8 additions & 2 deletions view/partial/permissions-edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@
foreach($aPermissonsByModules[$sModule] as $oPerm) {
$sModule = str_replace(['\\'],['-'],$sModule);
$bHasPerm = false;
$sLabelSyle = '';
if (array_key_exists($sModule,$aUserPermissions)) {
if (array_key_exists($oPerm->permission_key,$aUserPermissions[$sModule])) {
$bHasPerm = true;
}
} ?>
}
if($oPerm->needs_globaladmin == 1) {
$sLabelSyle = 'color:red;';
}?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-permissions[]" value="<?=$oPerm->permission_key?>-<?=$sModule?>" />
<?=$oPerm->label?>
<span style="<?=$sLabelSyle?>">
<?=$this->translate($oPerm->label)?>
</span>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/permissions-view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ foreach(array_keys($aPermissonsByModules) as $sModule) { ?>
?>
<div class="col-md-4">
<?=($bHasPerm) ? ' <i class="fas fa-check"></i>' : ''?>
<?=$oPerm->label?>,
<?=$this->translate($oPerm->label)?>,
</div>
<?php } ?>
</div>
Expand Down
4 changes: 2 additions & 2 deletions view/partial/tabs-add.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ foreach(array_keys($aTabsByForm) as $sTable) {
$aTabs = $aTabsByForm[$sTable]['aTabs']; ?>
<li class="list-group-item">
<div class="row">
<div class="col-md-4"><?=$oForm->label?></div>
<div class="col-md-4"><?=$this->translate($oForm->label)?></div>
<div class="col-md-8">
<div class="row">
<?php foreach($aTabs as $oTab) {
Expand All @@ -25,7 +25,7 @@ foreach(array_keys($aTabsByForm) as $sTable) {
?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-tabs[]" value="<?=$oTab->Tab_ID?>_<?=$oForm->form_key?>" />
<?=$oTab->title?>
<?=$this->translate($oTab->title)?>
</div>
<?php } ?>
</div>
Expand Down
4 changes: 2 additions & 2 deletions view/partial/tabs-edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ foreach(array_keys($aTabsByForm) as $sTable) {
<li class="list-group-item">
<div class="row">
<div class="col-md-2">
<?=$oForm->label?>
<?=$this->translate($oForm->label)?>
</div>
<div class="col-md-2">
<a href="#" class="btn btn-light plc-user-permissions-selectall">
Expand All @@ -35,7 +35,7 @@ foreach(array_keys($aTabsByForm) as $sTable) {
?>
<div class="col-md-4">
<input type="checkbox"<?=($bHasPerm) ? ' checked' : ''?> name="<?=$this->sFormName?>-tabs[]" value="<?=$oTab->Tab_ID?>_<?=$oForm->form_key?>" />
<?=$oTab->title?>
<?=$this->translate($oTab->title)?>
</div>
<?php } ?>
</div>
Expand Down
6 changes: 4 additions & 2 deletions view/partial/tabs-view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ foreach(array_keys($aTabsByForm) as $sTable) {
$aTabs = $aTabsByForm[$sTable]['aTabs']; ?>
<li class="list-group-item">
<div class="row">
<div class="col-md-4"><?=$oForm->label?></div>
<div class="col-md-4">
<?=$this->translate($oForm->label)?>
</div>
<div class="col-md-8">
<div class="row">
<?php foreach($aTabs as $oTab) {
Expand All @@ -25,7 +27,7 @@ foreach(array_keys($aTabsByForm) as $sTable) {
?>
<div class="col-md-4">
<?=($bHasPerm) ? ' <i class="fas fa-check"></i>' : ''?>
<?=$oTab->title?>
<?=$this->translate($oTab->title)?>
</div>
<?php } ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/partial/usernav.phtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="card">
<div class="card-header">
Your Details
<?=$this->translate('My Settings')?>
</div>
<div class="card-body" style="padding:0;">
<ul class="list-group" style="margin:0; padding:0;">
Expand Down

0 comments on commit 48bfb74

Please sign in to comment.