Link some users to a content - drupal

I have created a content type called "Event". For each event, I would like to be able to specify contacts (people in charge of organising).
Therefore I would like to add a field "Contact" to the Event type, where a widget would give access to the list of users. One could then pick one or several users.
This field would be displayed as a list of links to the profiles of those users.
I seem to remember there was a module providing that widget in Drupal 6, but I am now using Drupal 7, and haven't been able to find the necessary module!
Thanks!
(NB: I'm not using the Event module, but Date + Calendar.)

Here are two possible options you can check out:
Entity Reference module - can reference user entities
Provides a field type that can reference arbitrary entities
Relation module
Relation is an API module and storage model for both simple and the
most complex relations between entities. The module can handle both
directional and symmetrical relations very well.

Related

Use the unique values from a field in one content type as a filter in another content type

I need some help with a Drupal views filter. I'm not a developer but I have been using Drupal for several years.
I have a content type named 'City/Town' that contains several fields including state and county. I'm using this content type as an entity reference field in another content type named 'Project'.
I would like to use a unique value list of States as a filter in a view of Projects.
I've installed the Views Entity Reference Filter (https://www.drupal.org/project/verf) module but I'm only able to access the entity reference title, not any of the fields that are part of the content type.
The project I'm working on is still in design phase so I can change my approach if there is a viable solution.
You need to get the relationship to the reference in views. Then you have access to the fields of the reference for viewing, sorting & filtering.

Are Dexterity z3c relations between non-cataloged content possible?

Specifically, I want to be able to use Dexterity content that has a z3c relationfield pointing to a user in acl_users.source_users. The Plone documentation demonstrates how to create relations in the schema using plone.formwidget.contenttree, but the binders all seem to be based on catalog searches. Since users aren't content in this sense they aren't cataloged.
I'm not sure if this is even the best approach, but being able to link to a user seems simple as an abstract concept. I suppose the alternative would be to store the userid as a simple string field and listen for user management events.
There are two possible approaches:
(1) low-level indexing of relationships between content and users, possibly collective.subscribe (disclosure, I am the principal author, and the only example of this in use is collective.inviting, an event RSVP add-on). There are no widgets or UIs for this.
(2) If you simply want to pick users, you could just use a Choice field in your schema with a dynamic vocabulary of users in your system (example), and store the user-id on your content (unrelated warning: user name and user id can be distinct from each other; if you use email as login in Plone 4, I suggest you use collective.emaillogin4). The content tree widget is not going to work here, so look at either using a drop-down (for <200 users) or an auto-complete widget).

Drupal: relating two fields with each other

I have two fields: Supervisor and agent in a new content type. The list of agents depends on the supervisor selected. How can I create such a dependency i.e. each time a different supervisor is selected from a list a new list of agents is set?
Do I need to set up the supervisor and the agents each as nodes and then use entity reference?
How can I set up the dependency in the content type?
Cannot ask for clarification since I'm new here but here goes
Taxonomy terms can be a solution to the problem depending on the amount of information Supervisor and agent holds. If they hold information like phonenumbers, adresses, names etc. then they need a content type. If these are in fact references to users in the system then you need to use those users. If it's just for categorization, taxonomy terms will work just fine.
Set up the Supervisor as the parent term and the agents as children. Then use a widget like this one to handle the input: https://drupal.org/project/term_reference_tree
Afterwards you can retrieve and show data based on which term/agent is relevant.

Sugar CRM - creating new module using module builder

I wanted to create a new module in my copy of Sugar CRM. I selected a package, and went to create a new module (using module builder). The last field in the form asks to select a module type . If we select module type, say, user, then around 10-15 fields comes up in the module. These cannot be edited. But I wanted to create a module which would consists of only those elements I wanted to. So is there any way to create a new module without having those fields?
For example, I wanted to create a module called 'donation' which would contain the list of all donations made by the users (1 'User' can make MANY 'donation'). Since user field will
always contain all the user detail (example, first name, last name, email etc), so we do not repeat them for each donations made by the user. So donation module should contain only field like
["user-id", "donation-amount", "payment-method", "cc-number"].
Any Sugar usercan help me in this issue?
Thanks.
Just simply hide the unwanted fields on the various views. Some of these fields are basically required by the framework in one way or another (name, date_modified, etc). But it doesn't mean that you need to utilize them. The other additional fields could be removed from the vardefs.php if desired, but it isn't worth the hassle usually.

Drupal Views Content Profile User as an argument

I have a normal Drupal User. I have used the content_profile module to create a profile content type. This content type contains a node reference to another content type company. The company node then references a type of node called Task.
I want to create a view that list all the tasks for a given user id.
So I imagine I would create a view with an argument of user id. Then I would add the relationship to the profile and the company and output the Task title.
The user id used seems to work on the created used ID and not the user id of the content profile that it is referencing. In our system the "admin" user creates the profiles so it causing some problems.
Any ideas? I feel I may need to write a custom module to do what I want.
i have answered a similar question in the past about how to create a view using part of the url as an argument to filter the view by the user profile. check out this url. the answer you are looking for may be a variation of my original response.
also, how are you creating those profiles? on one of my sites, when i created the profile page, its author ID is automatically changed to the user it is associated with.

Resources