robetus Posted October 18, 2017 Share Posted October 18, 2017 (edited) Is there a way I can put this link: href="../dologin.php?username={$clientsdetails.email|urlencode}&language=&?action=productdetails&id={$serviceid}" Inside the Product/Services tab (/admin/clientsservices.php) so that I can directly login to the product in the clientarea that I'm looking at in the admin area? I'm not sure the above syntax is correct either. Edited October 18, 2017 by robetus Link to comment Share on other sites More sharing options...
brian! Posted October 18, 2017 Share Posted October 18, 2017 2 hours ago, robetus said: Is there a way I can put this link: this is a problem in two halves... firstly, I don't think it's possible to easily create such a link to login and redirect to a specific product in the client area - I know why it's difficult to do, but can't think of a simple workaround - the best I could quickly do was go to their products page. even if you could get a working link, the second problem would be that you'd need to add it using an admin area hook - there isn't a template to edit. I suspect it's just simpler to continue using the 'login as client' link in the summary and then working through the client area to the specific product. Link to comment Share on other sites More sharing options...
robetus Posted October 18, 2017 Author Share Posted October 18, 2017 Okay so I couldn't build a link using PHP and insert it that way with my module? Link to comment Share on other sites More sharing options...
robetus Posted October 18, 2017 Author Share Posted October 18, 2017 I'd have to grab the clients email and the service id, and then encode the url using php. Not possible? Link to comment Share on other sites More sharing options...
brian! Posted October 18, 2017 Share Posted October 18, 2017 3 minutes ago, robetus said: Okay so I couldn't build a link using PHP and insert it that way with my module? the big problem is the double question mark in the URL and getting the browser to interpret that second one correctly... Link to comment Share on other sites More sharing options...
robetus Posted October 18, 2017 Author Share Posted October 18, 2017 print out a question mark in a php variable and then include that variable in the link? Link to comment Share on other sites More sharing options...
brian! Posted October 18, 2017 Share Posted October 18, 2017 11 minutes ago, robetus said: print out a question mark in a php variable and then include that variable in the link? you could try it, but I wouldn't be optimistic... $goto is your friend here, but you need to figure out a way to pass the redirect part of the URL correctly. ..dologin.php?username={$clientsdetails.email|urlencode}&language={$adminLanguage}&goto=clientarea.php?action=productdetails&id={$serviceid} Link to comment Share on other sites More sharing options...
robetus Posted October 18, 2017 Author Share Posted October 18, 2017 That's a smarty link, where would I put that? Like you said there is no template. I'm working inside a php file with my module. Is there a way to get smarty into a php file? Link to comment Share on other sites More sharing options...
brian! Posted October 18, 2017 Share Posted October 18, 2017 8 minutes ago, robetus said: That's a smarty link, where would I put that? Like you said there is no template. I'm working inside a php file with my module. Is there a way to get smarty into a php file? in a hook yes, but try passing it in the browser, or add the code to clientsummary.tpl and hardcode the variables and see if it works... I don't think it will. Link to comment Share on other sites More sharing options...
robetus Posted October 18, 2017 Author Share Posted October 18, 2017 No it didn't, thanks for trying. I'll have to think of something else. Link to comment Share on other sites More sharing options...
Recommended Posts