Posted by madymad on November 9, 2012 at 11:46am
assume i have two field in my content type, User1 and User2, I send mail notification during node creation from User1 to User2. These user1 and user2 are already registered user, Now i want create a view to display the all node which display only the user1 created node and mail send user ie is this case user2. How can i display this using view.Please help.
Comments
Views
You can create a view with the fields for Content:Title, Content:User1 and Content:User2. You can add a filter or contextual filter for the User1 field. If you have more details to you question, please let me know.
Also, I don't think this is a module development question. Please move this issue to the Post-Installation forum.
Thanks for reply...but i am
Thanks for reply...but i am unable to understand with Content:User1 and Content:User2.Can you elaborate little more.
References?
You said in your original post that you had a content type with 2 fields, User1 and User2. Are you using the References or Entity Reference module for these fields? Can you explain more about how your content type is setup?
OR condition
I successfully completed the view by the query with hook_view_query_alter
SELECT node.title AS node_title, node.nid AS nid, node.uid AS node_uid, node.created AS node_created, 'node' AS field_data_field_level_node_entity_type
FROM
{node} node
INNER JOIN {users} users_node ON node.uid = users_node.uid
LEFT JOIN {field_data_field_details} field_data_field_details ON node.nid = field_data_field_details.entity_id AND (field_data_field_details.entity_type = 'node' AND field_data_field_details.deleted = '0')
LEFT JOIN {assign_ticket} assign_ticket ON node.nid = assign_ticket.nid
LEFT OUTER JOIN {support_ticket} st ON st.nid = node.nid
WHERE (( (assign_ticket.asignto = 'user@user.com') )AND(( (node.status = '1') OR( (users_node.uid = '5') )OR (field_data_field_details.field_details_value IS NOT NULL ) )))AND( (st.client IN ('1')) OR (st.client IS NULL ) )
ORDER BY node_created DESC
LIMIT 100 OFFSET 0
Now i think u understand what i want to do,
Here i faced another problem that it display only the issues who create by other user, Now i want to alter the bold AND to OR how can i do it.please help.
OR groups
Under the Filter Criteria, you can use the drop down button to choose "and/or,rearrange" to setup an "OR" group. It seems like you have already done this based on your query.
I must say this issue has become confusing. I asked questions which you did not answer. Then you say that you used a hook without any details about what you did. More details would be helpful in assisting you.
Very good morning to you,
Very good morning to you, Actually I am designing a ticketing system for help desk, But there is certain condition like during ticket creation the ticket goes to level one service man,if he does not close the ticket in between certain time frame the ticket automatically assign to next level. I did it by using timestamps, Ok now In the ticket create content type there is two field of list box one is department and another is Issue, Issue is dependent on department dynamically, I create a table namely issue to store the all mail_id of level1,level2 etc.. issue wise, Ok there is a point that all mail id's are users only, who are already registered to the site.
There is another table called assign_ticket with nid and assignto field, Here update the table with nid and assignto during content creation nid is the nodeid and the assign to is the email id to whom the mail has sent,it change depends on timestamps with level2,leve3 etc.
Now the question come on view, I want to display the all ticket created by the logged user and the ticket send to him.I create the view for current user using the user:current filter with author relation, Its ok But the creation of left join with assign_ticket paused me.Because it is a external table,But i use the view_query_alter hook to alter the query, but again i stuck with the AND operator, I really appreciate your reply that u given in last few days, And from the last reply i change the AND operator to OR, Finally i got my solution..very very Thanks to u...