aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-12-29 11:16:40 +0100
committerAndrea Lepori <alepori@student.ethz.ch>2022-12-29 11:16:41 +0100
commit37bfbd7dcdd2542228984b1f8161fd94860750f7 (patch)
tree25cf42a5905b74f60de2744b9c468567e288be49 /server
parentfix quick select for readonly doclist (diff)
downloadscout-subs-37bfbd7dcdd2542228984b1f8161fd94860750f7.tar.gz
scout-subs-37bfbd7dcdd2542228984b1f8161fd94860750f7.zip
remove unarchive, enable archive unapproved docs
Diffstat (limited to '')
-rw-r--r--server/templates/server/doc_list.html3
-rw-r--r--server/views.py30
2 files changed, 15 insertions, 18 deletions
diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html
index 023cf54..06c8893 100644
--- a/server/templates/server/doc_list.html
+++ b/server/templates/server/doc_list.html
@@ -17,7 +17,7 @@
</a>
</li>
<li><a class="tooltipped modal-trigger" href="#modal2" data-position="top" data-tooltip="Archivia selezionati"><i class="material-icons">archive</i></a></li>
- <li><a class="tooltipped" data-position="top" data-tooltip="Dearchivia selezionati" Onclick="send('unarchive')"><i class="material-icons">unarchive</i></a></li>
+ <!--<li><a class="tooltipped" data-position="top" data-tooltip="Dearchivia selezionati" Onclick="send('unarchive')"><i class="material-icons">unarchive</i></a></li>-->
<li><a class="tooltipped modal-trigger" href="#modal3" data-position="top" data-tooltip="Scarica selezionati" Onclick="send('download')"><i class="material-icons">file_download</i></a></li>
{% if settings.DEBUG %}
<li><a class="tooltipped" data-position="top" data-tooltip="Approva selezionati" Onclick="send('approve')"><i class="material-icons left">check</i>DEBUG</a></li>
@@ -38,6 +38,7 @@
<div class="modal-content">
<h4>Attenzione</h4>
<p>
+ Una volta archiviato un documento non potrà più essere dearchiviato.<br>
Se il documento contine dati medici quando archiviato tutti i dati medici verranno eliminati.
</p>
</div>
diff --git a/server/views.py b/server/views.py
index fb4af8a..89c66b2 100644
--- a/server/views.py
+++ b/server/views.py
@@ -1118,23 +1118,19 @@ def doclist(request):
docc.status = 'ok'
docc.save()
elif request.POST["action"] == 'archive':
- if docc.status == 'ok':
- docc.status = 'archive'
- if docc.medical_data:
- docc.medical_data.delete()
- docc.medical_data.save()
- docc.medical_data = None
- docc.save()
- else:
- error = True
- error_text = "Non puoi archiviare un documento non approvato"
- elif request.POST["action"] == 'unarchive':
- if docc.status == 'archive':
- docc.status = 'ok'
- docc.save()
- else:
- error = True
- error_text = "Non puoi dearchiviare un documento non archiviato"
+ docc.status = 'archive'
+ if docc.medical_data:
+ docc.medical_data.delete()
+ docc.medical_data.save()
+ docc.medical_data = None
+ docc.save()
+ #elif request.POST["action"] == 'unarchive':
+ # if docc.status == 'archive':
+ # docc.status = 'ok'
+ # docc.save()
+ # else:
+ # error = True
+ # error_text = "Non puoi dearchiviare un documento non archiviato"
# get filter values
hidden = "filter_hidden" in request.POST