1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Notes Element - Additional Field?

Discussion in 'Professional Support' started by terryzzz, Nov 2, 2015.

  1. terryzzz

    terryzzz Member

    Level: Community
    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.
     
  2. terryzzz

    terryzzz Member

    Level: Community
    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.
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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
     
  5. terryzzz

    terryzzz Member

    Level: Community
    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?
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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
     
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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
     
  8. terryzzz

    terryzzz Member

    Level: Community
    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 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
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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 (Text):
    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
     
  10. terryzzz

    terryzzz Member

    Level: Community
    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?
     
  11. terryzzz

    terryzzz Member

    Level: Community
    Yes to the initial referral date as well which as you can see is already logged.
     
  12. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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
     
  13. terryzzz

    terryzzz Member

    Level: Community
    I'm excited! I really can't thank u enough for the awesome support, assistance and patience :)
     
  14. terryzzz

    terryzzz Member

    Level: Community
    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!!! :)
     
  15. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    You'll need to fill out the ftp details in your My Sites, https://fabrikar.com/you/my-sites, so I can get at the file to edit it. Or install the exTplorer component, which lets you edit files via the backend.

    -- hugh
     
  16. terryzzz

    terryzzz Member

    Level: Community
    Ah yes...absolutely! Please find the eXtplorer installed :)
     

Share This Page