Guidance on Linking Forms

Status
Not open for further replies.

degarrin

Member
Hello. This is going to be a long post, so please bear with me as I explain what I am attempting to do. I have been using Fabrik for a few months, but I am just now getting into some of the features of joining tables, linking records, etc. I have I read over the tutorials and various forum posts regarding table joins, the autofill element, creating a search form, table relationships, etc., but I am having difficulty accomplishing my goal and that is what I need some assistance with today.

I have two main record areas in my site: Member Records and Client Records. They are each their own forms. Then I have a variety of other forms that go along with those records. Some are for use only with the Member Records, some for use only with Client Records, and some for use with both. I want all of the member forms to be linked together (and all the client forms linked together, etc). So for instance, say a person needs to create an attendance record. I want them to be able to get to it from their main member record and have it pre-populate with their personal information as much as possible. Then I want to be able to go to a page on my site, type in a person's name, and pull up links to all of their records - any forms they have filled out.

The one constant on all my forms is that I have them pulling in the main Joomla Users table with a databasejoin element so that all the forms can be associated with the individual via their Joomla account. The only exception is my custom registration form, which uses the Fabrik juser plugin instead.

I was thinking that I might need to do table joins and then create a large search form? I tried that, but couldn't quite get it to work. Perhaps using the Joomla Users table via the database join element in my forms is interfering? Does anyone have suggestions on the best way to accomplish my goal or what step I might be missing? Any assistance is appreciated.

Thank You
Angela
 
say a person needs to create an attendance record. I want them to be able to get to it from their main member record and have it pre-populate with their personal information as much as possible.

Why do you need them to access sub forms from the main member record? Would simply a menu item be an alternative option.
E.g. you could link a menu item to the attendance list, filtered on the current users id so they only see their own attendance records.....

Then I want to be able to go to a page on my site, type in a person's name, and pull up links to all of their records - any forms they have filled out.
..... you would achieve this by using the same list and altering the prefilter so it was only applied to you user's access group and not the administrator.

The one constant on all my forms is that I have them pulling in the main Joomla Users table with a databasejoin element so that all the forms can be associated with the individual via their Joomla account.
Yup that sounds correct, or you could use the user element which does the same thing without you having to select so many options as with the database join element.

The only exception is my custom registration form, which uses the Fabrik juser plugin instead.
I'd argue that even here you would want to create an element to store the joomla user id, it allows users to edit their records later on.

I was thinking that I might need to do table joins and then create a large search form?
Well I think you might not have laid out what you over all goals are in your original post. Are you needing a single entry point to provide a global search across disparate lists? If so then perhaps consider using the Joomla search plugin we have for Joomla which would then allow you to search selected lists and return results as if you were searching through joomla articles.
 
Thanks Rob, you gave me a lot to think about and I believe I have a handle on most of it except the following:

Well I think you might not have laid out what you over all goals are in your original post. Are you needing a single entry point to provide a global search across disparate lists? If so then perhaps consider using the Joomla search plugin we have for Joomla which would then allow you to search selected lists and return results as if you were searching through joomla articles.

I need a single entry point so that I can search client names across all of the lists AND I need for a "manager" to be able to search individual lists to filter by client name as well. I already have filters in place so that a logged in user can only see his/her own records in a list, so I am good there.

For the individual list filters for each manager, I really just need to search by client name. However, since I am pulling in the users from the joomla users table via the juser element, of course that won't work because it is an integer field. I haven't been able to figure out how to make that work for me, so I am open to suggestions if you have any :).

For the single entry point option, I tried using Fabrik's Joomla search plugin, but could not get any of the records to appear. I have the Fabrik search plugin enabled, the Joomla content search plugin enabled, and I have "include in search results" set to "yes" in the form settings. Does the restriction regarding certain element types apply to Fabrik's Joomla search plugin as well?
 
If you are using the user element and 'username' as the display choice for it, or a join element using username as the label, searching for a username should work with the standard element filters.

Is this not happening for you?

-- hugh
 
No, none of my clients from my fabrik lists will show up in the Joomla search. I have even tested with inputting a name that I know is in my client records and also other places in my site - it will pull in the listings from the other places in my site, but not the fabrik list. I have "Include in search all" and "Include in advanced search" set to "no" in the user element because if I turn those on and try to search, I get SQL collation errors; my understanding is that I can't use any of the advanced search features for this type of element because it is an "int" type field, correct? I have the Fabrik search plugin enabled, the Joomla content search plugin enabled, and I have "include in search results" set to "yes" in the form settings.
 
hi
Seems like there was a bug here. The database and user elements, when in search all or joomla search, should only search on the label (e.g. 'Admin' and not the value e.g. 42)

If you update from github I have applied a fix for this. You will also need to edit your user element and set it's "Include in search all" to "yes"

-Rob
 
Yes, I updated from github and the search is working for me now. Yay! I was beginning to think I was crazy :D. Thanks for all the help.

Angela
 
Status
Not open for further replies.
Back
Top