Drupal node add/edit form - text input fields in a table - drupal

Is there a Drupal 7 module out there than can arrange text input fields into a table format on the node add/edit form?
Field collection module is not suitable as although it does have a table formatter it's purpose is to allow the user to add rows of data to the table themselves.
What I need is several text input fields just arranged into rows and columns on the node add/edit form - the user user should not be able to add or remove rows or columns.
Tablefield module is also not suitable as again it allows the user to construct the table themselves.
I have an image which perfectly demonstrates what I need, but I am unable to post images as I don't enough reputation points.

As you say
"Tablefield module is also not suitable as again it allows the user to
construct the table themselves."
While adding fields to your content type, in the field settings you can restrict the "Table rebuild"
OR
You can also restrict the table entry modification based on people Roles and Permissions. Below is the snapshot of permission page.

Related

Drupal 8 Views Question Involving Entity Reference

Trying to figure out views relationships and filters.
I'm trying to make a view that has the title of the page match the entity reference of the same page and make it reactive so I only need one. EX.) Page about animals, which there are nodes referencing the animal page as an entity reference.
Firstly, you have to take one unique field which can identify whether particular node is for animals or etc.
After that, In your views you need to select that field name in contextual filter and select option as you can see in screenshot and then save it.

Including Inventory Number in global search

I actually can't find any option how can i add this Inventory Number entries (subtab on item records) in global search. It would save me a lot of time if this field can be searchable under global netsuite's search which is located in header of every single page.
Is something like this possible? I asked their support and they are navigating me to their support documentation which is not that rich when this question is placed.
Please see screenshot of what i want to include in my global search
There isn't a way that I know of to make default fields accessible to the global search but you can make custom fields accessible.
You should be able to make a custom field that stores the value of the Inventory Number. Custom fields have a checkbox of "Global Search". The field must store the value so you will need to make sure that it updates if the Inventory Number ever updates (workflow/suitescript).
From NetSuite article 8403 titled "Including Custom Fields in Global Search":
To index a custom field to be included in global search, a user with
permission to edit or create custom fields must check the Global
Search box on the custom field record. By default, the Available for
Global Search box is not checked for preexisting or new custom fields.
Global search indexing is available for the following data types, when
the Store Value preference is enabled:
Currency
Decimal Number
Email Address
Free-Form Text
Help
Hyperlink
Inline HTML
Integer Number
Percent
Phone Number
Text Area
You cannot index a custom field for global search if None is
selected for any Level for Search/Reporting option on the Access
subtab of the custom field record.

Author of a particular field - which user modified the field

Is it possible in Drupal to find out which user modified a particular field? Not just the whole node. After saving the content I want to display the author name next to that field.
Not sure if this is possible or not.
This is not provided by Drupal core, and (As far as I know) it is not provided by any contributed modules on drupal.org.
So, in order to do that, you would probably need to create a custom module.
A simple module to achieve that would have a database table with (nid, uid, current field value) and hook_node_presave implementation (compare field values, then update/insert/ignore saving new data to your database table).

Drupal 7, listing users by custom field values

I created a custom field for a user's hometown, let's call it "field_home", that is required for every user when they register an account. They can only select certain text values from a list.
Is there any way I can add a "Hometown" column in admin/people, which lists every user's field_home value along with their user name and roles?
Thanks for any information!
I would recommend creating a new view. You can build a better view than the one provided in admin/people in no time.
Add your own custom fields, edit/cancel-account links and filtering criteria. That'd be much easier and faster.

How to display and hide Drupal 7 fields, based on value of a specific field

What I am trying to do here is controlling how a group of fields are showing up on node view. I don't want to control them by user role, as this is going to be a node level permission and I don't want these permissions affect other nodes with the same content type.
For example imagine I have three different roles: ROLEA, ROLEB and ROLEC. Each role has it's own permissions set for accessing to fields. When a node is created for the first time, a user with role of ROLEA, can see couple of fields and can edit the value of those fields. When node is published, a rule/action get called through Rules module, and will set a status field in that node to STAGE1. After this event (a new node created), if user (ROLEA) goes to that node that was just created by herself, those fields that were editable before, should be read-only now. This means when Rules module, set the value of the status field to STAGE1, when that node wants to get loaded by Drupal, we need to check the status value, and based on that if it was for example STAGE1, modify some other field in that particular node, read only or editable, or in some cases hide them from user. So my guess is to create a module that every time a node of that type, is loading, check the status field (which is a field that we have created in that node type) and based on the value of that field, decide which node should show up or hide. This should override the permission that have been set for those fields on that particular node type.
What I am trying to do is creating a method to control which field is going to be read only /editable / hidden based on the value of a specific field in that content type, which has been set by Roules module, based on different stages of working on that node by different group of users. I am not using Organic Group. I use Drupal 7 and Rules module and couple of other permission related modules. But I found that there is no such a way to handle field visibility in node level, separate from user roles.
Do you think there is any other way to achieve the same result? I appreciate if you could give me an idea about how to create such a module.
I really appreciate any and all input.
You can create a module and add a hook on node form using : hook_form_alter or hook_form_FORM_ID_alter
Using this kind of hook, you can easily modify node form and hide or make read only specific fields, based on whatever you want (user role, field value...)
There are also the hook_node_view_alter() hook and hook_entity_view_alter() hooks that allow you to modify the render array for a node before it is rendered. There you can set field arrays to have '#access' = FALSE so they are hidden, or '#access' = TRUE to show them.
I'm using this to hide some fields if the date in another field of the node has a time in the past (it's a "subscription expires" field). So I didn't need to change the edit form, just the field display.

Resources