#246 Fixed drop-down menu in timecard module

open
nobody
None
5
2012-11-15
2006-10-24
No

in the vw_timecard.php file, do the following:

around line 97 where it says:

$sql = "SELECT
users.user_contact,contacts.contact_first_name,contacts.contact_last_name,contacts.contact_id
FROM users
inner JOIN contacts on contact_id = user_contact
WHERE users.user_contact = ".$AppUI->user_id." or
(".getPermsWhereClause("companies", "user_company").")
ORDER BY contact_last_name, contact_first_name";

go ahead and add "users.user_id" to the list of
selected columns, like so:

$sql = "SELECT
users.user_contact,users.user_id,contacts.contact_first_name,contacts.contact_last_name,contacts.contact_id
FROM users
inner JOIN contacts on contact_id = user_contact
WHERE users.user_contact = ".$AppUI->user_id." or
(".getPermsWhereClause("companies", "user_company").")
ORDER BY contact_last_name, contact_first_name";

Then, on line 105, where it says:

echo "<option
value=\"".$user["user_contact"]."\"".($user["user_contact"]==$user_id?"selected":"").">".$user["contact_last_name"].",
".$user["contact_first_name"]."</option>\n";

replace that with

echo "<option
value=\"".$user["user_id"]."\"".($user["user_id"]==$user_id?"selected":"").">".$user["contact_last_name"].",
".$user["contact_first_name"]."</option>\n";

then it should work.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks