This topic is locked

Inserting links into Record data

7/29/2007 3:19:02 PM
PHPRunner General questions
E
ete author

I wonder if this 'List View' can be done? This would be a Master table.
[codebox]Example:

DTID username Date Location Professional Development Planning/Meetings

1 larry 07/29/07 NYC

2 larry 07/29/07 NYC [u][color="#0000FF"]134


3 larry 07/29/07 NYC [u][color="#0000FF"]573
3673

etc...

[/codebox]

The underlined data for Professional Development and Planning/Meetings are actually links to their individual records. (The numbers are primary keys for their individual records.) This way, a user can go into a list view, and if he/she wanted to know more about a particular Professional Development entry, he/she can click on it and be brought directly to that record in question.
Can this be done? I tried Master/Details feature, but I couldn't even get it to work. The primary key for the individual records for Professional Development and Planning/Meetings Details tables are not showing up as a 'foreign key'.

E
ete author 7/29/2007

I found out how to do it; In the Visual Editor pane, I clicked on the item in List View, and switched to HTML view.
I then wrapped a HTML link around the item;

<A href="_prodev_view.php?editid1={$row.1prodev_value}">{$row.1prodev_value}</A>
I wonder if there's a variable for '_prodev'? I'd prefer to use a variable than hardcoding in a name.

E
ete author 7/29/2007

The following SQL code works;

[codebox]$LookupSQL = "SELECT ";

$LookupSQL .= "`TaskID`";

$LookupSQL .= ",`TaskID`";

$LookupSQL .= " FROM `_prodev` ";

$LookupSQL .= " WHERE `TaskID` LIKE '".db_addslashes($value)."%'";

$LookupSQL .= " AND `username` = '".$_SESSION["UserID"]."'";

$LookupSQL.= " ORDER BY `TaskID`";[/codebox]

This is for the lookup control, where the SQL will query a table and retrieve individual items. However, I didn't want the lookup control indiscriminately selecting ALL records for use in the lookup table, and just wanted to limit it to the specific user using the table. So, I added in the code (boldfaced).
However, the lookup control only works if AJAX is enabled, and I want the standard lookup control instead. Where is the code the program uses to create the lookup control? I will also need to limit the number of items it returns; I can't have 100's of items in the lookup control, and will limit it to the last 20 entries or so.
Any help is much appreciated!

E
ete author 7/29/2007

However, the lookup control only works if AJAX is enabled, and I want the standard lookup control instead. Where is the code the program uses to create the lookup control? I will also need to limit the number of items it returns; I can't have 100's of items in the lookup control, and will limit it to the last 20 entries or so.

I found it; in commonfunctions.php. I was able to make the needed SQL changes to limit the lookup to entries that the user is qualified in using. Would be a good idea if there was a checkbox or something so I can check off whether I want the lookup entries to be limited by a security policy or not.
Now, I just need to find a way to limit the number of entries! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=19978&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />