Chore: Verschiebe Git-Repository in das Hauptverzeichnis und richte .gitignore ein

This commit is contained in:
salam committed 2026-10-19 10:11:04 +02:00
commit 96d0545193
502 files changed
+176027

No files matched your search

@@ -0,0 +1,76 @@
require([
'dojo/ready',
'dojo/_base/declare',
'dijit/layout/BorderContainer',
'dijit/layout/StackContainer',
'dgrid/Grid',
'dgrid/OnDemandGrid',
'dgrid/Selection',
'dgrid/CellSelection',
'dgrid/extensions/Pagination',
'dgrid/Editor',
'dgrid/extensions/ColumnHider',
'gutachten/lib/xhr',
'gutachten/menu/topmenu',
'gutachten/projekte/projekte_alle',
'gutachten/projekte/projekte_active',
'gutachten/vorlagen/vorlagen',
'dojo/domReady!'
], function (
ready,
declare,
BorderContainer,
StackContainer,
Grid,
OnDemandGrid,
Selection,
CellSelection,
Pagination,
Editor,
ColumnHider,
gutachten_xhr,
topmenu,
projekte_alle,
projekte_active,
vorlagen_alle
) {
ready(function () {
window.SelectionPaginationGrid = declare([Grid, Selection, Pagination])
window.CellSelectionPaginationGrid = declare([Grid, CellSelection, Editor, Pagination])
window.SelectionColumnHiderGrid = declare([OnDemandGrid, Selection, ColumnHider])
window.CellSelectionPaginationColumnHiderGrid = declare([Grid, CellSelection, Editor, Pagination, ColumnHider])
var callback = function (response) {
LOCALSCOPE.uid = response.uid
LOCALSCOPE.username = response.username
LOCALSCOPE.tx_help = response.tx_help
/*******************************************************
* LAYOUT
*******************************************************/
var bc_base = new BorderContainer(
{
design: 'headline',
id: 'bc_base'
},
'base'
)
var stack_container_main = new StackContainer({
region: 'center',
id: 'stack_container_main'
})
dijit.byId('bc_base').addChild(stack_container_main)
topmenu.create(bc_base)
projekte_alle.create(stack_container_main)
projekte_active.create(stack_container_main)
vorlagen_alle.create(stack_container_main)
bc_base.startup()
}
gutachten_xhr.call_function(
callback,
'settings_controller',
'load_localscope'
)
})
})
@@ -0,0 +1,476 @@
define([
'dojo/date/locale',
'dojo/_base/array',
'dojo/number',
'dijit/Tooltip',
'dijit/Dialog',
'dojo/domReady!'
], function (locale, arrayUtil, number, Tooltip, Dialog) {
return {
rendeCircle: function (data, xclass, act) {
var div = document.createElement('i')
if (data == act)
div.className = 'fa fa-circle ' + xclass
else
div.className = 'fa fa-circle off'
return div
},
renderToggle: function (data, xclass, act) {
var div = document.createElement('i')
if (data == act)
div.className = 'fa fa-toggle-on ' + xclass
else
div.className = 'fa fa-toggle-off ' + xclass
return div
},
renderIcon: function (iconclass, popup, label) {
var div = document.createElement('i')
div.className = iconclass
if (popup) {
new Tooltip({
connectId: div,
label: popup,
})
}
if (label) {
div += label
}
return div
},
renderText: function (bodytext, tooltipText) {
var div = document.createElement('div')
div.innerHTML = bodytext
if (tooltipText) {
new Tooltip({
connectId: div,
label: tooltipText,
position: ['above', 'below']
})
}
return div
},
renderAllowHTML: function (object, data) {
var div = document.createElement('div')
if (data) div.innerHTML = data
return div
},
/************************************************************
*
* NEEDS CHECKING
*
***************************************************/
/*
*
*/
test: function (item) {
console.log('GUTACHTEN_FUNCTIONS', item)
},
/*
*
*/
renderDate: function (object, data, td, options) {
var div = document.createElement('div')
var date = new Date(data * 1000)
div.innerHTML = locale.format(date, {
selector: 'date',
datePattern: 'dd. MM. yyyy'
})
return div
},
/*
*
*/
renderDateTime: function (object, data, td, options) {
var div = document.createElement('div')
var date = new Date(data * 1000)
div.innerHTML = locale.format(date, {
selector: 'date',
datePattern: 'd. M. yyyy HH:mm'
})
return div
},
/*
*
*/
formatterZeroEmpty: function (value, object) {
if (value * 1 == 0) return ' '
else return value
},
/*
*
*/
isNumeric: function (n) {
return !isNaN(parseFloat(n)) && isFinite(n)
},
/*
*
*/
addToolTip: function (txt) {
var visible = LOCALSCOPE.tx_help == 1 ? 'help_on' : 'help_off'
var id = Math.random()
.toString(36)
.replace(/[^a-z]+/g, '')
.substr(0, 7)
return (
'<i id="' +
id +
'" class="fa fa-question help ' +
visible +
'" onMouseOver="dijit.showTooltip( \'' +
txt +
"', '" +
id +
'\' );" onMouseOut="dijit.hideTooltip( \'' +
id +
'\' );"></i>'
)
},
/*
*
*/
checkSessionExpired: function (data) {
if (data == '[{"logout":1}]')
document.location.href =
'index.php?id=1&submit=Logout&logintype=logout&pid=1&tx_felogin_pi1[noredirect]=0'
arrayUtil.forEach(data, function (item) {
if (item.logout)
document.location.href =
'index.php?id=1&submit=Logout&logintype=logout&pid=1&tx_felogin_pi1[noredirect]=0'
})
},
/*
*
*/
setPageTitle: function (title) {
dijit
.byId('cp_base_top_title')
.set('content', LOCALSCOPE.pagename + ' ' + title)
},
/*
*
*/
renderOnOff: function (object, data) {
var div = document.createElement('div')
if (data == 1)
div.innerHTML = '<i class="fa fa-check-square fa-grid on"></i>'
else div.innerHTML = '<i class="fa fa-square-o fa-grid off"></i>'
return div
},
/*
*
*/
renderDelete: function (object, data) {
var div = document.createElement('div')
div.innerHTML = '<a class="far fa-trash-alt pointer blau"></a>'
return div
},
getStatus: function (object) {
var div
if (object.status == '1')
div = '<i class="fa fa-check-square fa-grid test"></i>'
else if (object.status == '2')
div = '<i class="fa fa-check-square fa-grid konzept"></i>'
else if (object.status == '3')
div = '<i class="fa fa-check-square fa-grid endfassung"></i>'
else if (object.status == '4')
div = '<i class="fa fa-check-square fa-grid active"></i>'
div += '&nbsp;' + object.intname
return div
},
/*
*
*/
renderDuplizieren: function (object, data) {
var div = document.createElement('div')
div.innerHTML = '<i class="far fa-clone pointer test"></i>'
return div
},
rendeOnOff: function (object, data) {
var div = document.createElement('div')
if (data == 1)
div.innerHTML = '<i class="fa fa-toggle-on rot2 pointer"></i>'
else
div.innerHTML =
'<i class="fa fa-toggle-on fa-rotate-180 gruen pointer"></i>'
return div
},
rendeOnOffLight: function (object, data) {
var div = document.createElement('div')
if (data == 1) div.innerHTML = '<i class="fa fa-toggle-on pointer"></i>'
else
div.innerHTML =
'<i class="fa fa-toggle-on fa-rotate-180 pointer"></i>'
return div
},
/*
*
*/
renderCheckBoxOnOff: function (object, data) {
var div = document.createElement('div')
if (data)
div.innerHTML = '<i class="fa fa-check-square endfassung pointer"></i>'
else div.innerHTML = '<i class="far fa-square off pointer"></i>'
return div
},
/*
*
*/
getAddAuftraggeber_CDialog: function () {
var content =
'<form data-dojo-type="dijit/form/Form" id="sendform_auf" name="sendform_auf" data-dojo-id="sendform_auf" encType="multipart/form-data" method="post">'
content +=
'<script type="dojo/method" data-dojo-event="onSubmit"> submitAddAuftraggeber(); dijit.byId("auftraggeberDialog").hide(); return false;</script>'
content += '<table style="width:100%; margin:5px;">'
content += '<tr>'
content += '<td><label for="name">Kennung:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="kennung" id="kennung1" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Kopf:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="kopf" id="kopf1" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Fliestext:</label></td>'
content +=
"<td><div data-dojo-type=\"dijit/Editor\" required=\"true\" name=\"txt\" id=\"txt1\" data-dojo-props=\"plugins:['undo','redo','copy','paste','selectAll','bold','italic','underline']\"></td>"
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Kontaktperson:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="kontaktperson" id="kontaktperson1" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">E-Mail:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="email" id="email1" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Telefon:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="telefon" id="telefon1"></td>'
content += '</tr>'
content += '<tr>'
content += '<td></td>'
content +=
'<td><button data-dojo-type="dijit/form/Button" type="submit">Anlegen</button><button data-dojo-type="dijit/form/Button" onClick="dijit.byId(\'auftraggeberDialog\').hide();">Abbrechen</button></td>'
content += '</tr>'
content += '</table>'
content += '</form>'
return new Dialog({
id: 'auftraggeberDialog',
region: 'center',
title: 'Neuen Auftraggeber anlegen',
content: content,
onShow: function () {
dijit.byId('txt1').set('value', '')
dijit.byId('sendform_auf').reset()
}
// submitFunction:function(){
//
// }
})
},
/*
*
*/
getAddGutachter_CDialog: function () {
var content =
'<form data-dojo-type="dijit/form/Form" id="sendform_gut" name="sendform_gut" data-dojo-id="sendform_gut" encType="multipart/form-data" method="post">'
content +=
'<script type="dojo/method" data-dojo-event="onSubmit"> submitAddGutachter(); dijit.byId("gutachterDialog").hide(); return false;</script>'
content += '<table style="width:100%; margin:5px;">'
content += '<tr>'
content += '<td><label for="name">Kennung:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="kennung" id="kennung2" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Kopf:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="kopf" id="kopf2" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Fliestext:</label></td>'
content +=
"<td><div data-dojo-type=\"dijit/Editor\" required=\"true\" name=\"txt\" id=\"txt2\" data-dojo-props=\"plugins:['undo','redo','copy','paste','selectAll','bold','italic','underline']\"></td>"
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Kontaktperson:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="kontaktperson" id="kontaktperson2" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">E-Mail:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="email" id="email2" required="true"></td>'
content += '</tr>'
content += '<tr>'
content += '<td><label for="name">Telefon:</label></td>'
content +=
'<td><input data-dojo-type="dijit/form/TextBox" name="telefon" id="telefon2"></td>'
content += '</tr>'
content += '<tr>'
content += '<td></td>'
content +=
'<td><button data-dojo-type="dijit/form/Button" type="submit">Anlegen</button><button data-dojo-type="dijit/form/Button" onClick="dijit.byId(\'gutachterDialog\').hide();">Abbrechen</button></td>'
content += '</tr>'
content += '</table>'
content += '</form>'
return new Dialog({
id: 'gutachterDialog',
region: 'center',
title: 'Neuen Gutachter anlegen',
content: content,
onShow: function () {
dijit.byId('txt2').set('value', '')
dijit.byId('sendform_gut').reset()
}
// submitFunction:function(){
//
// }
})
},
/*
*
*/
renderPos: function (number, color) {
var div = document.createElement('div')
if (!isNaN(parseFloat(number)) && isFinite(number)) {
div.innerHTML =
'<span class="pos-number" style="background-color: ' +
color +
'">' +
number +
'</span>'
}
return div
},
/*
*
*/
renderMoveStart: function (object, data) {
var div = document.createElement('div')
if (object.pos > 1)
div.innerHTML = '<i class="fas fa-angle-double-up pointer blau"></i>'
return div
},
/*
*
*/
renderMoveUp: function (object, data) {
var div = document.createElement('div')
if (object.pos > 1)
div.innerHTML = '<i class="fa fa-chevron-up pointer blau"></i>'
return div
},
/*
*
*/
renderMoveDown: function (object, data, td, index) {
var div = document.createElement('div')
if (object.all != undefined && object.all != object.pos)
div.innerHTML = '<i class="fa fa-chevron-down pointer blau"></i>'
return div
},
/*
*
*/
renderMoveEnd: function (object, data) {
var div = document.createElement('div')
if (object.all != undefined && object.all != object.pos)
div.innerHTML = '<i class="fas fa-angle-double-down pointer blau"></i>'
return div
},
/*
*
*/
renderEditIcon: function (object, data) {
var div = document.createElement('div')
div.innerHTML = '<a class="fa fa-pencil-alt pointer"></a>'
return div
},
/*
*
*/
renderHeaderToggleIcon: function (object, data) {
var div = document.createElement('div')
div.innerHTML = '<i class="fa fa-list pointer blau"></i>'
return div
},
/*
*
*/
renderHeaderPlusIcon: function (object, data) {
var div = document.createElement('div')
div.innerHTML = '<i class="fa fa-plus pointer blau center_icon"></i>'
return div
},
/*
*
*/
renderLeftArrow: function (object, data) {
var div = document.createElement('div')
div.innerHTML =
'<i class="far fa-arrow-alt-circle-left pointer blau center_icon"></i>'
return div
},
/*
*
*/
renderToggleArrow: function (object, data) {
var div = document.createElement('div')
if (data == '1')
div.innerHTML = '<i class="fa fa-circle blau pointer"></i>'
else div.innerHTML = '<i class="far fa-circle blau pointer"></i>'
return div
},
/*
*
*/
renderPlatzhalter: function (object, data) {
var div = document.createElement('div')
if (data == '1')
div.innerHTML = '<i class="fa fa-hashtag pointer center_icon"></i>'
else
div.innerHTML =
'<i class="fa fa-hashtag pointer center_icon"></i>'
return div
},
renderDecimal: function (object, data) {
if (data == 0) {
return
}
var div = document.createElement('div')
div.innerHTML = number.format(value, {
places: 2,
locale: 'us'
})
return div
},
/*
*
*/
formatNumber: function (n) {
if (n == 0) return ''
n = n.replace(',', '.')
return number.format(n, {
places: 2,
locale: 'us'
})
},
}
})
@@ -0,0 +1,74 @@
define([
'dojo/dom-style',
'dojox/form/Uploader',
'dojox/embed/Flash',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/ConfirmDialog',
'dojo/domReady!'
], function (
domStyle,
Uploader,
Flash,
ContentPane,
BorderContainer,
ConfirmDialog
) {
return {
init: function () {
if (dojox.embed.Flash.available) {
dojo.require('dojox.form.uploader.plugins.Flash')
} else {
dojo.require('dojox.form.uploader.plugins.IFrame')
}
var dialog = new ConfirmDialog({
region: 'center'
})
domStyle.set(dialog.okButton.domNode, 'display', 'none')
var bc_upload_dialog = new BorderContainer({
design: 'headline',
style: 'width: 300px; height: 40px;'
})
dialog.addChild(bc_upload_dialog)
var uploader = new Uploader({
name: 'uploadedfile',
id: 'uploader',
type: 'file',
label: '<i class="far fa-file-alt blau"></i> Dokument auswählen',
multiple: false,
uploadOnSelect: true,
preventCache: true,
enctype: 'multipart/form-data',
onBegin: function (response, ioArgs) {
dialog.set(
'title',
'<i class="fas fa-sync fa-spin blau"></i> Hochladen..'
)
}
})
dojo.connect(uploader, 'onComplete', function (response) {
dialog.hide()
var message =
'<span class="' + response.class + '">' + response.message + '</span>'
dijit.byId('cp_upload_response').set('content', message)
// setTimeout(function () {
// dijit.byId("cp_upload_response").set("content", "");
// }, 15000);
})
var cp_up = new ContentPane({
region: 'center',
class: 'no-border',
id: 'cp_up',
content: uploader
})
bc_upload_dialog.addChild(cp_up)
return dialog
}
}
})
@@ -0,0 +1,243 @@
define([
'dojo/request/xhr',
'dojo/on',
'dojo/mouse',
'dijit/Tooltip',
'dojo/domReady!'
], function (xhr, on, mouse, Tooltip) {
return {
/*******************************************************
* CALL FUNCTION
*******************************************************/
call_function: function (
callback,
controller,
action,
additional_parameters
) {
var url =
'index.php?eID=tx_gutachten&controller=' +
controller +
'&action=' +
action
if (additional_parameters != undefined) {
url = url + additional_parameters
}
xhrArgs = {
url: url,
handleAs: 'json',
preventCache: true
}
deferred = dojo.xhrGet(xhrArgs)
deferred.then(function (response) {
if (
response != null &&
typeof response == 'object' &&
'logout' in response
) {
window.location = window.location.host + '/login'
window.replace()
window.location.reload(true)
return
}
if (typeof callback === 'function') {
callback(response)
}
})
},
/*******************************************************
* CALL FUNCTION
*******************************************************/
call_function_text: function (
callback,
controller,
action,
additional_parameters
) {
var url =
'index.php?eID=tx_gutachten&controller=' +
controller +
'&action=' +
action
if (additional_parameters != undefined) {
url = url + additional_parameters
}
xhrArgs = {
url: url,
handleAs: 'text',
preventCache: true
}
deferred = dojo.xhrGet(xhrArgs)
deferred.then(function (response) {
if (
response != null &&
typeof response == 'object' &&
'logout' in response
) {
window.location = window.location.host + '/login'
window.replace()
window.location.reload(true)
return
}
if (typeof callback === 'function') {
callback(response)
}
})
},
/*******************************************************
* CALL DOWNLOAD
*******************************************************/
call_download: function (controller, action, additional_parameters) {
var url =
'index.php?eID=tx_gutachten&controller=' +
controller +
'&action=' +
action +
additional_parameters
window.open(url, '_blank')
return
},
/*******************************************************
* UPDATE FUNCTION
*******************************************************/
post_function: function (
callback,
controller,
action,
value_array,
additional_parameters
) {
var url =
'index.php?eID=tx_gutachten&controller=' +
controller +
'&action=' +
action
if (additional_parameters != undefined) {
url = url + additional_parameters
}
xhrArgs = {
url: url,
handleAs: 'json',
postData: {
data: dojo.toJson(value_array)
},
preventCache: true
}
deferred = dojo.xhrPost(xhrArgs)
deferred.then(function (response) {
if (typeof callback === 'function') {
callback(response)
}
})
},
/*******************************************************
* LOAD TOOLTIP
*******************************************************/
load_tooltip: function (
element,
controller,
action,
additional_parameters
) {
var url =
'index.php?eID=tx_gutachten&controller=' +
controller +
'&action=' +
action +
additional_parameters
xhr(url, {
handleAs: 'text',
method: 'GET',
preventCache: true
}).then(function (response) {
if (response) {
Tooltip.show(response, element, ['before', 'after'])
matches_grid.on(on.selector('.dgrid-cell', mouse.leave), function () {
Tooltip.hide(element)
})
}
})
},
/*******************************************************
* Update field
*******************************************************/
update_field_uid: function (callback, table, field, id, value) {
var url =
'index.php?eID=tx_gutachten&controller=update_controller&action=update_field&table=' +
table +
'&field=' +
field +
'&id=' +
id +
'&value=' +
value
xhrArgs = {
url: url,
handleAs: 'json',
preventCache: true
}
deferred = dojo.xhrGet(xhrArgs)
deferred.then(function (response) {
if (typeof callback === 'function') {
callback(response)
}
})
},
toggle_field_uid: function (callback, table, field, id) {
var url =
'index.php?eID=tx_gutachten&controller=update_controller&action=toggle_field&table=' +
table +
'&field=' +
field +
'&id=' +
id
xhrArgs = {
url: url,
handleAs: 'text',
preventCache: true
}
deferred = dojo.xhrGet(xhrArgs)
deferred.then(function (response) {
if (typeof callback === 'function') {
callback(response)
}
})
},
delete_uid: function (callback, table, id) {
var url =
'index.php?eID=tx_gutachten&controller=delete_controller&action=delete_from_table&table=' +
table +
'&id=' +
id
xhrArgs = {
url: url,
handleAs: 'text',
preventCache: true
}
deferred = dojo.xhrGet(xhrArgs)
deferred.then(function (response) {
if (typeof callback === 'function') {
callback(response)
}
})
}
}
})
@@ -0,0 +1,365 @@
define([
'dojo/request/xhr',
'dojo/dom-class',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/ToolbarSeparator',
'gutachten/lib/xhr',
'dojo/domReady!'
], function (
xhr,
domClass,
MenuBar,
MenuBarItem,
ToolbarSeparator,
gutachten_xhr
) {
return {
create: function (bc_base) {
/*******************************************************
* top menu
*******************************************************/
function tmsetactive(tm) {
switch (tm) {
case 'tm1':
domClass.add('tm1', 'topmenu-selected')
domClass.remove('tm2', 'topmenu-selected')
domClass.remove('tm3', 'topmenu-selected')
break;
case 'tm2':
domClass.remove('tm1', 'topmenu-selected')
domClass.add('tm2', 'topmenu-selected')
domClass.remove('tm3', 'topmenu-selected')
break;
case 'tm3':
domClass.remove('tm1', 'topmenu-selected')
domClass.remove('tm2', 'topmenu-selected')
domClass.add('tm3', 'topmenu-selected')
break;
}
}
var topmenu = new MenuBar({
id: 'topmenu',
region: "top",
className: 'center',
splitter: false
})
topmenu.addChild(
new MenuBarItem({
id: "tm1",
class: 'topmenu-selected',
label: '<i class="far fa-building"></i> Projekte Alle',
onClick: function (evt) {
tmsetactive('tm1')
dijit
.byId('stack_container_main')
.selectChild(dijit.byId('bc_projekte_alle'))
}
})
)
topmenu.addChild(new ToolbarSeparator())
topmenu.addChild(
new MenuBarItem({
id: "tm2",
label: '<i class="fa fa-building"></i> Projekte Active',
onClick: function (evt) {
tmsetactive('tm2')
dijit
.byId('stack_container_main')
.selectChild(dijit.byId('bc_projekte_active'))
}
})
)
topmenu.addChild(new ToolbarSeparator())
topmenu.addChild(
new MenuBarItem({
id: "tm3",
label: '<i class="fa fa-clipboard-list"></i> Vorlagen',
onClick: function (evt) {
tmsetactive('tm3')
dijit
.byId('stack_container_main')
.selectChild(dijit.byId('tap_vorlagen_center'))
}
})
)
if (LOCALSCOPE.uid == 1) {
// Hermann
topmenu.addChild(new ToolbarSeparator())
topmenu.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-font"></i> Font',
onClick: function () {
var callback = function (response) {
alert('Sonderzeichen Gerichted')
}
gutachten_xhr.call_function(
callback,
'settings_controller',
'sonderzeichen'
)
}
})
)
}
topmenu.addChild(new ToolbarSeparator())
topmenu.addChild(
new MenuBarItem({
showLabel: true,
style: 'margin-right:10px',
label: '<i class="fa fa-sign-out-alt"></i> Logout',
onClick: function () {
xhr('index.php?eID=tx_gutachten', {
data: {
logintype: 'logout',
pid: '53'
},
handleAs: 'json',
method: 'POST'
}).then(function (data) {
location.href = 'index.php'
})
}
})
)
bc_base.addChild(topmenu)
// var cp_titelbox = (window.cp_titelbox = new ContentPane({
// id: "cp_titelbox",
// region: "top",
// splitter: false
// }));
// var bc_base_topmenu = (window.bc_base_topmenu = new BorderContainer({
// design: 'sidebar',
// region: 'top',
// id: 'bc_base_topmenu',
// splitter: false
// }))
// var cp_base_topmenu_left = (window.cp_base_topmenu_left = new ContentPane(
// {
// id: 'cp_base_topmenu_left',
// region: 'left',
// splitter: false
// }
// ))
// bc_base_topmenu.addChild(cp_base_topmenu_left)
// var cp_base_topmenu_center = (window.cp_base_topmenu_center =
// new ContentPane({
// id: 'cp_base_topmenu_center',
// region: 'center',
// splitter: false
// }))
// bc_base_topmenu.addChild(cp_base_topmenu_center)
// var cp_base_topmenu_right = (window.cp_base_topmenu_right =
// new ContentPane({
// id: 'cp_base_topmenu_right',
// region: 'right',
// splitter: false
// }))
// bc_base_topmenu.addChild(cp_base_topmenu_right)
// /*******************************************************
// * top menu left
// *******************************************************/
// var topmenu_left = new MenuBar({
// id: 'topmenu_left',
// splitter: false
// })
// topmenu_left.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-building blau"></i> Nutzwertgutachten',
// onClick: function (evt) {
// window.location = 'index.php'
// }
// })
// )
// // topmenu_left.addChild(new MenuBarItem(
// // {
// // showLabel: true,
// // label: '<span class="logo">Nutzwertgutachten</span>',
// // onClick: function ()
// // {
// // window.location = 'index.php';
// // }
// // }));
// cp_base_topmenu_left.addChild(topmenu_left)
// /*******************************************************
// * top menu CENTER
// *******************************************************/
// var topmenu_center = new MenuBar({
// id: 'topmenu_center',
// style: 'text-align:center',
// splitter: false
// })
// topmenu_center.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="far fa-building blau"></i> Projekte Alle',
// onClick: function (evt) {
// dijit
// .byId('stack_container_main')
// .selectChild(dijit.byId('bc_projekte_alle'))
// }
// })
// )
// topmenu_center.addChild(new ToolbarSeparator())
// topmenu_center.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-building blau"></i> Projekte Active',
// onClick: function (evt) {
// dijit
// .byId('stack_container_main')
// .selectChild(dijit.byId('bc_projekte_active'))
// }
// })
// )
// topmenu_center.addChild(new ToolbarSeparator())
// topmenu_center.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-clipboard-list blau"></i> Vorlagen',
// onClick: function (evt) {
// dijit
// .byId('stack_container_main')
// .selectChild(dijit.byId('tap_vorlagen_center'))
// }
// })
// )
// cp_base_topmenu_center.addChild(topmenu_center)
// /*******************************************************
// * top menu right
// *******************************************************/
// var topmenu_right = new MenuBar({
// id: 'topmenu_right',
// splitter: false,
// style: 'text-align:right'
// })
// //
// // var dd_topmenu2 = new DropDownMenu(
// // {
// // region: "top",
// // id: "dd_topmenu2"
// // });
// // dd_topmenu2.addChild(new MenuItem(
// // {
// // showLabel: true,
// // label: '<i class="far fa-image"></i> ' + (LOCALSCOPE.layout == "Dark" ? "Hell" : "Dunkel") + ' ',
// // id: "thema-button-" + (LOCALSCOPE.layout == "Dark" ? "Light" : "Dark"),
// // onClick: function ()
// // {
// // var callback = function (response)
// // {
// // location.reload();
// // };
// // gutachten_xhr.call_function(
// // callback,
// // "settings_controller",
// // "toggle_theme",
// // );
// // }
// // }));
// if (LOCALSCOPE.uid == 1) {
// // Hermann
// topmenu_right.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-font blau"></i> Font',
// onClick: function () {
// var callback = function (response) {
// alert('Sonderzeichen Gerichted')
// }
// gutachten_xhr.call_function(
// callback,
// 'settings_controller',
// 'sonderzeichen'
// )
// }
// })
// )
// }
// topmenu_right.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="far fa-user blau"></i> ' + LOCALSCOPE.username
// })
// )
// topmenu_right.addChild(new ToolbarSeparator())
// topmenu_right.addChild(
// new MenuBarItem({
// showLabel: true,
// id: 'toggle_help_onoff',
// label:
// LOCALSCOPE.tx_help == 1
// ? '<i class="fa fa-toggle-on nuhhelp"></i> Hilfe An'
// : '<i class="fa fa-toggle-off blau"></i> Hilfe Aus',
// onClick: function () {
// var callback = function (response) {
// LOCALSCOPE.tx_help = response
// if (LOCALSCOPE.tx_help * 1 == 0) {
// dijit
// .byId('toggle_help_onoff')
// .set(
// 'label',
// '<i class="fa fa-toggle-off blau"></i> Hilfe Aus'
// )
// query('.help').forEach(function (node) {
// domClass.add(node, 'help_off')
// domClass.remove(node, 'help_on')
// })
// } else {
// dijit
// .byId('toggle_help_onoff')
// .set(
// 'label',
// '<i class="fa fa-toggle-on nuhhelp"></i> Hilfe An'
// )
// query('.help').forEach(function (node) {
// domClass.add(node, 'help_on')
// domClass.remove(node, 'help_off')
// })
// }
// }
// gutachten_xhr.call_function_text(
// callback,
// 'settings_controller',
// 'toggle_help_onoff'
// )
// }
// })
// )
// topmenu_right.addChild(new ToolbarSeparator())
// topmenu_right.addChild(
// new MenuBarItem({
// showLabel: true,
// style: 'margin-right:10px',
// label: '<i class="fa fa-sign-out-alt blau"></i> Logout',
// onClick: function () {
// xhr('index.php?eID=tx_gutachten', {
// data: {
// logintype: 'logout',
// pid: '53'
// },
// handleAs: 'json',
// method: 'POST'
// }).then(function (data) {
// location.href = 'index.php'
// })
// }
// })
// )
// cp_base_topmenu_right.addChild(topmenu_right)
// dijit.byId('bc_base').addChild(bc_base_topmenu)
}
}
})
@@ -0,0 +1,106 @@
define([
'dojo/_base/array',
'dijit/form/FilteringSelect',
'gutachten/lib/functions',
'dojo/domReady!'
], function (arrayUtil, FilteringSelect, functions) {
return {
load_columns: function () {
var fields = [
{
label: 'Top',
field: 'topNr',
className: 'width-80 center',
unhidable: true,
sortable: true
},
{
label: 'Typ',
field: 'typ',
editor: 'textarea',
autoSelect: true,
unhidable: true,
editorArgs: {
rows: 4,
cols: 50
},
editOn: 'click'
},
{
field: 'orientierung',
editor: FilteringSelect,
unhidable: true,
className: 'width-130 center',
sortable: true,
editOn: 'click',
editorArgs: {
style: 'width: 110px; text-align:center;',
sortByLabel: false,
store: orientierung_store,
searchAttr: 'orientierung',
name: 'orientierung',
labelAttr: 'label',
labelType: 'html'
},
renderHeaderCell: function () { return functions.renderIcon('fas fa-compass', 'Orientierung') }
}
]
arrayUtil.forEach(
[
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u'
],
function (str, index) {
fields.push({
field: str,
id: str,
hidden: true,
editor: 'text',
sortable: true,
autoSelect: true,
renderHeaderCell: function () {
var div = document.createElement('div')
div.className = 'bold'
div.id = str
return div
},
className: 'width-76 center bg-grau no-padding-lr',
editorArgs: {
style: 'width: 64px; text-align: right; margin: auto !important',
tabindex: 2 + index,
maxHeight: -1
}
})
}
)
fields.push(
{
label: 'Summe',
field: 'summe_az',
className: 'center bold',
unhidable: true
}
)
return fields
}
}
})
@@ -0,0 +1,233 @@
define([
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/form/TextBox',
'dstore/Memory',
'dstore/Trackable',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
query,
declare,
ContentPane,
BorderContainer,
MenuBar,
MenuBarItem,
TextBox,
Memory,
Trackable,
gutachten_functions,
gutachten_xhr
) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
FUNCTIONS
******************************************************/
var load_p_allgemeine_alle = (window.load_p_allgemeine_alle =
function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
}
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store_allgemeine_alle = (window.store_allgemeine_alle =
new (declare([Memory, Trackable]))({
data: response,
idProperty: 'id'
}))
grid_allgemeine.set('collection', store_allgemeine_alle)
grid_allgemeine.startup()
grid_allgemeine.resize()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'p_allgemeine_alle',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
function filter_allgemein_menu() {
var filterString = dijit.byId('SearchBox6').get('value')
store_allgemeine_alle_filtered = store_allgemeine_alle.filter(function (
item
) {
var geschoss = item.geschoss.toLowerCase()
var typ = item.typ.toLowerCase()
var qm1 = filterString.replace(',', '.') * 1
var qm2 = qm1 + 1
var qm = item.qm * 1
if (
~geschoss.indexOf(filterString.toLowerCase()) ||
~typ.indexOf(filterString.toLowerCase()) ||
(qm > qm1 && qm <= qm2)
)
return true
else return false
})
grid_allgemeine.set('collection', store_allgemeine_alle_filtered)
grid_allgemeine.refresh()
grid_allgemeine.resize()
}
/******************************************************
auftraggeber
******************************************************/
var p_allgemeine = (window.p_allgemeine = new BorderContainer({
title: '<i class="fa fa-list-ul"></i> Allgemeine Flächen',
design: 'headline',
id: 'p_allgemeine',
splitter: false,
onShow: function () {
load_p_allgemeine_alle()
}
}))
tab_projekte_aktive_center.addChild(p_allgemeine)
var menu_allgemeine = new MenuBar({
region: 'top',
id: 'menu_allgemeine',
splitter: false
})
menu_allgemeine.addChild(
new TextBox({
showLabel: true,
id: 'SearchBox6',
placeHolder: 'Filter Flächen',
class: 'filter-box',
selectOnClick: true,
onKeyUp: function () {
setTimeout(function () {
filter_allgemein_menu()
}, 500)
},
_setSelected: function () {
query('#widget_SearchBox6 div span').style('display', 'none')
}
})
)
menu_allgemeine.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-times" aria-hidden="true"></i>',
onClick: function () {
dijit.byId('SearchBox6').reset()
filter_allgemein_menu()
}
})
)
p_allgemeine.addChild(menu_allgemeine)
var cp_allgemeine_center = (window.cp_allgemeine_center = new ContentPane(
{
id: 'cp_allgemeine_center',
region: 'center'
}
))
p_allgemeine.addChild(cp_allgemeine_center)
var grid_allgemeine = (window.grid_allgemeine =
new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 40,
columns: [
{
field: 'geschoss',
hidden: true,
editor: TextBox,
autoSave: false,
editorArgs: {
style: 'width: 130px;'
},
renderHeaderCell: function () {
var div = document.createElement('div')
div.innerHTML =
'Geschoss' +
gutachten_functions.addToolTip('Bennenung des Geschoss')
return div
}
},
{
field: 'typ',
hidden: true,
editor: TextBox,
autoSave: false,
editorArgs: {
style: 'width: 130px;'
},
renderHeaderCell: function () {
var div = document.createElement('div')
div.innerHTML =
'Raum' +
gutachten_functions.addToolTip('Bennenung des Raumes')
return div
}
},
{
field: 'qm',
hidden: true,
editor: TextBox,
autoSave: false,
editorArgs: {
style: 'width: 130px;'
},
renderHeaderCell: function () {
var div = document.createElement('div')
div.innerHTML =
'qm' + gutachten_functions.addToolTip('Größe in qm')
return div
}
},
{
label: '',
field: 'fake'
}
]
},
'cp_allgemeine_center'
))
grid_allgemeine.on('dgrid-datachange', function (evt) {
// console.log( "data changed: ", evt.oldValue, " -> ", evt.value );
// console.log( "cell: ", evt.cell, evt.cell.row.id );
// console.log( "row: ", evt.cell.column.field );
if (evt.cell.column.field == 'qm') {
evt.value = evt.value.replace(',', '.')
evt.value = evt.value.replace(/[^0-9.]/g, '')
}
gutachten_xhr.call_function(
'',
'update_controller',
'update_allgemein',
'&field=' +
evt.cell.column.field +
'&value=' +
evt.value +
'&rowid=' +
evt.cell.row.id
)
})
}
}
})
@@ -0,0 +1,42 @@
define([
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (ContentPane, BorderContainer, gutachten_functions, gutachten_xhr) {
return {
create: function (tab_projekte_aktive_center) {
var load_p_basis_data = (window.load_p_basis_data = function () {
if (LOCALSCOPE.projekt_aktive == 0) return
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
dijit.byId('cp_basis_center').set('content', response)
}
gutachten_xhr.call_function_text(
callback,
'select_controller',
'projekte_basis_stammdaten',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
var p_basis = (window.p_basis = new BorderContainer({
title: '<i class="far fa-building"></i> Generelle Daten',
design: 'headline',
id: 'p_basis',
splitter: false,
onShow: function () {
load_p_basis_data()
}
}))
tab_projekte_aktive_center.addChild(p_basis)
var cp_basis_center = (window.cp_basis_center = new ContentPane({
id: 'cp_basis_center',
className: 'border-t-40',
region: 'center',
content:
'<div class="nothing-selected">Bitte ein Projekt ausgewählen</div>'
}))
p_basis.addChild(cp_basis_center)
}
}
})
@@ -0,0 +1,131 @@
define([
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/form/Button'
], function (ContentPane, BorderContainer, Button) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
pdf
******************************************************/
var p_pdf = (window.p_pdf = new BorderContainer({
title: '<i class="fa fa-download"></i> Herunterladen',
design: 'headline',
className: 'border-t-40',
id: 'p_pdf',
splitter: false,
onShow: function () { }
}))
tab_projekte_aktive_center.addChild(p_pdf)
p_pdf.addChild(
new ContentPane({
region: 'center',
splitter: false,
style: 'padding:100px 50px;',
content:
'<button id="pdfallg" type="button"></button> <br><br><button id="pdfpara6" type="button"></button> <br><br><button id="pdfnutz" type="button"></button> <br><br><br><br> <button id="excel" type="button"></button><br><br><button id="excel2" type="button"></button>'
})
)
new Button(
{
className: 'download_button',
label:
'<i class="fa fa-file-pdf red mr-5" aria-hidden="true"></i> Standard Text',
onClick: function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
} else {
window.open(
'index.php?eID=tx_gutachten&controller=download_controller&action=pdf_standards&projekt_aktive=' +
LOCALSCOPE.projekt_aktive
)
}
}
},
'pdfallg'
)
new Button(
{
className: 'download_button',
label:
'<i class="fa fa-file-pdf red mr-5" aria-hidden="true"></i> Gutachten gem. §6',
onClick: function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
} else {
window.open(
'index.php?eID=tx_gutachten&controller=download_controller&action=pdf_para6&projekt_aktive=' +
LOCALSCOPE.projekt_aktive
)
}
}
},
'pdfpara6'
)
new Button(
{
className: 'download_button',
label:
'<i class="fa fa-file-pdf red mr-5" aria-hidden="true"></i> Nutzwertberechnung',
onClick: function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
} else {
window.open(
'index.php?eID=tx_gutachten&controller=download_controller&action=pdf_nutzflaechen&projekt_aktive=' +
LOCALSCOPE.projekt_aktive
)
}
}
},
'pdfnutz'
)
new Button(
{
className: 'download_button',
label:
'<i class="fa fa-file-excel mr-5" aria-hidden="true"></i> Nutzflächen & Nutzwerte',
onClick: function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
} else {
window.open(
'index.php?eID=tx_gutachten&controller=download_controller&action=excel_nutzflaechen&projekt_aktive=' +
LOCALSCOPE.projekt_aktive
)
}
}
},
'excel'
)
new Button(
{
className: 'download_button',
label:
'<i class="fa fa-file-excel mr-5" aria-hidden="true"></i> Nutzflächen Aufstellung',
onClick: function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
} else {
window.open(
'index.php?eID=tx_gutachten&controller=download_controller&action=excel_aufstellung&projekt_aktive=' +
LOCALSCOPE.projekt_aktive
)
}
}
},
'excel2'
)
}
}
})
@@ -0,0 +1,449 @@
define([
'dojo/_base/array',
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/Menu',
'dijit/MenuItem',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/DropDownMenu',
'dijit/PopupMenuBarItem',
'dijit/ToolbarSeparator',
'dijit/form/TextBox',
"dijit/Tooltip",
"dgrid/OnDemandGrid",
"dgrid/Selection",
"dgrid/Selector",
'dgrid/Editor',
'dstore/Memory',
'dojo/store/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr',
], function (
arrayUtil,
query,
declare,
ContentPane,
BorderContainer,
Menu,
MenuItem,
MenuBar,
MenuBarItem,
DropDownMenu,
PopupMenuBarItem,
ToolbarSeparator,
TextBox,
Tooltip,
OnDemandGrid,
Selection,
Selector,
Editor,
Memory,
LegacyMemory,
gutachten_functions,
gutachten_xhr,
) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
FUNCTIONS
******************************************************/
function saveButtonStatusMethoden(status) {
if (status == 1) {
dijit.byId('save-button-methoden').set('disabled', 0)
dijit.byId('reply-button-methoden').set('disabled', 0)
} else {
dijit.byId('save-button-methoden').set('disabled', 1)
dijit.byId('reply-button-methoden').set('disabled', 1)
}
}
var load_methoden_projekt = (window.load_methoden_projekt = function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
}
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store_methoden_projekt = (window.store_methoden_projekt =
new (declare([Memory]))({
data: response,
idProperty: 'id'
}))
var filter_f = store_methoden_projekt.sort('raumart_id')
grid_methoden.set('collection', filter_f)
grid_methoden.startup()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'load_methoden_projekt',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
function loadMethoden() {
var callback = function (response) {
if (LOCALSCOPE.projekt_aktive == 0) return
var pSubMenu = new Menu()
arrayUtil.forEach(response, function (item) {
pSubMenu.addChild(
new MenuItem({
label: '<div class="lparent"><div class="width-80">' + item.raumart + '</div><div class="center width-30">' + gutachten_functions.addToolTip(item.erklaerung) + '</div>',
onClick: function () {
setSelectedToMethod(item.id)
}
})
)
})
dijit.byId('methoden_filter_popup').set('popup', pSubMenu)
}
gutachten_xhr.call_function(
callback,
'select_controller',
'load_methoden',
'&id=' + LOCALSCOPE.projekt_aktive
)
}
function loadAufstellungTitel() {
var callback = function (response) {
if (LOCALSCOPE.projekt_aktive == 0) return
var pSubMenu = new Menu()
pSubMenu.addChild(
new MenuItem({
label: '<div class= "dijitSelectLabel">Zurücksetzen</div>',
onClick: function () {
setSelectedToAufstellung(0)
}
})
)
arrayUtil.forEach(response, function (item) {
pSubMenu.addChild(
new MenuItem({
label: '<div class= "dijitSelectLabel">' + item.titel + '</div>',
onClick: function () {
setSelectedToAufstellung(item.id)
}
})
)
})
dijit.byId('aufstellung_filter_popup').set('popup', pSubMenu)
}
gutachten_xhr.call_function(
callback,
'select_controller',
'load_aufstellung',
)
}
function filter_methoden_menu() {
var filterString = dijit.byId('SearchBox3').get('value')
store_methoden_projekt_filtered = store_methoden_projekt.filter(
function (item) {
var raumart = item.raumart.toLowerCase()
var raum = item.raum.toLowerCase()
var factor = filterString.replace(',', '.') * 1
var factor1 = item.factor * 1
if (
~raumart.indexOf(filterString.toLowerCase()) ||
~raum.indexOf(filterString.toLowerCase()) ||
factor == factor1
)
return true
else return false
}
)
grid_methoden.set('collection', store_methoden_projekt_filtered)
grid_methoden.startup()
}
function selektierungAufheben() {
grid_methoden.clearSelection()
}
function setSelectedToMethod(methodid) {
var items = []
for (var id in grid_methoden.selection) {
if (grid_methoden.selection[id]) {
items.push(id)
}
}
if (items.length > 0) {
gutachten_xhr.post_function(
load_methoden_projekt,
'update_controller',
'update_method_many',
items,
'&methodid=' + methodid
)
}
}
function setSelectedToAufstellung(aufstellung_id) {
let items = []
for (var id in grid_methoden.selection) {
if (grid_methoden.selection[id]) {
items.push(id)
}
}
if (items.length) {
var callback = function (response) {
load_methoden_projekt()
}
gutachten_xhr.post_function(
callback,
'update_controller',
'update_austellung_many',
items,
'&aufstellung_id=' + aufstellung_id
)
}
}
var callback = function (response) {
window.methoden_store = new LegacyMemory({
data: response
})
var SelectionGrid = declare([OnDemandGrid, Selection, Selector, Editor]);
window.grid_methoden =
new SelectionGrid(
{
selectionMode: 'multiple',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 20,
columns: [
{
label: '',
field: 'checkbox',
selector: 'checkbox',
className: 'width-icon'
},
{
field: 'zunutzwert',
className: 'width-110 center',
sortable: false,
className: 'width-icon',
renderCell: function (object, data) {
// && object.zunutzwert == 1)
if (object.raumart_id == 2 || object.raumart_id == 8)
return gutachten_functions.renderIcon('fa fa-check-square')
},
renderHeaderCell: function () { return gutachten_functions.renderText('G', 'Räumen der Methode 2 oder 2b<br>werden der Gesamtnutzfläche zugeordnet.') }
},
{
field: 'factor',
hidden: true,
className: 'orientation',
editor: TextBox,
autoSave: true,
className: 'width-110',
editorArgs: {
style: 'width: 60px;'
},
renderHeaderCell: function () { return gutachten_functions.renderText('Factor', 'Modifikationsfaktor der zu berechnenten Räum.<br>Faktoren für Objekte die nicht mit Methode 1<br>belegt sind können nicht 0 sein!') }
},
{
label: 'Raum',
field: 'raum'
},
{
label: 'Methode',
field: 'raumart'
},
{
label: 'Aufstellung Titel',
field: 'aufstellung'
}
]
},
'cp_methoden'
)
grid_methoden.on('dgrid-datachange', function (evt) {
saveButtonStatusMethoden(1)
})
}
gutachten_xhr.call_function(
callback,
'select_controller',
'load_methoden_for_select'
)
/******************************************************
layout
******************************************************/
var p_methoden = (window.p_methoden = new BorderContainer({
title: '<i class="fa fa-calculator"></i> Methoden',
design: 'headline',
id: 'p_methoden',
splitter: false,
onShow: function () {
load_methoden_projekt()
loadMethoden()
loadAufstellungTitel()
}
}))
tab_projekte_aktive_center.addChild(p_methoden)
var menu_methoden = new MenuBar({
id: 'menu_methoden',
region: 'top',
splitter: false
})
menu_methoden.addChild(
new TextBox({
showLabel: true,
id: 'SearchBox3',
class: 'filter-box',
placeHolder: 'Raum/Methode',
selectOnClick: true,
onKeyUp: function () {
setTimeout(function () {
LOCALSCOPE.filter_field = 'search'
filter_methoden_menu()
}, 500)
},
_setSelected: function () {
query('#widget_SearchBox3 div span').style('display', 'none')
}
})
)
menu_methoden.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-times" aria-hidden="true"></i>',
onClick: function () {
dijit.byId('SearchBox3').reset()
filter_methoden_menu()
}
})
)
menu_methoden.addChild(new ToolbarSeparator())
menu_methoden.addChild(
new PopupMenuBarItem({
id: 'methoden_filter_popup',
label:
'<i class="fa fa-caret-down"></i> Methode' +
gutachten_functions.addToolTip(
'Ordnet die gewählte Methode den selektierten Räumen zu.'
),
popup: new DropDownMenu({
region: 'top'
})
})
)
menu_methoden.addChild(new ToolbarSeparator())
menu_methoden.addChild(
new PopupMenuBarItem({
id: 'aufstellung_filter_popup',
label:
'<i class="fa fa-caret-down"></i> Aufstellung Titel' +
gutachten_functions.addToolTip(
'Ordnet den gewählten Titel den selektierten Räumen zu.'
),
popup: new DropDownMenu({
region: 'top'
})
})
)
menu_methoden.addChild(new ToolbarSeparator())
menu_methoden.addChild(
new MenuBarItem({
showLabel: true,
label: 'Reset',
onClick: function () {
selektierungAufheben()
}
})
)
menu_methoden.addChild(new ToolbarSeparator());
menu_methoden.addChild(
new MenuBarItem({
showLabel: true,
label: 'Abgleichen' + gutachten_functions.addToolTip(
'Abgleichen der Methoden Tabelle mit Objekte im Detail, fehlende Elemente werden hinzugefügt'
),
onClick: function () {
var callback = function () {
load_methoden_projekt()
saveButtonStatusMethoden(0)
}
gutachten_xhr.call_function(
callback,
'update_controller',
'abgleich_raume_generell',
'&id=' + LOCALSCOPE.projekt_aktive
)
}
})
)
menu_methoden.addChild(new ToolbarSeparator());
menu_methoden.addChild(
new MenuBarItem({
showLabel: true,
id: 'save-button-methoden',
disabled: 1,
label: '<i class="fa fa-save rot"></i> Änderungen Sichern',
onClick: function () {
grid_orientierung_typen.save()
// evt.value = evt.value.replace(",", ".");
// evt.value = evt.value.replace(/[^0-9.]/g, "");
var callback = function () {
load_methoden_projekt()
saveButtonStatusMethoden(0)
}
gutachten_xhr.post_function(
callback,
'update_controller',
'update_methoden_projekt_factoren',
store_methoden_projekt.data
)
}
})
)
menu_methoden.addChild(new ToolbarSeparator());
menu_methoden.addChild(
new MenuBarItem({
showLabel: true,
id: 'reply-button-methoden',
disabled: 1,
label: '<i class="fa fa-reply"></i> Zurücksetzen',
onClick: function () {
load_methoden_projekt()
saveButtonStatusMethoden(0)
}
})
)
var cp_methoden = (window.cp_methoden = new ContentPane({
id: 'cp_methoden',
region: 'center',
splitter: false
}))
p_methoden.addChild(cp_methoden)
p_methoden.addChild(menu_methoden)
}
}
})
@@ -0,0 +1,116 @@
define([
'dijit/layout/BorderContainer',
'dijit/Editor',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/ToolbarSeparator',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
BorderContainer,
Editor,
MenuBar,
MenuBarItem,
ToolbarSeparator,
gutachten_functions,
gutachten_xhr
) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
FUNCTIONS
******************************************************/
var botton_status = (window.botton_status = function (value) {
dijit.byId('reload-notizen').set('disabled', value)
dijit.byId('save-notizen').set('disabled', value)
})
var load_p_notizen_data = (window.load_p_notizen_data = function () {
if (LOCALSCOPE.projekt_aktive == 0) return
botton_status(1)
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
dijit.byId('cp_notizen_center').set('value', response)
}
gutachten_xhr.call_function_text(
callback,
'select_controller',
'p_notizen_alle',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
/******************************************************
auftraggeber
******************************************************/
var p_notizen = (window.p_notizen = new BorderContainer({
title: '<i class="far fa-file-alt"></i> Notizen',
design: 'headline',
id: 'p_notizen',
splitter: false,
className: 'border-t-40',
onShow: function () {
load_p_notizen_data()
}
}))
tab_projekte_aktive_center.addChild(p_notizen)
var menu_notizen = new MenuBar({
region: 'top',
id: 'menu_notizen',
className: 'center',
splitter: false
})
menu_notizen.addChild(
new MenuBarItem({
showLabel: true,
disabled: 1,
id: 'reload-notizen',
label: '<i class="fa fa-reply"></i> Letzte Version',
onClick: function () {
load_p_notizen_data()
}
})
)
menu_notizen.addChild(new ToolbarSeparator())
menu_notizen.addChild(
new MenuBarItem({
showLabel: true,
id: 'save-notizen',
disabled: 1,
label: '<i class="fa fa-save rot"></i> Änderungen Sichern',
onClick: function () {
if (LOCALSCOPE.projekt_aktive > 0) {
botton_status(1)
var value = dijit.byId('cp_notizen_center').get('value')
gutachten_xhr.post_function(
'',
'update_controller',
'update_notizen',
value,
'&id=' + LOCALSCOPE.projekt_aktive
)
}
}
})
)
p_notizen.addChild(menu_notizen)
var cp_notizen_center = (window.cp_notizen_center = new Editor({
id: 'cp_notizen_center',
className: 'margin-50-lr',
style: "height: 400px; width 700px;",
region: 'center',
onClick: function () {
botton_status(0)
}
}))
p_notizen.addChild(cp_notizen_center)
}
}
})
@@ -0,0 +1,331 @@
define([
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/form/TextBox',
'dstore/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
query,
declare,
ContentPane,
BorderContainer,
MenuBar,
MenuBarItem,
TextBox,
Memory,
gutachten_functions,
gutachten_xhr
) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
FUNCTIONS
******************************************************/
function filter_object_menu() {
var filterString = dijit.byId('SearchBox5').get('value')
var filter_f
if (filterString != '') {
filter_f = store_objekte_alle.filter(function (object) {
if (object.show == 1) {
var topNr = object.topNr.toLowerCase()
if (~topNr.indexOf(filterString.toLowerCase())) return true
}
})
} else {
var filter_f = store_objekte_alle
.filter({
show: 1
})
.sort('topNr')
}
grid_objects_menu.set('collection', filter_f)
grid_objects_menu.startup()
grid_objects_menu.refresh()
grid_objects_menu.resize()
}
var load_p_objekte_alle = (window.load_p_objekte_alle = function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Bitte Projekt auswählen')
return
}
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
window.store_objekte_alle = new (declare([
Memory
]))({
data: response,
idProperty: 'id'
})
filter_object_menu()
if (LOCALSCOPE.object_selected) {
store_objekte_filter(LOCALSCOPE.object_selected)
}
}
gutachten_xhr.call_function(
callback,
'select_controller',
'p_objekte_alle',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
function store_objekte_filter(tt_raume_basis_id) {
LOCALSCOPE.object_selected = tt_raume_basis_id
grid_objects_menu.refresh()
var filter_f = store_objekte_alle.filter({
tt_raume_basis_id: LOCALSCOPE.object_selected
})
grid_objects_detail.set('collection', filter_f)
grid_objects_detail.startup()
grid_objects_detail.refresh()
}
/*
*
*/
LOCALSCOPE.object_selected = 0
/******************************************************
layout
******************************************************/
var p_objekte = (window.p_objekte = new BorderContainer({
title: '<i class="far fa-object-group"></i> Objekte im Detail',
design: 'headline',
id: 'p_objekte',
splitter: false,
onShow: function () {
load_p_objekte_alle()
}
}))
tab_projekte_aktive_center.addChild(p_objekte)
var menu_objects = new MenuBar({
region: 'top',
id: 'menu_objects',
splitter: false
})
menu_objects.addChild(
new TextBox({
showLabel: true,
id: 'SearchBox5',
class: 'filter-box',
placeHolder: 'Filter Top Nr.',
selectOnClick: true,
onKeyUp: function () {
setTimeout(function () {
filter_object_menu()
}, 500)
},
_setSelected: function () {
query('#widget_SearchBox5 div span').style('display', 'none')
}
})
)
menu_objects.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-times" aria-hidden="true"></i>',
onClick: function () {
dijit.byId('SearchBox5').reset()
filter_object_menu()
}
})
)
p_objekte.addChild(menu_objects)
/******************************************************
grids
******************************************************/
var grid_objects_menu = (window.grid_objects_menu =
new CellSelectionPaginationGrid({
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 0,
pagingTextBox: 0,
firstLastArrows: 0,
previousNextArrows: 0,
rowsPerPage: 1000,
columns: [
{
field: 'delete',
label: ' ',
className: 'width-icon',
renderCell: function () {
return gutachten_functions.renderIcon('far fa-trash-alt')
},
},
{
field: 'topNr',
label: 'Top Nr'
},
{
field: 'arrow',
className: 'width-icon',
label: '',
renderCell: function (object, data, td) {
if (object.tt_raume_basis_id == LOCALSCOPE.object_selected) {
td.className += ' dgrid-selected'
return gutachten_functions.renderIcon('fa fa-arrow-circle-right')
} else {
return gutachten_functions.renderIcon('far fa-circle')
}
}
}
]
}))
grid_objects_menu.on('.dgrid-content .dgrid-cell:click', function (evt) {
var cell = grid_objects_menu.cell(evt)
var field = cell.column.field
var item = grid_objects_menu.row(evt)
switch (field) {
case 'arrow':
store_objekte_filter(item.data.tt_raume_basis_id)
break
case 'delete':
if (confirm('Objekt löschen?')) {
var callback = function (response) {
store_objekte_alle.remove(item.id)
grid_objects_detail.set('collection', new Memory())
grid_objects_detail.refresh()
grid_objects_menu.refresh()
}
gutachten_xhr.call_function(
callback,
'delete_controller',
'delete_raumart_von_basis',
'&id=' + item.data.tt_raume_basis_id
)
}
break
}
})
// // topNr, raum, geschoss, factor, m2, NW einzel
var grid_objects_detail = (window.grid_objects_detail =
new CellSelectionPaginationGrid({
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 0,
pagingTextBox: 0,
firstLastArrows: 0,
previousNextArrows: 0,
rowsPerPage: 1000,
columns: [
{
label: 'Top Nr',
field: 'topNr'
},
{
label: 'Raum',
field: 'raum'
},
{
field: 'geschoss',
editor: TextBox,
autoSave: false,
editorArgs: {
style: 'width: 80px;'
},
},
{
field: 'factor',
editor: TextBox,
autoSave: false,
editorArgs: {
style: 'width: 80px;'
},
},
{
field: 'qm',
editor: TextBox,
autoSave: false,
editorArgs: {
style: 'width: 80px;'
},
},
{
field: 'NW',
renderHeaderCell: function () { return gutachten_functions.renderText('NW', 'Nutzwerte') }
},
{
field: 'delete',
sortable: false,
className: 'width-icon',
renderCell: function () {
return gutachten_functions.renderIcon('far fa-trash-alt')
},
renderHeaderCell: function () {
return gutachten_functions.renderIcon('fas fa-trash-alt')
},
}
]
}))
grid_objects_detail.on('dgrid-datachange', function (evt) {
// console.log( "data changed: ", evt.oldValue, " -> ", evt.value );
// console.log( "cell: ", evt.cell, evt.cell.row.id );
// console.log( "row: ", evt.cell.column.field );
gutachten_xhr.call_function(
load_p_objekte_alle,
'update_controller',
'update_raume_all',
'&field=' +
evt.cell.column.field +
'&value=' +
evt.value +
'&rowid=' +
evt.cell.row.id
)
})
grid_objects_detail.on(
'.dgrid-content .dgrid-cell:click',
function (evt) {
var cell = grid_objects_detail.cell(evt)
var field = cell.column.field
var item = grid_objects_detail.row(evt)
if (field == 'delete') {
gutachten_xhr.delete_uid(
load_p_objekte_alle,
'tx_gutachten_raume_all',
item.id
)
}
}
)
var cp_objects_left = (window.cp_objects_left = new ContentPane({
id: 'cp_objects_left',
region: 'left',
content: grid_objects_menu
}))
p_objekte.addChild(cp_objects_left)
var cp_objects_center = (window.cp_objects_center = new ContentPane({
id: 'cp_objects_center',
region: 'center',
content: grid_objects_detail
}))
p_objekte.addChild(cp_objects_center)
}
}
})
@@ -0,0 +1,465 @@
define([
'dojo/_base/declare',
'dojo/dom',
'dojo/dom-style',
'dojo/_base/array',
'dojo/query',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/form/TextBox',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dstore/Memory',
'dstore/Trackable',
'dojo/store/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr',
'gutachten/projekte/columnsets/cs_orientierung_typen',
'dojox/widget/Standby'
], function (
declare,
dom,
domStyle,
arrayUtil,
query,
ContentPane,
BorderContainer,
TextBox,
MenuBar,
MenuBarItem,
Memory,
Trackable,
LegacyMemory,
gutachten_functions,
gutachten_xhr,
cs_orientierung_typen,
Standby
) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
FUNCTIONS
******************************************************/
function filter_orientierung_typen() {
var orientierung_typen_filtered
if (LOCALSCOPE.filter_field == 'search') {
var filterString = dijit.byId('SearchBox2').get('value')
orientierung_typen_filtered = store_orientierung_typen_einzel.filter(
function (object) {
var topNr = object.topNr.toLowerCase()
var typ = object.typ
if (typ != null) {
typ = typ.toLowerCase()
} else {
typ = 'null'
}
if (
~topNr.indexOf(filterString.toLowerCase()) ||
~typ.indexOf(filterString.toLowerCase())
)
return true
else return false
}
)
grid_orientierung_typen.set('collection', orientierung_typen_filtered)
} else {
grid_orientierung_typen.set(
'collection',
store_orientierung_typen_einzel
)
}
grid_orientierung_typen.startup()
grid_orientierung_typen.refresh()
}
function saveButtonStatus(status) {
if (status == 1) {
dijit.byId('save-button').set('disabled', 0)
dijit.byId('reply-button').set('disabled', 0)
} else {
dijit.byId('save-button').set('disabled', 1)
dijit.byId('reply-button').set('disabled', 1)
}
}
var load_orientierung_typen_colums =
(window.load_orientierung_typen_colums = function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
}
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store_colums_einzel = (window.store_colums_einzel =
new (declare([Memory, Trackable]))({
data: response,
idProperty: 'id'
}))
grid_colums.set('collection', store_colums_einzel)
grid_colums.startup()
arrayUtil.forEach(store_colums_einzel.data, function (item) {
var ele = dom.byId(item.colid)
if (ele != undefined) {
ele.innerHTML = item.pos
}
})
}
gutachten_xhr.call_function(
callback,
'select_controller',
'orientierung_typen_colums_einzel',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
var load_orientierung_typen = (window.load_orientierung_typen =
function () {
orientStandby.show()
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
window.store_orientierung_typen_einzel = new (declare([Memory]))(
{
data: response,
idProperty: 'id'
}
)
filter_orientierung_typen()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'orientierung_typen_einzel',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
var hide_orientation_alle = (window.hide_orientation_alle = function () {
arrayUtil.forEach(
[
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u'
],
function (item) {
grid_orientierung_typen.toggleColumnHiddenState(item, 1)
}
)
})
var load_orientation_alle = (window.load_orientation_alle =
function () { })
/******************************************************
layout
******************************************************/
var p_orientierung_typen = (window.p_methoden = new BorderContainer({
title: '<i class="far fa-compass"></i> Orientierung & Typen',
design: 'headline',
id: 'p_orientierung_typen',
splitter: false,
onShow: function () {
load_orientierung_typen()
load_orientierung_typen_colums()
}
}))
tab_projekte_aktive_center.addChild(p_orientierung_typen)
/******************************************************
menu
******************************************************/
var menu_orient_typen = new MenuBar({
region: 'top',
id: 'menu_orient_typen',
splitter: false
})
menu_orient_typen.addChild(
new TextBox({
showLabel: true,
id: 'SearchBox2',
class: 'filter-box',
placeHolder: 'Filter',
selectOnClick: true,
onKeyUp: function () {
setTimeout(function () {
LOCALSCOPE.filter_field = 'search'
filter_orientierung_typen()
}, 500)
},
_setSelected: function () {
query('#widget_SearchBox2 div span').style('display', 'none')
}
})
)
menu_orient_typen.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-times"></i>',
onClick: function () {
dijit.byId('SearchBox2').reset()
LOCALSCOPE.filter_field = ''
filter_orientierung_typen()
}
})
)
// menu_orient_typen.addChild(new ToolbarSeparator());
menu_orient_typen.addChild(
new MenuBarItem({
showLabel: true,
id: 'save-button',
style: 'margin-left: 70px',
disabled: 1,
label: '<i class="fa fa-save rot"></i> Änderungen Sichern',
onClick: function () {
grid_orientierung_typen.save()
// evt.value = evt.value.replace(",", ".");
// evt.value = evt.value.replace(/[^0-9.]/g, "");
var callback = function () {
load_orientierung_typen()
saveButtonStatus(0)
}
gutachten_xhr.post_function(
callback,
'update_controller',
'update_raeume_alle_orientierung',
store_orientierung_typen_einzel.data
)
}
})
)
menu_orient_typen.addChild(
new MenuBarItem({
showLabel: true,
id: 'reply-button',
style: 'margin-left: 10px',
disabled: 1,
label: '<i class="fa fa-reply"></i> Zurücksetzen',
onClick: function () {
load_orientierung_typen()
saveButtonStatus(0)
}
})
)
p_orientierung_typen.addChild(menu_orient_typen)
var cp_orientierung_typen = (window.cp_orientierung_typen =
new ContentPane({
id: 'cp_orientierung_typen',
region: 'center',
splitter: false
}))
p_orientierung_typen.addChild(cp_orientierung_typen)
var cp_orientierung_typen_colums = (window.cp_orientierung_typen_colums =
new ContentPane({
id: 'cp_orientierung_typen_colums',
region: 'right',
splitter: false
}))
p_orientierung_typen.addChild(cp_orientierung_typen_colums)
/******************************************************
grid data
******************************************************/
// id,pid,topNr,typ,tt_orientierung_id,noDispInOrientierung,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,summe_az,bewertung,notizen
var callback = function (response) {
window.orientierung_store = new LegacyMemory({
data: response
})
var grid_orientierung_typen = (window.grid_orientierung_typen =
new CellSelectionPaginationColumnHiderGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 1000,
columns: cs_orientierung_typen.load_columns()
},
'cp_orientierung_typen'
))
grid_orientierung_typen.on('dgrid-datachange', function (evt) {
saveButtonStatus(1)
})
grid_orientierung_typen.on('dgrid-refresh-complete', function (event) {
orientStandby.hide()
})
window.orientStandby = new Standby({
target: 'cp_orientierung_typen',
opacity: 0.5,
text: '<i class="fas fa-spinner fa-spin fa-4x blau"></i>',
centerIndicator: 'text',
region: 'center',
zIndex: 1001
})
document.body.appendChild(orientStandby.domNode)
orientStandby.startup()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'load_orientation_for_select'
)
/******************************************************
GRID COLUMS
******************************************************/
var grid_colums = (window.grid_colums = new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 40,
// renderRow: function (object) {
// var rowElement = this.inherited(arguments)
// rowElement.className += ' bg-grau'
// return rowElement
// },
columns: [
{
label: ' ',
field: 'show',
className: 'width-icon',
sortable: false,
renderCell: function (object, data) {
return gutachten_functions.renderToggle(data, '', 1)
},
},
{
label: 'ID',
field: 'pos',
className: 'width-50 center bold',
sortable: false,
renderCell: function (object, data) {
return gutachten_functions.renderPos(data)
}
},
{
label: 'Faktor Merkmal',
field: 'coltitel',
sortable: false,
editor: 'text',
editOn: 'click'
},
{
label: ' ',
field: 'delete',
className: 'width-icon',
sortable: false,
renderCell: function () {
return gutachten_functions.renderIcon('fas fa-trash-alt')
},
renderHeaderCell: function () {
return gutachten_functions.renderIcon('fas fa-plus')
},
}
]
},
'cp_orientierung_typen_colums'
))
grid_colums.on('.dgrid-content .dgrid-cell:click', function (evt) {
var cell = grid_colums.cell(evt)
var field = cell.column.field
var item = grid_colums.row(evt)
switch (field) {
case 'delete':
var callback = function (response) {
hide_orientation_alle()
load_orientierung_typen()
load_orientierung_typen_colums()
}
gutachten_xhr.call_function(
callback,
'delete_controller',
'delete_merkmal',
'&id=' + item.id
)
break
case 'show':
if (item.data.colid != undefined) {
grid_orientierung_typen.toggleColumnHiddenState(item.data.colid)
}
store_colums_einzel
.filter({
id: item.id
})
.forEach(function (object) {
object.show = object.show == 1 ? 0 : 1
store_colums_einzel.put(object)
})
break
}
})
grid_colums.on('dgrid-datachange', function (evt) {
var item = evt.cell.row.data
var callback = function (response) {
load_orientierung_typen_colums()
}
gutachten_xhr.call_function(
callback,
'update_controller',
'update_orientierung_typen_colums',
'&id=' + item.id + '&value=' + evt.value
)
})
grid_colums.on('.dgrid-header .dgrid-cell:click', function (event) {
var cell = grid_colums.cell(event)
if (cell.column.field == 'delete') {
var callback = function (response) {
load_orientierung_typen_colums()
}
gutachten_xhr.call_function(
callback,
'insert_controller',
'neues_merkmal',
'&projektid=' + LOCALSCOPE.projekt_aktive
)
}
})
}
}
})
@@ -0,0 +1,118 @@
define([
"dojo/_base/declare",
"dijit/layout/ContentPane",
"dijit/layout/BorderContainer",
"dstore/Memory",
"gutachten/lib/functions",
"gutachten/lib/xhr"
], function (
declare,
ContentPane,
BorderContainer,
Memory,
gutachten_functions,
gutachten_xhr
) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
FUNCTIONS
******************************************************/
var load_platzhalter_einzeln = (window.load_platzhalter_einzeln = function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert("Kein Projekt ausgewählt");
return;
}
var callback = function (response) {
gutachten_functions.checkSessionExpired(response);
var store_platzhalter = (window.store_platzhalter = new (declare(
[Memory]
))({
data: response,
idProperty: "id"
}));
grid_platzhalter.set("collection", store_platzhalter);
grid_platzhalter.startup();
};
gutachten_xhr.call_function(
callback,
"select_controller",
"platzhalter_einzeln",
"&id=" + LOCALSCOPE.projekt_aktive
);
});
/******************************************************
platzhalter
******************************************************/
var p_platzhalter = (window.p_platzhalter = new BorderContainer({
title: '<i class="fa fa-hashtag"></i> Platzhalter',
design: "headline",
id: "p_platzhalter",
splitter: false,
onShow: function () {
load_platzhalter_einzeln();
}
}));
tab_projekte_aktive_center.addChild(p_platzhalter);
var cp_platzhalter = (window.cp_platzhalter = new ContentPane({
id: "cp_platzhalter",
region: "center",
splitter: false
}));
p_platzhalter.addChild(cp_platzhalter);
var grid_platzhalter = (window.grid_platzhalter = new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: "single",
keepScrollPosition: 1,
idProperty: "id",
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 40,
columns: [
{
label: "Platzhalter",
field: "code",
className: "width-300"
},
{
label: "",
field: "blind",
className: "width-icon",
renderCell: function (object, data) { return gutachten_functions.renderIcon('fas fa-exchange-alt') },
},
{
label: 'Austausch Text',
field: "txt",
sortable: false,
editor: "textarea",
editorArgs: {
rows: 4,
cols: 50
},
editOn: "click"
}
]
},
"cp_platzhalter"
));
grid_platzhalter.on("dgrid-datachange", function (evt) {
var item = evt.cell.row.data;
gutachten_xhr.call_function(
load_platzhalter_einzeln,
"update_controller",
"update_project_platzhalter",
"&value=" + evt.value + "&rowid=" + item.id
);
});
}
};
});
@@ -0,0 +1,463 @@
define([
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/form/Select',
'dijit/Editor',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/ConfirmDialog',
'dstore/Memory',
'dstore/legacy/DstoreAdapter',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
declare,
ContentPane,
BorderContainer,
Select,
TextEditor,
MenuBar,
MenuBarItem,
ConfirmDialog,
Memory,
DstoreAdapter,
gutachten_functions,
gutachten_xhr
) {
return {
create: function (tab_projekte_aktive_center) {
/******************************************************
FUNCTIONS
******************************************************/
function move_standard_einzeln(move, id, pid) {
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
load_standard_einzeln()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'move_position',
'&id=' + id + '&pid=' + pid + '&move=' + move
)
}
var load_standard_einzeln = (window.load_standard_einzeln = function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
}
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store_standard_active = (window.store_standard_active =
new (declare([Memory]))({
data: response,
idProperty: 'id'
}))
grid_standards.set('collection', store_standard_active)
grid_standards.startup()
grid_standards.resize()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'standards_einzeln',
'&id=' + LOCALSCOPE.projekt_aktive
)
})
function edit_add_StandardDialog() {
var callback = function (response) {
var myEditor = new TextEditor({
height: '600px',
id: 'editor_standard_fliestext',
plugins: [
'undo',
'redo',
'copy',
'paste',
'selectAll',
'bold',
'italic',
'underline',
'removeFormat'
]
})
var bc = new BorderContainer({
design: 'headline',
id: 'bc',
splitter: false,
style: 'height:580px'
})
var menu_textart = new MenuBar({
region: 'top',
style: 'margin-bottom:15px;'
})
menu_textart.addChild(
new MenuBarItem({
label: 'Textart:',
style: 'text-align: left; padding-left:0; width:75px;'
})
)
var textartStore = new DstoreAdapter(
new Memory({
idProperty: 'id',
data: response
})
)
var select = new Select({
id: 'textartSelect',
name: 'textartSelect',
_setSelected: function () { },
store: textartStore,
style: 'text-align:left;',
labelAttr: 'name',
maxHeight: -1, // tells _HasDropDown to fit menu within viewport
onChange: function (value) {
// console.log( "value", value );
// console.log( "this.get('displayedValue')", this.get( 'displayedValue' ) );
LOCALSCOPE.textart_id = value
}
})
menu_textart.addChild(select)
bc.addChild(menu_textart)
bc.addChild(
new ContentPane({
region: 'top',
id: 'cp_kennung',
style: 'margin-bottom:5px;',
content:
'Kennung: <input style="width:450px; height: 29px; line-height: 34px; margin-left:12px;" type="text" name="kennung" value="" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, propercase:true" id="kennung" />'
})
)
bc.addChild(
new ContentPane({
region: 'top',
id: 'cp_ueberschrift',
content:
'Überschrift:<input style="width:450px; height: 29px; line-height: 34px; margin-left:2px;" type="text" name="ueberschrift" value="" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, propercase:true" id="ueberschrift" />'
})
)
bc.addChild(
new ContentPane({
region: 'center',
style: 'margin-top:20px; line-height: 1.6em !important;',
content: myEditor
})
)
var menu_save = new MenuBar({
region: 'bottom',
style: 'margin:5px; text-align: right;'
})
bc.addChild(menu_save)
// menu_save.addChild(
// new MenuBarItem({
// id: 'sichernbutton',
// label: 'Sichern',
// style:
// 'user-select: none; width: 148px; background: #0089df; text-align: center; color: #fff; font-weight: bold; padding: 0px;',
// onClick: function () {
// if (!LOCALSCOPE.textart_id) {
// alert('Textart Wählen')
// return false
// }
// dijit
// .byId('sichernbutton')
// .set('label', '<i class="fa fa-cog fa-spin"></i> Sichern')
// var item = []
// item.push({
// txt: dijit.byId('editor_standard_fliestext').get('value')
// })
// item.push({
// titel: dijit.byId('ueberschrift').get('value')
// })
// item.push({
// kennung: dijit.byId('kennung').get('value')
// })
// item.push({
// textart_id: LOCALSCOPE.textart_id
// })
// if (LOCALSCOPE.mode == 'edit') {
// if (!gutachten_functions.isNumeric(LOCALSCOPE.id))
// return false
// gutachten_xhr.post_function(
// load_standard_einzeln,
// 'update_controller',
// 'update_projektestandards',
// item,
// '&rowid=' + LOCALSCOPE.id
// )
// } else if (LOCALSCOPE.mode == 'add') {
// gutachten_xhr.post_function(
// load_standard_einzeln,
// 'insert_controller',
// 'add_row',
// item,
// 'berechnen=1&table=tx_gutachten_projektestandards'
// )
// }
// }
// })
// )
return new ConfirmDialog({
id: 'editor_standard',
region: 'center',
title: 'Bearbeiten',
className: 'width-600 border-black',
content: bc,
onShow: function () {},
onCancel: function () { },
onExecute: function () {
if (!gutachten_functions.isNumeric(LOCALSCOPE.textart_id))
return false
var item = []
item.push({
txt: dijit.byId('editor_standard_fliestext').get('value')
})
item.push({
titel: dijit.byId('ueberschrift').get('value')
})
item.push({
kennung: dijit.byId('kennung').get('value')
})
item.push({
textart_id: LOCALSCOPE.textart_id
})
if (LOCALSCOPE.mode == 'edit') {
if (!gutachten_functions.isNumeric(LOCALSCOPE.id)) {
return false
}
gutachten_xhr.post_function(
load_standard_einzeln,
'update_controller',
'update_projektestandards',
item,
'&rowid=' + LOCALSCOPE.id
)
} else if (LOCALSCOPE.mode == 'add') {
gutachten_xhr.post_function(
load_standard_einzeln,
'insert_controller',
'add_row',
item,
'berechnen=1&table=tx_gutachten_projektestandards'
)
}
}
})
}
gutachten_xhr.call_function(
callback,
'select_controller',
'textart_alle'
)
}
/******************************************************
Standards
******************************************************/
edit_add_StandardDialog()
/******************************************************
standard element for PDF layout
******************************************************/
var p_standards = (window.p_standards = new BorderContainer({
title: '<i class="far fa-file-pdf"></i> Standards',
design: 'headline',
id: 'p_standards',
splitter: false,
onShow: function () {
load_standard_einzeln()
}
}))
tab_projekte_aktive_center.addChild(p_standards)
//menu end
var cp_standards = (window.cp_standards = new ContentPane({
id: 'cp_standards',
region: 'center',
splitter: false
}))
p_standards.addChild(cp_standards)
var grid_standards = (window.grid_standards =
new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
noDataMessage: 'Bitte ein Projekt ausgewählen',
rowsPerPage: 40,
columns: [
{
label: ' ',
field: 'pos',
className: 'width-50 center'
},
{
label: ' ',
field: 'hat_platzhalter',
className: 'width-50 center',
renderCell: gutachten_functions.renderPlatzhalter
},
{
label: 'Kennung',
field: 'kennung'
},
{
label: 'Überschrift',
field: 'titel'
},
{
label: ' ',
field: 'first',
className: 'width-icon',
sortable: false,
renderCell: function (object, data) { return gutachten_functions.renderIcon('fa fa-angle-double-up') },
},
{
label: ' ',
field: 'up',
className: 'width-icon',
sortable: false,
renderCell: function (object, data) { return gutachten_functions.renderIcon('fa fa-angle-up') },
},
{
label: ' ',
field: 'down',
className: 'width-icon',
sortable: false,
renderCell: function (object, data) { return gutachten_functions.renderIcon('fa fa-angle-down') },
},
{
label: ' ',
field: 'last',
className: 'width-icon',
sortable: false,
renderCell: function (object, data) { return gutachten_functions.renderIcon('fa fa-angle-double-down') },
},
{
label: 'Neue Seite',
field: 'neueseite',
sortable: false,
className: 'width-50 center',
renderCell: function (object, data) { return gutachten_functions.renderToggle(data, '', 1) },
renderHeaderCell: function (object, data) { return gutachten_functions.renderText('A', 'Neue Seite') }
},
{
label: ' ',
field: 'hidden',
sortable: false,
className: 'width-50 center',
renderCell: function (object, data) { return gutachten_functions.renderToggle(data, '', 1) },
renderHeaderCell: function (object, data) { return gutachten_functions.renderText('H', 'Element verbergen') }
},
{
label: ' ',
field: 'edit',
className: 'width-icon',
sortable: false,
renderCell: function () {
return gutachten_functions.renderIcon('fas fa-pencil-alt')
},
renderHeaderCell: function () {
return gutachten_functions.renderIcon('fas fa-plus')
},
}
]
},
'cp_standards'
))
grid_standards.on('.dgrid-header .dgrid-cell:click', function (evt) {
var column = grid_standards.column(evt)
var field = column.field
if (field == 'edit') {
if (!LOCALSCOPE.projekt_aktive) {
return false
}
gutachten_xhr.call_function(
load_standard_einzeln,
'select_controller',
'standards_add',
'&id=' + LOCALSCOPE.projekt_aktive
)
}
})
grid_standards.on('.dgrid-content .dgrid-cell:click', function (evt) {
var cell = grid_standards.cell(evt)
var item = grid_standards.row(evt)
var column = grid_standards.column(evt)
var field = column.field
switch (field) {
case 'first':
case 'last':
case 'up':
case 'down':
move_standard_einzeln(field, item.id, item.data.pid)
break
case 'hidden':
gutachten_xhr.toggle_field_uid(
load_standard_einzeln,
'tx_gutachten_projektestandards',
'hidden',
item.id
)
break
case 'neueseite':
gutachten_xhr.toggle_field_uid(
load_standard_einzeln,
'tx_gutachten_projektestandards',
'neueseite',
item.id
)
break
case 'edit':
LOCALSCOPE.mode = 'edit'
LOCALSCOPE.id = item.data.id
LOCALSCOPE.textart_id = item.data.textart_id
// dijit.byId("textart_" + item.textart_id)._set("selected", true);
// dijit.byId("menu_textart")._setSelected("textart_" + item.textart_id );
// dijit.byId("menu_textart").set("value","textart_" + item.textart_id );
// console.log("editor_standard_fliestext",item.data.txt);
dijit.byId('textartSelect').set('value', item.data.textart_id)
dijit.byId('ueberschrift').set('value', item.data.titel)
dijit.byId('kennung').set('value', item.data.kennung)
dijit.byId('editor_standard_fliestext').set('value', item.data.txt)
dijit.byId('editor_standard').show()
dijit.byId('editor_standard_fliestext').focus()
break
}
})
}
}
})
@@ -0,0 +1,100 @@
define([
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'gutachten/lib/uploadform',
'dijit/form/Button'
], function (ContentPane, BorderContainer, gutachten_uploadform, Button) {
return {
create: function (tab_projekte_aktive_center) {
LOCALSCOPE.document = ''
var uploadFormHandle = (window.uploadFormHandle =
gutachten_uploadform.init())
/******************************************************
upload
******************************************************/
var p_upload = (window.p_upload = new BorderContainer({
title: '<i class="fa fa-upload"></i> Hochladen',
className: 'border-t-40',
design: 'headline',
id: 'p_upload',
splitter: false,
onShow: function () {
dijit.byId('cp_upload_response').set('content', '')
}
}))
tab_projekte_aktive_center.addChild(p_upload)
var cp_upload_response = new ContentPane({
region: 'top',
class: 'no-border',
style: 'height: 100px; padding-top:50px;',
id: 'cp_upload_response'
})
p_upload.addChild(cp_upload_response)
p_upload.addChild(
new ContentPane({
region: 'center',
splitter: false,
style: 'padding:0 50px;',
content:
'<button id="allg" type="button"></button> <br><br><button id="nutz" type="button"></button>'
})
)
new Button(
{
label: '<i class="fa fa-upload mr-5"></i> Allgemeine Flächen',
onClick: function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
} else {
dijit
.byId('uploader')
.set(
'url',
'index.php?eID=tx_gutachten&controller=uploads_controller&action=allgemein&pid=' +
LOCALSCOPE.projekt_aktive
)
uploadFormHandle.set(
'title',
'<i class="fa fa-upload"></i> Allgemeine Flächen Hochladen'
)
uploadFormHandle.show()
}
}
},
'allg'
).startup()
new Button(
{
label: '<i class="fa fa-upload mr-5"></i> Nutzflächen',
onClick: function () {
if (LOCALSCOPE.projekt_aktive == 0) {
alert('Kein Projekt ausgewählt')
return
} else {
dijit
.byId('uploader')
.set(
'url',
'index.php?eID=tx_gutachten&controller=uploads_controller&action=nutzflaechen&pid=' +
LOCALSCOPE.projekt_aktive
)
uploadFormHandle.set(
'title',
'<i class="fa fa-upload"></i> Nutzflächen Hochladen'
)
uploadFormHandle.show()
}
}
},
'nutz'
).startup()
}
}
})
@@ -0,0 +1,252 @@
define([
'dojo/_base/declare',
'dojo/_base/array',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/layout/TabContainer',
'dstore/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr',
'gutachten/projekte/p_basis',
'gutachten/projekte/p_notizen',
'gutachten/projekte/p_standards',
'gutachten/projekte/p_platzhalter',
'gutachten/projekte/p_orientierung_typen',
'gutachten/projekte/p_allgemeine_flaechen',
'gutachten/projekte/p_objekte_im_detail',
'gutachten/projekte/p_methoden',
'gutachten/projekte/p_upload',
'gutachten/projekte/p_download'
], function (
declare,
arrayUtil,
ContentPane,
BorderContainer,
TabContainer,
Memory,
gutachten_functions,
gutachten_xhr,
p_basis,
p_notizen,
p_standards,
p_platzhalter,
p_orientierung_typen,
p_allgemeine_flaechen,
p_objekte_im_detail,
p_methoden,
p_upload,
p_download
) {
return {
create: function (stack_container_main) {
LOCALSCOPE.projekt_aktive = 0
window.update_projekt_item = function (
field,
value
) {
if (LOCALSCOPE.projekt_aktive > 0) {
gutachten_xhr.call_function(
'',
'update_controller',
'update_project',
'&table=tx_gutachten_projekte&field=' +
field +
'&value=' +
value +
'&id=' +
LOCALSCOPE.projekt_aktive
)
}
}
var load_projekte_active_data = (window.load_projekte_active_data =
function () {
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store = new (declare([Memory]))({
data: response
})
var _filter = store.filter({
active: 1
})
grid_projekte_active.set('collection', _filter)
grid_projekte_active.startup()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'projekte_alle',
'&active_only=1'
)
})
/******************************************************
layout base
******************************************************/
var bc_projekte_active = (window.bc_projekte_alle = new BorderContainer({
id: 'bc_projekte_active',
region: 'left',
splitter: false,
onShow: function () {
load_projekte_active_data()
}
}))
stack_container_main.addChild(bc_projekte_active)
var cp_projekte_aktive_title = (window.cp_projekte_aktive_title =
new ContentPane({
id: 'cp_projekte_aktive_title',
region: 'top',
splitter: false
}))
bc_projekte_active.addChild(cp_projekte_aktive_title)
var bc_projekte_aktive_top = (window.bc_projekte_aktive_top =
new BorderContainer({
id: 'bc_projekte_aktive_top',
region: 'left',
splitter: false
}))
bc_projekte_active.addChild(bc_projekte_aktive_top)
var cp_projekte_aktive_menu = (window.cp_projekte_aktive_menu =
new ContentPane({
id: 'cp_projekte_aktive_menu',
region: 'left',
splitter: false
}))
bc_projekte_aktive_top.addChild(cp_projekte_aktive_menu)
var cp_projekte_aktive_top = (window.cp_projekte_aktive_top =
new ContentPane({
id: 'cp_projekte_aktive_top',
region: 'left',
splitter: false
}))
bc_projekte_aktive_top.addChild(cp_projekte_aktive_top)
var tab_projekte_aktive_center = (window.tab_projekte_aktive_center =
new TabContainer({
id: 'tab_projekte_aktive_center',
tabPosition: 'left-h',
region: 'center',
splitter: false
}))
bc_projekte_active.addChild(tab_projekte_aktive_center)
p_basis.create(tab_projekte_aktive_center)
p_notizen.create(tab_projekte_aktive_center)
p_standards.create(tab_projekte_aktive_center)
p_platzhalter.create(tab_projekte_aktive_center)
p_orientierung_typen.create(tab_projekte_aktive_center)
p_methoden.create(tab_projekte_aktive_center)
p_allgemeine_flaechen.create(tab_projekte_aktive_center)
p_objekte_im_detail.create(tab_projekte_aktive_center)
p_upload.create(tab_projekte_aktive_center)
p_download.create(tab_projekte_aktive_center)
var grid_projekte_active = (window.grid_projekte_active =
new SelectionPaginationGrid(
{
idProperty: 'id',
showHeader: true,
rowsPerPage: 40,
columns: [
{
label: '',
field: 'id',
className: "width-icon",
renderCell: function () {
return gutachten_functions.renderIcon('fa fa-building')
}
},
{
label: 'Projekte',
field: 'intname'
}
]
},
'cp_projekte_aktive_menu'
))
grid_projekte_active.set('sort', {
attribute: 'intname',
descending: false
})
grid_projekte_active.on('dgrid-select', function (e) {
var row = e.rows[0],
item = row.data
LOCALSCOPE.projekt_aktive = item.id
dijit
.byId('cp_projekte_aktive_title')
.set('content', item.name + ' -> ' + item.intname)
var active = dijit.byId('tab_projekte_aktive_center')
.selectedChildWidget.id
switch (active) {
case 'p_basis':
load_p_basis_data()
break
case 'p_platzhalter':
load_platzhalter_einzeln()
break
case 'p_standards':
load_standard_einzeln()
break
case 'p_orientierung_typen':
load_orientierung_typen_colums()
load_orientierung_typen()
break
case 'p_methoden':
load_methoden_projekt()
break
case 'p_notizen':
load_p_notizen_data()
break
case 'p_allgemeine':
load_p_allgemeine_alle()
break
case 'p_objekte':
load_p_objekte_alle()
break
}
load_p_objekte_alle()
load_p_allgemeine_alle()
arrayUtil.forEach(
[
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u'
],
function (item) {
grid_orientierung_typen.toggleColumnHiddenState(item, 1)
}
)
})
}
}
})
@@ -0,0 +1,535 @@
define([
'dojo/dom',
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dstore/Memory',
'dstore/Trackable',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/ToolbarSeparator',
'dijit/ConfirmDialog',
'dijit/form/TextBox',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
dom,
query,
declare,
ContentPane,
BorderContainer,
Memory,
Trackable,
MenuBar,
MenuBarItem,
ToolbarSeparator,
ConfirmDialog,
TextBox,
gutachten_functions,
gutachten_xhr
) {
return {
create: function (stack_container_main) {
function store_projekte_filter() {
var filter_f
switch (LOCALSCOPE.filter_field) {
case 'test':
filter_f = store_projekte
.filter({
status: '1'
})
.sort([
{
property: 'erstelldatum',
descending: true
}
])
break
case 'konzept':
filter_f = store_projekte
.filter({
status: '2'
})
.sort('id')
break
case 'endfassung':
filter_f = store_projekte
.filter({
status: '3'
})
.sort('id')
break
case 'active':
filter_f = store_projekte
.filter({
active: 1
})
.sort('id')
break
case 'search':
var filterString = dijit.byId('SearchBox1').get('value')
filter_f = store_projekte.filter(function (object) {
var name = object.name.toLowerCase()
var intname = object.intname.toLowerCase()
var gutachter =
object.gutachter != null ? object.gutachter.toLowerCase() : ''
var auftraggeber =
object.auftraggeber != null
? object.auftraggeber.toLowerCase()
: ''
if (
~name.indexOf(filterString.toLowerCase()) ||
~intname.indexOf(filterString.toLowerCase()) ||
~gutachter.indexOf(filterString.toLowerCase()) ||
~auftraggeber.indexOf(filterString.toLowerCase()) ||
object.id == filterString.toLowerCase()
)
return true
else return false
})
break
default:
filter_f = store_projekte.sort([
{
property: 'erstelldatum',
descending: true
}
])
break
}
grid_projekte.set('collection', filter_f)
grid_projekte.startup()
}
/*******************************************************
* DIalog
*******************************************************/
LOCALSCOPE.filter_field = ''
var add_projekt_table = '<table class="pure-table pure-table-horizontal">'
add_projekt_table +=
'<tr><td><label for="internername">Interner Name:</label></td>'
add_projekt_table +=
'<td><input data-dojo-type="dijit/form/TextBox" style="width:400px;" name="internername" id="internername"></td></tr>'
add_projekt_table +=
'<tr><td><label for="projektname">Projekt Name:</label></td>'
add_projekt_table +=
'<td><input data-dojo-type="dijit/form/TextBox" style="width:400px;" name="projektname" id="projektname"></td></tr>'
add_projekt_table += '</table><br>'
var newProjektDialog = (window.newProjektDialog = new ConfirmDialog({
title: 'Neues Projekt anlegen',
content: add_projekt_table,
region: 'top',
style: 'width: 600px',
onShow: function () {
dom.byId('internername').value = ''
dom.byId('projektname').value = ''
},
onExecute: function () {
gutachten_xhr.call_function(
load_projekte_data,
'insert_controller',
'neues_projekt',
'&internername=' +
dom.byId('internername').value +
'&projektname=' +
dom.byId('projektname').value
)
}
}))
/*******************************************************
* Grid
*******************************************************/
var grid_projekte = (window.grid_projekte =
new CellSelectionPaginationGrid({
minRowsPerPage: 0,
cellNavigation: 1,
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 20,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
maxRowsPerPage: 50,
rowsPerPage: 50,
pageSkip: 50,
noDataMessage: 'Keine Daten',
columns: [
{
label: '',
field: 'blind',
className: "width-icon",
renderCell: function () {
return gutachten_functions.renderIcon('far fa-building')
}
},
{
label: 'Geändert',
field: 'timestamp',
sortable: true,
className: 'left-140',
},
{
label: 'Interner Name',
field: 'intname',
sortable: true,
editor: 'text',
editOn: 'click',
editorArgs: {
style: 'width: 230px; font-size:1rem;'
},
},
{
label: 'Projekt Name',
field: 'name',
sortable: true,
editor: 'text',
editOn: 'click',
editorArgs: {
style: 'width: 230px; font-size:1rem;'
},
},
{
label: ' ',
field: 'active',
sortable: false,
className: 'width-icon',
renderCell: function (object, data) { return gutachten_functions.rendeCircle(data, 'active', 1) },
renderHeaderCell: function () { return gutachten_functions.renderText('A', 'Aktive Projekte') }
},
{
label: ' ',
field: 'status',
sortable: false,
className: 'width-icon',
renderCell: function (object, data) { return gutachten_functions.rendeCircle(data, 'test', 1) },
renderHeaderCell: function () { return gutachten_functions.renderText('T', 'Test Projekte') }
},
{
label: ' ',
field: 'status',
sortable: false,
className: 'width-icon',
renderCell: function (object, data) { return gutachten_functions.rendeCircle(data, 'konzept', 2) },
renderHeaderCell: function () { return gutachten_functions.renderText('K', 'Konzeptineller Entwurf') }
},
{
label: ' ',
field: 'status',
sortable: false,
className: 'width-icon',
renderCell: function (object, data) { return gutachten_functions.rendeCircle(data, 'endfassung', 3) },
renderHeaderCell: function () { return gutachten_functions.renderText('E', 'Projekt Endfassung') }
},
{
label: 'Auftraggeber',
field: 'auftraggeber',
sortable: true
},
{
label: 'Gutachter',
field: 'gutachter',
sortable: true
},
{
label: ' ',
field: 'clone',
sortable: false,
className: 'width-icon',
renderCell: function () {
return gutachten_functions.renderIcon('far fa-clone')
},
renderHeaderCell: function () { return gutachten_functions.renderText('K', 'Projekt Klonen') }
},
{
label: ' ',
field: 'delete',
sortable: false,
className: 'width-icon',
renderCell: function () {
return gutachten_functions.renderIcon('far fa-trash-alt')
},
renderHeaderCell: function () { return gutachten_functions.renderText('L', 'Projekt Löschen') }
}
]
}))
grid_projekte.on('.dgrid-content .dgrid-cell:click', function (evt) {
var item = grid_projekte.row(evt)
var cell = grid_projekte.cell(evt)
var column = grid_projekte.column(evt)
var field = column.field
var callback
item = item.data
switch (field) {
case 'status':
console.log(cell.column);
var columnid = cell.column.id
let value = 1
switch (columnid) {
case '5':
value = 1
break
case '6':
value = 2
break;
case '7':
value = 3
break;
}
callback = function (response) {
store_projekte
.filter({
id: item.id
})
.forEach(function (object) {
object.status = response
store_projekte.put(object)
})
}
gutachten_xhr.call_function(
callback,
'select_controller',
'projekt_status',
'&id=' + item.id + '&value=' + value
)
break
case 'delete':
if (confirm('Projekt löschen?')) {
callback = function (response) {
store_projekte
.filter({
id: item.id
})
.forEach(function (object) {
store_projekte.remove(item.id)
})
}
gutachten_xhr.call_function(
callback,
'delete_controller',
'projekt_delete',
'&id=' + item.id
)
}
break
case 'clone':
if (confirm('Projekt du­pli­zie­ren?')) {
gutachten_xhr.call_function(
load_projekte_data,
'select_controller',
'projekt_clone',
'&id=' + item.id
)
}
break
case 'active':
callback = function (response) {
store_projekte
.filter({
id: item.id
})
.forEach(function (object) {
object.active = response
store_projekte.put(object)
})
}
gutachten_xhr.call_function(
callback,
'select_controller',
'projekt_active',
'&id=' + item.id
)
break
}
})
grid_projekte.on('dgrid-datachange', function (evt) {
if (
evt.cell.column.field == 'name' ||
evt.cell.column.field == 'intname'
) {
gutachten_xhr.call_function(
'',
'update_controller',
'update_project',
'&table=tx_gutachten_projekte&field=' +
evt.cell.column.field +
'&value=' +
evt.value +
'&id=' +
evt.cell.row.id
)
}
})
var load_projekte_data = (window.load_projekte_data = function () {
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store = new (declare([Memory, Trackable]))({
data: response,
idProperty: 'id'
})
var store_projekte = (window.store_projekte = store.sort('timestamp'))
store_projekte_filter()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'projekte_alle'
)
})
/******************************************************
layout base
******************************************************/
var bc_projekte_alle = (window.bc_projekte_alle = new BorderContainer({
id: 'bc_projekte_alle',
region: 'left',
splitter: false,
onShow: function () {
load_projekte_data()
}
}))
stack_container_main.addChild(bc_projekte_alle)
/******************************************************
layout grid
******************************************************/
var cp_projekte_allgemein_center = (window.cp_projekte_allgemein_center =
new ContentPane({
id: 'cp_projekte_allgemein_center',
region: 'center',
splitter: false,
content: grid_projekte
}))
bc_projekte_alle.addChild(cp_projekte_allgemein_center)
/******************************************************
layout menu
******************************************************/
var menu_projekte = new MenuBar({
id: 'menu_projekte',
region: 'top',
style: 'text-align: center',
splitter: false
})
bc_projekte_alle.addChild(menu_projekte)
menu_projekte.addChild(
new TextBox({
showLabel: true,
id: 'SearchBox1',
class: 'filter-box',
placeHolder: 'Filter',
selectOnClick: true,
onKeyUp: function () {
setTimeout(function () {
LOCALSCOPE.filter_field = 'search'
store_projekte_filter()
}, 500)
},
_setSelected: function () {
}
})
)
menu_projekte.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-times relative-t-2"></i>',
onClick: function () {
LOCALSCOPE.filter_field = ''
dijit.byId('SearchBox1').reset()
// store_projekte_filter()
load_projekte_data()
}
})
)
// menu_projekte.addChild(new ToolbarSeparator())
// menu_projekte.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-play"></i> Laden',
// onClick: function () {
// LOCALSCOPE.filter_field = ''
// load_projekte_data()
// }
// })
// )
menu_projekte.addChild(new ToolbarSeparator())
menu_projekte.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-circle active relative-t-2"></i> Aktive',
onClick: function () {
dijit.byId('SearchBox1').reset()
if (LOCALSCOPE.filter_field == 'active') {
LOCALSCOPE.filter_field = ''
store_projekte_filter()
} else {
LOCALSCOPE.filter_field = 'active'
store_projekte_filter()
}
}
})
)
menu_projekte.addChild(new ToolbarSeparator())
menu_projekte.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-circle test relative-t-2"></i> Test',
onClick: function () {
LOCALSCOPE.filter_field = 'test'
dijit.byId('SearchBox1').reset()
store_projekte_filter()
}
})
)
menu_projekte.addChild(new ToolbarSeparator())
menu_projekte.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-circle konzept relative-t-2"></i> Konzept',
onClick: function () {
LOCALSCOPE.filter_field = 'konzept'
dijit.byId('SearchBox1').reset()
store_projekte_filter()
}
})
)
menu_projekte.addChild(new ToolbarSeparator())
menu_projekte.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-circle endfassung relative-t-2"></i> Endfassung',
onClick: function () {
LOCALSCOPE.filter_field = 'endfassung'
dijit.byId('SearchBox1').reset()
store_projekte_filter()
}
})
)
menu_projekte.addChild(new ToolbarSeparator())
menu_projekte.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-plus-square relative-t-2"></i> Neu',
onClick: function () {
newProjektDialog.show()
}
})
)
load_projekte_data()
}
}
})
@@ -0,0 +1,164 @@
define([
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/form/TextBox',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dstore/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
query,
declare,
ContentPane,
BorderContainer,
TextBox,
MenuBar,
MenuBarItem,
Memory,
gutachten_functions,
gutachten_xhr
) {
return {
create: function () {
window.load_aufstellung_data = function () {
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store_aufstellung = new (declare([
Memory
]))({
data: response
})
grid_aufstellung.set('collection', store_aufstellung)
grid_aufstellung.startup()
grid_aufstellung.refresh()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'aufstellung_alle'
)
}
LOCALSCOPE.filter_field = 0
/******************************************************
aufstellung
******************************************************/
var bc_aufstellung = (window.bc_aufstellung = new BorderContainer({
title: '<i class="far fa-file-excel"></i> Aufstellung Titel',
design: 'headline',
id: 'bc_aufstellung',
splitter: false,
onShow: function () {
load_aufstellung_data()
}
}))
dijit.byId('tap_vorlagen_center').addChild(bc_aufstellung)
var grid_aufstellung = (window.grid_aufstellung =
new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 100,
columns: [
{
label: 'Id',
field: 'id',
className: 'width-80 center',
},
{
label: 'Titel',
field: 'titel',
className: 'width-300',
sortable: false,
editor: 'text',
editOn: 'click',
editorArgs: {
style: 'with:280px;'
},
renderCell: gutachten_functions.renderAllowHTML
},
{
label: ' ',
field: 'delete',
sortable: false,
className: 'width-icon',
renderCell: function () {
return gutachten_functions.renderIcon('far fa-trash-alt')
},
renderHeaderCell: function () {
return gutachten_functions.renderIcon('fas fa-plus')
},
},
{
label: '',
field: 'blind'
}
]
},
))
grid_aufstellung.on('dgrid-datachange', function (evt) {
gutachten_xhr.call_function(
'',
'update_controller',
'update_aufstellung',
'&value=' + evt.value + '&id=' + evt.cell.row.id
)
})
grid_aufstellung.on('.dgrid-header .dgrid-cell:click', function (evt) {
var cell = grid_aufstellung.cell(evt);
if (cell.column.field == "delete") {
gutachten_xhr.call_function(
load_aufstellung_data,
'insert_controller',
'neues_element',
'&table=tx_gutachten_aufstellung&field=titel&value=Neuer Title'
)
}
});
grid_aufstellung.on('.dgrid-content .dgrid-cell:click', function (evt) {
var cell = grid_aufstellung.cell(evt)
var field = cell.column.field
var item = grid_aufstellung.row(evt)
switch (field) {
case 'delete':
if (confirm('Titel löschen?')) {
gutachten_xhr.call_function(
load_aufstellung_data,
'delete_controller',
'delete_by_id',
'&table=tx_gutachten_aufstellung&id=' + item.id
)
}
break
}
})
var cp_aufstellung_center = (window.cp_aufstellung_center =
new ContentPane({
id: 'cp_aufstellung_center',
region: 'center',
splitter: false
}))
bc_aufstellung.addChild(cp_aufstellung_center)
cp_aufstellung_center.addChild(grid_aufstellung)
}
}
})
@@ -0,0 +1,297 @@
define([
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/form/TextBox',
'dijit/Editor',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/ToolbarSeparator',
'dstore/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
query,
declare,
ContentPane,
BorderContainer,
TextBox,
TextEditor,
MenuBar,
MenuBarItem,
ToolbarSeparator,
Memory,
gutachten_functions,
gutachten_xhr
) {
return {
create: function () {
var add_auftraggeber = gutachten_functions.getAddAuftraggeber_CDialog()
function store_auftraggeber_filter() {
var filterString = dijit.byId('SearchBox8').get('value')
if (filterString != '') {
filter_f = store_auftraggeber.filter(function (object) {
var kennung = object.kennung.toLowerCase()
var txt = object.txt.toLowerCase()
if (
~txt.indexOf(filterString.toLowerCase()) ||
~kennung.indexOf(filterString.toLowerCase()) ||
object.id == filterString.toLowerCase()
)
return true
else return false
})
} else {
filter_f = store_auftraggeber.sort({
property: 'id',
descending: false
})
}
grid_auftraggeber.set('collection', filter_f)
grid_auftraggeber.startup()
grid_auftraggeber.refresh()
}
function load_auftraggeber_data() {
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store_auftraggeber = (window.store_auftraggeber = new (declare([
Memory
]))({
data: response
}))
store_auftraggeber_filter()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'auftraggeber_alle'
)
}
/*
*
*/
window.submitAddAuftraggeber = function () {
var data = dijit.byId('sendform_auf').get('value')
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
load_auftraggeber_data()
}
gutachten_xhr.post_function(
callback,
'insert_controller',
'auftraggeber_neu',
data
)
}
LOCALSCOPE.filter_field = 0
/******************************************************
layout
******************************************************/
var bc_auftraggeber = (window.bc_auftraggeber = new BorderContainer({
title: '<i class="fa fa-user"></i> Auftraggeber',
design: 'headline',
id: 'bc_auftraggeber',
splitter: false,
onShow: function () {
load_auftraggeber_data()
}
}))
dijit.byId('tap_vorlagen_center').addChild(bc_auftraggeber)
/******************************************************
menu
******************************************************/
var menu_auftraggeber = new MenuBar({
id: 'menu_auftraggeber',
style: 'text-align: center',
region: 'top',
splitter: false
})
menu_auftraggeber.addChild(
new TextBox({
showLabel: true,
id: 'SearchBox8',
class: 'filter-box',
placeHolder: 'Name oder Id',
selectOnClick: true,
onKeyUp: function () {
setTimeout(function () {
LOCALSCOPE.filter_field = 'search'
store_auftraggeber_filter()
}, 500)
},
_setSelected: function () {
query('#widget_SearchBox8 div span').style('display', 'none')
}
})
)
menu_auftraggeber.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-times"></i>',
onClick: function () {
dijit.byId('SearchBox8').reset()
grid_auftraggeber.set('collection', store_auftraggeber)
grid_auftraggeber.startup()
grid_auftraggeber.refresh()
}
})
)
menu_auftraggeber.addChild(new ToolbarSeparator())
menu_auftraggeber.addChild(
new MenuBarItem({
showLabel: true,
label: '<i class="fa fa-plus-square relative-t-2"></i> Neu',
onClick: function () {
add_auftraggeber.show()
}
})
)
/******************************************************
center
******************************************************/
var cp_auftraggeber_center = (window.cp_auftraggeber_center =
new ContentPane({
id: 'cp_auftraggeber_center',
region: 'center',
splitter: false
}))
bc_auftraggeber.addChild(cp_auftraggeber_center)
/******************************************************
grid
******************************************************/
var grid_auftraggeber = (window.grid_auftraggeber =
new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 40,
columns: [
{
field: 'kennung',
sortable: false,
editor: 'text',
editOn: 'click',
renderCell: gutachten_functions.renderAllowHTML
},
{
label: 'Gutachten Kopf',
field: 'kopf',
sortable: false,
editor: 'text',
editOn: 'click',
rows: '4',
cols: '30',
editorArgs: {
selectOnClick: false,
class: 'snuf-g-odd center'
},
renderCell: gutachten_functions.renderAllowHTML
},
{
field: 'txt',
sortable: false,
editor: TextEditor,
className: 'width-500',
editOn: 'click',
renderCell: gutachten_functions.renderAllowHTML,
renderHeaderCell: function () { return gutachten_functions.renderText('Adresse Deckblatt', 'Zeilen der Adresse denen ein Minus <b>-</b> vorgestellt ist<br>werden im Deckblatt <b>Fett</b> ausgedruckt') }
},
{
label: 'Kontaktperson',
field: 'kontaktperson',
sortable: false,
editor: 'text',
editOn: 'click'
},
{
label: 'E-Mail',
field: 'email',
sortable: false,
editor: 'text',
editOn: 'click'
},
{
label: 'Telefon',
field: 'telefon',
sortable: false,
editor: 'text',
editOn: 'click'
},
{
label: ' ',
field: 'delete',
sortable: false,
className: 'width-icon',
renderCell: function () {
return gutachten_functions.renderIcon('far fa-trash-alt')
},
renderHeaderCell: function () { return gutachten_functions.renderText('L', 'Projekt Löschen') }
}
]
},
'cp_auftraggeber_center'
))
grid_auftraggeber.set('sort', [
{
property: 'id',
descending: true
}
])
grid_auftraggeber.on('.dgrid-content .dgrid-cell:click', function (evt) {
var cell = grid_auftraggeber.cell(evt)
var item = grid_auftraggeber.row(evt)
var column = grid_auftraggeber.column(evt)
var field = column.field
switch (field) {
case 'delete':
if (confirm('Auftraggeber löschen?')) {
gutachten_xhr.delete_uid(
load_auftraggeber_data,
'tx_gutachten_auftraggeber',
item.id
)
}
break
}
})
grid_auftraggeber.on('dgrid-datachange', function (evt) {
gutachten_xhr.call_function(
load_auftraggeber_data,
'update_controller',
'update_project',
'&table=tx_gutachten_auftraggeber&field=' +
evt.cell.column.field +
'&value=' +
evt.value +
'&id=' +
evt.cell.row.id
)
})
}
}
})
@@ -0,0 +1,292 @@
define([
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/form/TextBox',
'dijit/Editor',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dstore/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
query,
declare,
ContentPane,
BorderContainer,
TextBox,
TextEditor,
MenuBar,
MenuBarItem,
Memory,
gutachten_functions,
gutachten_xhr
) {
return {
create: function () {
/******************************************************
FUNCTIONS
******************************************************/
// window.store_gutachter_filter = function () {
// var filterString = dijit.byId('SearchBox7').get('value')
// if (filterString != '') {
// filter_f = store_gutachter.filter(function (object) {
// var kennung = object.kennung.toLowerCase()
// var txt = object.txt.toLowerCase()
// if (
// ~txt.indexOf(filterString.toLowerCase()) ||
// ~kennung.indexOf(filterString.toLowerCase()) ||
// object.id == filterString.toLowerCase()
// )
// return true
// else return false
// })
// } else {
// filter_f = store_gutachter.sort({
// property: 'id',
// descending: false
// })
// }
// grid_gutachter.set('collection', filter_f)
// grid_gutachter.startup()
// grid_gutachter.refresh()
// }
function load_gutachter_data() {
var callback = function (response) {
var store_gutachter = new (declare([
Memory
]))({
data: response
})
grid_gutachter.set('collection', store_gutachter)
grid_gutachter.startup()
grid_gutachter.refresh()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'gutachter_alle'
)
}
window.submitAddGutachter = function () {
var data = dijit.byId('sendform_gut').get('value')
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
load_gutachter_data()
}
gutachten_xhr.post_function(
callback,
'insert_controller',
'gutachter_neu',
data
)
}
/******************************************************
gutachter
******************************************************/
var bc_gutachter = (window.bc_gutachter = new BorderContainer({
title: '<i class="far fa-user"></i> Gutachter',
design: 'headline',
id: 'bc_gutachter',
splitter: false,
onShow: function () {
load_gutachter_data()
}
}))
dijit.byId('tap_vorlagen_center').addChild(bc_gutachter)
/******************************************************
menu
******************************************************/
// var menu_gutachter = new MenuBar({
// id: 'menu_gutachter',
// region: 'top',
// splitter: false
// })
// menu_gutachter.addChild(
// new TextBox({
// showLabel: true,
// id: 'SearchBox7',
// class: 'filter-box',
// placeHolder: 'Name oder Id',
// selectOnClick: true,
// onKeyUp: function () {
// setTimeout(function () {
// store_gutachter_filter()
// }, 500)
// },
// _setSelected: function () {
// query('#widget_SearchBox7 div span').style('display', 'none')
// }
// })
// )
// menu_gutachter.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-times blau"></i>',
// onClick: function () {
// dijit.byId('SearchBox7').reset()
// grid_gutachter.set('collection', store_gutachter)
// grid_gutachter.startup()
// grid_gutachter.refresh()
// }
// })
// )
// var add_gutachter = gutachten_functions.getAddGutachter_CDialog()
// menu_gutachter.addChild(
// new MenuBarItem({
// showLabel: true,
// style: 'float:right;margin-right:5px',
// label: '<i class="fa fa-plus "></i>',
// onClick: function () {
// add_gutachter.show()
// }
// })
// )
// bc_gutachter.addChild(menu_gutachter)
var cp_gutachter_center = (window.cp_gutachter_center = new ContentPane({
id: 'cp_gutachter_center',
region: 'center',
splitter: false
}))
bc_gutachter.addChild(cp_gutachter_center)
/******************************************************
grid
******************************************************/
var grid_gutachter = (window.grid_gutachter =
new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 40,
columns: [
// {
// label: 'Id',
// field: 'id',
// className: 'width-icon'
// },
{
label: 'Kennung',
field: 'kennung',
className: 'width-150',
sortable: false,
editor: 'text',
editOn: 'click',
renderCell: gutachten_functions.renderAllowHTML
},
{
label: 'Gutachten Kopf',
field: 'kopf',
className: 'width-300',
sortable: false,
editor: 'text',
editOn: 'click',
renderCell: gutachten_functions.renderAllowHTML
},
{
label: 'Fliestext',
field: 'txt',
sortable: false,
editor: TextEditor,
editorArgs: {
plugins: [
'undo',
'redo',
'copy',
'paste',
'selectAll',
'bold',
'italic',
'underline'
]
},
editOn: 'click',
renderCell: gutachten_functions.renderAllowHTML
},
{
label: 'Kontakt',
field: 'kontaktperson',
className: 'width-150',
sortable: false,
editor: 'text',
editOn: 'click'
},
{
label: 'E-Mail',
field: 'email',
className: 'width-150',
sortable: false,
editor: 'text',
editOn: 'click'
},
{
label: 'Telefon',
field: 'telefon',
className: 'width-150',
sortable: false,
editor: 'text',
editOn: 'click'
}
// {
// label: ' ',
// field: 'delete',
// sortable: false,
// className: 'width-50 center',
// renderCell: gutachten_functions.renderDelete
// }
]
},
'cp_gutachter_center'
))
grid_gutachter.on('.dgrid-content .dgrid-cell:click', function (evt) {
var cell = grid_gutachter.cell(evt)
var item = grid_gutachter.row(evt)
var column = grid_gutachter.column(evt)
var field = column.field
switch (field) {
case 'delete':
if (confirm('Gutachter löschen?')) {
gutachten_xhr.delete_uid(
load_gutachter_data,
'tx_gutachten_auftraggeber',
item.id
)
}
break
}
})
grid_gutachter.on('dgrid-datachange', function (evt) {
gutachten_xhr.call_function(
load_gutachter_data,
'update_controller',
'update_project',
'&table=tx_gutachten_gutachter&field=' +
evt.cell.column.field +
'&value=' +
evt.value +
'&id=' +
evt.cell.row.id
)
})
}
}
})
@@ -0,0 +1,175 @@
define([
'dojo/query',
'dojo/_base/declare',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/form/TextBox',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dstore/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
query,
declare,
ContentPane,
BorderContainer,
TextBox,
MenuBar,
MenuBarItem,
Memory,
gutachten_functions,
gutachten_xhr
) {
return {
create: function () {
/******************************************************
FUNCTIONS
******************************************************/
// function store_orientierung_filter() {
// var filterString = dijit.byId('SearchBox9').get('value')
// if (filterString != '') {
// filter_f = store_orientierung.filter(function (object) {
// var orientierung = object.orientierung.toLowerCase()
// if (~orientierung.indexOf(filterString.toLowerCase())) return true
// else return false
// })
// } else {
// filter_f = store_orientierung.sort({
// property: 'id',
// descending: false
// })
// }
// grid_orientierung.set('collection', filter_f)
// grid_orientierung.startup()
// grid_orientierung.refresh()
// }
function load_orientierung_data() {
var callback = function (response) {
window.store_orientierung = new (declare([
Memory
]))({
data: response
})
grid_orientierung.set('collection', store_orientierung)
grid_orientierung.startup()
grid_orientierung.refresh()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'orientierung_alle'
)
}
LOCALSCOPE.filter_field = 0
/******************************************************
orientierung
******************************************************/
var bc_orientierung = (window.bc_orientierung = new BorderContainer({
title: '<i class="far fa-compass"></i> Orientierung',
design: 'headline',
id: 'bc_orientierung',
splitter: false,
onShow: function () {
load_orientierung_data()
}
}))
dijit.byId('tap_vorlagen_center').addChild(bc_orientierung)
/******************************************************
menu
******************************************************/
// var menu_orientierung = new MenuBar({
// id: 'menu_orientierung',
// region: 'top',
// splitter: false
// })
// menu_orientierung.addChild(
// new TextBox({
// showLabel: true,
// id: 'SearchBox9',
// class: 'filter-box',
// placeHolder: 'Filter',
// selectOnClick: true,
// onKeyUp: function () {
// setTimeout(function () {
// LOCALSCOPE.filter_field = 'search'
// store_orientierung_filter()
// }, 500)
// },
// _setSelected: function () {
// query('#widget_SearchBox9 div span').style('display', 'none')
// }
// })
// )
// menu_orientierung.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-times blau"></i>',
// onClick: function () {
// dijit.byId('SearchBox9').reset()
// grid_orientierung.set('collection', store_orientierung)
// grid_orientierung.startup()
// grid_orientierung.refresh()
// }
// })
// )
// bc_orientierung.addChild(menu_orientierung)
/******************************************************
center
******************************************************/
var cp_orientierung_center = (window.cp_orientierung_center =
new ContentPane({
id: 'cp_orientierung_center',
region: 'center',
splitter: false
}))
bc_orientierung.addChild(cp_orientierung_center)
/******************************************************
grid
******************************************************/
var grid_orientierung = (window.grid_orientierung =
new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 100,
columns: [
{
label: 'Orientierung',
field: 'orientierung',
sortable: false,
editor: 'text',
editOn: 'click',
editorArgs: {
style: 'text-align: center; width:400px; padding:5px'
},
renderCell: gutachten_functions.renderAllowHTML
}
]
},
'cp_orientierung_center'
))
grid_orientierung.set('sort', [
{
property: 'sortierung',
descending: false
}
])
}
}
})
@@ -0,0 +1,390 @@
define([
'dojo/_base/declare',
'dojo/_base/array',
'dijit/layout/ContentPane',
'dijit/layout/BorderContainer',
'dijit/Editor',
'dijit/ConfirmDialog',
'dijit/Menu',
'dijit/MenuItem',
'dijit/MenuBar',
'dijit/MenuBarItem',
'dijit/PopupMenuBarItem',
'dstore/Memory',
'gutachten/lib/functions',
'gutachten/lib/xhr'
], function (
declare,
arrayUtil,
ContentPane,
BorderContainer,
Editor,
ConfirmDialog,
Menu,
MenuItem,
MenuBar,
MenuBarItem,
PopupMenuBarItem,
Memory,
gutachten_functions,
gutachten_xhr
) {
return {
create: function () {
/******************************************************
FUNCTIONS
******************************************************/
// function store_standards_filter() {
// var filterString = dijit.byId('SearchBox10').get('value')
// if (filterString != '') {
// filter_f = store_standards.filter(function (object) {
// var kennung = object.kennung.toLowerCase()
// var txt = object.txt.toLowerCase()
// if (
// ~txt.indexOf(filterString.toLowerCase()) ||
// ~kennung.indexOf(filterString.toLowerCase()) ||
// object.id == filterString.toLowerCase()
// )
// return true
// else return false
// })
// } else {
// filter_f = store_standards.sort({
// property: 'id',
// descending: false
// })
// }
// grid_standards.set('collection', filter_f)
// grid_standards.startup()
// grid_standards.refresh()
// }
var load_standards_data = (window.load_standards_data = function () {
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var store_standards = new (declare([
Memory
]))({
data: response
})
grid_standards.set('collection', store_standards)
grid_standards.startup()
grid_standards.refresh()
// store_standards_filter()
}
gutachten_xhr.call_function(
callback,
'select_controller',
'standards_alle'
)
})
/*
*
*/
function editStandardDialog() {
var callback = function (response) {
gutachten_functions.checkSessionExpired(response)
var myEditor = new Editor({
height: '500px',
style: "border:1px solid #000; margin-bottom:5px; padding:4px; border-radius:5px",
id: 'editor_standard_vorlagen_fliestext',
plugins: [
'undo',
'redo',
'copy',
'paste',
'selectAll',
'bold',
'italic',
'underline'
]
})
var bc_editor = new BorderContainer({
design: 'headline',
id: 'bc_editor',
splitter: false,
style: 'height:380px'
})
var menu_textart = new MenuBar({
region: 'top',
style: 'height:40px'
})
menu_textart.addChild(
new MenuBarItem({
label: 'Textart:',
style: 'width: 80px; padding-left: 0;'
})
)
var popupTexArtMenu = new Menu({
style: "border-left:1px solid #ccc; border-top:1px solid #ccc; ",
})
arrayUtil.forEach(response, function (item) {
popupTexArtMenu.addChild(
new MenuItem({
levelid: item.id,
label: item.name,
onClick: function () {
LOCALSCOPE.textart_id = item.id
dijit.byId('menu_textart').set('label', this.label)
}
})
)
})
menu_textart.addChild(
new PopupMenuBarItem({
showLabel: true,
label: 'Bitte wählen &darr;',
id: 'menu_textart',
popup: popupTexArtMenu
})
)
bc_editor.addChild(menu_textart)
bc_editor.addChild(
new ContentPane({
region: 'top',
style: 'height:40px',
content:
'<span style="width:100px; display:inline-block;">Überschrift:</span><input style="width:400px;" type="text" name="ueberschrift_vorlagen" value="" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, propercase:true" id="ueberschrift_vorlagen" />'
})
)
bc_editor.addChild(
new ContentPane({
region: 'center',
content: myEditor
})
)
return new ConfirmDialog({
id: 'editor_standard_vorlagen',
region: 'center',
title: 'Eintrag bearbeiten',
style: 'height:500px; width: 600px; border:1px solid #000; border-radius:5px;',
content: bc_editor,
onShow: function () { },
onCancel: function () { },
onExecute: function () {
if (!gutachten_functions.isNumeric(LOCALSCOPE.textart_id))
return false
if (!gutachten_functions.isNumeric(LOCALSCOPE.id)) return false
var update_array = []
update_array.push({
txt: dijit
.byId('editor_standard_vorlagen_fliestext')
.get('value')
})
update_array.push({
titel: dijit.byId('ueberschrift_vorlagen').get('value')
})
update_array.push({
textart_id: LOCALSCOPE.textart_id
})
gutachten_xhr.post_function(
load_standards_data,
'update_controller',
'update_row',
update_array,
'berechnen=1&table=tx_gutachten_standards&id=' + LOCALSCOPE.id
)
}
})
}
gutachten_xhr.call_function(
callback,
'select_controller',
'textart_alle'
)
}
/******************************************************
standards
******************************************************/
var bc_standards = (window.bc_standards = new BorderContainer({
title: '<i class="far fa-file-pdf"></i> Standards',
design: 'headline',
id: 'bc_standards',
splitter: false,
onShow: function () {
load_standards_data()
}
}))
dijit.byId('tap_vorlagen_center').addChild(bc_standards)
/******************************************************
menu
******************************************************/
// var menu_standards_vorlagen = new MenuBar({
// id: 'menu_standards_vorlagen',
// region: 'top',
// splitter: false
// })
// menu_standards_vorlagen.addChild(
// new TextBox({
// showLabel: true,
// id: 'SearchBox10',
// placeHolder: 'Name oder Id',
// class: 'filter-box',
// selectOnClick: true,
// onKeyUp: function () {
// setTimeout(function () {
// LOCALSCOPE.filter_field = 'search'
// store_standards_filter()
// }, 500)
// },
// _setSelected: function () {
// query('#widget_SearchBox10 div span').style('display', 'none')
// }
// })
// )
// menu_standards_vorlagen.addChild(
// new MenuBarItem({
// showLabel: true,
// label: '<i class="fa fa-times"></i>',
// onClick: function () {
// dijit.byId('SearchBox10').reset()
// grid_standards.set('collection', store_standards)
// grid_standards.startup()
// grid_standards.refresh()
// }
// })
// )
// bc_standards.addChild(menu_standards_vorlagen)
/******************************************************
center
******************************************************/
var cp_standards_center = (window.cp_standards_center = new ContentPane({
id: 'cp_standards_center',
region: 'center',
splitter: false
}))
bc_standards.addChild(cp_standards_center)
/******************************************************
grid
******************************************************/
var grid_standards = (window.grid_standards =
new CellSelectionPaginationGrid(
{
collection: new Memory(),
selectionMode: 'single',
keepScrollPosition: 1,
idProperty: 'id',
pagingLinks: 1,
pagingTextBox: 0,
firstLastArrows: 1,
previousNextArrows: 1,
rowsPerPage: 40,
columns: [
{
label: "Position",
field: 'pos',
sortable: false,
className: 'width-150 center',
},
{
label: 'Neue Seite',
field: 'neueseite',
className: 'width-80 center',
sortable: false,
renderCell: function (object, data) { return gutachten_functions.renderToggle(data, '', 1) },
renderHeaderCell: function () { return gutachten_functions.renderText('SEITE', 'Für aktivierte Elemente wird eine neue Seite angelegt') }
},
{
label: 'Textart',
field: 'textart',
className: 'width-150',
sortable: true
},
{
label: 'Kennung / Überschrift',
field: 'kennung',
sortable: false,
editor: 'text',
editOn: 'click',
renderCell: gutachten_functions.renderAllowHTML
},
// {
// label: 'Überschrift',
// field: 'titel',
// sortable: false,
// editor: 'text',
// editOn: 'click',
// renderCell: gutachten_functions.renderAllowHTML
// },
{
label: '',
field: 'edit',
className: 'width-icon',
sortable: false,
renderCell: function () {
return gutachten_functions.renderIcon('fas fa-pencil-alt')
},
},
{
label: '',
field: 'fake'
}
// {
// label: ' ',
// field: 'delete',
// sortable: false,
// renderCell: gutachten_functions.renderDelete
// }
]
},
'cp_standards_center'
))
grid_standards.set('sort', [
{
property: 'pos',
descending: false
}
])
editStandardDialog()
grid_standards.on('.dgrid-content .dgrid-cell:click', function (evt) {
var cell = grid_standards.cell(evt)
var item = grid_standards.row(evt)
var column = grid_standards.column(evt)
var field = column.field
switch (field) {
case 'neueseite':
gutachten_xhr.toggle_field_uid(
load_standards_data,
'tx_gutachten_standards',
cell.column.field,
item.id
)
break
case 'edit':
dijit
.byId('editor_standard_vorlagen_fliestext')
.set('value', item.data.txt)
dijit
.byId('menu_textart')
.set('label', item.data.textart + ' &darr;')
LOCALSCOPE.textart_id = item.data.textart_id
LOCALSCOPE.id = item.id
dijit.byId('ueberschrift_vorlagen').set('value', item.data.titel)
dijit.byId('editor_standard_vorlagen').show()
break
}
})
}
}
})
@@ -0,0 +1,28 @@
define([
'dijit/layout/TabContainer',
'gutachten/vorlagen/gutachter',
'gutachten/vorlagen/auftraggeber',
'gutachten/vorlagen/orientierungen',
'gutachten/vorlagen/standards',
'gutachten/vorlagen/aufstellung'
], function (TabContainer, gutachter, auftraggeber, orientierungen, standards, aufstellung) {
return {
create: function (stack_container_main) {
/******************************************************
Vorlagen
******************************************************/
var tap_vorlagen_center = (window.tap_vorlagen_center = new TabContainer({
id: 'tap_vorlagen_center',
tabPosition: 'left-h',
region: 'center',
splitter: false
}))
stack_container_main.addChild(tap_vorlagen_center)
gutachter.create()
auftraggeber.create()
orientierungen.create()
standards.create()
aufstellung.create()
}
}
})