Show me the sorting!
Posted: 2013-03-16 22:37
Hello
Been a while since I have posted so here is one more trick I am using.
Since it is easier to save the find/sort filters I use rather than have to create them new each time I created a page for them. It also allowed me to allow other groups to see and use the filters and get rid of the 'how do I do this" emails.
Here are the steps I used:
1. Create the filters one at a time (one of my filter pages has 8 common filters created and saved)
2. Copy and paste the generated code into a web page like the following:(yours will look different depending upon your filters)
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Common Filters</title>
</head>
<body>
<p>Click on the Filter button below to filter results. </p>
<form method="post" action="http://www.yourwebsite.ca/somefolder/yourtable_view.php">
<p>
<input name=FilterAnd[1] value='' type=hidden>
<input name=FilterField[1] value='19' type=hidden>
<input name=FilterOperator[1] value='like' type=hidden>
<input name=FilterValue[1] value='Fish Creek' type=hidden>
<input name=FilterAnd[2] value='' type=hidden>
<input name=FilterField[2] value='14' type=hidden>
<input name=FilterOperator[2] value='like' type=hidden>
<input name=FilterValue[2] value='2013' type=hidden>
<input type=submit value="Descriptive Name for Button">
</body>
</html>
3. Remove extra /body/html tags when copying/pasting the filter code generated by your appgini application.
4. Save the page as a html page with some name you like - your choice.
5. In the links-home.php file create a link to the file which should look like the following code. Please note I only allow the admin group to see this link on the home page but you can let whichever group you wish see the link.
$homeLinks[] = array(
'url' => 'http://www.yourwebsite/yourfolder/yourfile.html',
'title' => 'Filters for Records',
'description' => 'Some Premade Filters for Data',
'groups' => array('Admins''), // groups allowed to see this link, use '*' if you want to show the link to all groups
'tileClasses' => '', // optional CSS classes to apply to link block
'textClasses' => '' // optional CSS classes to apply to link description
//'icon' => 'path/to/icon' // optional icon to use with the link
);
Then, when those who are allowed to see the filters log in and are shown the home page they can see a square they can click on to take them to the filters page. Then they just click on the filter of their choice.
I, on the html page, put a brief description of what each button will show when clicked. When the button is clicked on it takes you to the correct table and shows the filtered results. Since you have to be logged in with the correct group to have the filters work there is no real worry about someone accessing the html page by itself and clicking on a button. The results will not be shown until they log in. If they access the page they will get an error message and then be taken to the login page.
Enjoy. Any questions just ask.
I also have a instance of a include php file which places the pre made filter buttons at the top of the page above the table to make it easy for the user to just click. Again these are only shown to those who log in as a member of select group(s). This solution is nicer but involves more code. The above solution is easier to implement but the one with the buttons above the table is nicer to use.
Coming in a future tip - how to use a table to log when a user logs in rather then just a text log file as shown on the appgini site (http://www.bigprof.com/appgini/help/adv ... obal-hooks. Little more user friendly than a text file and can be sorted etc. You then do not need to get the log file from your server. This is created in two places, when the appgini app is generated and by writing a hook. Also records those attempts which fail.
Alan
Been a while since I have posted so here is one more trick I am using.
Since it is easier to save the find/sort filters I use rather than have to create them new each time I created a page for them. It also allowed me to allow other groups to see and use the filters and get rid of the 'how do I do this" emails.
Here are the steps I used:
1. Create the filters one at a time (one of my filter pages has 8 common filters created and saved)
2. Copy and paste the generated code into a web page like the following:(yours will look different depending upon your filters)
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Common Filters</title>
</head>
<body>
<p>Click on the Filter button below to filter results. </p>
<form method="post" action="http://www.yourwebsite.ca/somefolder/yourtable_view.php">
<p>
<input name=FilterAnd[1] value='' type=hidden>
<input name=FilterField[1] value='19' type=hidden>
<input name=FilterOperator[1] value='like' type=hidden>
<input name=FilterValue[1] value='Fish Creek' type=hidden>
<input name=FilterAnd[2] value='' type=hidden>
<input name=FilterField[2] value='14' type=hidden>
<input name=FilterOperator[2] value='like' type=hidden>
<input name=FilterValue[2] value='2013' type=hidden>
<input type=submit value="Descriptive Name for Button">
</body>
</html>
3. Remove extra /body/html tags when copying/pasting the filter code generated by your appgini application.
4. Save the page as a html page with some name you like - your choice.
5. In the links-home.php file create a link to the file which should look like the following code. Please note I only allow the admin group to see this link on the home page but you can let whichever group you wish see the link.
$homeLinks[] = array(
'url' => 'http://www.yourwebsite/yourfolder/yourfile.html',
'title' => 'Filters for Records',
'description' => 'Some Premade Filters for Data',
'groups' => array('Admins''), // groups allowed to see this link, use '*' if you want to show the link to all groups
'tileClasses' => '', // optional CSS classes to apply to link block
'textClasses' => '' // optional CSS classes to apply to link description
//'icon' => 'path/to/icon' // optional icon to use with the link
);
Then, when those who are allowed to see the filters log in and are shown the home page they can see a square they can click on to take them to the filters page. Then they just click on the filter of their choice.
I, on the html page, put a brief description of what each button will show when clicked. When the button is clicked on it takes you to the correct table and shows the filtered results. Since you have to be logged in with the correct group to have the filters work there is no real worry about someone accessing the html page by itself and clicking on a button. The results will not be shown until they log in. If they access the page they will get an error message and then be taken to the login page.
Enjoy. Any questions just ask.
I also have a instance of a include php file which places the pre made filter buttons at the top of the page above the table to make it easy for the user to just click. Again these are only shown to those who log in as a member of select group(s). This solution is nicer but involves more code. The above solution is easier to implement but the one with the buttons above the table is nicer to use.
Coming in a future tip - how to use a table to log when a user logs in rather then just a text log file as shown on the appgini site (http://www.bigprof.com/appgini/help/adv ... obal-hooks. Little more user friendly than a text file and can be sorted etc. You then do not need to get the log file from your server. This is created in two places, when the appgini app is generated and by writing a hook. Also records those attempts which fail.
Alan