diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-01-28 02:24:07 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-01-28 02:24:07 -0800 |
commit | a2faeced765b00c0339fd86d7905cb77318e3d20 (patch) | |
tree | 6c6d9e3bd5c0fccca6ab47f4afe5a3fb576cf01f /httemplate | |
parent | 0928a6aa2ef66fedcdc0429c6450e26a3df5f444 (diff) |
sticky customer notes, RT#29311
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/cust_main_note.cgi | 27 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main_note.cgi | 1 | ||||
-rw-r--r-- | httemplate/view/cust_main/notes/notes.html | 18 |
3 files changed, 31 insertions, 15 deletions
diff --git a/httemplate/edit/cust_main_note.cgi b/httemplate/edit/cust_main_note.cgi index 61590566c..a089db2d1 100755 --- a/httemplate/edit/cust_main_note.cgi +++ b/httemplate/edit/cust_main_note.cgi @@ -18,17 +18,24 @@ <BR> % } -% if( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) { - <TEXTAREA NAME="comment_plain" ROWS="12" COLS="60"><% - join '', split /<br \/>| /, $comment - %></TEXTAREA> -% } -% else { -<% include('/elements/htmlarea.html', 'field' => 'comment_html', - 'curr_value' => $comment) %> +% if ( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) { + <TEXTAREA NAME="comment_plain" ROWS="12" COLS="60"><% + join '', split /<br \/>| /, $comment + %></TEXTAREA> +% } else { + <& /elements/htmlarea.html, 'field' => 'comment_html', + 'curr_value' => $comment + &> % } -<BR><BR> +<BR> + +<& /elements/checkbox.html, 'field' => 'sticky', + 'value' => 1, + 'curr_value' => $sticky, +&> +Sticky note<BR><BR> + <INPUT TYPE="submit" VALUE="<% $notenum ? emt("Apply changes") : emt("Add Note") %>"> </FORM> @@ -42,6 +49,7 @@ my $conf = new FS::Conf; my $comment; my $notenum = ''; my $classnum; +my $sticky = 0; if ( $cgi->param('error') ) { $comment = $cgi->param('comment'); $classnum = $cgi->param('classnum'); @@ -52,6 +60,7 @@ if ( $cgi->param('error') ) { die "no such note: ". $notenum unless $note; $comment = $note->comments; $classnum = $note->classnum; + $sticky = $note->sticky; } $comment =~ s/\r//g; # remove weird line breaks to protect FCKeditor diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index 227297eef..53e616a43 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -33,6 +33,7 @@ my $new = new FS::cust_main_note ( { _date => time, usernum => $FS::CurrentUser::CurrentUser->usernum, comments => $comment, + sticky => scalar( $cgi->param('sticky') ), } ); my $error; diff --git a/httemplate/view/cust_main/notes/notes.html b/httemplate/view/cust_main/notes/notes.html index 6a7a06a02..fa45a68f2 100644 --- a/httemplate/view/cust_main/notes/notes.html +++ b/httemplate/view/cust_main/notes/notes.html @@ -34,6 +34,10 @@ % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; +% my %sticky_color = ( '#eeeeee' => '#ffff66', +% '#ffffff' => '#ffffb8', +% ); +% % my $bgcolor = ''; % my $last_classnum = -1; % my $skipheader = 0; @@ -56,7 +60,7 @@ % ";notenum=$notenum", % 'actionlabel' => emt('Edit customer note'), % 'width' => 616, -% 'height' => 538, #575 +% 'height' => 575, % 'frame' => 'top', % ); % my $clickjs = qq!onclick="$onclick"!; @@ -103,21 +107,23 @@ % $last_classnum = $note->classnum; % } +% my $color = $note->sticky ? $sticky_color{$bgcolor} : $bgcolor; + <TR> - <% note_datestr($note,$conf,$bgcolor) %> - <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"> + <% note_datestr($note,$conf,$color) %> + <TD CLASS="grid" BGCOLOR="<% $color %>"> <% $note->usernum ? $note->access_user->name : $note->otaker %> </TD> % if ($conf->exists('note-classes') && $conf->config('note-classes') == 1) { - <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"> + <TD CLASS="grid" BGCOLOR="<% $color %>"> <% $note->classname %> </TD> % } - <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"> + <TD CLASS="grid" BGCOLOR="<% $color %>"> <% $note->comments | defang %> </TD> % if($edit) { - <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $edit %></TD> + <TD CLASS="grid" BGCOLOR="<% $color %>"><% $edit %></TD> % } </TR> |