https://rt-wiki.bestpractical.com/index.php?title=PopUpAlert&feed=atom&action=historyPopUpAlert - Revision history2024-03-28T14:21:39ZRevision history for this page on the wikiMediaWiki 1.37.2https://rt-wiki.bestpractical.com/index.php?title=PopUpAlert&diff=2610&oldid=prevAdmin: 2 revisions imported2016-04-06T20:20:28Z<p>2 revisions imported</p>
<p><b>New page</b></p><div>= PopUpAlert =<br />
<br />
In RT responses are generally to requestors however, on occasion one accidentally replies with an internal comment, forgetting that there are probably watchers set on the Queue...<br />
<br />
While some users might like this to prevent themselves from accidentally sending messages to unintended recipients, for others it would be an annoyance.<br />
<br />
== 3.6.4 ==<br />
<br />
$RT_HOME/local/html/Elements/Submit<br />
<br />
% if ($Label_pop_up) {<br />
&lt;span class="caption"&gt;&lt;%$Caption%&gt;&lt;/span&gt;<br />
&lt;input type="submit" onClick="return confirmSubmit()" &lt;% $Name &amp;&amp; qq[name="$Name"] | n %&gt; value="&lt;%$Label_pop_up%&gt;" class="button" /&gt;<br />
<br />
% } elsif ($AlternateLabel) {<br />
&lt;span class="caption"&gt;&lt;%$AlternateCaption%&gt;&lt;/span&gt;<br />
&lt;input type="submit" &lt;% $Name &amp;&amp; qq[ name="$Name"] | n %&gt; value="&lt;%$AlternateLabel%&gt;" class="button" /&gt;<br />
% } else {<br />
&lt;span class="caption"&gt;&lt;%$Caption%&gt;&lt;/span&gt;<br />
&lt;input type="submit" &lt;% $Name &amp;&amp; qq[ name="$Name"] | n %&gt; value="&lt;%$Label%&gt;" class="button" /&gt;<br />
% }<br />
<br />
<br />
$RT_HOME/local/html/Ticket/Update.html<br />
<br />
&lt;script type="text/javascript" src="&lt;%$RT::WebPath%&gt;/NoAuth/js/pop_up.js"&gt;&lt;/script&gt;<br />
<br />
% if ($CommentDefault eq "SELECTED") {<br />
&lt;&amp; /Elements/Submit, Label =&gt; loc('Update Ticket'), Name =&gt; 'SubmitTicket' &amp;&gt;<br />
% } elsif ($ResponseDefault eq "SELECTED") {<br />
&lt;&amp; /Elements/Submit, Label_pop_up =&gt; loc('Update Ticket'), Name =&gt; 'SubmitTicket' &amp;&gt;<br />
% }<br />
<br />
<br />
pop_up.js is just:<br />
<br />
function confirmSubmit(){<br />
var agree=confirm("Attention! This email bla bla bla....");<br />
if (agree)<br />
return true ;<br />
else<br />
return false ;<br />
}<br />
<br />
== 3.8.1 ==<br />
<br />
Below is a patch to implement the same functionality as above. What remains to be done, and would be more useful, would be to develop a [[JavaScript]] function in an external file that parses the current form state to display who the message is to be sent to. In addition, this should probably be a preference...<br />
<br />
--- share/html/Ticket/Update.html 2008-08-30 19:22:14.000000000 -0400<br />
+++ local/html/Ticket/Update.html 2008-10-10 23:50:05.000000000 -0400<br />
@@ -147,8 +147,12 @@<br />
<br />
<br />
<br />
-<br />
+%if ( length($ResponseDefault) ){<br />
+&lt;&amp; /Elements/Submit, Label =&gt; loc('Update Ticket'), Name =&gt; 'SubmitTicket', OnClick =&gt; qq(return confirm('Are you sure you want to send this message to:')?true:false) &amp;&gt;<br />
+%} else {<br />
&lt;&amp; /Elements/Submit, Label =&gt; loc('Update Ticket'), Name =&gt; 'SubmitTicket' &amp;&gt;<br />
+%}<br />
+<br />
% if ($TicketObj-&gt;CurrentUserHasRight('ShowOutgoingEmail')) {<br />
&lt;&amp;|/Widgets/TitleBox, title =&gt; loc('Scrips and Recipients') &amp;&gt;<br />
&lt;&amp; /Ticket/Elements/PreviewScrips, TicketObj =&gt; $TicketObj, %ARGS &amp;&gt;<br />
<br />
<br />
<br />
Alternately, it may be enough to simply colorize the non-preferred 'Update Type' list option to remind the user which they've selected:<br />
<br />
--- share/html/Ticket/Update.html 2009-11-20 09:43:14.000000000 -0800<br />
+++ local/html/Ticket/Update.html 2010-02-11 10:06:08.000000000 -0800<br />
@@ -91,7 +91,7 @@<br />
&lt;tr&gt;&lt;td class="label"&gt;&lt;&amp;|/l&amp;&gt;Update Type&lt;/&amp;&gt;:&lt;/td&gt;<br />
&lt;td&gt;&lt;select name="UpdateType"&gt;<br />
% if ($CanComment) {<br />
-&lt;option value="private" &lt;% ($ARGS{'UpdateType'} &amp;&amp; $ARGS{'UpdateType'} eq "private") ? qq[ selected="selected"] : !$ARGS{'UpdateType'}&amp;&amp;$CommentDefault |n %&gt;&gt;&lt;&amp;|/l&amp;&gt;Comments (Not sent to requestors)&lt;/&amp;&gt;&lt;/option&gt;<br />
+&lt;option value="private" style="color:red" &lt;% ($ARGS{'UpdateType'} &amp;&amp; $ARGS{'UpdateType'} eq "private") ? qq[ selected="selected"] : !$ARGS{'UpdateType'}&amp;&amp;$CommentDefault |n %&gt;&gt;&lt;&amp;|/l&amp;&gt;Comments (Not sent to requestors)&lt;/&amp;&gt;&lt;/option&gt;<br />
% }<br />
% if ($CanRespond) {<br />
&lt;option value="response" &lt;% ($ARGS{'UpdateType'} &amp;&amp; $ARGS{'UpdateType'} eq "response") ? qq[ selected="selected"] : !$ARGS{'UpdateType'}&amp;&amp;$ResponseDefault |n %&gt;&gt;&lt;&amp;|/l&amp;&gt;Reply to requestors&lt;/&amp;&gt;&lt;/option&gt;</div>Admin