How to prefilter with two different userelement

stekir

Member
Hello dear fabrikworkers,

first let me thank you for your great tool. Even though I'm real joomla beginner and I'm able to manage the fabrik thing!

My question/ problem is following:
I have a list filled in by our teachers (userelement) in which they write protocols about our pupils (userelement different usergroups).
In the teachercoloumn (Lehrer) every user is displayed, also in the pupilcolumn (Sch?ler).
How do I manage that in the teachercolumn only user of this usergroup (Lehrer) are displayed and same for the pupilcolumn?

Thank you in advance
stekir

Working on/with Joomla 2.5. Fabrik 3
 
need more information I think...

one table or two tables?
if two how joined?

give a little bit of background on the structure and someone will help you filter it... :)
 
Sorry, sure you need more informations

I'm working with more than one table. And I more or less have understand how to. Actually the table I'm talking about isn't joined!

The Problem isn't to prefilter the existing entries (I just made it by joining the adresstable with categories for "Sch?ler" and "Lehrer") but when I add an entry there are again all joomlausers listed in the formular.

I hope this will help you to find a solution. Propably it's not that good working with the userplugin in this case?
 
Stekir,

I am still not sure I understand exactly what you are trying to do, but if you are working with teachers/students and you want the lists to show all students for one teacher, or all teachers for one student, there is a very good example of grouping in the tutorials here: http://fabrikar.com/help/tutorials/details/3/9

Are you using a databse dropdown list or something when creating a new record? If you are you can filter the results shown in the dropdown by entering a Where clause in the join.

And I am afraid that I do not understand why you need to use the Juser plugin at all for this?

Maybe a screenshot of your tables and elements would help to make it clearer?
 
hello nickbunyan,

I switched the Element "Lehrer" (teacher) from the user plug-in to a simple dropdown plug-in because there are only 10 to choose from.
Filter and edit the existing list is no problem and works fine with the inlinedit plug-in. I simple edit an existing entry and copy as new. Perfect.

My challenge is when I want to add a new entry.
Then I have to choose from the complete user list in the field "Sch?ler" (pupil). I'm looking for a way to choose the user just from the usergroup he is in. My thought was to pre-filter with usergroup but I have no idea how, because I'm not in SQL queries. ;-(

I just tried it with joining the protocollist with the adresslist and prefilter with usergroup which give me exact what I want in the list, but no change when I want to add a new entry.

I think I will have to go away from the user plug-in...
 

Attachments

  • Bildschirmfoto 2012-12-02 um 18.11.15.png
    Bildschirmfoto 2012-12-02 um 18.11.15.png
    132.6 KB · Views: 387
  • Bildschirmfoto 2012-12-02 um 18.27.31.png
    Bildschirmfoto 2012-12-02 um 18.27.31.png
    80 KB · Views: 350
I just switched from user plug-in to dropdown plug-in as an element.
Adding the pupils done in 2 minutes, and just discovered the option of Front end additions!
It looks like this is a much easier way to handle!
 
Hi Stekir

One other thing you might want to look at is the Cascading Drop Down (CDD). If you already have a relationship between teachers and students, you can restrict the display of students to those in the group belonging to the selected teacher... which I think is what you want.
 
I would like to switch my actual form with a normal dropdown element to a CDD.
I've made it like the example in the wiki.
Label is username and watchelemt is a "categorie" so that i can choose in a form the user from a categorie or group.
For any reason i still getting an error "500 - No watch element set up for cdd6293"

Any suggestions? THANKS
 
Seems to be the wrong (Fabrik2.0) forum, I've moved your thread.
Can you post (screenshots) the settings of your CDD and the watched element?
 
Sorry for posting in the wrong forum. Lucky for me that you found me although ;-)

this is the cdd:
table = "Adressbuch" (the table with my userdata)
id = id
Label = Name

watch element = adressbuch.kategorie
Foreign key = Kategorie

the watch element:

Name = Kategorie
Group = Adressbuch_Allgemein
Plugin = dropdown
Value = ex. 117
Label = B?ro

I hope this is enough information for you. Tell me if you have to look in the backend.

Thank you
stekir
 

