Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The solution could be as follows:</p> <p>File => custom/modules/Tasks/views/view.edit.php</p> <pre><code>/** * @see SugarView::display() */ public function display() { if($this-&gt;ev-&gt;isDuplicate){ $this-&gt;bean-&gt;status = $this-&gt;bean-&gt;getDefaultStatus(); } //if global $current_user; // check if current user is in specific role $isEnabledRole = in_array("ITOperation", ACLRole::getUserRoleNames($current_user-&gt;id)); if($isEnabledRole) $this-&gt;ev-&gt;ss-&gt;assign('readOnly', 'readonly = "readonly"'); else $this-&gt;ev-&gt;ss-&gt;assign('readOnly', ''); parent::display(); } </code></pre> <p>File => custom/modules/Tasks/metadata/editviewdefs.php</p> <pre><code> array ( array ( 'name' =&gt; 'description', 'customCode' =&gt; '&lt;input type="text" title="" value="{$fields.description.value}" id="description" name="description" {$readOnly}&gt;', ), ), ), </code></pre> <p>For checkbox input type then: File => custom/modules/Tasks/views/view.edit.php</p> <pre><code> if($isEnabledRole) { $this-&gt;ev-&gt;ss-&gt;assign('readOnly', 'readonly = "readonly"'); $this-&gt;ev-&gt;ss-&gt;assign('disabled', 'disabled'); } else { $this-&gt;ev-&gt;ss-&gt;assign('readOnly', ''); $this-&gt;ev-&gt;ss-&gt;assign('disabled', ''); } </code></pre> <p>File => custom/modules/Tasks/metadata/editviewdefs.php</p> <pre><code> array ( 'name' =&gt; 'processor_signoff_c', 'label' =&gt; 'LBL_PROCESSOR_SIGNOFF', 'customCode' =&gt; '&lt;input type="hidden" name="processor_signoff_c" value="0"&gt;&lt;input type="checkbox" id="processor_signoff_c" name="processor_signoff_c" value="1" {if $fields.processor_signoff_c.value == "1"} checked {/if} {$disabled}&gt;', ), </code></pre> <p>Bye, Antonio.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload