{% extends "ishtar/sheet.html" %}
{% load i18n l10n ishtar_helpers window_tables window_header window_ope_tables window_field from_dict %}
{% block head_title %}{% trans "Operation" %} - {{item.short_label}}{% if item.common_name %} - {{item.common_name}}{% endif %}{% endblock %}
{% block toolbar %}
{% window_nav item window_id 'show-operation' 'operation_modify' 'show-historized-operation' 'revert-operation' previous next 1 %}
{% endblock %}
{% block content %}
{# trick to set to null non existing variable #}
{% with permission_view_document=permission_view_document %}
{% with permission_view_own_document=permission_view_own_document %}
{% with permission_view_find=permission_view_find %}
{% with permission_view_own_find=permission_view_own_find %}
{% with permission_view_contextrecord=permission_view_contextrecord %}
{% with permission_view_own_contextrecord=permission_view_own_contextrecord %}
{% with permission_view_container=permission_view_container %}
{% with permission_view_own_container=permission_view_own_container %}
{% with permission_change_own_geovectordata=permission_change_own_geovectordata %}
{% with permission_change_geovectordata=permission_change_geovectordata %}
{% with permission_change_geo=permission_change_own_geovectordata|or_:permission_change_geovectordata %}
{% with display_data=item.data %}
{% with display_relations=item|safe_or:"right_relations.count|left_relations.count" %}
{% with display_sites=item|safe_or:"archaeological_sites.count|grouped_parcels|administrative_act.count|archaeological_sites_list" %}
{% with perm_documents=permission_view_own_document|or_:permission_view_document %}
{% with has_documents=item|safe_or:"documents.count|documents_list" %}
{% with display_documents=perm_documents|and_:has_documents %}
{% with perm_context_records=permission_view_own_contextrecord|or_:permission_view_contextrecord %}
{% with has_context_records=item|safe_or:"context_record.count" %}
{% with display_context_records=perm_context_records|and_:has_context_records %}
{% with perm_find=permission_view_own_find|or_:permission_view_find %}
{% with has_finds=item|safe_or:"has_finds" %}
{% with display_finds=perm_find|and_:has_finds %}
{% if output != "ODT" and output != "PDF" %}
{% include "ishtar/blocks/window_image.html" %}
{% include "ishtar/blocks/sheet_external_id.html" %}
{% with PROFILE.operation_prefix|add:item.code_patriarche as ope_code %}
{% if not item.code_patriarche and item.year and item.operation_code %}
{{item.year|default:''}}-{{item.operation_code|default:''}}
{% else %}
{{ope_code}}
{% endif %}
{% if item.complete_identifier != ope_code %}
{{ item.complete_identifier }}
{% endif %}
{% endwith %}
{% if item.year %}{% trans "Year" %}{{ item.year|unlocalize }}{% endif %}
{% trans "Towns" %}
{% if next %}
{{ item|m2m_listing:'towns'|join:" ; "|default:'' }}
{% else %}
{{ item.cached_towns_label }}
{% endif %}
{% if item.common_name %}{% trans "Name" %}{{ item.common_name }}{% endif %}
{% if item.address %}{% trans "Address / Locality" %}{{ item.address }}{% endif %}
{% trans "Excavation dates (start/end)" as date_label %}
{% if item.start_date or item.end_date %}{% if not is_external %}
{% with start_date=item.start_date|date:"DATE_FORMAT"|default:"-" %}
{% with end_date=item.excavation_end_date|date:"DATE_FORMAT"|default:"-" %}
{% with dates=start_date|add:" / "|add:end_date %}
{% field_flex_2 date_label dates %}
{% endwith %}{% endwith %}{% endwith %}
{% else %}
{% with start_date=item.start_date|default:"-" %}
{% with end_date=item.excavation_end_date|default:"-" %}
{% with dates=start_date|add:" / "|add:end_date %}
{% field_flex_2 date_label dates %}
{% endwith %}{% endwith %}{% endwith %}
{% endif %}{% endif %}
-
{% trans "State" %}
-
{% if item.is_active %}
{% trans "Active file" %}
{% elif is_external %}{% else %}
{% trans "Closed operation" %}
{% endif %}
{% field_flex_2 "Code DRASSM" item.drassm_code %}
{% field_flex_2 "Old code" item.old_code %}
{% with has_image=item.images.count %}
{% if not has_image %}
{% endif %}
{% field_flex "Type" item.operation_type %}
{% field_flex_detail "Head scientist" item.scientist has_image %}
{% field_flex_detail "Scientific monitor" item.in_charge has_image %}
{% field_flex_multiple "Collaborators" item.collaborators has_image %}
{% field_flex_detail "Operator" item.operator has_image %}
{% if item.closing.date %}
- {%trans "Closing date"%}
-
{{ item.closing.date }} {%trans "by" %} {{ item.closing.user }}
{% endif %}
{% if item.surface %}
- {%trans "Surface"%}
-
{{ item.surface }} m2 ({{ item.surface_ha }} ha)
{% endif %}
{% if item.cost %}
- {%trans "Cost" %}
-
{{ item.cost }} €{% if item.cost_by_m2 %}, ({{ item.cost_by_m2 }} €/m2){%endif%}
{% endif %}
{% if item.duration %}
- {%trans "Duration"%}
- {{ item.duration }} {% trans "days" %}
{% endif %}
{% if has_image %}
{#
#}
{% endif %}
{% endwith %}
{% field_flex_multiple_obj "Remains" item 'remains' %}
{% field_flex_multiple_obj "Chronological period" item 'periods' %}
{% field_flex "Record quality" item.record_quality_type %}
{% with report_delivery_date=item.report_delivery_date|date:"DATE_FORMAT"|default:"" %}
{% field_flex "Report delivery date" report_delivery_date %}
{% endwith %}
{% field_flex "Report processing" item.report_processing %}
{% with documentation_deadline=item.documentation_deadline|date:"DATE_FORMAT"|default:"" %}
{% field_flex "Deadline for submission of the documentation" documentation_deadline %}
{% endwith %}
{% field_flex "Documentation received" item.documentation_received %}
{% with finds_deadline=item.finds_deadline|date:"DATE_FORMAT"|default:"" %}
{% field_flex "Deadline for submission of the finds" finds_deadline %}
{% endwith %}
{% field_flex "Finds received" item.finds_received %}
{% field_flex_detail "Associated file" item.associated_file %}
{% field_flex "Résultat considéré comme négatif" item.negative_result %}
{% field_flex_detail "Rapporteur CTRA/CIRA" item.cira_rapporteur %}
{% with cira_date=item.cira_date|date:"DATE_FORMAT"|default:"" %}
{% field_flex "Date avis CTRA/CIRA" cira_date %}
{% endwith %}
{% field_flex "Operator reference" item.operator_reference %}
{% field_flex "Responsible for planning service" item.associated_file.responsible_town_planning_service.full_address %}
{% if item.associated_file.town_planning_service %}
{% field_flex "Planning service organization" item.associated_file.town_planning_service.full_address %}
{% else %}
{% field_flex "Planning service organization" item.associated_file.responsible_town_planning_service.attached_to.full_address %}
{% endif %}
{% field_flex "Permit type" item.associated_file.permit_type %}
{% field_flex "Permit reference" item.associated_file.permit_reference %}
{% field_flex "General contractor" item.associated_file.general_contractor.full_address %}
{% if item.associated_file.corporation_general_contractor %}
{% field_flex "General contractor organization" item.associated_file.corporation_general_contractor.full_address %}
{% else%}
{% field_flex "General contractor organization" item.associated_file.general_contractor.attached_to.full_address %}
{% endif %}
{% field_flex_full "Comment" item.comment "
" "
" %}
{% field_flex_full "Abstract" item.abstract "
" "
" %}
{% field_flex_full "Comment about scientific documentation" item.scientific_documentation_comment "
" "
" %}
{% if item.virtual_operation %}
{% trans "This operation is virtual." %}
{% endif %}
{% if not item.code_patriarche %}
{% trans "Patriarche OA code not yet recorded!"%}
{% endif %}
{% if item.fnap_financing or item.fnap_cost or item.zoning_prescription or item.large_area_prescription or item.geoarchaeological_context_prescription or item.scheduled_man_days or item.optional_man_days or item.effective_man_days %}
{% trans "Preventive" %}
{% field_flex "Financement FNAP (%)" item.fnap_financing %}
{% field_flex "Financement FNAP (€)" item.fnap_cost %}
{% field_flex "Prescription on zoning" item.zoning_prescription %}
{% field_flex "Prescription on large area" item.large_area_prescription %}
{% field_flex "Prescription on geoarchaeological context" item.geoarchaeological_context_prescription %}
{% field_flex "Scheduled man-days" item.scheduled_man_days %}
{% field_flex "Optional man-days" item.optional_man_days %}
{% field_flex "Effective man-days" item.effective_man_days %}
{% endif %}
{% if item.seizure_name or item.official_report_number or item.name_of_the_protagonist or item.applicant_authority or item.minutes_writer %}
{% trans "Court-ordered seizure" %}
{% field_flex "Seizure name" item.seizure_name %}
{% field_flex "Official report number" item.official_report_number %}
{% field_flex_detail "Protagonist" item.protagonist %}
{% field_flex_detail "Applicant authority" item.applicant_authority %}
{% field_flex_detail "Writer of the minutes" item.minutes_writer %}
{% endif %}
{% trans "Geographic localisation" %}
{% with geo_item=item %}
{% include "ishtar/blocks/sheet_map.html"%}
{% endwith %}
{% if next %}
{% field_flex "Towns" item|m2m_listing:'towns'|join:" ; " %}
{% else %}
{% field_flex_detail_multiple "Towns" item.towns %}
{% endif %}
{% field_flex "Address" item.address %}
{% if not item.address %}
{% field_flex "Main address" item.associated_file.address %}
{% field_flex "Complement" item.associated_file.address_complement %}
{% field_flex "Postal code" item.associated_file.postal_code %}
{% endif %}
{% if not is_external %}
{% trans "Sheet"%}
{% include "ishtar/blocks/sheet_creation_section.html" %}
{% endif %}
{% if display_sites %}
{% trans "Archaeological sites" as archaeologicalsites_label %}
{% if item.archaeological_sites.count %}
{% dynamic_table_document archaeologicalsites_label 'sites' 'operations' item.pk '' output %}
{% elif item.archaeological_sites_list %}
{{archaeologicalsites_label}}
{% for values in item.archaeological_sites_list %}{% if not forloop.counter0 %}
{% for value in values %}{{value}} | {% endfor %}
{% else %}
{% for value in values %}{{value}} | {% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if item.parcels.count %}
{% trans "Associated parcels" as parcels_label %}
{% include "ishtar/blocks/window_tables/parcels.html" %}
{% endif %}
{% if item.administrative_act.count %}
{% trans "Administrative acts" %}
{% table_administrativact "" item.administrative_act.all %}
{% endif %}
{% endif %}
{% if display_documents %}
{% trans "Document from this operation" as operation_docs %}
{% if item.documents.count %}
{% dynamic_table_document operation_docs 'documents' 'operations' item.pk '' output %}
{% elif item.documents_list %}
{{operation_docs}}
{% include "ishtar/blocks/api_document_list.html" %}
{% endif %}
{% endif %}
{% if display_relations %}
{% if item.right_relations.count %}
{% trans "Relations"%}
{% for rel in item.right_relations.all %}
{% ifchanged rel.relation_type %}
{% if forloop.counter0 %}{% endif %}
{{rel.relation_type}}
{% endifchanged %}
{% if forloop.last %}
{% endif %}
{% endfor %}
{% else %}
{% trans "No relations" %}
{% endif %}
{% endif %}
{% if display_context_records %}
{% trans "Context records" as cr_lab %}
{% dynamic_table_document cr_lab 'context_records_for_ope' 'operation_id' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% if item.context_record_relations_q.count %}
{% trans "Context record relations" as cr_rels %}
{% dynamic_table_document cr_rels 'context_records_relations_detail' 'left_record__operation' item.pk '' output %}
{% endif %}
{% if permission_view_own_document or permission_view_document %}
{% if item.context_record_docs_q.count %}
{% trans "Documents from associated context records" as cr_docs %}
{% dynamic_table_document cr_docs 'documents' 'context_records__operation' item.pk '' output %}
{% endif %}
{% if item.context_record_relations_q.count %}
{% trans "Diagram of stratigraphic relations" %}
{% with gen_url='generate-relation-image-contextrecord' %}
{% with relation_type="full" %}
{% with relation_image=item.relation_image %}
{% with relation_png=item.relation_bitmap_image %}
{% with relation_dot=item.relation_dot %}
{% include "ishtar/blocks/sheet_relation_image.html" %}
{% endwith %}{% endwith %}{% endwith %}{% endwith %}
{% endwith %}
{% endif %}
{% endif %}
{% if display_finds %}
{% trans "Finds" as finds %}
{% dynamic_table_document finds 'finds_for_ope' 'base_finds__context_record__operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
{% if perm_documents and item.find_docs_q.count %}
{% trans "Documents from associated finds" as finds_docs %}
{% dynamic_table_document finds_docs 'documents' 'finds__base_finds__context_record__operation' item.pk '' output %}
{% endif %}
{% if permission_view_own_container or permission_view_container %}
{% if item.containers_q.count %}
{% trans "Associated containers" as containers_lbl %}
{% dynamic_table_document containers_lbl 'containers' 'finds__base_finds__context_record__operation' item.pk '' output %}
{% endif %}
{% endif %}
{% endif %}
{% if not is_external and SHOW_GEO %}
{% with geo_item=item %}{% include "ishtar/blocks/sheet_geographic.html" %}{% endwith %}
{% endif %}
{% if display_data %}
{% trans "Statistics" %}
{% with item.last_stats_update as last_stats_update%}
{% if last_stats_update %}
{% trans "Last update:" %} {{last_stats_update}}
{% endif %}{% endwith %}
{% trans "Administrative acts" %}
{% field_flex_2 "Number of administrative acts" item.nb_acts %}
{% field_flex_2 "Number of indexed administrative acts" item.nb_indexed_acts %}
{% trans "Parcels" %}
{% field_flex_2 "Number of parcels" item.nb_parcels %}
{% trans "Context records" %}
{% field_flex_2 "Number of context records" item.nb_context_records %}
{% if item.nb_context_records_by_type %}
{% trans "Type" %} | {% trans "Number" %} |
{% for label, nb in item.nb_context_records_by_type %}
{{label|default:"-"}} | {{nb}} |
{% endfor %}
{% endif %}
{% if item.nb_context_records_by_periods %}
{% trans "Chronological period" %} | {% trans "Number" %} |
{% for label, nb in item.nb_context_records_by_periods %}
{{label|default:"-"}} | {{nb}} |
{% endfor %}
{% endif %}
{% trans "Finds" %}
{% field_flex_2 "Number of finds" item.nb_finds %}
{% if item.nb_finds_by_material_type %}
{% trans "Material type" %} | {% trans "Number" %} |
{% for label, nb in item.nb_finds_by_material_type %}
{{label|default:"-"}} | {{nb}} |
{% endfor %}
{% endif %}
{% if item.nb_finds_by_types %}
{% trans "Object type" %} | {% trans "Number" %} |
{% for label, nb in item.nb_finds_by_types %}
{{label}} | {{nb}} |
{% endfor %}
{% endif %}
{% if item.nb_finds_by_periods %}
{% trans "Chronological period" %} | {% trans "Number" %} |
{% for label, nb in item.nb_finds_by_periods %}
{{label|default:"-"}} | {{nb}} |
{% endfor %}
{% endif %}
{% trans "Sources" %}
{% field_flex "Number of sources" item.nb_documents %}
{% if item.nb_documents_by_types %}
{% trans "Type" %} | {% trans "Number" %} |
{% for label, nb in item.nb_documents_by_types %}
{{label}} | {{nb}} |
{% endfor %}
{% endif %}
{% if item.nb_stats_finds_by_ue %}
{% trans "Finds by context records" %}
{% field_flex_2 "Mean" item.nb_stats_finds_by_ue.mean %}
{% field_flex_2 "Min" item.nb_stats_finds_by_ue.min %}
{% field_flex_2 "Max" item.nb_stats_finds_by_ue.max %}
{% field_flex_2 "Mode" item.nb_stats_finds_by_ue.mode %}
{% endif %}
{% endif %}
{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %}
{% endblock %}