AnsweredAssumed Answered

How do I get current user id from .hbs files?

Question asked by Autchara Chaiprom on May 22, 2016
Latest reply on May 25, 2016 by Autchara Chaiprom

Hi all,

 

I'd like to get current user id from detail.hbs file in clients/base/fields/phone then I pass parameter to function one()

then function redirect to custom view.php like this: view.php?module=<module name>&id=<id>&user=

 

 

in detail.hbs:

{{#if value}}
<div class="ellipsis_inline" data-placement="bottom"{{#if dir}} dir="{{dir}}"{{/if}} title="{{value}}">
    {{#if skypeValue}}
        <a href="callto:{{skypeValue}}">{{value}}</a>
        <img src="custom/icon_phone.png" onclick="one('{{module}}','{{model.id}}','{{user.id}}');">
    {{else}}{{value}}{{/if}}
</div>
{{/if}}

 

for {{module}} return module name

for {{model.id}} return id

but for {{user.id}} not return any data.

 

I just tried with code below but not work:

...
<img src="custom/icon_phone.png" onclick="one('{{module}}','{{model.id}}','{{app.user.id}}');">
...

 

So for {{app.user.id}} and {{user.id}} not work.

How do I pass current user id into my function via detail.hbs or I can't?

 

Sugar 7.6 Ent

Thanks,

M

Outcomes