Compare commits
No commits in common. "master" and "nextcloud" have entirely different histories.
|
|
@ -10,7 +10,6 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Agenturname</th>
|
||||
<th scope="col">NC Main ID</th>
|
||||
<th scope="col">Registriert am</th>
|
||||
<th scope="col">Mitarbeiter</th>
|
||||
<th scope="col">Standards</th>
|
||||
|
|
@ -22,7 +21,6 @@
|
|||
{% getAgencyData ele as agdata %}
|
||||
<tr>
|
||||
<td><a href="{% url 'adm-agency-single' ele.pk %}">{{ele.name}}</a></td>
|
||||
<td>{{ele.pk}}</td>
|
||||
<td data-sort='{{ele.registerdate|date:"U"}}'>{{ele.registerdate}}</td>
|
||||
<td>{{agdata.0}}</td>
|
||||
<td>{{agdata.1}}</td>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
$(document).ready(function(){
|
||||
// FIRST CALL GROUPS, When Groups finished User will call by Groups
|
||||
createAgencyGroups(groupids[0]);
|
||||
//addFiles(files[0]);
|
||||
|
||||
//DEV
|
||||
//rebuildingStandards(standards[0]);
|
||||
//addGroupFolder();
|
||||
|
|
@ -105,23 +105,6 @@
|
|||
if(files[0] != undefined){
|
||||
addFiles(files[0]);
|
||||
}
|
||||
else{
|
||||
console.log("NO FILES FOUND");
|
||||
if(standard_files[0] != undefined){
|
||||
console.log("start adding standard files...");
|
||||
addStandardFilesFiles(standard_files[0]);
|
||||
}
|
||||
else {
|
||||
console.log("NO STANDARD FILES FOUND");
|
||||
if(dirids[0] != undefined){
|
||||
addDirs(dirids[0]);
|
||||
}
|
||||
else {
|
||||
console.log("NO DIRS FOUND - MIGRATION DONE!");
|
||||
$("#migfinished").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log(data);
|
||||
|
|
@ -238,65 +221,9 @@
|
|||
});
|
||||
}
|
||||
standardcounter = 0;
|
||||
var ncfiledata = [];
|
||||
//Anlegen der Standarddateien
|
||||
function rebuildingStandards(id){
|
||||
/*
|
||||
ncfiledata.splice(0, ncfiledata.length);
|
||||
$("#cloud_process_standards").show();
|
||||
ncfiledata[0] = ['standardid', id];
|
||||
console.log("LOADING NC FILES");
|
||||
$.ajax({
|
||||
url: "{% url 'api:apiswitchstandardsprepare' %}",
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'standardid' : id,
|
||||
},
|
||||
success: function(data)
|
||||
{
|
||||
ncfiledata.push(data);
|
||||
console.log(ncfiledata);
|
||||
console.log("NC FILES LOADED, STARTING REBUILDING STANDARDS");
|
||||
$.ajax({
|
||||
url: "{% url 'api:apiswitchstandards' %}",
|
||||
dataType: 'json',
|
||||
type: "POST",
|
||||
data: JSON.stringify(ncfiledata),
|
||||
success: function(data){
|
||||
if(data['status'] == "OK"){
|
||||
standardcounter += 1;
|
||||
if(standardcounter < standards.length){
|
||||
console.log("STANDARD " + id + " OK");
|
||||
ncfiledata = [];
|
||||
rebuildingStandards(standards[standardcounter]);
|
||||
}
|
||||
else{
|
||||
ncfiledata = [];
|
||||
console.log("STANDARD " + id + " OK");
|
||||
$("#migfinished").show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
standardcounter += 1;
|
||||
console.log("FEHLER BEI STANDARD " + data['status'] + " ID " + id);
|
||||
if(standardcounter < standards.length){
|
||||
ncfiledata = [];
|
||||
rebuildingStandards(standards[standardcounter]);
|
||||
}
|
||||
else{
|
||||
ncfiledata = [];
|
||||
console.log("FEHLER BEI STANDARD " + data['status'] + " ID " + id);
|
||||
$("#migfinished").show();
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(e){
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
*/
|
||||
$.ajax({
|
||||
url: "{% url 'api:apiswitchstandards' %}",
|
||||
dataType: 'json',
|
||||
|
|
@ -331,7 +258,6 @@
|
|||
console.log(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
<h4>Agenturimport</h4>
|
||||
<small>Agenturen können hier importiert werden und erhalten einen detallierten Bericht. Bereits importierte Agenturen speichern ihre MainGroupID in Nextcloud</small>
|
||||
<hr>
|
||||
|
||||
<table class="table table-hover" id="agdata" >
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -25,7 +25,6 @@ urlpatterns = [
|
|||
path('wd/<int:pk>/delete', AdmWorkdayDelete.as_view(), name="adm-workday-delete"),
|
||||
path('wd/break/<int:pk>/delete', AdmBreakDelete.as_view(), name="adm-break-delete"),
|
||||
path('wd/<int:pk>/break/add', AdmAddBreak.as_view(), name="adm-break-add"),
|
||||
|
||||
# MIGRATION
|
||||
path('mig/aggroupfolder/<int:agencypk>', createAgGroupFolder, name="mig-groupfolder"),
|
||||
]
|
||||
|
|
|
|||
31
adm/views.py
31
adm/views.py
|
|
@ -471,7 +471,7 @@ def statisticCronJob(request, code):
|
|||
# FILES
|
||||
'''
|
||||
TODO: Hier bitte einmal checken, ob umbenannte Dateien auch gefunden werden können oder nicht
|
||||
|
||||
'''
|
||||
allfiles = 0
|
||||
try:
|
||||
files_data = DataFile.objects.all()
|
||||
|
|
@ -482,7 +482,6 @@ def statisticCronJob(request, code):
|
|||
allfiles_storage += os.stat(f.file.path).st_size
|
||||
except:
|
||||
pass
|
||||
'''
|
||||
|
||||
# LOGINS YESTERDAY
|
||||
yesterday = today - timedelta(days=1)
|
||||
|
|
@ -527,7 +526,7 @@ def statisticCronJob(request, code):
|
|||
extrausercount += len(user_ag) - 3
|
||||
finalmrr = abos + 3*extrausercount
|
||||
|
||||
newMainS = MainStatistic(agencys=agencycount,users=usercount,standards=standardcount,chatmessages=chatmesscount, active_abos=abocount, absenceobjects=absenceobjects, user_active_timemanagement=user_active_timemanagement, organizerobjects=organizerobjects, agency_recoverobjects=agency_recoverobjects, logins=logins, mrr=finalmrr)
|
||||
newMainS = MainStatistic(agencys=agencycount,users=usercount,standards=standardcount,chatmessages=chatmesscount, active_abos=abocount, absenceobjects=absenceobjects, user_active_timemanagement=user_active_timemanagement, organizerobjects=organizerobjects, agency_recoverobjects=agency_recoverobjects, allfiles=allfiles, allfiles_storage=allfiles_storage, logins=logins, mrr=finalmrr)
|
||||
newMainS.save()
|
||||
data.update({"status" : "success"})
|
||||
else:
|
||||
|
|
@ -671,13 +670,6 @@ class AdmAddBreak(CreateView):
|
|||
class AdmImport(TemplateView):
|
||||
template_name="adm/adm_import_overview.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForStuffUser(self.request)):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
messages.warning(self.request, f'Sie benötigen einen Mitarbeiter-Account, um diese Seiten aufzurufen!')
|
||||
return redirect("login")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context.update({'active_link' : 'adm-import'})
|
||||
|
|
@ -691,13 +683,6 @@ from cloud.models import *
|
|||
class AdmImportFlow(TemplateView):
|
||||
template_name="adm/adm_import_flow.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForStuffUser(self.request)):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
messages.warning(self.request, f'Sie benötigen einen Mitarbeiter-Account, um diese Seiten aufzurufen!')
|
||||
return redirect("login")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context.update({'active_link' : 'adm-import'})
|
||||
|
|
@ -725,11 +710,8 @@ class AdmImportFlow(TemplateView):
|
|||
ag_pk = str(agency.pk)
|
||||
ag_groups = []
|
||||
for g in groups:
|
||||
# GET AGENCY GROUP
|
||||
#gencygroupcheck = AgencyGroup.objects.get(group=g.id)
|
||||
for ag_group_agency in AgencyGroup.objects.filter(group=g):
|
||||
if(ag_pk in g.name and str(ag_group_agency.agency.pk) == ag_pk):
|
||||
ag_groups.append(g)
|
||||
if(ag_pk in g.name):
|
||||
ag_groups.append(g)
|
||||
|
||||
context.update({'groups' : ag_groups})
|
||||
|
||||
|
|
@ -766,11 +748,10 @@ def createAgGroupFolder(request, agencypk):
|
|||
}
|
||||
|
||||
r = requests.post(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/da_agency/api/v1/creategf?format=json", auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API), data=data)
|
||||
|
||||
r_2 = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_" + str(agency.pk)+ '/Standards Uploadbereich', auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
r_2 = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/admin/Agenturdaten_" + str(agency.pk)+ '/Standards Uploadbereich', auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
json_response = json.loads(r.text)
|
||||
response_status = json_response['ocs']['meta']['status']
|
||||
if(response_status == "ok"):
|
||||
return JsonResponse({'status' : True, 'message': 'Gruppenordner angelegt!' + r_2.text + " " + r.text})
|
||||
return JsonResponse({'status' : True, 'message': 'Gruppenordner angelegt!'})
|
||||
else:
|
||||
return JsonResponse({'status' : False, 'message': 'Konnte nicht angelegt werden!', 'errormessage_r' : r.text})
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ urlpatterns = [
|
|||
path('addstandardfile/', views.NCAddStandardFiles, name="apiaddstandardfile"),
|
||||
path('adddir/', views.NCAddDirs, name="apiadddir"),
|
||||
path('addswitchstandards/', views.NCSwitchStandardFiles, name="apiswitchstandards"),
|
||||
path('prepareswitchstandards/', views.NCGetFilesForStandardSwitch, name="apiswitchstandardsprepare"),
|
||||
|
||||
path('setlog/', views.SetUserData, name="apisetlog"),
|
||||
# EXTERNAL FROM NC
|
||||
|
|
|
|||
279
api/views.py
279
api/views.py
|
|
@ -223,12 +223,6 @@ def NCAddUser(request):
|
|||
for g in user.groups.all():
|
||||
groups.append(AgencyGroup.objects.get(group=g).nc_name)
|
||||
|
||||
# Die gruppe Mitarbeiter holen und ebenfalls hinzufügen
|
||||
ag_mitarbeiter = AgencyGroup.objects.filter(agency=user.profile.agency, agencygroupname="Mitarbeiter").first()
|
||||
ag_mitarbeiter.group.user_set.add(user)
|
||||
|
||||
groups.append("agencymaingroupid_" + str(user.profile.agency.pk))
|
||||
|
||||
#password = get_random_password(50)
|
||||
password = ""
|
||||
userid = user.username
|
||||
|
|
@ -256,7 +250,6 @@ def NCAddUser(request):
|
|||
try:
|
||||
r_status = json.loads(r.text)
|
||||
if(r_status['ocs']['meta']['statuscode'] == 100):
|
||||
|
||||
return JsonResponse({'status' : True, 'message': 'Benutzer ' + user.first_name + " " + user.last_name + ' angelegt und in die Gruppen gepackt.'})
|
||||
else:
|
||||
return JsonResponse({'status' : True, 'message': 'Benutzer ' + user.first_name + " " + user.last_name + ' konnte nicht angelegt werden. Bitte manuell prüfen!', 'message' : r.text})
|
||||
|
|
@ -309,40 +302,37 @@ import os
|
|||
def NCAddFiles(request):
|
||||
if request.method == "GET":
|
||||
agency = Agency.objects.get(pk=request.GET.get('agencyid'))
|
||||
if(DataFile.objects.filter(pk=request.GET.get('fileid')).exists()):
|
||||
file_to_load = DataFile.objects.get(pk=request.GET.get('fileid'))
|
||||
datadir_parent = None
|
||||
datadir_parent_dirnames = []
|
||||
if(file_to_load.parent != None):
|
||||
datadir_parent = file_to_load.parent
|
||||
datadir_parent_dirnames = [file_to_load.parent.name]
|
||||
file_to_load = DataFile.objects.get(pk=request.GET.get('fileid'))
|
||||
datadir_parent = None
|
||||
datadir_parent_dirnames = []
|
||||
if(file_to_load.parent != None):
|
||||
datadir_parent = file_to_load.parent
|
||||
datadir_parent_dirnames = [file_to_load.parent.name]
|
||||
|
||||
while(datadir_parent.parent != None):
|
||||
datadir_parent_dirnames.append(datadir_parent.parent.name)
|
||||
datadir_parent = datadir_parent.parent
|
||||
## Popping last Element
|
||||
d_prestring = ""
|
||||
if(len(datadir_parent_dirnames) > 0):
|
||||
datadir_parent_dirnames.pop(len(datadir_parent_dirnames)-1)
|
||||
# Turning Array around
|
||||
datadir_parent_dirnames = datadir_parent_dirnames[::-1]
|
||||
while(datadir_parent.parent != None):
|
||||
datadir_parent_dirnames.append(datadir_parent.parent.name)
|
||||
datadir_parent = datadir_parent.parent
|
||||
## Popping last Element
|
||||
d_prestring = ""
|
||||
if(len(datadir_parent_dirnames) > 0):
|
||||
datadir_parent_dirnames.pop(len(datadir_parent_dirnames)-1)
|
||||
# Turning Array around
|
||||
datadir_parent_dirnames = datadir_parent_dirnames[::-1]
|
||||
|
||||
# Dirs needed for the File
|
||||
for d in datadir_parent_dirnames:
|
||||
new_folder = d_prestring + "/" +d
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_" + str(agency.pk)+ '/' + new_folder, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
d_prestring += "/" + d
|
||||
# Dirs needed for the File
|
||||
for d in datadir_parent_dirnames:
|
||||
new_folder = d_prestring + "/" +d
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/admin/Agenturdaten_" + str(agency.pk)+ '/' + new_folder, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
d_prestring += "/" + d
|
||||
|
||||
# Uplod the file!
|
||||
final_file_path = settings.NEXTCLOUD_URL + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_"+ str(agency.pk) + "/" + d_prestring + "/" + file_to_load.name
|
||||
with open(file_to_load.file.path, 'rb') as f:
|
||||
r = requests.put(final_file_path, data=f, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
if(len(r.text) == 0):
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' angelegt.'})
|
||||
else:
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' konnte nicht angelegt. Bitte manuell prüfen!'})
|
||||
else:
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + str(request.GET.get('fileid')) + ' konnte nicht in Django gefunden werden. Bitte manuell prüfen!'})
|
||||
# Uplod the file!
|
||||
final_file_path = settings.NEXTCLOUD_URL + "remote.php/dav/files/admin/Agenturdaten_"+ str(agency.pk) + "/" + d_prestring + "/" + file_to_load.name
|
||||
with open(file_to_load.file.path, 'rb') as f:
|
||||
r = requests.put(final_file_path, data=f, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
if(len(r.text) == 0):
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' angelegt.'})
|
||||
else:
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' konnte nicht angelegt. Bitte manuell prüfen!'})
|
||||
|
||||
return JsonResponse({"status" : "NO AUTH"})
|
||||
|
||||
|
|
@ -353,22 +343,17 @@ def NCAddFiles(request):
|
|||
def NCAddStandardFiles(request):
|
||||
if request.method == "GET":
|
||||
agency = Agency.objects.get(pk=request.GET.get('agencyid'))
|
||||
try:
|
||||
if(DataFile.objects.filter(pk=request.GET.get('fileid')).exists()):
|
||||
file_to_load = DataFile.objects.get(pk=request.GET.get('fileid'))
|
||||
file_to_load = DataFile.objects.get(pk=request.GET.get('fileid'))
|
||||
|
||||
# Uplod the file!
|
||||
final_file_path = settings.NEXTCLOUD_URL + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_"+ str(agency.pk) + "/Standards Uploadbereich/" + file_to_load.name
|
||||
with open(file_to_load.file.path, 'rb') as f:
|
||||
r = requests.put(final_file_path, data=f, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
|
||||
if(len(r.text) == 0):
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' angelegt.'})
|
||||
else:
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' konnte nicht angelegt. Bitte manuell prüfen!'})
|
||||
except:
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ID nicht gefunden'})
|
||||
# Uplod the file!
|
||||
final_file_path = settings.NEXTCLOUD_URL + "remote.php/dav/files/admin/Agenturdaten_"+ str(agency.pk) + "/Standards Uploadbereich/" + file_to_load.name
|
||||
with open(file_to_load.file.path, 'rb') as f:
|
||||
r = requests.put(final_file_path, data=f, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
|
||||
if(len(r.text) == 0):
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' angelegt.'})
|
||||
else:
|
||||
return JsonResponse({'status' : True, 'message': 'Datei ' + file_to_load.name + ' konnte nicht angelegt. Bitte manuell prüfen!'})
|
||||
|
||||
return JsonResponse({"status" : "NO AUTH"})
|
||||
|
||||
|
|
@ -380,43 +365,41 @@ def NCAddStandardFiles(request):
|
|||
def NCAddDirs(request):
|
||||
if request.method == "GET":
|
||||
agency = Agency.objects.get(pk=request.GET.get('agencyid'))
|
||||
try:
|
||||
dir_to_create = DataDir.objects.get(pk=request.GET.get('dirid'))
|
||||
sharestring = ""
|
||||
if(dir_to_create.visibleby.all().count() > 0):
|
||||
sharestring = " Ordner nur sichtbar durch: "
|
||||
for cd in dir_to_create.visibleby.all():
|
||||
sharestring += cd.agencygroupname + " (" + cd.nc_name + ")"
|
||||
# Dir has no parent, create
|
||||
if(len(dir_to_create.parent.name) == 0):
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_" + str(agency.pk)+ '/' + dir_to_create.name, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
return JsonResponse({'status' : True, 'message': 'Ordner ' + dir_to_create.name + ' angelegt. ' + sharestring + " RESP: " + r.text})
|
||||
# Dir has parents, start thinking :)
|
||||
else:
|
||||
datadir_parent = None
|
||||
datadir_parent_dirnames = []
|
||||
if(dir_to_create.parent != None and len(dir_to_create.parent.name) > 0):
|
||||
datadir_parent = dir_to_create.parent
|
||||
datadir_parent_dirnames = [dir_to_create.parent.name]
|
||||
dir_to_create = DataDir.objects.get(pk=request.GET.get('dirid'))
|
||||
sharestring = ""
|
||||
if(dir_to_create.visibleby.all().count() > 0):
|
||||
sharestring = " Ordner nur sichtbar durch: "
|
||||
for cd in dir_to_create.visibleby.all():
|
||||
sharestring += cd.agencygroupname + " (" + cd.nc_name + ")"
|
||||
# Dir has no parent, create
|
||||
if(len(dir_to_create.parent.name) == 0):
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/admin/Agenturdaten_" + str(agency.pk)+ '/' + dir_to_create.name, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
return JsonResponse({'status' : True, 'message': 'Ordner ' + dir_to_create.name + ' angelegt. ' + sharestring})
|
||||
# Dir has parents, start thinking :)
|
||||
else:
|
||||
datadir_parent = None
|
||||
datadir_parent_dirnames = []
|
||||
if(dir_to_create.parent != None and len(dir_to_create.parent.name) > 0):
|
||||
datadir_parent = dir_to_create.parent
|
||||
datadir_parent_dirnames = [dir_to_create.parent.name]
|
||||
|
||||
if(datadir_parent.parent != None):
|
||||
while(datadir_parent.parent != None and len(datadir_parent.parent.name) > 0):
|
||||
datadir_parent_dirnames.append(datadir_parent.parent.name)
|
||||
datadir_parent = datadir_parent.parent
|
||||
if(datadir_parent.parent != None):
|
||||
while(datadir_parent.parent != None and len(datadir_parent.parent.name) > 0):
|
||||
datadir_parent_dirnames.append(datadir_parent.parent.name)
|
||||
datadir_parent = datadir_parent.parent
|
||||
|
||||
if(len(datadir_parent_dirnames) > 0):
|
||||
datadir_parent_dirnames = datadir_parent_dirnames[::-1]
|
||||
d_prestring = ""
|
||||
for d in datadir_parent_dirnames:
|
||||
new_folder = d_prestring + "/" +d
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_" + str(agency.pk)+ '/' + new_folder, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
d_prestring += "/" + d
|
||||
if(len(datadir_parent_dirnames) > 0):
|
||||
datadir_parent_dirnames = datadir_parent_dirnames[::-1]
|
||||
d_prestring = ""
|
||||
for d in datadir_parent_dirnames:
|
||||
new_folder = d_prestring + "/" +d
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/admin/Agenturdaten_" + str(agency.pk)+ '/' + new_folder, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
d_prestring += "/" + d
|
||||
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_" + str(agency.pk)+ d_prestring + "/" + dir_to_create.name, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/admin/Agenturdaten_" + str(agency.pk)+ '/' + d_prestring + "/" + dir_to_create.name, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
|
||||
return JsonResponse({'status' : True, 'message': 'Ordner ' + dir_to_create.name + ' angelegt.' + sharestring})
|
||||
|
||||
return JsonResponse({'status' : True, 'message': 'Ordner ' + dir_to_create.name + ' angelegt.' + sharestring + " RESP: " + r.text + " " + "remote.php/dav/files/vhdadjangoapi_8fjz47epc6/Agenturdaten_" + str(agency.pk) + d_prestring + "/" + dir_to_create.name})
|
||||
except:
|
||||
return JsonResponse({'status' : True, 'message': 'Ordner ID ID nicht gefunden'})
|
||||
|
||||
return JsonResponse({'status' : False, 'message': 'AUTH ERROR'})
|
||||
|
||||
|
|
@ -437,6 +420,8 @@ def SetUserData(request):
|
|||
return JsonResponse({'message' : 'USER NOT FOUND'})
|
||||
|
||||
|
||||
|
||||
|
||||
def getFileIdFromXML(xmlresponse):
|
||||
try:
|
||||
split_response = xmlresponse.split("<oc:fileid>")
|
||||
|
|
@ -451,123 +436,23 @@ def getFileIdFromXML(xmlresponse):
|
|||
|
||||
Pro Datei in addedfiles wird ein neues NCFile-Objekt erstellt und in addedfiles_nc gespeichert. In den Ansichten der Standards werden dann nur noch die addedfiles_nc-Elemente gesehen und verändert.
|
||||
'''
|
||||
import re, json
|
||||
from urllib.parse import unquote
|
||||
@api_view(['GET'], )
|
||||
def NCSwitchStandardFiles(request):
|
||||
if request.method == "GET":
|
||||
standard = Standards.objects.get(pk=request.GET.get('standardid'))
|
||||
response_status = "OK"
|
||||
# Dateien aus NC laden
|
||||
# TODO: HIER WIEDER DEN USER EINTRAGEN vhdarootadmin_2cdme7ckw
|
||||
filesearchdata = '<?xml version="1.0" encoding="UTF-8"?><d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:basicsearch><d:select><d:prop><oc:fileid/></d:prop></d:select><d:from><d:scope><d:href>/files/vhdarootadmin_2cdme7ckw' + '/Agenturdaten_' + str(standard.agency.pk) + '/</d:href><d:depth>infinity</d:depth></d:scope></d:from><d:where><d:gt><d:prop><oc:size/></d:prop><d:literal>1</d:literal></d:gt></d:where></d:basicsearch></d:searchrequest>'
|
||||
|
||||
#filesearchdata = '<?xml version="1.0" encoding="UTF-8"?><d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:prop><oc:fileid /></d:prop><d:depth>infinity</d:depth></d:propfind>'
|
||||
r = requests.request("SEARCH", settings.NEXTCLOUD_URL + "remote.php/dav/", data=filesearchdata, headers={'Content-Type' : 'text/xml', 'Authorization' : "Bearer " + request.user.profile.nc_sid})
|
||||
print(r.text)
|
||||
# IDs filtern aus XML-Response
|
||||
#print(r.text)
|
||||
ncfileids = [str(s) for s in re.findall('<d:response>(.+?)</d:response>', r.text)]
|
||||
final_nc_files = []
|
||||
# IDs from the User
|
||||
for ele in ncfileids:
|
||||
nc_filename_with_path = [str(s) for s in re.findall('<d:href>(.+?)</d:href>', ele)][0]
|
||||
nc_filename_with_path = nc_filename_with_path.split("/")
|
||||
|
||||
filename = nc_filename_with_path[len(nc_filename_with_path)-1]
|
||||
|
||||
nc_file_id = [str(s) for s in re.findall('<oc:fileid>(.+?)</oc:fileid>', ele)][0]
|
||||
|
||||
if(len(filename) > 0):
|
||||
final_nc_files.append([nc_file_id, unquote(filename, errors="strict")])
|
||||
|
||||
# Reset der NC-Files
|
||||
for nc_standard_file in standard.addedfiles_nc.all():
|
||||
nc_standard_file.delete()
|
||||
|
||||
standard.addedfiles_nc.clear()
|
||||
standard.save()
|
||||
|
||||
for f in standard.addedfiles.all():
|
||||
for nc_file_ele in final_nc_files:
|
||||
print(f.name + " NAME " + nc_file_ele[1])
|
||||
if(f.name == nc_file_ele[1]):
|
||||
ncfile = NCFile.objects.create(agency=standard.agency, nc_id=nc_file_ele[0], file_id=f)
|
||||
standard.addedfiles_nc.add(ncfile)
|
||||
response_status += " DATEI " + f.name + " ZU STANDARD " + str(standard.pk) + " zugeordnet. - NC FILE ID " + str(nc_file_ele[0])
|
||||
print("ZUGEORDNET!")
|
||||
return JsonResponse({"status" : response_status})
|
||||
|
||||
return JsonResponse({"status" : "NO AUTH"})
|
||||
'''
|
||||
if request.method == "GET":
|
||||
|
||||
#agency = Agency.objects.get(pk=request.GET.get('agencyid'))
|
||||
|
||||
jsonresponse = json.dumps(request.GET)
|
||||
json_final = json.loads(jsonresponse)
|
||||
standardid = False
|
||||
ncfiledata = False
|
||||
elejson = ""
|
||||
|
||||
for ele in json_final:
|
||||
elejson = json.loads(ele)
|
||||
standardid = elejson[0][1]
|
||||
|
||||
ncfiledata = elejson[1]['ncfiledata']
|
||||
|
||||
response_status = "OK"
|
||||
standard = Standards.objects.get(pk=standardid)
|
||||
|
||||
# Reset der NC-Files
|
||||
for nc_standard_file in standard.addedfiles_nc.all():
|
||||
nc_standard_file.delete()
|
||||
|
||||
standard.addedfiles_nc.clear()
|
||||
standard.save()
|
||||
|
||||
for f in standard.addedfiles.all():
|
||||
for nc_file_ele in ncfiledata:
|
||||
print(f.name + " NAME " + nc_file_ele[1])
|
||||
if(f.name == nc_file_ele[1]):
|
||||
ncfile = NCFile.objects.create(agency=standard.agency, nc_id=nc_file_ele[0], file_id=f)
|
||||
standard.addedfiles_nc.add(ncfile)
|
||||
response_status += " DATEI " + f.name + " ZU STANDARD " + str(standard.pk) + " zugeordnet. - NC FILE ID " + str(nc_file_ele[0])
|
||||
|
||||
return JsonResponse({"status" : response_status})
|
||||
return JsonResponse({"status" : "NO AUTH"})
|
||||
'''
|
||||
|
||||
@api_view(['GET'], )
|
||||
def NCGetFilesForStandardSwitch(request):
|
||||
if request.method == "GET":
|
||||
#agency = Agency.objects.get(pk=request.GET.get('agencyid'))
|
||||
standard = Standards.objects.get(pk=request.GET.get('standardid'))
|
||||
|
||||
# Dateien aus NC laden
|
||||
filesearchdata = '<?xml version="1.0" encoding="UTF-8"?><d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:basicsearch><d:select><d:prop><oc:fileid/></d:prop></d:select><d:from><d:scope><d:href>/files/vhdarootadmin_2cdme7ckw' + '/Agenturdaten_' + str(standard.agency.pk) + '/</d:href><d:depth>infinity</d:depth></d:scope></d:from><d:where><d:gt><d:prop><oc:size/></d:prop><d:literal>1</d:literal></d:gt></d:where></d:basicsearch></d:searchrequest>'
|
||||
|
||||
#filesearchdata = '<?xml version="1.0" encoding="UTF-8"?><d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:prop><oc:fileid /></d:prop><d:depth>infinity</d:depth></d:propfind>'
|
||||
r = requests.request("SEARCH", settings.NEXTCLOUD_URL + "remote.php/dav/", data=filesearchdata, headers={'Content-Type' : 'text/xml', 'Authorization' : "Bearer " + request.user.profile.nc_sid})
|
||||
# IDs filtern aus XML-Response
|
||||
#print(r.text)
|
||||
ncfileids = [str(s) for s in re.findall('<d:response>(.+?)</d:response>', r.text)]
|
||||
final_nc_files = []
|
||||
# IDs from the User
|
||||
for ele in ncfileids:
|
||||
nc_filename_with_path = [str(s) for s in re.findall('<d:href>(.+?)</d:href>', ele)][0]
|
||||
nc_filename_with_path = nc_filename_with_path.split("/")
|
||||
|
||||
filename = nc_filename_with_path[len(nc_filename_with_path)-1]
|
||||
|
||||
nc_file_id = [str(s) for s in re.findall('<oc:fileid>(.+?)</oc:fileid>', ele)][0]
|
||||
|
||||
if(len(filename) > 0):
|
||||
final_nc_files.append([nc_file_id, filename])
|
||||
|
||||
return JsonResponse({"ncfiledata" : final_nc_files})
|
||||
|
||||
|
||||
response_status = "OK"
|
||||
for f in standard.addedfiles.all():
|
||||
filesearchdata = '<?xml version="1.0" encoding="UTF-8"?><d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:basicsearch><d:select><d:prop><oc:fileid/><d:displayname/></d:prop></d:select><d:from><d:scope><d:href>/files/' + settings.NEXTCLOUD_USER_API + '/Agenturdaten_' + str(standard.agency.pk) + '</d:href><d:depth>infinity</d:depth></d:scope></d:from><d:where><d:like><d:prop><d:displayname/></d:prop><d:literal>' + f.name + '</d:literal></d:like></d:where></d:basicsearch></d:searchrequest>'
|
||||
r = requests.request("SEARCH", settings.NEXTCLOUD_URL + "remote.php/dav", data=filesearchdata, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API), headers={'Content-Type' : 'text/xml'})
|
||||
fileid = getFileIdFromXML(r.text)
|
||||
if(fileid == None):
|
||||
response_status += " FEHLER BEI STANDARD " + str(standard.pk) + " "
|
||||
else:
|
||||
ncfile = NCFile.objects.create(agency=standard.agency, nc_id=fileid, file_id=f)
|
||||
standard.addedfiles_nc.add(ncfile)
|
||||
return JsonResponse({"status" : response_status})
|
||||
return JsonResponse({"status" : "NO AUTH"})
|
||||
|
||||
@api_view(['GET'], )
|
||||
def deleteNCFile(request, fid, secretkey):
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
<a class="nav-link" id="calc-tab" data-toggle="tab" href="#calc" role="tab" aria-controls="calc" aria-selected="false"><i class="fas fa-coins"></i> Abrechnung</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if user|usergperm:"usermanager" %}
|
||||
{% if user|usergperm:"agencyinfo" %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="quota-tab" data-toggle="tab" href="#quota" role="tab" aria-controls="quota" aria-selected="false"><i class="fas fa-database"></i> Speicherplatz</a>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1060,10 +1060,9 @@ def SettingsAjaxRouter(request):
|
|||
'Access-Control-Allow-Headers' : 'OCS-APIRequest',
|
||||
'OCS-APIRequest' : 'true'
|
||||
}
|
||||
# TODO: Hier prüfen, ob das doppelte Leerzeichen nun weg ist.
|
||||
data_nc = {
|
||||
"key" : "displayname",
|
||||
"value" : tempuser.first_name + "" + tempuser.last_name
|
||||
"value" : tempuser.first_name + " " + tempuser.last_name
|
||||
}
|
||||
r = requests.put(settings.NEXTCLOUD_URL + "/ocs/v1.php/cloud/users/" + tempuser.username,headers=headers, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API), data=data_nc)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ SESSION_COOKIE_SECURE = False
|
|||
# FOR SUMMERNOTE ORIGIN
|
||||
#X_FRAME_OPTIONS = 'SAMEORIGIN'
|
||||
#X_FRAME_OPTIONS = 'ALLOWALL'
|
||||
X_FRAME_OPTIONS = 'allow-from .digitale-agentur.com'
|
||||
X_FRAME_OPTIONS = 'allow-from *cloud.digitale-agentur.com'
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
||||
|
|
@ -49,9 +49,7 @@ MAILINFOKEY = "jka7sd8iukashdna78skduJAHDsu6dilaksdjba65a68iadbhjak"
|
|||
#LEX_API = "8f9ba01f-9e84-42c7-9548-48c254f14c19"
|
||||
|
||||
# Gültig bis 17.10.2022
|
||||
#LEX_API = "8dcbd7a5-9447-417f-a4a4-989818742a36"
|
||||
|
||||
LEX_API = "p6xxyzOul0BaLDr-xuhVNYNzZ5s"
|
||||
LEX_API = "8dcbd7a5-9447-417f-a4a4-989818742a36"
|
||||
|
||||
# KEYS FOR ENCRYPTED FILE FIELDS
|
||||
DEFF_SALT = 'A-!GDtuKp?H/H5-UUatEh6ZcG/6h-VQf1OkDORRkK0(:(qCf//'
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ class RecoverDirAddPL(CreateView):
|
|||
template_name = "recoverdir/rd_pers_add.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -489,7 +489,7 @@ class RecoverDirUpdatePL(UpdateView):
|
|||
template_name = "recoverdir/rd_pers_update.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -513,7 +513,7 @@ class RDAoneAddDoc(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_1_adddoc.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -544,7 +544,7 @@ class RDAoneViewDoc(DetailView):
|
|||
context_object_name = 'document'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -556,7 +556,7 @@ class RDAoneDelDoc(DeleteView):
|
|||
context_object_name = 'document'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -573,7 +573,7 @@ class RDAoneUpdateDoc(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_1_adddoc.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -625,7 +625,7 @@ class RDAoneUpdateHL(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_1_addhl.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -643,7 +643,7 @@ class RDAoneAddFC(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_1_addfc.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -664,7 +664,7 @@ class RDAoneUpdateContact(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_1_addfc.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -681,7 +681,7 @@ class RDAoneViewContact(DetailView):
|
|||
context_object_name = 'contact'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -693,7 +693,7 @@ class RDAoneDelContact(DeleteView):
|
|||
context_object_name = 'contact'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -711,7 +711,7 @@ class RDAoneViewTrust(DetailView):
|
|||
context_object_name = 'contact'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -723,7 +723,7 @@ class RDAoneDelTrust(DeleteView):
|
|||
context_object_name = 'contact'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -740,7 +740,7 @@ class RDAoneAddTrust(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_1_addtrust.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -761,7 +761,7 @@ class RDAoneUpdateTrust(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_1_addtrust.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -780,7 +780,7 @@ class RDAtwoAddHLFV(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_addhlvf.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -801,7 +801,7 @@ class RDAtwoUpdateFV(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_addhlvf.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -819,7 +819,7 @@ class RDAtwoViewdeposit(DetailView):
|
|||
context_object_name = 'deposit'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -831,7 +831,7 @@ class RDAtwoDeldeposit(DeleteView):
|
|||
context_object_name = 'deposit'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -848,7 +848,7 @@ class RDAtwoAdddeposit(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_adddeposit.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -877,7 +877,7 @@ class RDAtwoUpdatedeposit(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_adddeposit.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -899,7 +899,7 @@ class RDAtwoViewergo(DetailView):
|
|||
context_object_name = 'ergo'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -911,7 +911,7 @@ class RDAtwoDelergo(DeleteView):
|
|||
context_object_name = 'ergo'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -928,7 +928,7 @@ class RDAtwoAddergo(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_addergo.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -949,7 +949,7 @@ class RDAtwoUpdateergo(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_addergo.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -971,7 +971,7 @@ class RDAtwoViewonlinebank(DetailView):
|
|||
context_object_name = 'onlinebank'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -983,7 +983,7 @@ class RDAtwoDelonlinebank(DeleteView):
|
|||
context_object_name = 'onlinebank'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1000,7 +1000,7 @@ class RDAtwoAddonlinebank(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_addonlinebank.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1030,7 +1030,7 @@ class RDAtwoUpdateonlinebank(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_2_addonlinebank.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1059,7 +1059,7 @@ class RDAthreeViewstreaming(DetailView):
|
|||
context_object_name = 'streaming'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1071,7 +1071,7 @@ class RDAthreeDelstreaming(DeleteView):
|
|||
context_object_name = 'streaming'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1088,7 +1088,7 @@ class RDAthreeAddstreaming(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_3_addstreamingabo.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1117,7 +1117,7 @@ class RDAthreeUpdatestreaming(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_3_addstreamingabo.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1146,7 +1146,7 @@ class RDAfourViewdigitalaccount(DetailView):
|
|||
context_object_name = 'account'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1159,7 +1159,7 @@ class RDAfourDeldigitalaccount(DeleteView):
|
|||
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1176,7 +1176,7 @@ class RDAfourAdddigitalaccount(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_4_adddigitalaccount.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1206,7 +1206,7 @@ class RDAfourUpdatedigitalaccount(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_4_adddigitalaccount.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1235,7 +1235,7 @@ class RDAfiveViewpersonal(DetailView):
|
|||
context_object_name = 'personal'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1247,7 +1247,7 @@ class RDAfiveDelpersonal(DeleteView):
|
|||
context_object_name = 'personal'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1264,7 +1264,7 @@ class RDAfiveAddpersonal(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_5_addpersonal.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1286,7 +1286,7 @@ class RDAfiveUpdatepersonal(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_5_addpersonal.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1308,7 +1308,7 @@ class RDAnineViewelse(DetailView):
|
|||
context_object_name = 'else'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1320,7 +1320,7 @@ class RDAnineDelelse(DeleteView):
|
|||
context_object_name = 'ele'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1337,7 +1337,7 @@ class RDAnineAddelse(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_9_addelse.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1359,7 +1359,7 @@ class RDAnineUpdateelse(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_9_addelse.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1381,7 +1381,7 @@ class RDAsevenViewcontract(DetailView):
|
|||
context_object_name = 'contract'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1393,7 +1393,7 @@ class RDAsevenDelcontract(DeleteView):
|
|||
context_object_name = 'ele'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1410,7 +1410,7 @@ class RDAsevenAddcontract(CreateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_7_addcontract.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self)):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1431,7 +1431,7 @@ class RDAsevenUpdatecontract(UpdateView):
|
|||
template_name = "recoverdir/rd_elements_forms/rd_area_7_addcontract.html"
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1454,7 +1454,7 @@ class PLSingleHistory(DetailView):
|
|||
context_object_name = 'persletter'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1481,7 +1481,7 @@ class HLSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_1_hl_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1510,7 +1510,7 @@ class HLVFSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_2_hl_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1539,7 +1539,7 @@ class ContactSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_1_contact_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1568,7 +1568,7 @@ class TrustSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_1_trust_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1597,7 +1597,7 @@ class DepositSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_2_deposit_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1626,7 +1626,7 @@ class DocumentSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_doc_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1655,7 +1655,7 @@ class ErgoSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_2_ergo_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1684,7 +1684,7 @@ class OnlinebankSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_2_onlinebank_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1713,7 +1713,7 @@ class StreamingSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_3_streamingabo_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1742,7 +1742,7 @@ class DigitalAccountSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_4_digitalaccount_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1771,7 +1771,7 @@ class PersonalSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_5_personal_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1800,7 +1800,7 @@ class ContractSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_7_contract_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
@ -1829,7 +1829,7 @@ class ElseSingleHistory(DetailView):
|
|||
template_name = 'recoverdir/rd_elements_forms/rd_area_9_else_single.html'
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
if(checkForLogin(self) and self.get_object().agency == self.request.user.profile.agency):
|
||||
if(checkForLogin(self) and self.instance.agency == self.request.user.profile.agency):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
else:
|
||||
return redirect('recoverdir-login')
|
||||
|
|
|
|||
|
|
@ -145,7 +145,10 @@
|
|||
</div>
|
||||
<datalist id="poss_files">
|
||||
{% for f in files %}
|
||||
<option id="files_{{f.0}}" value="{{f.1}}">{{f.1}}</option>
|
||||
{% getNCFileInfos request f as filename %}
|
||||
{% if filename != "FAIL_TO_LOAD_NC_FILE_DATA" %}
|
||||
<option id="files_{{f}}" value="{{filename}}">{{filename}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@
|
|||
{% getNCFileInfosURL request file.nc_id as filelink %}
|
||||
{% getNCDirInfosURL request file.nc_id as dirlink %}
|
||||
{% getNextcloudURL as nc_url %}
|
||||
<a href="{{nc_url}}apps/files/?dir=/{{dirlink}}&openfile={{file.nc_id}}" target="_blank">{{filename|truncatechars:30}}</a>
|
||||
<a href="{{nc_url}}apps/files/?dir=/{{dirlink}}&openfile={{file.nc_id}}" target="_blank">{{filename|truncatechars:30}}</a>
|
||||
<br />
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1181,46 +1181,40 @@ def getNCDirInfosURL(request, ncid):
|
|||
@register.simple_tag
|
||||
def getAGGroupQuotaData(request):
|
||||
r = requests.request("PROPFIND", settings.NEXTCLOUD_URL + "remote.php/dav/files/" + request.user.username + "/Agenturdaten", headers={'Content-Type' : 'text/xml', 'Authorization' : "Bearer " + request.user.profile.nc_sid})
|
||||
|
||||
# IN USE
|
||||
try:
|
||||
split_response = r.text.split("<d:quota-used-bytes>")
|
||||
inuse = split_response[1].split("</d:quota-used-bytes>")[0]
|
||||
|
||||
# QUOTA
|
||||
split_response = r.text.split("<d:quota-available-bytes>")
|
||||
quota = split_response[1].split("</d:quota-available-bytes>")[0]
|
||||
|
||||
# PERCENT VALUE
|
||||
percent = (100 / int(quota))*int(inuse)
|
||||
return [quota, inuse, str(round(percent, 0)).replace(",", ".")]
|
||||
except:
|
||||
return [0, 0, 0]
|
||||
split_response = r.text.split("<d:quota-used-bytes>")
|
||||
inuse = split_response[1].split("</d:quota-used-bytes>")[0]
|
||||
|
||||
# QUOTA
|
||||
split_response = r.text.split("<d:quota-available-bytes>")
|
||||
quota = split_response[1].split("</d:quota-available-bytes>")[0]
|
||||
|
||||
# PERCENT VALUE
|
||||
percent = (100 / int(quota))*int(inuse)
|
||||
|
||||
return [quota, inuse, str(round(percent, 0)).replace(",", ".")]
|
||||
|
||||
# User QUOTA
|
||||
import re, math
|
||||
@register.simple_tag
|
||||
def getUserQuotaData(userdata):
|
||||
r = requests.request("GET", settings.NEXTCLOUD_URL + "/ocs/v1.php/cloud/users/" + userdata.username, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API), headers={'Content-Type' : 'text/xml', 'OCS-APIRequest': "true"})
|
||||
try:
|
||||
quotadata = [int(s) for s in re.findall('<quota>(.+?)</quota>', r.text)]
|
||||
inuse = [int(s) for s in re.findall('<used>(.+?)</used>', r.text)]
|
||||
|
||||
quotadata_value = quotadata[0]
|
||||
valuequota_MB = 0
|
||||
counter = 0
|
||||
while(quotadata_value > 9999 or counter > 3):
|
||||
quotadata_value = quotadata_value / 1024
|
||||
counter += 1
|
||||
quotadata = [int(s) for s in re.findall('<quota>(.+?)</quota>', r.text)]
|
||||
inuse = [int(s) for s in re.findall('<used>(.+?)</used>', r.text)]
|
||||
|
||||
valuequota_MB = round(quotadata_value, 0)
|
||||
quotadata_value = quotadata[0]
|
||||
valuequota_MB = 0
|
||||
counter = 0
|
||||
while(quotadata_value > 9999 or counter > 3):
|
||||
quotadata_value = quotadata_value / 1024
|
||||
counter += 1
|
||||
|
||||
# PERCENT
|
||||
percent = (100 / int(quotadata[0]))*int(inuse[0])
|
||||
valuequota_MB = round(quotadata_value, 0)
|
||||
|
||||
return [quotadata[0], inuse[0], str(round(percent, 0)).replace(",", "."), str(valuequota_MB).split(".")[0]]
|
||||
except:
|
||||
return [0, 0, 0, 0]
|
||||
# PERCENT
|
||||
percent = (100 / int(quotadata[0]))*int(inuse[0])
|
||||
|
||||
return [quotadata[0], inuse[0], str(round(percent, 0)).replace(",", "."), str(valuequota_MB).split(".")[0]]
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ def StandardAdd(request, id=False):
|
|||
}
|
||||
|
||||
nc_login_headers = {'Authorization' : 'Bearer ' + request.user.profile.nc_sid}
|
||||
r = requests.request("PROPFIND", settings.NEXTCLOUD_URL + "remote.php/dav/files/" + request.user.username + "/Agenturdaten_" + str(request.user.profile.agency.pk) + "/", headers=nc_login_headers, data=data_nc)
|
||||
r = requests.request("PROPFIND", settings.NEXTCLOUD_URL + "remote.php/dav/files/" + request.user.username + "/Agenturdaten_1/", headers=nc_login_headers, data=data_nc)
|
||||
print(r.text)
|
||||
|
||||
#allfiles = DataFile.objects.filter(agency=request.user.profile.agency)
|
||||
|
|
@ -500,17 +500,16 @@ def StandardAdd(request, id=False):
|
|||
users_of_other_ag = User.objects.filter(profile__agency=agn_admin)
|
||||
for u in users_of_other_ag:
|
||||
if u.has_perm('users.standardmanager') and u.has_perm('users.agencynetwork'):
|
||||
pass
|
||||
#if u.usernotifications.agn_standard_created_mail:
|
||||
# notificationtext = "im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name
|
||||
#sendMailNoti(notificationtext, u)
|
||||
if u.usernotifications.agn_standard_created_mail:
|
||||
notificationtext = "im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name
|
||||
sendMailNoti(notificationtext, u)
|
||||
|
||||
#if u.usernotifications.agn_standard_created_push:
|
||||
# newnotification = UserNotification(touser=u, notificationtext="im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name, notificationtype="")
|
||||
# newnotification.save()
|
||||
if u.usernotifications.agn_standard_created_push:
|
||||
newnotification = UserNotification(touser=u, notificationtext="im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name, notificationtype="")
|
||||
newnotification.save()
|
||||
|
||||
# channel_layer = channels.layers.get_channel_layer()
|
||||
# async_to_sync(channel_layer.group_send)("user_" + str(u.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Agenturverbund | Im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name})
|
||||
channel_layer = channels.layers.get_channel_layer()
|
||||
async_to_sync(channel_layer.group_send)("user_" + str(u.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Agenturverbund | Im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name})
|
||||
for agn_admin in agencynetwork_single.members.all():
|
||||
if(agn_admin not in agency_send):
|
||||
agency_send.append(agn_admin)
|
||||
|
|
@ -518,17 +517,16 @@ def StandardAdd(request, id=False):
|
|||
users_of_other_ag = User.objects.filter(profile__agency=agn_admin)
|
||||
for u in users_of_other_ag:
|
||||
if u.has_perm('users.standardmanager') and u.has_perm('users.agencynetwork'):
|
||||
pass
|
||||
#if u.usernotifications.agn_standard_created_mail:
|
||||
#notificationtext = "im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name
|
||||
#sendMailNoti(notificationtext, u)
|
||||
if u.usernotifications.agn_standard_created_mail:
|
||||
notificationtext = "im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name
|
||||
sendMailNoti(notificationtext, u)
|
||||
|
||||
#if u.usernotifications.agn_standard_created_push:
|
||||
#newnotification = UserNotification(touser=u, notificationtext="im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name, notificationtype="")
|
||||
#newnotification.save()
|
||||
if u.usernotifications.agn_standard_created_push:
|
||||
newnotification = UserNotification(touser=u, notificationtext="im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name, notificationtype="")
|
||||
newnotification.save()
|
||||
|
||||
#channel_layer = channels.layers.get_channel_layer()
|
||||
#async_to_sync(channel_layer.group_send)("user_" + str(u.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Agenturverbund | Im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name})
|
||||
channel_layer = channels.layers.get_channel_layer()
|
||||
async_to_sync(channel_layer.group_send)("user_" + str(u.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Agenturverbund | Im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name})
|
||||
for agn_admin in agencynetwork_single.sharemembers.all():
|
||||
if(agn_admin not in agency_send):
|
||||
agency_send.append(agn_admin)
|
||||
|
|
@ -536,17 +534,16 @@ def StandardAdd(request, id=False):
|
|||
users_of_other_ag = User.objects.filter(profile__agency=agn_admin)
|
||||
for u in users_of_other_ag:
|
||||
if u.has_perm('users.standardmanager') and u.has_perm('users.agencynetwork'):
|
||||
pass
|
||||
#if u.usernotifications.agn_standard_created_mail:
|
||||
# notificationtext = "im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name
|
||||
# sendMailNoti(notificationtext, u)
|
||||
if u.usernotifications.agn_standard_created_mail:
|
||||
notificationtext = "im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name
|
||||
sendMailNoti(notificationtext, u)
|
||||
|
||||
#if u.usernotifications.agn_standard_created_push:
|
||||
# newnotification = UserNotification(touser=u, notificationtext="im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name, notificationtype="")
|
||||
# newnotification.save()
|
||||
if u.usernotifications.agn_standard_created_push:
|
||||
newnotification = UserNotification(touser=u, notificationtext="im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name, notificationtype="")
|
||||
newnotification.save()
|
||||
|
||||
# channel_layer = channels.layers.get_channel_layer()
|
||||
# async_to_sync(channel_layer.group_send)("user_" + str(u.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Agenturverbund | Im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name})
|
||||
channel_layer = channels.layers.get_channel_layer()
|
||||
async_to_sync(channel_layer.group_send)("user_" + str(u.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Agenturverbund | Im Agenturverbund " + agencynetwork_single.name + " wurde ein neuer Standard geteilt: " + standard.name})
|
||||
# Clear sended Agencys for multiple Networks
|
||||
agency_send = []
|
||||
|
||||
|
|
@ -603,39 +600,27 @@ def StandardAdd(request, id=False):
|
|||
#filesearchdata = '<?xml version="1.0" encoding="UTF-8"?><d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:prop><oc:fileid /></d:prop><d:depth>infinity</d:depth></d:propfind>'
|
||||
r = requests.request("SEARCH", settings.NEXTCLOUD_URL + "remote.php/dav/", data=filesearchdata, headers={'Content-Type' : 'text/xml', 'Authorization' : "Bearer " + request.user.profile.nc_sid})
|
||||
# IDs filtern aus XML-Response
|
||||
try:
|
||||
split_response = r.text.split("<oc:fileid>")
|
||||
|
||||
# Header des XML-Response entfernen
|
||||
split_response.pop(0)
|
||||
|
||||
# IDs from the User
|
||||
for ele in split_response:
|
||||
new_id = ele.split("</oc:fileid>")[0]
|
||||
|
||||
file_free = True
|
||||
# Prüfen, dass diese IDs nicht im aktuellen Standard sind
|
||||
for sf in standard.addedfiles_nc.all():
|
||||
if str(sf.nc_id) == str(new_id):
|
||||
file_free = False
|
||||
|
||||
ncfileids = [str(s) for s in re.findall('<d:response>(.+?)</d:response>', r.text)]
|
||||
final_nc_files = []
|
||||
# IDs from the User
|
||||
for ele in ncfileids:
|
||||
nc_filename_with_path = [str(s) for s in re.findall('<d:href>(.+?)</d:href>', ele)][0]
|
||||
nc_filename_with_path = nc_filename_with_path.split("/")
|
||||
|
||||
filename = nc_filename_with_path[len(nc_filename_with_path)-1]
|
||||
|
||||
nc_file_id = [str(s) for s in re.findall('<oc:fileid>(.+?)</oc:fileid>', ele)][0]
|
||||
|
||||
if(len(filename) > 0):
|
||||
final_nc_files.append([nc_file_id, filename])
|
||||
|
||||
|
||||
|
||||
# IDs from the User
|
||||
for ele in final_nc_files:
|
||||
|
||||
file_free = True
|
||||
# Prüfen, dass diese IDs nicht im aktuellen Standard sind
|
||||
for sf in standard.addedfiles_nc.all():
|
||||
if str(sf.nc_id) == str(ele[0]):
|
||||
file_free = False
|
||||
|
||||
if file_free == True:
|
||||
possibleFilesByVisible.append([ele[0], ele[1]])
|
||||
|
||||
if file_free == True:
|
||||
possibleFilesByVisible.append(new_id)
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
# STANDARDS
|
||||
possible_standards = []
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@
|
|||
<span style="color: red">-{{erg.0}}</span>
|
||||
{% endif %}
|
||||
</small>
|
||||
<button style="float: right; margin-right: 10px; margin-bottom: -40px; z-index:10000;" class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button style="float: right; margin-right: -22px; margin-bottom: -40px; z-index:10000;" class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button style="float: right; margin-right: 10px; margin-bottom: -40px;" class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button style="float: right; margin-right: -22px; margin-bottom: -40px;" class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@
|
|||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'" style="z-index:10000;"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " style="z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" href="{% url 'tm-update' workday.pk %}" style=" z-index:10000;"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm" style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
@ -131,8 +131,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
@ -162,8 +162,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" href="{% url 'tm-update' workday.pk %}" style=" z-index:10000;"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
@ -195,8 +195,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
|
@ -227,8 +227,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
|
@ -431,8 +431,8 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
@ -133,8 +133,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
@ -197,8 +197,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
|
@ -229,8 +229,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if breakmonthline < da %}
|
||||
<a class="btn btn-secondary btn-sm ml-2" style=" z-index:10000;" href="{% url 'tm-update' workday.pk %}"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " style=" z-index:10000;" onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
|
@ -426,8 +426,8 @@
|
|||
{% endif %}
|
||||
|
||||
|
||||
<a class="btn btn-secondary btn-sm ml-2" href="{% url 'tm-update' workday.pk 1 %}" style=" z-index:10000;"><small><i class="fas fa-pen"></i></small></a>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')" style=" z-index:10000;"><small><i class="fas fa-trash"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk 1 %}'"><small><i class="fas fa-pen"></i></small></button>
|
||||
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -422,8 +422,7 @@ def TimeManagement(request, activemonth=False, activeyear=False):
|
|||
def TimeUpdate(request, pk, team=0):
|
||||
workday = Workday.objects.get(pk=pk)
|
||||
user = workday.user
|
||||
#if(request.user.profile.agency == workday.agency and request.user.has_perm('users.usermanager')):
|
||||
if(request.user.profile.agency == workday.agency):
|
||||
if(request.user.profile.agency == workday.agency and request.user.has_perm('users.usermanager')):
|
||||
if(request.method == "POST"):
|
||||
if(team == 0):
|
||||
form = UpdateWorkdayForm(request.POST, instance=request.user)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
<script src="{%static 'users/js/jquery.js' %}" type="text/javascript"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
window.location.replace("https://app.digitale-agentur.com/external/1");
|
||||
window.location.replace("https://cloud.digitale-agentur.com/external/1");
|
||||
localStorage.clear();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<script src="{%static 'users/js/jquery.js' %}" type="text/javascript"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
window.location.replace("app.digitale-agentur.com/external/1");
|
||||
window.location.replace("cloud.digitale-agentur.com/external/1");
|
||||
localStorage.clear();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<script src="{%static 'users/js/jquery.js' %}" type="text/javascript"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
window.location.replace("app.digitale-agentur.com/external/1");
|
||||
window.location.replace("cloud.digitale-agentur.com/external/1");
|
||||
localStorage.clear();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<script src="{%static 'users/js/jquery.js' %}" type="text/javascript"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
window.location.replace("app.digitale-agentur.com/external/1");
|
||||
window.location.replace("cloud.digitale-agentur.com/external/1");
|
||||
localStorage.clear();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -1639,9 +1639,7 @@ def cronactions(request, code):
|
|||
news.agnotify = True
|
||||
news.save()
|
||||
for user in allusers:
|
||||
pass
|
||||
# SEMI-SIGNAL FOR NEWS GOING ONLINE
|
||||
'''
|
||||
if(user.usernotifications.news_created_mail and news.agency == user.profile.agency):
|
||||
notificationtext = "Neue Agenturnews: " + news.name
|
||||
username = user.first_name + " " + user.last_name
|
||||
|
|
@ -1661,7 +1659,7 @@ def cronactions(request, code):
|
|||
|
||||
channel_layer = channels.layers.get_channel_layer()
|
||||
async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__News | Neue Agenturnews: " + news.name})
|
||||
'''
|
||||
|
||||
# LEXOFFICE TEST
|
||||
# HEADERS CURL
|
||||
'''
|
||||
|
|
@ -1857,14 +1855,13 @@ def cronactionsdaily(request, code):
|
|||
for r in repre_absence:
|
||||
if(r.representator.usernotifications.absence_user_is_rep_reminder_mail):
|
||||
sendMailNoti(" in einer Woche startet Ihre Vertretung für " + r.user.first_name + " " + r.user.last_name + "!", user)
|
||||
'''
|
||||
|
||||
if(r.representator.usernotifications.absence_user_is_rep_reminder_push):
|
||||
newnotification = UserNotification(touser=user, notificationtext="Erinnerung für Abwesenheitsvertretung!", notificationtype="", elementid=r.pk)
|
||||
newnotification.save()
|
||||
|
||||
channel_layer = channels.layers.get_channel_layer()
|
||||
async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Abwesenheit | In einer Woche startet Ihre Vertretung für " + r.user.first_name + " " + r.user.last_name + "!"})
|
||||
'''
|
||||
except:
|
||||
mailstatus += "ERROR REMINDER ABSENCEMAIL"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue