Forums

Model Conditions and Search field

tshirley 07 Apr, 2015
Hello,

I have a table that has records from three different Departments.

I set up a CC5 connection with a Model condition that lists the records from only one Department, based on a parameter. This works fine. It also has a search field for a user to find a smaller selection for review and editing.

All good so far, and this mostly works.

But the search does not obey the original conditions, and returns any matching record in the table even if it is from a different Department.

And, if the user has made a search but then clears the search field and clicks submit, all records in the table are then displayed, not just the ones for the originally selected Department.

I don't want users from one Department to be able to "see" the records from the other Departments.

How can I change this so that the search also obeys the original conditions for the Model?

Cheers

Tim
Max_admin 04 May, 2015
Hi Tim,

How many connections do you have ? you have 1 for departments and another for records inside each one ? and how do you have the department conditions setup ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tshirley 04 May, 2015
Hi,

I have worked around this now, but the basic problem is still there.

I have a single table with sales orders from three Departments, A,B,C. I have a CF5 form where the user is from one of these Departments and so I redirect to a CC5 connection using a parameter &Dept=$Dept which is then used in the Conditions of the Model. So far so good - the connection correctly filters the records to show only the Department of the user.

But then I have a search field, in which the user can enter an Order Number for editing. If the user enters any order number that exists in the table, it is found - regardless of whether it is from the relevant Department. And, when the search field is cleared, the connection displays all the records in the table and not only the original selected Department.

What I would like to see is that the initial conditions in the model are always maintained.

Cheers

Tim
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger