fehler begin

This commit is contained in:
darthsandmann 2017-01-17 19:57:12 +01:00
parent 9f156a8d63
commit 1a415347c8
8 changed files with 138 additions and 3 deletions

View File

@ -3,7 +3,7 @@
import json
import cherrypy
from .database import KatfehlerDatabase_cl, KatursacheDatabase_cl, FehlerDatabase_cl
from .database import KatfehlerDatabase_cl, KatursacheDatabase_cl, FehlerDatabase_cl, KomponenteDatabase_cl, QsMitarbeiterDatabase_cl, SwEntwicklerDatabase_cl
# Method-Dispatching!
# Übersicht Anforderungen / Methoden
@ -252,6 +252,11 @@ class Fehler_cl(object):
def __init__(self):
#-------------------------------------------------------
self.db_o = FehlerDatabase_cl()
self.dbKomponente_o = KomponenteDatabase_cl()
self.dbQsMitarbeiter_o = QsMitarbeiterDatabase_cl()
self.dbSwEntwickler_o = SwEntwicklerDatabase_cl()
self.dbKatFehler_o = KatfehlerDatabase_cl()
self.dbKatUrsache_o = KatursacheDatabase_cl()
#-------------------------------------------------------
def GET(self, id = None):
@ -268,6 +273,12 @@ class Fehler_cl(object):
if data_o != None:
retVal_o['data'] = adjustId_p(id, data_o)
retVal_o['komponente'] = self.dbKomponente_o.read_px()
retVal_o['qsmitarbeiter'] = self.dbQsMitarbeiter_o.read_px()
retVal_o['swentwickler'] = self.dbSwEntwickler_o.read_px()
retVal_o['katfehler'] = self.dbKatFehler_o.read_px()
retVal_o['katursache'] = self.dbKatUrsache_o.read_px()
return retVal_o
#-------------------------------------------------------
@ -287,7 +298,13 @@ class Fehler_cl(object):
id_s = data_opl["id_s"]
data_o = {
'name': data_opl["name_s"],
'id': data_opl["id_s"]
'id': data_opl["id_s"],
'komponente-id': data_opl["komponente-id_s"],
'katfehler-id': data_opl["katfehler-id_s"],
'katursache-id': data_opl["katursache-id_s"],
'qsmitarbeiter-id': data_opl["qsmitarbeiter-id_s"],
'swentwickler-id': data_opl["swentwickler-id_s"],
'status': data_opl["status_s"]
}
# Update-Operation
retVal_o['id'] = id_s
@ -310,7 +327,14 @@ class Fehler_cl(object):
# hier müsste man prüfen, ob die Daten korrekt vorliegen!
data_o = {
'name': data_opl["name_s"]
'name': data_opl["name_s"],
'id': data_opl["id_s"],
'komponente-id': data_opl["komponente-id_s"],
'katfehler-id': data_opl["katfehler-id_s"],
'katursache-id': data_opl["katursache-id_s"],
'qsmitarbeiter-id': data_opl["qsmitarbeiter-id_s"],
'swentwickler-id': data_opl["swentwickler-id_s"],
'status': data_opl["status_s"]
}
# Create-Operation
id_s = self.db_o.create_px(data_o)

View File

