• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Concept question

darkroast

Member
Possibly this is easier than I think, but I'm looking for some suggestions on the best way to handle the following scenario:

I have a database table with an association name and a manager (which is a dbjoin from another table). When an association is transferred to another manager, I want to create a form which allows me to select the association from a dropdown; based on the association chosen, the current manager will be displayed (read only). Another dropdown will also show a list of managers, where I can select the new manager.

Once I submit the form, the manager is updated in the database, and I am sent an email that says something like "Please transfer [association name] from [old manager] to [new manager]."

Basically, someone else will fill out the form. I want to automatically update the database, and send me an email like the above to let me know to change the manager in a completely different system (which I do manually).

Any thoughts?

Oh, another possible addition to this process: each manager has a "team lead" which is stored in the table used for the dbjoins above. Sometimes, the new manager has a different team lead. If, and only if, that's true, I'd like to add a message to the email that's send reminding me to change the team lead in the second system as well as the manager. This would be nice, but not missions-critical.
 
Personally on reading your post twice I neither understand the business problem, nor can I pinpoint your specific question., unfortunately.

Some of the pieces seem easy enough to do, like sending an email or updating a database, but like this I feel unable to say anything intelligent.

Could you formulate exactly what you want help with? Which element, which part of the element and what is the end result, once fabrik is done processing the element?
 
Let me try again...

Our company has several associations which we manage. Each association is assigned a property manager, and each property manager has a division manager. Most of the actual business operation is handled through an SAAS (Software as a Service) application we lease. My Fabrik-based system is designed so that I can track, among other things, which property manager is assigned to which association. The list of managers is in a separate DB table, and I use a dbjoin to select the manager from that table to insert into the association table.

From time to time, we need to change the manager assigned to an association (for instance, if a manager leaves the company). Another department is responsible for assigning a new manager, and they then email me with the name of the old manager and the new manager. I then log into the SAAS application, and change the manager; because of the way the SAAS application tracks which manager has which association, I have to go into the OLD manager's record and remove that association from his account, and then go into to NEW manager's record and add that association to him.

In addition, sometimes the association is transferred to an association manager with a different division manager. When that happens, I also have to change the division manager assigned to the association in the SAAS application.

I then also have to update my Fabrik-based application, to reflect the new manager. However, I have this set up so that the 'manager' element in the association record comes from a dbjoin in a separate table. So, when I make the change in my Fabrik system, all I need to do is choose the new manager from the dropdown in the form.

What I want to build is a form in my Fabrik system that the other department - the ones who assign the managers to the associations - can go into and select the association whose manager is changing. Once they select that, a read-only field will appear which shows the current manager. Another dropdown will also appear, where they can select the new manager.

When they click on the submit button, the manager will be changed in my Fabrik application (automatically). Fabrik should then send me an email with the name of the association, the old manager, and the new manager. That will give me the information I need to change the data in the SAAS application.

In addition, if (and only if) the new association manager has a different division manager, I would like the email to include the old division manager and the new division manager.

The end result would be that I would use the information in the email - generated by Fabrik - to change the association manager for the association, as well as the division manager (if needed).

So, here's the parts I'm not sure how to accomplish:

1. How do I display the currently assigned manager's name (which is actually easy) but ALSO give a dropdown where the user in the other department can select the NEW manager.

2. How do I include both the old manager name and new manager name in the email? I assume that by the time you do the submit, the old manager's name is no longer available, but I could be wrong.

3. Same issue for the division manager - how do I include both the old and new division manager's name in the email?

I know this is a fairly complex application I'm developing, and I really like Fabrik and think it's exactly the right tool for what I need. (Frankly, I'd love to replace the SAAS application with an application I develop from Fabrik, but that would involve the company actually wanting to spend the time and money on development costs.... :cool: ) I do appreciate the help.
 
1 - what's wrong with just showing the select list, the original manager is selected as default when the form loads an existing record? If thats not appropriate perhaps you could add a calculation element or display text to show the original manager.

for points 2 & 3 I *think* you can get the form's original data with:

PHP:
$origData = $formModel->getOrigData();
Thats' sets $origData as an array (with generally only one entry, which is an object with the form's orginal data. so to get at the 'project___manager' element you'd do

PHP:
$previousManager = $origData[0]->project___manager
 
Hey, Rob -

I'm not sure how to get the select list to display in the form. In the list I'm trying to use as the basis for the form, the "association" element is defined as a field type. When I create the new form, and copy that element to it, it still shows up as a field type, instead of a dropdown. So if I just link to the form in the menu, all I get is the blank field.

Were you thinking that the other user (in the other department) would select the association from the list, instead of a dropdown in the form? That would certainly be one way (and probably the easiest way).

Once I get that working I can give the $origData a try.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top