Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
add language
  • Loading branch information
JBinggi committed Mar 6, 2020
1 parent 31f4902 commit 2b32616
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 68 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 Project Module",
"type": "oneplace-module",
"license": "BSD-3-Clause",
"version": "1.0.4",
"version": "1.0.4",
"keywords": [
"laminas",
"mvc",
Expand Down
2 changes: 1 addition & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
'route' => '/project/search[/:action[/:id]]',
'constraints' => [
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
'id' => '[a-zA-Z0-9_-]+',
],
'defaults' => [
'controller' => Controller\SearchController::class,
Expand Down
5 changes: 5 additions & 0 deletions data/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@ INSERT INTO `user_xp_activity` (`Activity_ID`, `xp_key`, `label`, `xp_base`) VAL
(NULL, 'project-edit', 'Edit Project', '5'),
(NULL, 'project-export', 'Edit Project', '5');

--
-- module icon
--
INSERT INTO `settings` (`settings_key`, `settings_value`) VALUES ('project-icon', 'fas fa-sitemap');

COMMIT;
Binary file added language/de_DE.mo
Binary file not shown.
48 changes: 48 additions & 0 deletions language/de_DE.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de_DE\n"
"X-Generator: Poedit 2.2.4\n"

msgid "Project"
msgstr "Projekt"

msgid "Projects"
msgstr "Projekte"

msgid "Add Project"
msgstr "Arbeitszeit erfassen"

msgid "Add new Project"
msgstr "Neues Projekt erfassen"

msgid "Save Project"
msgstr "Projekt speichern"

msgid "Edit Project"
msgstr "Projekt ändern"

msgid "Export Projects"
msgstr "Projekte exportieren"

msgid "Find Projects"
msgstr "Projekte finden"

msgid "State"
msgstr "Status"

msgid "Customer"
msgstr "Kunde"

msgid "Person responsible"
msgstr "Verantwortlicher"

msgid "planned Release"
msgstr "Abschluss Termin"
45 changes: 21 additions & 24 deletions view/one-place/project/install/checkdb.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,34 @@
<div class="card-body">
<form action="" method="POST">
<div class="form-group">
<?php
?>
<?php
if($bTableExists) { ?>
<div class="alert alert-success py-2 px-2">
<?=$this->translate('Database is up-to-date')?>
</div>
<?php
} else { ?>
<div class="alert alert-warning py-2 px-2">
<?=$this->translate('Database needs update. Please choose config')?>
</div>
<?php
if(file_exists('vendor/'.$sVendor.'/'.$sModule.'/data/structure_simple.sql')) {
?> <br/><input type="radio" name="plc_module_setup_config" value="simple" checked /> Simple
?>
<?php
if($bTableExists) { ?>
<div class="alert alert-success py-2 px-2">
<?=$this->translate('Database is up-to-date')?>
</div>
<?php
}
if(file_exists('vendor/'.$sVendor.'/'.$sModule.'/data/structure_extended.sql')) {
?> <br/><input type="radio" name="plc_module_setup_config" value="extended" /> Simple
} else { ?>
<div class="alert alert-warning py-2 px-2">
<?=$this->translate('Database needs update. Please choose config')?>
</div>
<?php
foreach(glob('vendor/'.$sVendor.'/'.$sModule.'/data/structure_*.sql') as $sConfig) {
$sConfig = str_replace(['.sql'],[],explode('_',basename($sConfig))[1]); ?>
<br/><input type="radio" name="plc_module_setup_config" value="<?=$sConfig?>" checked /> <?=$sConfig?>
<?php
}
}
}
?>
?>
</div>

<?php if (! $bTableExists) { ?>
<div class="form-group">
<button type="submit" class="btn btn-primary">
<?=$this->translate('Update Database')?>
</button>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">
<?=$this->translate('Update Database')?>
</button>
</div>
<?php } ?>
</form>
</div>
Expand Down
37 changes: 34 additions & 3 deletions view/one-place/project/project/index.phtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
<?php
use Application\Controller\CoreController;
?>
<div class="card">
<div class="card-header">
<?= $this->partial('partial/indexheader',['sTitle'=>'Projects']) ?>
<div class="row">
<div class="col-md-10">
<?php
$sIcon = (array_key_exists('project-icon',CoreController::$aGlobalSettings))
? CoreController::$aGlobalSettings['project-icon'] : '';
?>
<?= $this->partial('partial/indexheader',['sTitle'=>'Project','sIcon' => $sIcon]) ?>
</div>
<div class="col-md-2 text-right">
<select class="form-control plc-index-load-saved-search">
<option>-- <?=$this->translate('All')?> --</option>
<?php
if (count($aSavedSearches) > 0) {
foreach($aSavedSearches as $oSearch) { ?>
<option value="<?=$oSearch->Search_ID?>">
<?=$oSearch->label?>
</option>
<?php
}
}
?>
</select>
</div>
</div>
</div>
<div class="card-body py-0">
<?= $this->partial('partial/indextable', ['sTableName'=>$sTableName,'aItems'=>$aItems]); ?>
<?= $this->partial('partial/indextable', [
'sTableName' => $sTableName,
'aItems' => $aItems,
'aFilters' => $aFilters,
'sRoute' => $sRoute
]); ?>
</div>
<div class="card-footer">
<?= $this->partial('partial/indexpager', ['aItems'=>$aItems,'sRoute'=>(isset($sRoute)) ? $sRoute : explode('-',$sTableName)[0]]); ?>
<?= $this->partial('partial/indexpager', ['aItems'=>$aItems,'sRoute'=>$sRoute]); ?>
</div>
</div>
101 changes: 62 additions & 39 deletions view/one-place/project/search/index.phtml
Original file line number Diff line number Diff line change
@@ -1,47 +1,70 @@
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h2>Find Project</h2>
</div>
<?php if(isset($aResults)) { ?>

<?php } else { ?>
<form action="" method="post">
<div class="card-body">
<?= $this->partial('partial/basictabs', ['sFormName'=>$this->sFormName]); ?>
<?= $this->partial('partial/searchtabcontents', ['sFormName'=>$this->sFormName]); ?>
</div>
<div class="card-footer">
<button class="btn btn-primary" type="submit">
Start Search
</button>
</div>
</form>
<?php } ?>
<?php
if(isset($sTableName)) {
$sRoute = (isset($sRoute)) ? $sRoute : explode('-',$sTableName)[0];
?>
<div class="card">
<div class="card-header">
<?= $this->partial('partial/indexheader',['sTitle'=>'Project']) ?>
</div>
<div class="card-body py-0">
<?= $this->partial('partial/indextable', [
'sTableName' => $sTableName,
'aItems' => $aItems,
'aFilters' => $aFilters,
'sRoute' => $sRoute
]); ?>
</div>
<div class="card-footer">
<?= $this->partial('partial/indexpager', ['aItems' => $aItems,'sRoute' => $sRoute]); ?>
</div>
</div>
<?php if(isset($aResults)) { ?>
<?php } else { ?>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h2>Results</h2>
</div>
<div class="card-body">
<ul class="list-group">
<?php
foreach($aResults as $oProject) { ?>
<li class="list-group-item">
<a href="<?=$this->url('project',['action'=>'view','id'=>$oProject->getID()])?>" title="<?=$this->translate('View Project')?>">
<?=$oProject->getLabel();?>
</a>
</li>
<?php
}
?>
</ul>
<h2>Find Project</h2>
</div>
<?php if(isset($aResults)) { ?>

<?php } else { ?>
<form action="" method="post">
<div class="card-body">
<?= $this->partial('partial/basictabs', ['sFormName'=>$this->sFormName]); ?>
<?= $this->partial('partial/searchtabcontents', ['sFormName'=>$this->sFormName]); ?>
</div>
<div class="card-footer">
<button class="btn btn-primary" type="submit">
Start Search
</button>
</div>
</form>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<?php if(isset($aResults)) { ?>
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h2>Results - <?=$aResults->getTotalItemCount()?></h2>
</div>
<div class="card-body">
<ul class="list-group">
<?php
foreach($aResults as $oProject) { ?>
<li class="list-group-item">
<a href="<?=$this->url('project',['action'=>'view','id'=>$oProject->getID()])?>" title="<?=$this->translate('View Project')?>">
<?=$oProject->getLabel();?>
</a>
</li>
<?php
}
?>
</ul>
<?= $this->partial('partial/indexpager', ['aItems'=>$aResults,'sRoute'=>'project-search']); ?>
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?>

0 comments on commit 2b32616

Please sign in to comment.