Commit 7858d75f authored by Thorsten Küfer's avatar Thorsten Küfer

Merge remote-tracking branch 'origin/16-dokumentenmanagement' into kosmetik

parents 14915239 4b431646
......@@ -278,8 +278,6 @@
}
else
{
trigger_error('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
error_log('[SecDoc] Utils.class.php ->ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
return [];
}
}
......@@ -319,8 +317,6 @@
}
else
{
trigger_error('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
error_log('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
return [];
}
}
......@@ -364,8 +360,6 @@
}
else
{
trigger_error('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
error_log('[SecDoc] Utils.class.php ->ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
return [];
}
}
......@@ -399,8 +393,6 @@
}
else
{
trigger_error('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
error_log('[SecDoc] Utils.class.php ->ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
return '';
}
}
......@@ -442,8 +434,6 @@
}
else
{
trigger_error('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
error_log('[SecDoc] Utils.class.php ->ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
return FALSE;
}
}
......@@ -516,12 +506,19 @@
# Einträge suchen
$ldap_search = @ldap_search($ldap_handle, $base, $filter, $attributes);
if(!$ldap_search) {
if($ldap_search === FALSE) {
trigger_error('[SecDoc] Utils.class.php -> ldap_search() Fehler: ' . ldap_error($ldap_handle));
error_log('[SecDoc] Utils.class.php -> ldap_search() Fehler: ' . ldap_error($ldap_handle));
return [];
}
$result = @ldap_get_entries($ldap_handle, $ldap_search);
if($result === FALSE) {
trigger_error('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
error_log('[SecDoc] Utils.class.php -> ldap_get_entries() Fehler: ' . ldap_error($ldap_handle));
return [];
}
return $result;
}
......
......@@ -132,6 +132,7 @@ function loadTables(tier) {
$('#inbearbeitung table').DataTable().destroy();
$('#abgeschlossen table').off();
$('#inbearbeitung table').off();
abgTable.empty();
inbTable.empty();
......@@ -149,20 +150,19 @@ function loadTables(tier) {
newEntry.append('<td>' + data['data'][c]['Erstelldatum'] + '</td>');
newEntry.append('<td>' + data['data'][c]['Aktualisierung'] + '</td>');
newEntry.append('<td><textarea class="form-control comment" data-id="' + data['data'][c]['ID'] + '" style="resize: both;">' + htmlDecode(data['data'][c]['DSBKommentar']) + '</textarea></td>');
newEntry.append('<td><div class="btn-group inline"><a class="btn" href="?id=' + data['data'][c]['ID'] + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-edit"></i> Bearbeiten</a><a class="btn" href="?copy=' + data['data'][c]['ID'] + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-copy"></i> Kopieren</a><button type="button" class="btn pdfdownload" data-id="' + data['data'][c]['ID'] + '" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> PDF anzeigen</button></div> <button type="button" data-id="' + data['data'][c]['ID'] +'" data-name="' + data['data'][c]['Bezeichnung'] +'" class="btn del btn-danger"><i class="fa fa-minus"></i> Löschen</button></td>');
if(parseInt(data['data'][c]['Typ']) === 1 || parseInt(data['data'][c]['Typ']) === 3 || parseInt(data['data'][c]['Typ']) === 2) newEntry.find('.pdfdownload').closest('div').append('<button type="button" class="btn completepdf" data-id="' + data['data'][c]['ID'] + '" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> Vollständige PDF erzeugen</button>');
newEntry.append('<td><div class="btn-group inline"><a class="btn" href="?id=' + data['data'][c]['ID'] + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-edit"></i> Bearbeiten</a><a class="btn" href="?copy=' + data['data'][c]['ID'] + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-copy"></i> Kopieren</a><button type="button" class="btn pdfdownload" data-id="' + data['data'][c]['ID'] + '" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> ' + (parseInt(data['data'][c]['Status']) === 0 ? 'Letzte abgeschlossene PDF anzeigen' : 'PDF anzeigen') + '</button></div> <button type="button" data-id="' + data['data'][c]['ID'] +'" data-name="' + data['data'][c]['Bezeichnung'] +'" class="btn del btn-danger"><i class="fa fa-minus"></i> Löschen</button></td>');
if(parseInt(data['data'][c]['Status']) === 0) {
inbTable.append(newEntry);
}
else {
if(parseInt(data['data'][c]['Typ']) === 1 || parseInt(data['data'][c]['Typ']) === 3 || parseInt(data['data'][c]['Typ']) === 2) newEntry.find('.pdfdownload').closest('div').append('<button type="button" class="btn completepdf" data-id="' + data['data'][c]['ID'] + '" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> Vollständige PDF erzeugen</button>');
abgTable.append(newEntry);
}
}
// Event-Listener zum Speichern von Änderungen an den Kommentaren
$('#abgeschlossen table').on('input change', 'textarea.comment', function(event) {
$('#abgeschlossen table, #inbearbeitung table').on('input change', 'textarea.comment', function(event) {
let tar = $(event.target);
let timeout = 5000;
clearTimeout(tar.data('timer'));
......@@ -194,16 +194,16 @@ function loadTables(tier) {
});
// PDF-Download ermöglichen
$('#abgeschlossen table').on('click', 'button.pdfdownload', function(event) {
$('#abgeschlossen table, #inbearbeitung table').on('click', 'button.pdfdownload', function(event) {
getPDFFromServer($(event.target).data('id'));
});
$('#abgeschlossen table').on('click', 'button.completepdf', function(event) {
$('#abgeschlossen table, #inbearbeitung table').on('click', 'button.completepdf', function(event) {
getCompletePDF($(event.target).data('id'));
});
// Handler für das Löschen von Verfahren
$('#abgeschlossen table').on('click', 'button.del', function() {
$('#abgeschlossen table, #inbearbeitung table').on('click', 'button.del', function() {
var confirmed = confirm('Achtung: Von diesem Verfahren könnten andere Verfahren abhängen! Wollen Sie das Verfahren "' + $(this).data('name') + '" wirklich löschen?');
if(confirmed) {
deleteFromServer($(this).data('id'));
......
......@@ -428,26 +428,26 @@ function showVerfahrensliste(startup = false) {
let currId = parseInt(data['data'][c]['ID']);
let newEntry = $('<tr></tr>');
let statusSymbol = data['data'][c]['Status'] in statusSymbolMapping ? ' <i class="fa ' + statusSymbolMapping[data['data'][c]['Status']] + '"></i>' : '';
data['data'][c]['Status'] = data['data'][c]['Status'] in statusMapping ? statusMapping[data['data'][c]['Status']] : statusMapping['9'];
let statusName = data['data'][c]['Status'] in statusMapping ? statusMapping[data['data'][c]['Status']] : statusMapping['9'];
// Editierbare/Eigene Verfahren
if(data['data'][c]['Editierbar'] === true) {
newEntry.append('<td style="width: 16px;"></td>');
newEntry.append('<td>' + data['data'][c]['Bezeichnung'] + ' <i data-toggle="tooltip" class="fa fa-info-circle" title="' + data['data'][c]['Beschreibung'] + '"></i></td>');
newEntry.append('<td>' + data['data'][c]['Fachabteilung'] + '</td>');
newEntry.append('<td>' + data['data'][c]['Status'] + statusSymbol + '</td>');
newEntry.append('<td>' + statusName + statusSymbol + '</td>');
newEntry.append('<td>' + data['data'][c]['LetzterBearbeiter'] + ' <i data-toggle="tooltip" class="fa fa-info-circle" title="' + (data['data'][c]['BearbeiterDetails'] ? data['data'][c]['BearbeiterDetails'] : '<Keine Details vorhanden>') + '"></i></td>');
newEntry.append('<td>' + data['data'][c]['Aktualisierung'] + '</td>');
newEntry.append('<td><div class="btn-group inline"><a class="btn" href="?id=' + currId + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-edit"></i> Bearbeiten</a><a class="btn" href="?copy=' + currId + '" target="_blank"><i class="fa fa-copy"></i> Kopieren</a><button type="button" title="Die PDF-Version repräsentiert das zuletzt abgeschlossene Verfahren!" data-id="' + currId + '" class="btn pdfdownload" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> PDF anzeigen</button></div> <button type="button" data-id="' + currId +'" data-name="' + data['data'][c]['Bezeichnung'] +'" class="btn del btn-danger" ' + (data['data'][c]['Löschbar'] === true ? '' : 'disabled') + '><i class="fa fa-minus"></i> Löschen</button></td>');
newEntry.append('<td><div class="btn-group inline"><a class="btn" href="?id=' + currId + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-edit"></i> Bearbeiten</a><a class="btn" href="?copy=' + currId + '" target="_blank"><i class="fa fa-copy"></i> Kopieren</a><button type="button" title="Die PDF-Version repräsentiert das zuletzt abgeschlossene Verfahren!" data-id="' + currId + '" class="btn pdfdownload" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> ' + (parseInt(data['data'][c]['Status']) === 0 ? 'Letzte abgeschlossene PDF anzeigen' : 'PDF anzeigen') + '</button></div> <button type="button" data-id="' + currId +'" data-name="' + data['data'][c]['Bezeichnung'] +'" class="btn del btn-danger" ' + (data['data'][c]['Löschbar'] === true ? '' : 'disabled') + '><i class="fa fa-minus"></i> Löschen</button></td>');
modalBody.find('#editableprocesses tbody').append(newEntry);
}
else {
newEntry.append('<td style="width: 16px;"></td>');
newEntry.append('<td>' + data['data'][c]['Bezeichnung'] + ' <i data-toggle="tooltip" class="fa fa-info-circle" title="' + data['data'][c]['Beschreibung'] + '"></i></td>');
newEntry.append('<td>' + data['data'][c]['Fachabteilung'] + '</td>');
newEntry.append('<td>' + data['data'][c]['Status'] + statusSymbol + '</td>');
newEntry.append('<td>' + statusName + statusSymbol + '</td>');
newEntry.append('<td>' + data['data'][c]['Aktualisierung'] + '</td>');
newEntry.append('<td><div class="btn-group inline"><a class="btn" href="?id=' + currId + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-edit"></i> Anzeigen</a><a class="btn" href="?copy=' + currId + '" target="_blank"><i class="fa fa-copy"></i> Kopieren</a><button type="button" data-id="' + currId + '" class="btn pdfdownload" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> PDF anzeigen</button></div></td>');
newEntry.append('<td><div class="btn-group inline"><a class="btn" href="?id=' + currId + (debug ? '&debug=true' : '') + '" target="_blank"><i class="fa fa-edit"></i> Anzeigen</a><a class="btn" href="?copy=' + currId + '" target="_blank"><i class="fa fa-copy"></i> Kopieren</a><button type="button" data-id="' + currId + '" class="btn pdfdownload" ' + (data['data'][c]['PDF'] ? '' : 'disabled') + '><i class="fa fa-file-pdf-o"></i> ' + (parseInt(data['data'][c]['Status']) === 0 ? 'Letzte abgeschlossene PDF anzeigen' : 'PDF anzeigen') + '</button></div></td>');
modalBody.find('#readableprocesses tbody').append(newEntry);
}
}
......@@ -1555,7 +1555,7 @@ function initTypeahead(node) {
}*/
} :
{ // Einmal alle Daten holen und dann cachen lassen
[nodeData['url'] + '_' + nodeData['path']]: {
[window.location.origin + '/' + nodeData['url'] + '_' + nodeData['path']]: {
data: [{"label": "-- keine --"}],
ajax: {
type: 'GET',
......@@ -2121,6 +2121,8 @@ function showDocumentAddDialog(docID = -1, fileref = '', description = '') {
* @return {undefined}
*/
function loadDocuments() {
if(loadId === 0) return;
$.get(backendPath, { 'action': 'listDocuments', 'id': loadId, 'debug': debug }).done(function(data) {
if(!data['success']) {
showError('Laden der angehängten Dokumente', data['error']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment