I have a data table with employee numbers as a field (which is also used as usernames) and the employee's real names. The table relates to a few other tables to provide those fields where needed. Using Table Wizard and Views I have created views that display this data for all users.
What I wish to accomplish is to show a single employee's data, or in other words a single record (row) at a time. To be clear: one (1) single user's information is to appear at a time according to the currently logged in employee.
Table Wizard/Views lacks a filter that is similar to the Views "Global: User" filter. I have a pressing demand to hide all data from users except those where usernames match the employee number field in the view I created. Do I need to write a new module. I am also curious about how I can compare the field's content to the username. Is there a simple way to do this?
I have never created a module to complete such tasks, so input is greatly appreciated.
There are some of the views in question.
__
Edited by WorldFallz - moved to appropriate forum.
Comments
I have come up with a fairly
I have come up with a fairly simple solution to this: I can configure a Views 2 filter that looks for a value that matches the current user's username. I've tested this theory manually and it works just fine, but I really need to code it so it is automatic and it needs to reference 'users.name' from the database. I think a token should be used, but I am unsure of how to implement it at this time.
Does anyone have any clue about this? I believe .inc files use PHP: does that mean that I can use regular PHP functions? Thanks for your considerations.
For further reference, I have exported includes (.inc) file instead of only the queries that Views 2 outputs. In this, the filter is set to the appropriate 'table.field' but the "Is equal to" operator has been left blank at the moment.
Wrong Forum
Hi,
This forum is for folks who have already decided to extend Drupal's functionality by writing custom modules.
From the moderator:
Please post your question in the issue queue of the modules in question or in the Post Installation forum :)
Your question is a support question, not a module development question.