X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsaved_search.html;h=f8f0333c59b5d86234c91ccf824cdc64a349bfed;hb=2009d9cee8038aeff5b4313113fc23f546455cf5;hp=3039aed35cf75e13b54aa4d7b39c925a87b92a9c;hpb=54ef6b82c54b5d4c6336ab9fe96aed56fc92963c;p=freeside.git diff --git a/httemplate/edit/saved_search.html b/httemplate/edit/saved_search.html index 3039aed35..f8f0333c5 100644 --- a/httemplate/edit/saved_search.html +++ b/httemplate/edit/saved_search.html @@ -23,14 +23,13 @@ type => 'fixed-date', }, { field => 'format', - type => 'hidden', # revisit this later -# type => 'select', -# options => [ 'html', 'xls', 'csv' ], -# labels => { -# 'html' => 'webpage', -# 'xls' => 'spreadsheet', -# 'csv' => 'CSV', -# }, + type => 'select', + options => [ 'html', 'xls', 'csv' ], + labels => { + 'html' => 'webpage', + 'xls' => 'spreadsheet', + 'csv' => 'CSV', + }, }, { field => 'disabled', # currently unused type => 'hidden', @@ -61,6 +60,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;