diff options
author | Mark Wells <mark@freeside.biz> | 2016-09-08 11:26:12 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-09-08 11:26:12 -0700 |
commit | 91bcf35460fb2b33c71ab6b078ba049875a18cd5 (patch) | |
tree | c8053e362cecd4c74596d134f16eff4c3e55898b /httemplate | |
parent | 87194c546606205e78e36f99ec1f2ae6f0a9cafc (diff) |
fix UI links and CSS in searches delivered by email, #72101
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/saved_search.html | 22 | ||||
-rw-r--r-- | httemplate/elements/header-popup.html | 6 |
2 files changed, 28 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; diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html index 6c0f80b37..7ddb53ce4 100644 --- a/httemplate/elements/header-popup.html +++ b/httemplate/elements/header-popup.html @@ -37,7 +37,13 @@ Example: <% $head |n %> </HEAD> <BODY <% $etc |n %>> +% if ($m->notes('inline_stylesheet')) { # for email delivery + <style type="text/css"> + <& /elements/freeside.css &> + </style> +% } else { <link href="<%$fsurl%>elements/freeside.css" type="text/css" rel="stylesheet"> +% } % if ( $title || $title_noescape ) { <FONT SIZE=6> <CENTER><% encode_entities($title) || $title_noescape |n %></CENTER> |