@ -39,6 +39,11 @@ APP.Application_cl = class {
this.listKatUrsache_o = new APP.ListView_cl('katursache', '/katursache/', 'katursachelist.tpl');
this.detailKatUrsache_o = new APP.DetailView_cl('katursache', '/katursache/', 'katursachedetail.tpl');
this.listFehler_o = new APP.ListView_cl('fehler', '/fehler/', 'fehlerlist.tpl');
this.detailFehler_o = new APP.DetailView_cl('fehler', '/fehler/', 'fehlerdetail.tpl');
this.detailFehlerQs_o = new APP.DetailView_cl('fehler', '/fehler/', 'fehlerqsdetail.tpl');
this.detailFehlerSw_o = new APP.DetailView_cl('fehler', '/fehler/', 'fehlerswdetail.tpl');
// this.listSources_o = new APP.ListView_cl('source', '/source/', 'sourceslist.tpl');
// this.detailSources_o = new APP.SourceDetailView_cl('source', '/source/', 'sourcedetail.tpl');
// this.listEvaluated_o = new APP.ListView_cl('evaluated', '/evaluated/', 'evaluatedlist.tpl');
@ -125,6 +130,25 @@ APP.Application_cl = class {
// Detailformular im Content-Bereich anzeigen
self_opl.setContent_p(self_opl.detailKatUrsache_o, data_apl[1]);
break;
case 'fehler':
self_opl.setContent_p(self_opl.listFehler_o, data_apl[1]);
break;
case 'fehler.add':
// (leeres) Detailformular im Content-Bereich anzeigen
self_opl.setContent_p(self_opl.detailFehler_o, data_apl[1]);
break;
case 'fehler.edit':
// Detailformular im Content-Bereich anzeigen
self_opl.setContent_p(self_opl.detailFehler_o, data_apl[1]);
break;
case 'fehler.editqs':
// Detailformular im Content-Bereich anzeigen
self_opl.setContent_p(self_opl.detailFehlerQs_o, data_apl[1]);
break;
case 'fehler.editsw':
// Detailformular im Content-Bereich anzeigen
self_opl.setContent_p(self_opl.detailFehlerSw_o, data_apl[1]);
break;
default:
console.warn('[Application_cl] unbekannte app-Notification: '+data_apl[0]);
break;

Binary file not shown.

View File

@ -0,0 +1,20 @@
<!-- Template -->
<form id="idForm" class="clContent">
<h2 id="idContentHeader" class="clContentHeader">
Pflege Fehlerkategorien
</h2>
<div id="idContentArea" class="clContentArea">
<input type="hidden" value="#context.data.id#" id="id_s" name="id_s" />
<div class="clFormRow">
<label for="name_s">Name <span class="clRequired"></span></label>
<input type="text" value="#context.data.name#" id="name_s" name="name_s" autofocus required />
</div>
</div>
<div id="idButtonArea" class="clButtonArea">
<button data-action="back" class="clButton">Zurück</button>
<button data-action="save" class="clButton">Speichern</button>
</div>
</form>
<!-- EOF -->

View File

@ -0,0 +1,27 @@
<!-- Template -->
<div id="idListContent" class="clContent">
<h2 id="idContentHeader" class="clContentHeader">
Pflege SW-Mitarbeiter
</h2>
<div id="idContentArea" class="clContentArea">
<table id="idList">
<tr class="listheader"><th>Name</th><th>ID</th><th>Komponente-ID</th><th>(KatFehler-ID)</th><th>(KatUrsache-ID)</th><th>(QS)</th><th>(SW)</th><th>Status</th></tr>
@var rows_o = context['data'];@
@for var key_s in rows_o@
<tr id='#key_s#'>
@var row_o = rows_o[key_s];@
<td>#row_o['name']#</td><td>#row_o['id']#</td><td>#row_o['komponente-id']#</td><td>#row_o['katfehler-id']#</td><td>#row_o['katursache-id']#</td><td>#row_o['qsmitarbeiter-id']#</td><td>#row_o['swentwickler-id']#</td><td>#row_o['status']#</td>
</tr>
@endfor@
</table>
</div>
<div id="idButtonArea" class="clButtonArea">
<button data-action="add" class="clButton">Hinzufügen</button>
<button data-action="edit" class="clButton">Bearbeiten</button>
<button data-action="editqs" class="clButton">Bearbeiten QS</button>
<button data-action="editsw" class="clButton">Bearbeiten SW</button>
<button data-action="delete" class="clButton">(Löschen)</button>
</div>
</div>
<!-- EOF -->

View File

@ -0,0 +1,20 @@
<!-- Template -->
<form id="idForm" class="clContent">
<h2 id="idContentHeader" class="clContentHeader">
Pflege Fehlerkategorien
</h2>
<div id="idContentArea" class="clContentArea">
<input type="hidden" value="#context.data.id#" id="id_s" name="id_s" />
<div class="clFormRow">
<label for="name_s">Name <span class="clRequired"></span></label>
<input type="text" value="#context.data.name#" id="name_s" name="name_s" autofocus required />
</div>
</div>
<div id="idButtonArea" class="clButtonArea">
<button data-action="back" class="clButton">Zurück</button>
<button data-action="save" class="clButton">Speichern</button>
</div>
</form>
<!-- EOF -->

View File

@ -0,0 +1,20 @@
<!-- Template -->
<form id="idForm" class="clContent">
<h2 id="idContentHeader" class="clContentHeader">
Pflege Fehlerkategorien
</h2>
<div id="idContentArea" class="clContentArea">
<input type="hidden" value="#context.data.id#" id="id_s" name="id_s" />
<div class="clFormRow">
<label for="name_s">Name <span class="clRequired"></span></label>
<input type="text" value="#context.data.name#" id="name_s" name="name_s" autofocus required />
</div>
</div>
<div id="idButtonArea" class="clButtonArea">
<button data-action="back" class="clButton">Zurück</button>
<button data-action="save" class="clButton">Speichern</button>
</div>
</form>
<!-- EOF -->