Hi all,
Is there a way to hide translation fieldset (that one that contains "This translation is published" and "flag translation as outdated" checkboxes, and "created by" and "modified on" input fields) on field translation page?
I want my users can translates some fields (that's why I give them "Translate entities of type Node" permission), but not manage the above kind of options.
Thank you very much for any help
Comments
Comment #1
plachThey are governed by the same permission, I am afraid. You need to form alter the entity form and set the fieldset
'#access'key to FALSE.Comment #2
mxtThank you for your answer Plach, but using hook_form_alter I can't find "translation" fieldset in the array.
Doing a dpm($form) I can find all the other fieldset (author, revision information, publishing options, comment settings) but there is no trace for "translation" fieldset.
Surely I'm missing something: first of all, I'm using the right hook or does another "entity" hook exists?
Comment #3
plachAlso ET acts on
hook_form_alter(), maybe it's a problem of invocation order since you should find a'translation'key:http://drupalcode.org/project/entity_translation.git/blob/refs/heads/7.x-1.x:/includes/translation.handler.inc#l1030
Comment #4
mxtOk I've got it.
For anyone interested in:
Seems that this hook have to be executed after i18n hook.
So, is necessary to change your custom module weight > 10 in system table.
After that, you can implement() hook_form_alter() in this way for example:
Obviously the above code hides translation fieldset for all users. You have to put a condition by user role to restrict or bypass hiding.
@Platch: in any case, may a more granularity in entity translation permissions give rise to a new feature request? I think this can be useful to many: think at "community websites" where common users can translate their own content, but obviously they don't need (and must not have!) the possibility to change the translation author (that is always themselves because they don't share their translations) or to mark their own translations as outdated.
Thank you!
Comment #5
plachI think this should be discussed in #1829630: Improve workflow permissions (match D8 solution).