mitarbeiter finished
This commit is contained in:
parent
4552aa346a
commit
00ecaf25c6
Binary file not shown.
Binary file not shown.
@ -36,7 +36,8 @@ class Navigation_cl(object):
|
||||
{'action': 'fehler' , 'text': 'Bearbeitung Fehlerdaten'},
|
||||
{'action': 'projekt' , 'text': 'Pflege Projekte'},
|
||||
{'action': 'komponente' , 'text': 'Pflege Komponenten'},
|
||||
{'action': 'mitarbeiter' , 'text': 'Pflege Daten Mitarbeiter'},
|
||||
{'action': 'qsmitarbeiter' , 'text': 'Pflege Daten QS-Mitarbeiter'},
|
||||
{'action': 'swentwickler' , 'text': 'Pflege Daten SW-Entwickler'},
|
||||
{'action': 'kategorien' , 'text': 'Pflege Kategorien'},
|
||||
{'action': 'prolist' , 'text': 'Auswertung Projekte/Fehler'},
|
||||
{'action': 'catlist' , 'text': 'Auswertung Kategorien/Fehler'}
|
||||
|
@ -3,12 +3,25 @@
|
||||
import json
|
||||
|
||||
import cherrypy
|
||||
#from .database import SourceDatabase_cl, EvaluatedDatabase_cl
|
||||
from .database import QsMitarbeiterDatabase_cl, SwEntwicklerDatabase_cl
|
||||
# Method-Dispatching!
|
||||
|
||||
# Übersicht Anforderungen / Methoden
|
||||
# (beachte: / relativ zu /navigation, siehe Konfiguration Server!)
|
||||
|
||||
#-------------------------------------------------------
|
||||
def adjustId_p(id_spl, data_opl):
|
||||
#-------------------------------------------------------
|
||||
|
||||
if id_spl == None:
|
||||
data_opl['id'] = ''
|
||||
elif id_spl == '':
|
||||
data_opl['id'] = ''
|
||||
elif id_spl == '0':
|
||||
data_opl['id'] = ''
|
||||
else:
|
||||
data_opl['id'] = id_spl
|
||||
return data_opl
|
||||
|
||||
|
||||
"""
|
||||
@ -32,27 +45,87 @@ class QsMitarbeiter_cl(object):
|
||||
#-------------------------------------------------------
|
||||
def __init__(self):
|
||||
#-------------------------------------------------------
|
||||
self.db_o = QsMitarbeiterDatabase_cl()
|
||||
|
||||
#-------------------------------------------------------
|
||||
def GET(self, id = None):
|
||||
#-------------------------------------------------------
|
||||
retVal_o = {
|
||||
'data': None
|
||||
}
|
||||
if id == None:
|
||||
# Anforderung der Liste
|
||||
retVal_o['data'] = self.db_o.read_px()
|
||||
else:
|
||||
# Anforderung eines Dokuments
|
||||
data_o = self.db_o.read_px(id)
|
||||
if data_o != None:
|
||||
retVal_o['data'] = adjustId_p(id, data_o)
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def PUT(self, data_opl):
|
||||
#-------------------------------------------------------
|
||||
# Sichern der Daten: jetzt wird keine vollständige Seite
|
||||
# zurückgeliefert, sondern nur noch die Information, ob das
|
||||
# Speichern erfolgreich war
|
||||
|
||||
retVal_o = {
|
||||
'id': None
|
||||
}
|
||||
|
||||
# data_opl: Dictionary mit den gelieferten key-value-Paaren
|
||||
# hier müsste man prüfen, ob die Daten korrekt vorliegen!
|
||||
|
||||
id_s = data_opl["id_s"]
|
||||
data_o = {
|
||||
'name': data_opl["name_s"],
|
||||
'id': data_opl["id_s"]
|
||||
}
|
||||
# Update-Operation
|
||||
retVal_o['id'] = id_s
|
||||
if self.db_o.update_px(id_s, data_o):
|
||||
pass
|
||||
else:
|
||||
retVal_o['id'] = None
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def GET(self):
|
||||
def POST(self, data_opl):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
retVal_o = {
|
||||
'id': None
|
||||
}
|
||||
|
||||
# data_opl: Dictionary mit den gelieferten key-value-Paaren
|
||||
|
||||
# hier müsste man prüfen, ob die Daten korrekt vorliegen!
|
||||
|
||||
data_o = {
|
||||
'name': data_opl["name_s"]
|
||||
}
|
||||
# Create-Operation
|
||||
id_s = self.db_o.create_px(data_o)
|
||||
retVal_o['id'] = id_s
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def PUT(self):
|
||||
def DELETE(self, id):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
# Eintrag löschen, nur noch Rückmeldung liefern
|
||||
retVal_o = {
|
||||
'id': id
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
def POST(self):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
if self.db_o.delete_px(id):
|
||||
pass
|
||||
else:
|
||||
retVal_o['id'] = None
|
||||
|
||||
#-------------------------------------------------------
|
||||
def DELETE(self):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
return retVal_o
|
||||
|
||||
|
||||
|
||||
@ -75,26 +148,86 @@ class SwEntwickler_cl(object):
|
||||
#-------------------------------------------------------
|
||||
def __init__(self):
|
||||
#-------------------------------------------------------
|
||||
self.db_o = SwEntwicklerDatabase_cl()
|
||||
|
||||
#-------------------------------------------------------
|
||||
def GET(self, id = None):
|
||||
#-------------------------------------------------------
|
||||
retVal_o = {
|
||||
'data': None
|
||||
}
|
||||
if id == None:
|
||||
# Anforderung der Liste
|
||||
retVal_o['data'] = self.db_o.read_px()
|
||||
else:
|
||||
# Anforderung eines Dokuments
|
||||
data_o = self.db_o.read_px(id)
|
||||
if data_o != None:
|
||||
retVal_o['data'] = adjustId_p(id, data_o)
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def PUT(self, data_opl):
|
||||
#-------------------------------------------------------
|
||||
# Sichern der Daten: jetzt wird keine vollständige Seite
|
||||
# zurückgeliefert, sondern nur noch die Information, ob das
|
||||
# Speichern erfolgreich war
|
||||
|
||||
retVal_o = {
|
||||
'id': None
|
||||
}
|
||||
|
||||
# data_opl: Dictionary mit den gelieferten key-value-Paaren
|
||||
# hier müsste man prüfen, ob die Daten korrekt vorliegen!
|
||||
|
||||
id_s = data_opl["id_s"]
|
||||
data_o = {
|
||||
'name': data_opl["name_s"],
|
||||
'id': data_opl["id_s"]
|
||||
}
|
||||
# Update-Operation
|
||||
retVal_o['id'] = id_s
|
||||
if self.db_o.update_px(id_s, data_o):
|
||||
pass
|
||||
else:
|
||||
retVal_o['id'] = None
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def GET(self):
|
||||
def POST(self, data_opl):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
retVal_o = {
|
||||
'id': None
|
||||
}
|
||||
|
||||
# data_opl: Dictionary mit den gelieferten key-value-Paaren
|
||||
|
||||
# hier müsste man prüfen, ob die Daten korrekt vorliegen!
|
||||
|
||||
data_o = {
|
||||
'name': data_opl["name_s"]
|
||||
}
|
||||
# Create-Operation
|
||||
id_s = self.db_o.create_px(data_o)
|
||||
retVal_o['id'] = id_s
|
||||
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
def PUT(self):
|
||||
def DELETE(self, id):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
# Eintrag löschen, nur noch Rückmeldung liefern
|
||||
retVal_o = {
|
||||
'id': id
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
def POST(self):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
if self.db_o.delete_px(id):
|
||||
pass
|
||||
else:
|
||||
retVal_o['id'] = None
|
||||
|
||||
#-------------------------------------------------------
|
||||
def DELETE(self):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
return retVal_o
|
||||
|
||||
# EOF
|
4
Praktikum3/bt/data/qsmitarbeiter/1.dat
Normal file
4
Praktikum3/bt/data/qsmitarbeiter/1.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "QS-Mitarbeiter1",
|
||||
"id": "1"
|
||||
}
|
4
Praktikum3/bt/data/qsmitarbeiter/2.dat
Normal file
4
Praktikum3/bt/data/qsmitarbeiter/2.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "QS-Mitarbeiter2",
|
||||
"id": "2"
|
||||
}
|
4
Praktikum3/bt/data/qsmitarbeiter/3.dat
Normal file
4
Praktikum3/bt/data/qsmitarbeiter/3.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "QS-Mitarbeiter3",
|
||||
"id": "3"
|
||||
}
|
4
Praktikum3/bt/data/qsmitarbeiter/4.dat
Normal file
4
Praktikum3/bt/data/qsmitarbeiter/4.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "QS-Mitarbeiter4",
|
||||
"id": "4"
|
||||
}
|
@ -1 +1 @@
|
||||
0
|
||||
5
|
4
Praktikum3/bt/data/swentwickler/1.dat
Normal file
4
Praktikum3/bt/data/swentwickler/1.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "SW-Entwickler1",
|
||||
"id": "1"
|
||||
}
|
4
Praktikum3/bt/data/swentwickler/2.dat
Normal file
4
Praktikum3/bt/data/swentwickler/2.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "SW-Entwickler2",
|
||||
"id": "2"
|
||||
}
|
4
Praktikum3/bt/data/swentwickler/3.dat
Normal file
4
Praktikum3/bt/data/swentwickler/3.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "SW-Entwickler3",
|
||||
"id": "3"
|
||||
}
|
4
Praktikum3/bt/data/swentwickler/5.dat
Normal file
4
Praktikum3/bt/data/swentwickler/5.dat
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "SW-Entwickler5",
|
||||
"id": "5"
|
||||
}
|
@ -1 +1 @@
|
||||
0
|
||||
5
|
@ -27,6 +27,12 @@ APP.Application_cl = class {
|
||||
this.listKomponente_o = new APP.ListView_cl('komponente', '/komponente/', 'komponentelist.tpl');
|
||||
this.detailKomponente_o = new APP.DetailView_cl('komponente', '/komponente/', 'komponentedetail.tpl');
|
||||
|
||||
this.listQsMitarbeiter_o = new APP.ListView_cl('qsmitarbeiter', '/qsmitarbeiter/', 'qsmitarbeiterlist.tpl');
|
||||
this.detailQsMitarbeiter_o = new APP.DetailView_cl('qsmitarbeiter', '/qsmitarbeiter/', 'qsmitarbeiterdetail.tpl');
|
||||
|
||||
this.listSwEntwickler_o = new APP.ListView_cl('swentwickler', '/swentwickler/', 'swentwicklerlist.tpl');
|
||||
this.detailSwEntwickler_o = new APP.DetailView_cl('swentwickler', '/swentwickler/', 'swentwicklerdetail.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');
|
||||
@ -69,6 +75,28 @@ APP.Application_cl = class {
|
||||
// Detailformular im Content-Bereich anzeigen
|
||||
self_opl.setContent_p(self_opl.detailKomponente_o, data_apl[1]);
|
||||
break;
|
||||
case 'qsmitarbeiter':
|
||||
self_opl.setContent_p(self_opl.listQsMitarbeiter_o, data_apl[1]);
|
||||
break;
|
||||
case 'qsmitarbeiter.add':
|
||||
// (leeres) Detailformular im Content-Bereich anzeigen
|
||||
self_opl.setContent_p(self_opl.detailQsMitarbeiter_o, data_apl[1]);
|
||||
break;
|
||||
case 'qsmitarbeiter.edit':
|
||||
// Detailformular im Content-Bereich anzeigen
|
||||
self_opl.setContent_p(self_opl.detailQsMitarbeiter_o, data_apl[1]);
|
||||
break;
|
||||
case 'swentwickler':
|
||||
self_opl.setContent_p(self_opl.listSwEntwickler_o, data_apl[1]);
|
||||
break;
|
||||
case 'swentwickler.add':
|
||||
// (leeres) Detailformular im Content-Bereich anzeigen
|
||||
self_opl.setContent_p(self_opl.detailSwEntwickler_o, data_apl[1]);
|
||||
break;
|
||||
case 'swentwickler.edit':
|
||||
// Detailformular im Content-Bereich anzeigen
|
||||
self_opl.setContent_p(self_opl.detailSwEntwickler_o, data_apl[1]);
|
||||
break;
|
||||
default:
|
||||
console.warn('[Application_cl] unbekannte app-Notification: '+data_apl[0]);
|
||||
break;
|
||||
|
BIN
Praktikum3/bt/templates/.DS_Store
vendored
BIN
Praktikum3/bt/templates/.DS_Store
vendored
Binary file not shown.
20
Praktikum3/bt/templates/qsmitarbeiterdetail.tpl
Normal file
20
Praktikum3/bt/templates/qsmitarbeiterdetail.tpl
Normal file
@ -0,0 +1,20 @@
|
||||
<!-- Template -->
|
||||
<form id="idForm" class="clContent">
|
||||
<h2 id="idContentHeader" class="clContentHeader">
|
||||
Pflege QS-Mitarbeiter
|
||||
</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 -->
|
25
Praktikum3/bt/templates/qsmitarbeiterlist.tpl
Executable file
25
Praktikum3/bt/templates/qsmitarbeiterlist.tpl
Executable file
@ -0,0 +1,25 @@
|
||||
<!-- Template -->
|
||||
<div id="idListContent" class="clContent">
|
||||
<h2 id="idContentHeader" class="clContentHeader">
|
||||
Pflege QS-Mitarbeiter
|
||||
</h2>
|
||||
<div id="idContentArea" class="clContentArea">
|
||||
<table id="idList">
|
||||
<tr class="listheader"><th>Name</th><th>ID</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>
|
||||
</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="delete" class="clButton">Löschen</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- EOF -->
|
20
Praktikum3/bt/templates/swentwicklerdetail.tpl
Normal file
20
Praktikum3/bt/templates/swentwicklerdetail.tpl
Normal file
@ -0,0 +1,20 @@
|
||||
<!-- Template -->
|
||||
<form id="idForm" class="clContent">
|
||||
<h2 id="idContentHeader" class="clContentHeader">
|
||||
Pflege SW-Mitarbeiter
|
||||
</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 -->
|
25
Praktikum3/bt/templates/swentwicklerlist.tpl
Executable file
25
Praktikum3/bt/templates/swentwicklerlist.tpl
Executable file
@ -0,0 +1,25 @@
|
||||
<!-- 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></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>
|
||||
</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="delete" class="clButton">Löschen</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- EOF -->
|
Loading…
x
Reference in New Issue
Block a user