FWAJL / FieldWorkManager

FWA MVC
1 stars 5 forks source link

Automatically add Task Items when editing a Task. #1061

Open bsaiken opened 9 years ago

bsaiken commented 9 years ago

This Issue will reduce the steps needed to add Task technicians, locations, field parameters (analytes), lab analytes, service providers.
Currently, using the left menu these are automatically added to the Project/PM, but not to the Task. The left menu behaviors will stay the same.

New behaviors (adding each of the above listed items to the Task): Add buttons to each of the listed tabs: /task/technicians --> Add Task Technician /task/locations --> Add Task Location /task/fieldAnalytes --> Add Field Parameter /task/labAnalytes --> Add Lab Parameter /task/services --> Add Service Provider

When clicking the Add Task Technician button, the technician will be added to the database, in the same manner as using the left menu, but the technician will also be added to the task_technician table, as is done when clicking the button value="Add technician(s)".

I think the easiest way to do this is have the "Add Task Technician" button direct the user to the page technicain/showForm, except that the url will be /technician/showForm?task_id=#. Then, at line 164 of technician_manager.js add code some thing like this: if (isset(task_id)) {call the function updateTechnicians with the new technician_id}

Then redirect to /task/technicians. The newly added Technician should appear in the left hand column. If the task_id is not set, the function will continue as normal (redirecting to technician/listAll).

This method (or similar) will be used for all identified instances. Whatever method is chosen to accomplish this Issue, do only one instance (technicians) and I can copy the method for all other instances.

WebDevJL commented 9 years ago

@bsaiken

So the main underlying functionality that you want when editing a task and:

Is that correct?

bsaiken commented 9 years ago

@WebDevJL Yes, I thought this was obvious, so I did not list each one. No harm in clarifying, though.

WebDevJL commented 9 years ago

@bsaiken Done for the technicians. Code committed to feature_PM if you want to test.

bsaiken commented 9 years ago

@WebDevJL Did you mean to assign me to this and change the label to function review?

WebDevJL commented 9 years ago

@bsaiken No. I'm just letting you know that I have done it for the technicians and today for the locations. The rest will come soon.

You can test on feature_PM branch if you need.

bsaiken commented 9 years ago

@WebDevJL I did test on the feature_PM branch and it did not work for technicians.

WebDevJL commented 9 years ago

@bsaiken

Please post a screenshot of chrome dev console with the response after clicking add on the page technician/showForm.

Also do another pull and retest please.

Thank you. On 13 Aug 2015 16:56, "bsaiken" notifications@github.com wrote:

@WebDevJL https://github.com/WebDevJL I did test on the feature_PM branch and it did not work for technicians.

— Reply to this email directly or view it on GitHub https://github.com/FWAJL/FieldWorkManager/issues/1061#issuecomment-130720632 .

bsaiken commented 9 years ago

@WebDevJL I would do that, of course, but there was not response.

FWAJL commented 9 years ago

@bsaiken

It works on that branch. See my screenshots: screen shot 2015-08-13 at 19 26 19 screen shot 2015-08-13 at 19 26 33 screen shot 2015-08-13 at 19 26 51 screen shot 2015-08-13 at 19 26 59

If you really can't get it to work, check in the dev tools the tab "Elements" and check if you see a HTML comment that looks like an error logged. It is always at the very top (see rectangle in red below). screen shot 2015-08-13 at 19 30 27

bsaiken commented 9 years ago

@FWAJL Just push it to dev