diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-04 00:52:07 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-04 00:52:07 +0100 |
| commit | 969eda7b6d5d8eafffab1279a223f9172f403837 (patch) | |
| tree | 70048ed62d8f8aec7e68867dc595a628c3d6c075 /archaeological_files | |
| parent | dee287f34dab74c184273f936b08b53d54d24893 (diff) | |
| parent | b0a48f170a51b7239960aadcc501e23b9af339c2 (diff) | |
| download | Ishtar-969eda7b6d5d8eafffab1279a223f9172f403837.tar.bz2 Ishtar-969eda7b6d5d8eafffab1279a223f9172f403837.zip | |
Merge branch 'master' into v0.9
Diffstat (limited to 'archaeological_files')
| -rw-r--r-- | archaeological_files/forms.py | 75 | ||||
| -rw-r--r-- | archaeological_files/locale/django.pot | 178 | ||||
| -rw-r--r-- | archaeological_files/views.py | 17 |
3 files changed, 173 insertions, 97 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index 42b3f6b6f..8b3513438 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -53,14 +53,25 @@ class FileSelect(TableSelect): internal_reference = forms.CharField(max_length=200, label=_("Other reference")) towns = get_town_field() + parcel = ParcelField(label=_("Parcel (section/number)")) if settings.ISHTAR_DPTS: towns__numero_insee__startswith = forms.ChoiceField( label="Department", choices=[]) name = forms.CharField(label=_(u"File name"), max_length=200) file_type = forms.ChoiceField(label=_("File type"), choices=[]) - saisine_type = forms.ChoiceField(label=_("Saisine type"), choices=[]) - parcel = ParcelField(label=_("Parcel (section/number)")) end_date = forms.NullBooleanField(label=_(u"Is active?")) + saisine_type = forms.ChoiceField(label=_("Saisine type"), choices=[]) + permit_type = forms.ChoiceField(label=_("Permit type"), choices=[]) + permit_reference = forms.CharField(max_length=200, + label=_("Permit reference")) + comment = forms.CharField(label=_(u"Comment"), max_length=500) + in_charge = forms.IntegerField( + label=_(u"In charge"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-person', + args=[SRA_AGENT.pk]), + associated_model=Person), + validators=[valid_id(Person)]) general_contractor = forms.IntegerField( label=_(u"General contractor"), widget=widgets.JQueryAutoComplete( @@ -75,27 +86,27 @@ class FileSelect(TableSelect): args=[GENERAL_CONTRACTOR_ORGA.pk]), associated_model=Organization), validators=[valid_id(Organization)]) - in_charge = forms.IntegerField( - label=_(u"In charge"), + history_creator = forms.IntegerField( + label=_(u"Created by"), widget=widgets.JQueryAutoComplete( reverse_lazy('autocomplete-person', - args=[SRA_AGENT.pk]), + args=['0', 'user']), associated_model=Person), validators=[valid_id(Person)]) - history_creator = forms.IntegerField( - label=_(u"Created by"), + history_modifier = forms.IntegerField( + label=_(u"Modified by"), widget=widgets.JQueryAutoComplete( reverse_lazy('autocomplete-person', args=['0', 'user']), associated_model=Person), validators=[valid_id(Person)]) - permit_reference = forms.CharField(max_length=200, - label=_("Permit reference")) def __init__(self, *args, **kwargs): super(FileSelect, self).__init__(*args, **kwargs) self.fields['saisine_type'].choices = models.SaisineType.get_types() self.fields['saisine_type'].help_text = models.SaisineType.get_help() + self.fields['permit_type'].choices = models.PermitType.get_types() + self.fields['permit_type'].help_text = models.PermitType.get_help() self.fields['file_type'].choices = models.FileType.get_types() self.fields['file_type'].help_text = models.FileType.get_help() if settings.ISHTAR_DPTS: @@ -407,8 +418,21 @@ class AdministrativeActFileModifySelect(TableSelect): class AdministrativeActFileSelect(TableSelect): - associated_file__towns = get_town_field() + year = forms.IntegerField(label=_("Year")) + index = forms.IntegerField(label=_("Index")) + if settings.COUNTRY == 'fr': + ref_sra = forms.CharField(label=u"Autre référence", + max_length=15) act_type = forms.ChoiceField(label=_("Act type"), choices=[]) + indexed = forms.NullBooleanField(label=_(u"Indexed?")) + associated_file__towns = get_town_field() + parcel = ParcelField(label=_("Parcel (section/number)")) + if settings.ISHTAR_DPTS: + associated_file__towns__numero_insee__startswith = forms.ChoiceField( + label=_(u"Department"), choices=[]) + act_object = forms.CharField(label=_(u"Object"), + max_length=300) + signature_date_after = forms.DateField( label=_(u"Signature date after"), widget=widgets.JQueryDate) signature_date_before = forms.DateField( @@ -433,12 +457,12 @@ class AdministrativeActFileSelect(TableSelect): associated_model=Organization), validators=[valid_id(Organization)]) associated_file__numeric_reference = forms.IntegerField( - label=_("Numeric reference")) - associated_file__year = forms.IntegerField(label=_("Year")) + label=_("File numeric reference")) + associated_file__year = forms.IntegerField(label=_("File year")) associated_file__internal_reference = forms.CharField( - max_length=200, label=_("Other reference")) + max_length=200, label=_("File other reference")) associated_file__in_charge = forms.IntegerField( - label=_(u"In charge"), + label=_(u"File in charge"), widget=widgets.JQueryAutoComplete( reverse_lazy( 'autocomplete-person', @@ -446,12 +470,7 @@ class AdministrativeActFileSelect(TableSelect): associated_model=Person), validators=[valid_id(Person)]) associated_file__permit_reference = forms.CharField( - max_length=200, label=_("Permit reference")) - if settings.ISHTAR_DPTS: - operation__towns__numero_insee__startswith = forms.ChoiceField( - label=_(u"Department"), choices=[]) - act_object = forms.CharField(label=_(u"Object (full text search)"), - max_length=300) + max_length=200, label=_("File permit reference")) history_creator = forms.IntegerField( label=_(u"Created by"), widget=widgets.JQueryAutoComplete( @@ -460,6 +479,13 @@ class AdministrativeActFileSelect(TableSelect): args=['0', 'user']), associated_model=Person), validators=[valid_id(Person)]) + history_modifier = forms.IntegerField( + label=_(u"Modified by"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-person', + args=['0', 'user']), + associated_model=Person), + validators=[valid_id(Person)]) def __init__(self, *args, **kwargs): super(AdministrativeActFileSelect, self).__init__(*args, **kwargs) @@ -468,10 +494,17 @@ class AdministrativeActFileSelect(TableSelect): self.fields['act_type'].help_text = ActType.get_help( dct={'intented_to': 'F'}) if settings.ISHTAR_DPTS: - k = 'operation__towns__numero_insee__startswith' + k = 'associated_file__towns__numero_insee__startswith' self.fields[k].choices = [ ('', '--')] + list(settings.ISHTAR_DPTS) + def get_input_ids(self): + ids = super(AdministrativeActFileSelect, self).get_input_ids() + ids.pop(ids.index('parcel')) + ids.append('parcel_0') + ids.append('parcel_1') + return ids + class AdministrativeActFileFormSelection(AdministrativeActOpeFormSelection): pk = forms.IntegerField( diff --git a/archaeological_files/locale/django.pot b/archaeological_files/locale/django.pot index ee94947e0..b1732ae06 100644 --- a/archaeological_files/locale/django.pot +++ b/archaeological_files/locale/django.pot @@ -7,214 +7,246 @@ msgid "" msgstr "" -#: forms.py:51 forms.py:198 forms.py:242 forms.py:383 forms.py:437 +#: forms.py:51 forms.py:209 forms.py:253 forms.py:394 forms.py:421 #: models.py:75 templates/ishtar/sheet_file.html:150 msgid "Year" msgstr "" -#: forms.py:52 forms.py:203 forms.py:244 forms.py:436 models.py:78 +#: forms.py:52 forms.py:214 forms.py:255 models.py:78 msgid "Numeric reference" msgstr "" -#: forms.py:54 forms.py:205 forms.py:439 +#: forms.py:54 forms.py:216 msgid "Other reference" msgstr "" -#: forms.py:59 forms.py:417 +#: forms.py:56 forms.py:429 +msgid "Parcel (section/number)" +msgstr "" + +#: forms.py:60 forms.py:441 msgid "File name" msgstr "" -#: forms.py:60 forms.py:144 forms.py:209 models.py:84 +#: forms.py:61 forms.py:155 forms.py:220 models.py:84 msgid "File type" msgstr "" -#: forms.py:61 forms.py:146 forms.py:306 -msgid "Saisine type" +#: forms.py:62 +msgid "Is active?" msgstr "" -#: forms.py:62 -msgid "Parcel (section/number)" +#: forms.py:63 forms.py:157 forms.py:317 +msgid "Saisine type" msgstr "" -#: forms.py:63 -msgid "Is active?" +#: forms.py:64 forms.py:307 models.py:57 models.py:115 +msgid "Permit type" msgstr "" -#: forms.py:65 forms.py:274 forms.py:419 models.py:91 -msgid "General contractor" +#: forms.py:66 forms.py:310 models.py:116 +msgid "Permit reference" msgstr "" -#: forms.py:72 forms.py:428 -msgid "Organization of general contractor" +#: forms.py:67 forms.py:226 forms.py:364 models.py:145 +#: templates/ishtar/sheet_file.html:111 +msgid "Comment" msgstr "" -#: forms.py:79 forms.py:441 templates/ishtar/sheet_file.html:127 +#: forms.py:69 templates/ishtar/sheet_file.html:127 msgid "In charge" msgstr "" -#: forms.py:86 forms.py:456 +#: forms.py:76 forms.py:285 forms.py:443 models.py:91 +msgid "General contractor" +msgstr "" + +#: forms.py:83 forms.py:452 +msgid "Organization of general contractor" +msgstr "" + +#: forms.py:90 forms.py:475 msgid "Created by" msgstr "" -#: forms.py:93 forms.py:299 forms.py:449 models.py:116 -msgid "Permit reference" +#: forms.py:97 forms.py:483 +msgid "Modified by" msgstr "" -#: forms.py:115 +#: forms.py:126 msgid "Archaeological file search" msgstr "" -#: forms.py:129 +#: forms.py:140 msgid "You should select a file." msgstr "" -#: forms.py:132 forms.py:207 models.py:124 +#: forms.py:143 forms.py:218 models.py:124 msgid "Creation date" msgstr "" -#: forms.py:133 forms.py:309 models.py:126 +#: forms.py:144 forms.py:320 models.py:126 msgid "Reception date" msgstr "" -#: forms.py:138 +#: forms.py:149 msgid "Slicing" msgstr "" -#: forms.py:140 +#: forms.py:151 msgid "Department detail" msgstr "" -#: forms.py:142 +#: forms.py:153 msgid "Date get from" msgstr "" -#: forms.py:148 +#: forms.py:159 msgid "Date after" msgstr "" -#: forms.py:150 +#: forms.py:161 msgid "Date before" msgstr "" -#: forms.py:187 templates/ishtar/sheet_file.html:31 +#: forms.py:198 templates/ishtar/sheet_file.html:31 msgid "General" msgstr "" -#: forms.py:192 models.py:86 +#: forms.py:203 models.py:86 msgid "Person in charge" msgstr "" -#: forms.py:206 models.py:83 +#: forms.py:217 models.py:83 msgid "Name" msgstr "" -#: forms.py:211 models.py:128 +#: forms.py:222 models.py:128 msgid "Related file" msgstr "" -#: forms.py:215 forms.py:353 models.py:145 -#: templates/ishtar/sheet_file.html:111 -msgid "Comment" -msgstr "" - -#: forms.py:219 models.py:136 +#: forms.py:230 models.py:136 msgid "Total surface (m2)" msgstr "" -#: forms.py:222 models.py:142 +#: forms.py:233 models.py:142 msgid "Main address" msgstr "" -#: forms.py:223 +#: forms.py:234 msgid "Main address - complement" msgstr "" -#: forms.py:235 +#: forms.py:246 #, python-format msgid "<br/>(last recorded: %s)" msgstr "" -#: forms.py:257 +#: forms.py:268 msgid "Another file with this numeric id exists." msgstr "" -#: forms.py:268 +#: forms.py:279 msgid "Preventive informations" msgstr "" -#: forms.py:286 models.py:103 +#: forms.py:297 models.py:103 msgid "Responsible for town planning service" msgstr "" -#: forms.py:296 models.py:57 models.py:115 -msgid "Permit type" -msgstr "" - -#: forms.py:302 models.py:139 +#: forms.py:313 models.py:139 msgid "Total developed surface (m2)" msgstr "" -#: forms.py:321 templates/ishtar/sheet_file.html:101 +#: forms.py:332 templates/ishtar/sheet_file.html:101 #: templates/ishtar/dashboards/dashboard_file.html:42 msgid "Research archaeology" msgstr "" -#: forms.py:329 models.py:148 templates/ishtar/sheet_file.html:102 +#: forms.py:340 models.py:148 templates/ishtar/sheet_file.html:102 msgid "Departments" msgstr "" -#: forms.py:340 models.py:157 +#: forms.py:351 models.py:157 msgid "Scientist in charge" msgstr "" -#: forms.py:342 models.py:151 templates/ishtar/sheet_file.html:104 +#: forms.py:353 models.py:151 templates/ishtar/sheet_file.html:104 msgid "Requested operation type" msgstr "" -#: forms.py:344 +#: forms.py:355 msgid "Lead organization" msgstr "" -#: forms.py:360 models.py:161 templates/ishtar/sheet_file.html:109 +#: forms.py:371 models.py:161 templates/ishtar/sheet_file.html:109 msgid "Classified area" msgstr "" -#: forms.py:362 models.py:163 templates/ishtar/sheet_file.html:110 +#: forms.py:373 models.py:163 templates/ishtar/sheet_file.html:110 msgid "Protected area" msgstr "" -#: forms.py:374 +#: forms.py:385 msgid "Would you like to close this archaeological file?" msgstr "" -#: forms.py:379 +#: forms.py:390 msgid "Would you like to delete this archaelogical file ?" msgstr "" -#: forms.py:384 +#: forms.py:395 forms.py:422 msgid "Index" msgstr "" -#: forms.py:388 forms.py:411 forms.py:498 +#: forms.py:399 forms.py:426 forms.py:531 msgid "Act type" msgstr "" -#: forms.py:389 forms.py:453 +#: forms.py:400 msgid "Object (full text search)" msgstr "" -#: forms.py:394 forms.py:452 models.py:518 +#: forms.py:405 forms.py:432 models.py:518 msgid "Department" msgstr "" -#: forms.py:413 +#: forms.py:427 +msgid "Indexed?" +msgstr "" + +#: forms.py:433 +msgid "Object" +msgstr "" + +#: forms.py:437 msgid "Signature date after" msgstr "" -#: forms.py:415 +#: forms.py:439 msgid "Signature date before" msgstr "" +#: forms.py:460 +msgid "File numeric reference" +msgstr "" + +#: forms.py:461 +msgid "File year" +msgstr "" + +#: forms.py:463 +msgid "File other reference" +msgstr "" + +#: forms.py:465 +msgid "File in charge" +msgstr "" + +#: forms.py:473 +msgid "File permit reference" +msgstr "" + #: ishtar_menu.py:33 models.py:185 templates/ishtar/sheet_file.html:6 msgid "Archaeological file" msgstr "" @@ -384,39 +416,39 @@ msgstr "" msgid "File" msgstr "" -#: views.py:144 +#: views.py:155 msgid "File search" msgstr "" -#: views.py:153 +#: views.py:164 msgid "New file" msgstr "" -#: views.py:172 +#: views.py:183 msgid "File modification" msgstr "" -#: views.py:195 +#: views.py:206 msgid "File closing" msgstr "" -#: views.py:200 +#: views.py:211 msgid "File deletion" msgstr "" -#: views.py:207 +#: views.py:218 msgid "File: search administrative act" msgstr "" -#: views.py:216 +#: views.py:227 msgid "File: new administrative act" msgstr "" -#: views.py:226 +#: views.py:237 msgid "File: administrative act modification" msgstr "" -#: views.py:235 +#: views.py:246 msgid "File: administrative act deletion" msgstr "" diff --git a/archaeological_files/views.py b/archaeological_files/views.py index e31cd00b8..5eed99278 100644 --- a/archaeological_files/views.py +++ b/archaeological_files/views.py @@ -89,10 +89,12 @@ get_file = get_item( 'towns__numero_insee__startswith': 'towns__numero_insee__startswith', 'name': 'name__icontains', + 'comment': 'comment__icontains', 'permit_reference': 'permit_reference__icontains', 'general_contractor__attached_to': 'general_contractor__attached_to__pk', 'history_creator': 'history_creator__ishtaruser__person__pk', + 'history_modifier': 'history_modifier__ishtaruser__person__pk', },) revert_file = revert_item(models.File) @@ -116,7 +118,8 @@ get_administrativeactfile = get_item( 'year': 'signature_date__year', 'associated_file__towns': 'associated_file__towns__pk', 'history_creator': 'history_creator__ishtaruser__person__pk', - 'operation__towns': 'operation__towns__pk', + 'associated_file__operations__code_patriarche': + 'associated_file__operations__code_patriarche', 'act_type__intented_to': 'act_type__intented_to', 'act_object': 'act_object__icontains', 'signature_date_before': 'signature_date__lte', @@ -124,10 +127,18 @@ get_administrativeactfile = get_item( 'associated_file__general_contractor__attached_to': 'associated_file__general_contractor__attached_to__pk', 'associated_file__name': 'associated_file__name__icontains', - 'operation__towns__numero_insee__startswith': - 'operation__towns__numero_insee__startswith', + 'associated_file__towns__numero_insee__startswith': + 'associated_file__towns__numero_insee__startswith', + 'indexed': 'index__isnull', + 'parcel_0': ('operation__parcels__section', + 'associated_file__parcels__section'), + 'parcel_1': ( + 'operation__parcels__parcel_number', + 'associated_file__parcels__parcel_number'), 'associated_file__permit_reference': 'associated_file__permit_reference__icontains'}, + reversed_bool_fields=['index__isnull'], + base_request={"associated_file__pk__isnull": False}, relative_session_names={'file': 'associated_file__pk'}) |
