Merge lp:~keitheis/sahana-eden/edentrunk into lp:sahana-eden

Proposed by Keith Yang
Status: Superseded
Proposed branch: lp:~keitheis/sahana-eden/edentrunk
Merge into: lp:sahana-eden
Diff against target: 100 lines (+22/-9)
5 files modified
controllers/irs.py (+1/-1)
models/00_settings.py (+1/-0)
models/00_utils.py (+10/-8)
models/01_crud.py (+7/-0)
modules/s3xrc.py (+3/-0)
To merge this branch: bzr merge lp:~keitheis/sahana-eden/edentrunk
Reviewer Review Type Date Requested Status
Fran Boon Needs Fixing
Review via email: mp+33323@code.launchpad.net

This proposal has been superseded by a proposal from 2010-08-22.

Description of the change

Patch to reuse last input record as template to create new incident report

To post a comment you must log in.
lp:~keitheis/sahana-eden/edentrunk updated
1055. By Fran Boon

per-merge commit: collapse-mode mini from sonicx

1056. By Fran Boon

Merge nursix: Notifications persist through redirection

1057. By Fran Boon

Merge nursix: Don't redirect after create from popups

Revision history for this message
Fran Boon (flavour) wrote :

I'm not sure that I like this as the default behaviour...how often would someone be reporting multiple incidents with several details in common?
We should default the Reporter Name & Date/Time fields on Create records anyway.
(The Reporter Name is defaulted, but the AutoComplete renders this invisible, which I'll fix.

This was the original Ticket, which prompted this feature:
http://eden.sahanafoundation.org/ticket/506

I think I'd prefer to see this feature as an action button, so that the Incidents list is visible & user has option to 'Copy' an Incident which makes a new one.
This could then be used in other modules too.

review: Needs Fixing
lp:~keitheis/sahana-eden/edentrunk updated
1058. By Fran Boon

Fix defaults showing in AutoCompletes

1059. By Fran Boon

Usability enhancements for RMS (suggestions from Hsiaojan) & AutoCompletes/Default

1060. By Fran Boon

Merge nursix: extend from_record to support templating to alternate resources

1061. By Fran Boon

Remove print statement

1062. By Fran Boon

Handle commas in KML Layer Names
Improve Lat/Lon help text in Add Location
Tooltip opacity increased & don't display them if we have no attributes for them
Provide model changes to KML layers to support flexible popups

1063. By Fran Boon

Merge nursix: Form subheaders

Revision history for this message
Michael Howden (michael-howden) wrote :
lp:~keitheis/sahana-eden/edentrunk updated
1064. By Fran Boon

Move locations hierarchy to deployment_settings
Enhanced KML overlay support

1065. By Fran Boon

Merge keitheis: Copy function added to shn_action_buttons in IRS
Added the same to KML layers, more KML tweaks

1066. By Fran Boon

per-merge commit: Protect the default Map settings, whilst still allowing personalisable settings. Start preparing for GeoServer/GeoSpatial DB integration (Healthscapes merge)

1067. By Fran Boon

merge nursix: RAT section 3

1068. By Fran Boon

Correct Locations security

1069. By Fran Boon

Locations now have a Simple Search form

1070. By Fran Boon

Location AutoComplete progress (not complete, so not being pulled to live yet)
Moved Ext JS/CSS to load for all pages (gray theme live throughout)

1071. By Fran Boon

More work on Locations Selector - can now add new records, still much to be done though

1072. By Fran Boon

Merge michael: many tweaks :)

1073. By Keith Yang

Try the way of redifined minimal incident categories

Unmerged revisions

1073. By Keith Yang

Try the way of redifined minimal incident categories

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'controllers/irs.py'
2--- controllers/irs.py 2010-08-22 10:49:45 +0000
3+++ controllers/irs.py 2010-08-22 18:11:00 +0000
4@@ -139,7 +139,7 @@
5
6 # Post-processor
7 def user_postp(jr, output):
8- shn_action_buttons(jr, deletable=False)
9+ shn_action_buttons(jr, deletable=False, copyable=True)
10 return output
11 response.s3.postp = user_postp
12
13
14=== modified file 'models/00_settings.py'
15--- models/00_settings.py 2010-08-20 13:35:28 +0000
16+++ models/00_settings.py 2010-08-22 18:11:00 +0000
17@@ -14,6 +14,7 @@
18 #UPDATE = T("Edit")
19 #UPDATE = T("Update")
20 DELETE = T("Delete")
21+COPY = T("Copy")
22
23 # Default strings are in US English
24 T.current_languages = ["en", "en-us"]
25
26=== modified file 'models/00_utils.py'
27--- models/00_utils.py 2010-08-22 13:48:34 +0000
28+++ models/00_utils.py 2010-08-22 18:11:00 +0000
29@@ -393,7 +393,7 @@
30 else:
31 return word
32
33-def shn_action_buttons(jr, deletable=True):
34+def shn_action_buttons(jr, deletable=True, copyable=False):
35
36 """
37 Provide the usual Action Buttons for Column views.
38@@ -407,15 +407,17 @@
39
40 if shn_has_permission("update", jr.table):
41 # Provide the ability to delete records in bulk
42+ response.s3.actions = [
43+ dict(label=str(UPDATE), _class="action-btn", url=str(URL(r=request, args = args + ["update"]))),
44+ ]
45 if deletable and shn_has_permission("delete", jr.table):
46- response.s3.actions = [
47- dict(label=str(UPDATE), _class="action-btn", url=str(URL(r=request, args = args + ["update"]))),
48+ response.s3.actions.append(
49 dict(label=str(DELETE), _class="action-btn", url=str(URL(r=request, args = args + ["delete"])))
50- ]
51- else:
52- response.s3.actions = [
53- dict(label=str(UPDATE), _class="action-btn", url=str(URL(r=request, args = args + ["update"])))
54- ]
55+ )
56+ if copyable:
57+ response.s3.actions.append(
58+ dict(label=str(COPY), _class="action-btn", url=str(URL(r=request, args = args + ["copy"])))
59+ )
60 else:
61 response.s3.actions = [
62 dict(label=str(READ), _class="action-btn", url=str(URL(r=request, args = args)))
63
64=== modified file 'models/01_crud.py'
65--- models/01_crud.py 2010-08-22 14:18:24 +0000
66+++ models/01_crud.py 2010-08-22 18:11:00 +0000
67@@ -1799,6 +1799,12 @@
68 return output
69
70 #
71+# shn_copy ------------------------------------------------------------------
72+#
73+def shn_copy(r, **attr):
74+ redirect(URL(r=request, args="create", vars={"from_record":r.id}))
75+
76+#
77 # shn_search ------------------------------------------------------------------
78 #
79 def shn_search(r, **attr):
80@@ -2030,6 +2036,7 @@
81 s3xrc.set_handler("update", shn_update)
82 s3xrc.set_handler("delete", shn_delete)
83 s3xrc.set_handler("search", shn_search)
84+ s3xrc.set_handler("copy", shn_copy)
85
86 res, req = s3xrc.parse_request(module, resource, session, request, response)
87 output = res.execute_request(req, **attr)
88
89=== modified file 'modules/s3xrc.py'
90--- modules/s3xrc.py 2010-08-22 10:04:24 +0000
91+++ modules/s3xrc.py 2010-08-22 18:11:00 +0000
92@@ -963,6 +963,9 @@
93 r.representation in json_import_formats:
94 method = "import_tree"
95
96+ elif method == "copy":
97+ authorised = permit("create", tablename)
98+
99 elif method == "delete":
100 return self.__delete(r)
101