Attachments

  • Bildschirmfoto 2013-03-07 um 11.29.01.png
    Bildschirmfoto 2013-03-07 um 11.29.01.png
    39.2 KB · Views: 348
  • Bildschirmfoto 2013-03-07 um 11.29.18.png
    Bildschirmfoto 2013-03-07 um 11.29.18.png
    28.3 KB · Views: 354
  • Bildschirmfoto 2013-03-07 um 11.40.28.png
    Bildschirmfoto 2013-03-07 um 11.40.28.png
    52 KB · Views: 352
that error means you have not selected a watch element in the cascadingdropdown, double check that you have done that.

-Rob
 
I think there's an misunderstanding. I have selected a watch element.
Do I have to make any changes in the element I want to select as the watch element?
Propably easy to manage, but I'm sitting here with no idea ;-(
 
adressbuch.kategorie seems to be a strange element label, is this really the label of your dropdown element?

The Fremd-Schl?ssel "Kategorie" (i.e. the element in your Addresbuch list) must contain the "Wert" of the watched dropdown element (i.e. 177, not B?ro)
 
adressbuch.kategorie is shown when I want to choose the element, but it is NOT the real label of the dropdown element.
The label of the element is "kategorie", the full label of the element is "fabrik_adressen___kategorie"

I changed the value of the watched dropdown element from numbers to the same as in label (was 177, now B?ro)

there is no change in the error...but we are getting closer ;-)
 

Attachments

  • Bildschirmfoto 2013-03-07 um 23.18.56.png
    Bildschirmfoto 2013-03-07 um 23.18.56.png
    33.4 KB · Views: 334
  • Bildschirmfoto 2013-03-07 um 23.18.39.png
    Bildschirmfoto 2013-03-07 um 23.18.39.png
    45.3 KB · Views: 368
I can see a lot of duplicate elements, 3 ids..., what is your list setup, do you have joins added?
Maybe from adressbuch to fabrik_adressen and vice versa?
 
I am wondering also about these dublicates. Yes I do have joins, but from the list "adressbuch" to "protokolle.." the list "fabrik_adressen" isn't used anymore.
 
One of us is going to have to get on your site and take a look, as I've read this thread three times, and still can't get a good enough grasp of you setup.

I don't think this applies, but one thing to watch out for is if you CDD is a "child" element. For instance, if it's in a form for a list which you then use as a joined list elsewhere. At which point we create a new group for that join, with copies of the original elements in it.

If your CDD is in one of those groups, then you have to "unlink" it (by editing the copy, and hitting the unlink checkbox) and reset the "watched element". It's just a nasty little issue that we've never gotten round to fixing.

You can tell if your CDD is a copy by looking at the little icon on the left. If the "children" (the two little boxes in the icon, under the bigger box) are blue colored, it's a child.

-- hugh
 
You say
The label of the element is "kategorie", the full label of the element is "fabrik_adressen___kategorie"
but also
"fabrik_adressen" isn't used anymore.

So there seems to be a mismatch in your setup.

I would suggest to delete (Papierkorb) all unused lists + then empty trash (select status "Papierkorb" to see the trashed ones).
Select "Listen, Formulare, Gruppen und Elemente l?schen"
Don't select to delete the database table if you'll need it somewhere else (e.g. an other list is pointing to this database table or you want to keep the data for later use).

Check the settings of your other lists and delete all unnecessary joins.
 
Thank's for the hint to empty the trash. I made a little clean up.
Well a little bit too much, because now I'm getting this error in my Adresslist
"getData:Unknown column 'adressbuch.Schueler_Tes' in 'field list' SQL=SELECT SQL_CALC_FOUND_ROWS DISTINCT"`

Fixed the error. Just delete the unknown columns, empty trash and the list is as it has to be.

Tomorrow I'll will try again with cdd.
 
I'm back again with a cleaned up setting. Trying and not understanding the CCD :-(

I have joined the list "Protokolle Nottuln" with the list "Adressbuch"
left JOIN adressbuch ON fabrik_schuelerprotokolle_nottuln.name = adressbuch.field_name

This works fine.

Then I made a CCD in the group "Protokolle Nottuln"
The table is "Adressbuch"
Id = ID
Label = Name
watch element = adressbuch.kategorie (which is a dropdown element)
foreign key = Kategorie

The only I get is a grey filed in the frontend. Where is the mistake in my setup???
What can I do to make it work?
I don't want to make with usergroups and usernames because I don't know how to hide the administrator or super user etc. group.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top