Hey,
I've read all possibly related threads to my issue, but unfortunately i didn't find the answer.
My problem is: I need to disable field in Opportunities module Edit View according to current user (let's say it's next step field). I've made these changes:
1. \modules\Opportunities\views\view.edit.php - added new script:
$disable_script=<<<EOQ
<script>
document.getElementsByName('next_step')[0].disabled="disabled";
</script>
EOQ;
and use this code to call the script:
global $current_user;
$user=$current_user->user_name;
if($user!='grazina') $this->ss->assign('DISABLE_SCRIPT', $disable_script);
2. \modules\Opportunities\metadata\editviewdefs.php - added one line:
'javascript' => '{$DISABLE_SCRIPT}',
3. \cache\modules\Opportunities\EditView,tpl -- below {$PROBABILITY_SCRIPT} added one line:
<!-- Begin Meta-Data Javascript -->
{$PROBABILITY_SCRIPT}
{$DISABLE_SCRIPT}
So, everything works fine, the next step field is disabled when it's needed. But everything crashes, when I make some changes to Opportunities module via Studio. Then the line {$DISABLE_SCRIPT} disappears from \cache\modules\Opportunities\EditView.tpl (2).
Maybe I'm doing something wrong. Any Help?


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks