This topic is locked

List Page modifying the query

3/19/2007 3:50:55 PM
PHPRunner General questions
K
kenny_robb author

I have an application that is multi-language and I have put security on each of the tables by adding an ID_owner field that corresponds to a country code so I can limit what country sees what.
I now need to share one of the tables accross all the countries and have changed some of the security so the countries can see each others entries (for the purpose of a look up on another screen.
Unfortunatly when I go to the screen that maintains the information I can see every countries entries as well as having edit access to my own countries data.
In the list screen is there any way of only showing my countries data rather than all the data. Can I put some sort of filter on the country field to only show my own. I can pick up the variable from "ID_owner=" .$_SESSION["var_ID_country"]
Thanks

Kenny

J
Jane 3/20/2007

Kenny,
just choose User can see and edit their own records only option and select your OwnerID field in both Main table: OwnerID field and Users table: OwnerID field dropdown boxes on the Advanced security settings dialog on the Security tab.

K
kenny_robb author 3/20/2007

Kenny,

just choose User can see and edit their own records only option and select your OwnerID field in both Main table: OwnerID field and Users table: OwnerID field dropdown boxes on the Advanced security settings dialog on the Security tab.


I had done that Jane and that ensured that each country could see only their own stuff. I have used that method over the 10 or so tables I am using. However I now wish to share one of the tables accross all the countries. I have changes the security to say that users can see all data but can only edit their own which allows me to do what I need to do on the drop down.
However when I go to the list page on the table I have now shared I see all the enntries for every country. I was hoping that there was a way of only showing or filtering for the country I am logged on as.
In the visual editor I seem to be able to add custom code for a column heading. Is there anything I can do there?
Kenny

J
Jane 3/20/2007

Kenny,
if you want to filter records on the List page just select another security option on the Advanced security settings dialog.
Regarding the second issue.

You can do the following:

  • turn on HTML mode on the Visual Editor tab


  • replace your field name in the column header with this one:

    {$myheader1}


  • add this code to the ListOnLoad event on the Events tab:

    global $smarty;

    $smarty->assign("myheader1","new column header1");



K
kenny_robb author 3/21/2007

I have tried this every which way but I can't seem to make any sense of it. Maybe my explanation is not very good of what I am trying to do so I will try again.
I have 2 screens which relate to 2 tables.
First one is a list of people. They belong to a number of countires and have a county code as one of the fields. I have used this to secure the records by associating it through security with the logon id which has a similar country code. That way when people look at the list page they only see they country they are ment to.
I have a second page which is a registration screen where the people above can be registered for events (usually in their own country) therefore the rop down list only shows the people from the table above that are in the country of the person logged on.
What I have done is changed the security so the drop down shows everyone in the database so they can be registerd for any event anywhere in the world. Problem then comes when you go back to the list of people. it now shows everyone in the database as opposed to just the people for the county of the logged on person.
I have tried the various options in Advanced security but they work on the table and not on the screens.
I want to be able to limit what is shown on the People list to limit to the logged on country while still allowing me to have all the people available to the drop down on the event registration screen.

J
Jane 3/21/2007

I see what you're saying.

Use where clause for your dropdown box on the "Edit as" settings dialog on the Visual Editor tab. Here is a sample:

" OwnerIDField = '".$_SESSION["OwnerID"]."'"