Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nursix/eden
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Apr 27, 2021
2 parents aac9281 + 2c0961b commit 7619bfe
Show file tree
Hide file tree
Showing 74 changed files with 23,150 additions and 1,537 deletions.
Empty file modified ABOUT
100755 → 100644
Empty file.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
FROM ubuntu:14.10
FROM ubuntu:18.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y build-essential unzip curl python-pip python-dev python-matplotlib python-lxml \
python-numpy python-dateutil python-gdal python-yaml python-serial python-xlwt python-shapely python-pil python-gdal \
python-reportlab python-reportlab-accel python-tweepy python-xlrd python-pyth python-boto ansible
python-reportlab python-reportlab-accel python-tweepy python-xlrd python-pyth python-boto ansible \
&& rm -rf /var/lib/apt/lists/*

RUN pip install selenium\>=2.23.0 sunburnt\>=0.6 TwitterSearch\>=1.0 requests\>=2.3.0

RUN curl -o web2py.zip https://codeload.github.com/web2py/web2py/zip/R-2.9.11 && unzip web2py.zip && mv web2py-R-2.9.11 /home/web2py && rm web2py.zip

ADD . /home/web2py/applications/eden
COPY . /home/web2py/applications/eden

RUN cp /home/web2py/applications/eden/private/templates/000_config.py /home/web2py/applications/eden/models/000_config.py && sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' /home/web2py/applications/eden/models/000_config.py
RUN cp /home/web2py/applications/eden/modules/templates/000_config.py /home/web2py/applications/eden/models/000_config.py && sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' /home/web2py/applications/eden/models/000_config.py

CMD python /home/web2py/web2py.py -i 0.0.0.0 -p 8000 -a eden
Empty file modified INSTALL
100755 → 100644
Empty file.
Empty file modified LICENSE
100755 → 100644
Empty file.
Empty file modified README.md
100755 → 100644
Empty file.
Empty file modified __init__.py
100755 → 100644
Empty file.
10 changes: 5 additions & 5 deletions controllers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,11 +1089,11 @@ def prep(r):
title_update = T("Personal Profile"))

# Organisation-dependent Fields
set_org_dependent_field = settings.set_org_dependent_field
set_org_dependent_field("pr_person_details", "father_name")
set_org_dependent_field("pr_person_details", "mother_name")
set_org_dependent_field("pr_person_details", "affiliations")
set_org_dependent_field("pr_person_details", "company")
#set_org_dependent_field = settings.set_org_dependent_field
#set_org_dependent_field("pr_person_details", "father_name")
#set_org_dependent_field("pr_person_details", "mother_name")
#set_org_dependent_field("pr_person_details", "affiliations")
#set_org_dependent_field("pr_person_details", "company")

if r.component:
if r.component_name == "physical_description":
Expand Down
4 changes: 4 additions & 0 deletions languages/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,8 @@
'Distance from %s:': 'Abstand von %s:',
'Distance(Kms)': 'Distanz (km)',
'Distributed without Record': 'Verteilt ohne Aufzeichnung',
'Distribution Center': 'Verteilungszentrum',
'Distribution center no longer active': 'Verteilungszentrum nicht mehr aktiv',
'Distribution groups': 'Verteilergruppen',
'Distribution of Clients': 'Verteilung der Klienten',
'Distribution': 'Verteilung',
Expand Down Expand Up @@ -3728,6 +3730,7 @@
'No skills currently set': 'Zurzeit sind keine Fähigkeiten festgelegt',
'No staff or volunteers currently registered': 'Zurzeit sind weder Mitarbeiter noch Freiwillige registriert',
'No status information available': 'Keine Statusinformation verfügbar',
'No suitable distribution center found': 'Kein passendes Verteilungszentrum gefunden',
'No synchronization': 'Keine Synchronisation',
'No tasks currently registered': 'Zurzeit sind keine Aufgaben registriert',
'No template found!': 'Keine Vorlage gefunden!',
Expand Down Expand Up @@ -4572,6 +4575,7 @@
'Requested': 'Angefragt',
'Requester': 'Anfragender',
'Requesting Organisation': 'Anfragende Organisation',
'Requesting site no longer active': 'Bestellende Stelle nicht mehr aktiv',
'Requests Management': 'Anfragenverwaltung',
'Requests Report': 'Statistik Bestellungen',
'Requests': 'Anfragen',
Expand Down
2,142 changes: 1,071 additions & 1,071 deletions languages/zh-tw.py

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions modules/s3/codecs/xls.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,14 @@ def encode(self, resource, **attr):
COL_WIDTH_MULTIPLIER = self.COL_WIDTH_MULTIPLIER

# Get the attributes
title = attr.get("title")
attr_get = attr.get
title = attr_get("title")
if title is None:
title = current.T("Report")
list_fields = attr.get("list_fields")
group = attr.get("dt_group")
use_colour = attr.get("use_colour", False)
evenodd = attr.get("evenodd", True)
list_fields = attr_get("list_fields")
group = attr_get("dt_group")
use_colour = attr_get("use_colour", False)
evenodd = attr_get("evenodd", True)

# Extract the data from the resource
if isinstance(resource, dict):
Expand Down Expand Up @@ -517,7 +518,7 @@ def get_current_row(row_count, row_limit):
book.save(output)
output.seek(0)

if attr.get("as_stream", False):
if attr_get("as_stream", False):
return output

# Response headers
Expand Down
31 changes: 16 additions & 15 deletions modules/s3/s3report.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ def geojson(self, r, **attr):

# Export as GeoJSON
current.xml.show_ids = True
output = resource.export_xml(fields=include,
mcomponents=None,
references=[],
stylesheet=stylesheet,
as_json=True,
location_data=location_data,
map_data=dict(style=style),
output = resource.export_xml(fields = include,
mcomponents = None,
references = [],
stylesheet = stylesheet,
as_json = True,
location_data = location_data,
map_data = {"style": style},
)
# Transformation error?
if not output:
Expand Down Expand Up @@ -444,17 +444,18 @@ def geojson(self, r, **attr):
# Export as GeoJSON
current.xml.show_ids = True
gresource = current.s3db.resource("gis_location", id=ids)
output = gresource.export_xml(fields=[],
mcomponents=None,
references=[],
stylesheet=stylesheet,
as_json=True,
location_data=location_data,
output = gresource.export_xml(fields = [],
mcomponents = None,
references = [],
stylesheet = stylesheet,
as_json = True,
location_data = location_data,
# Tell the client that we are
# displaying aggregated data and
# the level it is aggregated at
map_data=dict(level=int(level[1:]),
style=style),
map_data = {"level": int(level[1:]),
"style": style,
},
)
# Transformation error?
if not output:
Expand Down
12 changes: 6 additions & 6 deletions modules/s3/s3resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,9 @@ def load(self,
else:
meta_fields = s3.all_meta_fields = s3_all_meta_field_names()
s3db = current.s3db
superkeys = s3db.get_super_keys(table)
else:
meta_fields = superkeys = None

# Field selection
qfields = ([table._id.name, UID])
Expand Down Expand Up @@ -1136,12 +1139,9 @@ def load(self,
continue

# Must include all super-keys
ktablename = s3_get_foreign_key(table[f], m2m=False)[0]
if ktablename:
ktable = s3db.table(ktablename)
if ktable and hasattr(ktable, "instance_type"):
append(f)
continue
if f in superkeys:
append(f)
continue

if f in skip:
continue
Expand Down
3 changes: 1 addition & 2 deletions modules/s3db/inv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2590,8 +2590,7 @@ def inv_send_process():
}
recv_id = rtable.insert(**recv_item)
recv_item["id"] = recv_id
realm_entity = auth.get_realm_entity(rtable, recv_item)
db(rtable.id == recv_id).update(realm_entity = realm_entity)
auth.s3_set_record_owner(rtable, recv_id)

# Change the status for all track items in this shipment to In transit
# and link to the receive record
Expand Down
5 changes: 3 additions & 2 deletions modules/s3db/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -5636,7 +5636,7 @@ def custom_lookup_rows(self, key, values, fields=None):
rows = db(query).select(limitby=limitby, *fields)
self.queries += 1

if show_type:
if show_type or show_link:

# Collect the site_ids
site_ids = set(row.site_id for row in rows)
Expand Down Expand Up @@ -5665,7 +5665,8 @@ def custom_lookup_rows(self, key, values, fields=None):

# Bulk-represent all type IDs
# (stores the representations in the S3Represent)
ltable.facility_type_id.represent.bulk(list(all_types))
if show_type:
ltable.facility_type_id.represent.bulk(list(all_types))

# Add the list of corresponding type IDs to each row
for row in rows:
Expand Down
5 changes: 0 additions & 5 deletions modules/templates/CumbriaEAC/Demo/cr_shelter.csv

This file was deleted.

3 changes: 2 additions & 1 deletion modules/templates/CumbriaEAC/Demo/organisation.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Organisation,Type,Country,L1,L2,L3,L4
Cumbria Police,,GB,England,Cumbria,,
Cumbria Police,,GB,England,Cumbria,,
Cumbria County Council,,GB,England,Cumbria,,
2 changes: 1 addition & 1 deletion modules/templates/CumbriaEAC/Demo/tasks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# s3import::S3BulkImporter
# =============================================================================
org,organisation,organisation.csv,organisation.xsl
cr,shelter,cr_shelter.csv,shelter.xsl
#cr,shelter,cr_shelter.csv,shelter.xsl
*,import_user,users.csv
# =============================================================================
1 change: 1 addition & 0 deletions modules/templates/CumbriaEAC/Demo/users.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
First Name,Last Name,Email,Password,Role,Organisation,Link
Police,Emergency Room,police@example.com,eden,,Cumbria Police,staff
Cumbria,County Council,ccc@example.com,eden,,Cumbria County Council,staff
19 changes: 19 additions & 0 deletions modules/templates/CumbriaEAC/auth_roles.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uid,role,description,controller,function,table,uacl,oacl,entity,Notes
ANONYMOUS,Anonymous,,,,org_organisation,READ,,,Required for 'existing' self-registration
AUTHENTICATED,Authenticated,,gis,,,READ,,,
AUTHENTICATED,Authenticated,,cr,,,CREATE|READ|UPDATE,,,
AUTHENTICATED,Authenticated,,,,cr_shelter,CREATE|READ|UPDATE,,,
AUTHENTICATED,Authenticated,,hrm,person,,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,hrm,human_resource,,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,hrm,staff,,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,,,hrm_human_resource,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,org,organisation,,CREATE|READ,,,
AUTHENTICATED,Authenticated,,,,org_organisation,CREATE|READ,,,
AUTHENTICATED,Authenticated,,,,org_organisation_organisation_type,CREATE|READ,,,
AUTHENTICATED,Authenticated,,pr,contact,,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,pr,contact_emergency,,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,pr,person,,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,,,pr_address,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,,,pr_contact,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,,,pr_contact_emergency,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
AUTHENTICATED,Authenticated,,,,pr_person,CREATE|READ|UPDATE,READ|UPDATE|DELETE,,
Loading

0 comments on commit 7619bfe

Please sign in to comment.