diff options
author | Mark Wells <mark@freeside.biz> | 2016-09-08 11:05:26 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-09-08 11:05:26 -0700 |
commit | 1768c2039b6ff3d68bd3b711621d82dcbf5eab75 (patch) | |
tree | d0eb9024f64415c49c94a97ffe5441c404696d4c /httemplate/edit | |
parent | 54ef6b82c54b5d4c6336ab9fe96aed56fc92963c (diff) |
fix UI links and CSS in searches delivered by email, #72101
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/saved_search.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/httemplate/edit/saved_search.html b/httemplate/edit/saved_search.html index 3039aed35..cb6aa45d1 100644 --- a/httemplate/edit/saved_search.html +++ b/httemplate/edit/saved_search.html @@ -61,6 +61,28 @@ <%init> my $curuser = $FS::CurrentUser::CurrentUser; +# remember the user's rooturl() when accessing the UI. this will be the +# base URL for sending email reports to that user so that links work. +my $rooturl_pref = qsearchs('access_user_pref', { + usernum => $curuser->usernum, + prefname => 'rooturl', +}); +my $error; +if ($rooturl_pref) { + if ($rooturl_pref->prefvalue ne rooturl()) { + $rooturl_pref->set('prefvalue', rooturl()); + $error = $rooturl_pref->replace; + } # else don't update it +} else { + $rooturl_pref = FS::access_user_pref->new({ + usernum => $curuser->usernum, + prefname => 'rooturl', + prefvalue => rooturl(), + }); + $error = $rooturl_pref->insert; +} + +warn "error updating rooturl pref: $error" if $error; # prefix to the freeside document root (usually '/freeside/') my $root = URI->new($fsurl)->path; |