Notes Element - Additional Field?

Yes Hugh,

The Status Element is hidden on the form as the person inputting the data cannot select the status. It gets AUTOMATICALLY defaulted to 'Not Assigned' which will only appear in the 'Holding Pool' list. When a Consultant 'picks up' the Not Assigned Client in the Holding Pool list, the Status gets Auto Changed to 'Assigned'. From then the Status can only be changed by a Consultant (or higher) and not a Referrer in the Details.
 
The whole idea is to be able to log the Status changes with a date and User (person who changed it), be able to measure days between changes, and count the amount of Status's set to a particular Status.
 
OK, I've gotten what I think you want going with the status change. When you save the client referral form, and change the status, it will create a new row in the notes table, saying "status changed from X to Y", and with additional columns for the old and new status. It also records the client being change, and the user doing it. If there is no change to the status, no notes record is saved.

If you can explain what the 'status count' and 'status number' should be on the client table, I'll figure out how to set those for you.

-- hugh
 
I've also re-enabled the 'noted' element on the form.

NOTE that we no longer need that JavaScript. The form plugin on the client form handles adding the status change.

Also note that you can use the notes element to add whatever other notes you want. The status change will still be added automatically when the form is submitted (and the status has been changed).

If you need to automatically record any other change to the client data, we can add code to do that.

-- hugh
 
Okay.... so this is a little exciting! Thank you!

So I can see in the records the changes you've made, but when I try and change a Status myself in the Client Details, it doesn't seem to populate the two new Notes fields you've created. Is this because the JS is still in use?
 
I've only implemented that form plugin on the Referrals form.

If you need it on a different copy of that clients form, just create a PHP plugin on the one(s) you want it on, and copy the code over, and set the settings exactly the same (on edit, onBeforeProcess).

-- hugh
 
If you are going to want the plugin to run on more that one version of the form, we should probably move the code into a file that we can include in the plugin "PHP File" selection, so we don't have to modify multiple copies of it whenever we need to make changes.

-- hugh
 
I understand what you're saying! (That in itself is a miracle for me! lol ). I didn't even know that was a possibility to use a single PHP file for multiple forms so thats pretty cool!

Before I read that I had copied that PHP to the Client Details form with the same settings and voila of course it works! Later I will attempt to do it the way you suggest (just more learning for me!)

Checking out the php you created, my mind boggles :( I'm so out of my league here. I'm scraping little bits of information from here and there and trying to get something working. I guess if you are well versed in the coding side then this is easy for you. Before I started with Fabrik, I was hoping that all the work you had done to make Fabrik so awesome would negate my need to code, but its like you lot are having to figure out every single persons potential need and then create an idiot method to complete the tasks for them. It must be a never ending battle and what you've already achieved in building Fabrik is incredible!

I have disabled the JS now as suggested.

I have a question about the status change. I have noticed that Fabrik can calculate the time between dates with a plugin? Is that correct. If so, with this new script, can I use the date logged on the status change to calculate the days between the changes and then give me that number in a field I can use for reporting?

If you can explain what the 'status count' and 'status number' should be on the client table, I'll figure out how to set those for you.

If you take a look at the Pie Chart (in the menu), I have it displaying the data I manually entered to give a count of the current statii :) Thats one report I'd like to have.

Hugh... you and your team are wonderful and you must dread the day that rookies like me turn up. I can't thank you enough for helping make a vision into reality!

Kindest regards
Terry
 
I was hoping that all the work you had done to make Fabrik so awesome would negate my need to code, but its like you lot are having to figure out every single persons potential need and then create an idiot method to complete the tasks for them.

Fabrik does most of what most people need, but there's sometimes going to be some stuff that needs a little custom coding. And we're pretty good at identifying that stuff if it crops up more than a few times, and will add that capability built-in. This is one of those cases we've tried in the past to build a generic form plugin to log changes, but it's a tough thing to do. We do have a 'logs' plugin that kinda does it, but we haven't touched the code for many years, and are going to get rid of it, and try again.

Code:
I have noticed that Fabrik can calculate the time between dates with a plugin? Is that correct. If so, with this new script, can I use the date logged on the status change to calculate the days between the changes and then give me that number in a field I can use for reporting?

We don't have anything built in to calculate time between changes, but that's something we could adapt the code for the status changes to do. Do you need that time in the 'notes' table? And I presume you would want it to be the time between this change and the previous change, or this change and when the record was created (if this is the first time the status has been changed)?

-- hugh
 
Okay. I thought I'd seen that in passing but it seems there are a lot of people doing the same thing with php.

What i would like to do is have a table that displays average change times (in days) between all status changes for a consultant, and in a separate table, the status change times for a chosen client. So i guess if each record has a log of the dates. ..i can call on them?
 
Yes. I think I need to tweak that code a little so it creates a 'change' row when a client record is created, though. That'll make it easier to calculate the deltas. I'll have a think about the best way to do this.


Sent from my HTC One using Tapatalk
 
I've put the php script into a file and loaded it in 3 pages via the PHP File selector. Thats a very handy feature!!! :)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top