summaryrefslogtreecommitdiff
path: root/archaeological_operations/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-10 00:26:07 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-10 00:26:07 +0100
commitc0f14049777002bf0849f04dabc99a6bc66de295 (patch)
tree777c2f1bcfc1cde0056a64b04d0ee322948ade56 /archaeological_operations/views.py
parent229a5559e9933ea76020963ca3778906d39279d4 (diff)
parent1191cb323ca087ea05d5f58acb555b8e2d266801 (diff)
downloadIshtar-c0f14049777002bf0849f04dabc99a6bc66de295.tar.bz2
Ishtar-c0f14049777002bf0849f04dabc99a6bc66de295.zip
Merge branch 'master' into v0.9
Conflicts: archaeological_files/migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r--archaeological_operations/views.py36
1 files changed, 27 insertions, 9 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py
index 18d57e617..005fae0db 100644
--- a/archaeological_operations/views.py
+++ b/archaeological_operations/views.py
@@ -163,8 +163,8 @@ def dashboard_operation(request, *args, **kwargs):
return render_to_response('ishtar/dashboards/dashboard_operation.html',
dct, context_instance=RequestContext(request))
-operation_search_wizard = SearchWizard.as_view([
- ('general-operation_search', OperationFormSelection)],
+operation_search_wizard = SearchWizard.as_view(
+ [('general-operation_search', OperationFormSelection)],
label=_(u"Operation search"),
url_name='operation_search',)
@@ -276,9 +276,14 @@ operation_closing_wizard = OperationClosingWizard.as_view(
label=_(u"Operation closing"),
url_name='operation_closing',)
-operation_deletion_wizard = OperationDeletionWizard.as_view([
+
+operation_deletion_steps = [
('selec-operation_deletion', OperationFormSelection),
- ('final-operation_deletion', OperationDeletionForm)],
+ ('final-operation_deletion', OperationDeletionForm)
+]
+
+operation_deletion_wizard = OperationDeletionWizard.as_view(
+ operation_deletion_steps,
label=_(u"Operation deletion"),
url_name='operation_deletion',)
@@ -404,17 +409,30 @@ def generatedoc_administrativeactop(request, pk, template_pk=None):
return HttpResponse(mimetype='text/plain')
-def administrativeactfile_document(request, operation=True):
+def administrativeactfile_document(
+ request, file=False, treatment=False, treatment_file=False):
search_form = AdministrativeActOpeFormSelection
- if not operation:
+ document_type = 'O'
+ if file:
from archaeological_files.forms import \
AdministrativeActFileFormSelection
search_form = AdministrativeActFileFormSelection
+ document_type = 'F'
+ elif treatment:
+ from archaeological_finds.forms import \
+ AdministrativeActTreatmentFormSelection
+ search_form = AdministrativeActTreatmentFormSelection
+ document_type = 'T'
+ elif treatment_file:
+ from archaeological_finds.forms import \
+ AdministrativeActTreatmentFileFormSelection
+ search_form = AdministrativeActTreatmentFileFormSelection
+ document_type = 'TF'
dct = {}
if request.POST:
dct['search_form'] = search_form(request.POST)
dct['template_form'] = DocumentGenerationAdminActForm(
- operation=operation)
+ document_type=document_type)
c_object = None
try:
if dct['search_form'].is_valid():
@@ -425,7 +443,7 @@ def administrativeactfile_document(request, operation=True):
pass
if c_object:
dct['template_form'] = DocumentGenerationAdminActForm(
- request.POST, operation=operation, obj=c_object)
+ request.POST, document_type=document_type, obj=c_object)
if dct['template_form'].is_valid():
return generatedoc_administrativeactop(
request,
@@ -434,7 +452,7 @@ def administrativeactfile_document(request, operation=True):
else:
dct['search_form'] = search_form()
dct['template_form'] = DocumentGenerationAdminActForm(
- operation=operation)
+ document_type=document_type)
return render_to_response('ishtar/administrativeact_document.html', dct,
context_instance=RequestContext(request))