Pergunta

I am trying to add a custom link to a custom page using the vtiger_link table, with 2 parameters; 1 is the trouble ticket id which works fine:

This is in the URL field in the database:

modules/Helpdesk%20Info/index.php?ticketid=$RECORD$"target='helpdeskinfo'

and 2 is the id of the logged in user ($current_user) but it doesn't work:

modules/Helpdesk%20Info/index.php?ticketid=$RECORD$&$user=$current_user"target='helpdeskinfo'

It shows the page just as it should, but the variable $user gets the value '$current_user':

http://localhost:8888/modules/Helpdesk%20Info/index.php?ticketid=135409&$user=$current_user

I wanted to post a picture of the table, but I don't have enough reputation for that.

I have tried many things, but I am clearly doing something wrong.

Any help would be much appreciated.

Foi útil?

Solução

I did not need to put the variable in the URL,

the reason I could not use the $current_user variable is because it didn't exist in "detailview.php" which is where the link ends up.

I used:

echo "<pre>";
print_r($GLOBALS);
echo "</pre>";

to view all globals, there I found the authenticated_user_id

Knowing I could use this I was able to access the global from my file without the URL:

$current_user = $_SESSION["authenticated_user_id"];

I would like to thank STT LCU for his advice, as he was the only one who helped me through this problem, which took me a full week in total.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top