<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Script Solution&#187; customer</title>
	<atom:link href="http://www.openscriptsolution.com/tag/customer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Closed Ticket Alert for All Department Members in osTicket v1.6 ST (Stable)</title>
		<link>http://www.openscriptsolution.com/2010/02/27/closed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable/</link>
		<comments>http://www.openscriptsolution.com/2010/02/27/closed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 11:23:46 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[closed ticket]]></category>
		<category><![CDATA[customer]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[reply]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[ticket system]]></category>
		<category><![CDATA[v1.6 ST]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1123</guid>
		<description><![CDATA[It does make sense when a ticket is closed by your customer or client, then all department members will be automatically notified by your ticketing system via email. I made the modification to implement this requirement into osTicket v1.6 ST (Stable), including the related setting in order to enable or disable this feature, just in [...]]]></description>
			<content:encoded><![CDATA[<p>It does make sense when a ticket is closed by your customer or client, then all department members will be automatically notified by your ticketing system via email. I made the modification to implement this requirement into osTicket v1.6 ST (Stable), including the related setting in order to enable or disable this feature, just in case whether this feature is necessary to be implemented, and sometimes it is not. Besides that, you will be able to define the email template for the notification that sent to your customer via Admin Panel. This modification also will answer <a href="http://www.osticket.com/forums/showthread.php?t=3602" target="_blank">the related question in osTicket Discussion Forum</a>. <span id="more-1123"></span></p>
<ol>
<li>
First of all, you have to alter your <strong>ost_config</strong> table by adding four additional new fields into it, simply by executing this following SQL script into your osTicket database. Please note that in this example, I use <strong>ost_</strong> as the table prefix. Adjust it in case it differs with yours:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ALTER TABLE ost_config 
ADD COLUMN `closed_alert_active` tinyint(1) default 0 NOT NULL,
ADD COLUMN `closed_alert_assigned` tinyint(1) default 0 NOT NULL,
ADD COLUMN `closed_alert_dept_manager` tinyint(1) default 0 NOT NULL,
ADD COLUMN `closed_alert_dept_members` tinyint(1) default 0 NOT NULL;</pre></div></div>

</li>
<li>
You also have to alter the <strong>ost_email_template</strong> by adding two new fields in order to create new email template for closing alert ticket. Simply run this following SQL script to your osTicket database as well as the first step above:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ALTER TABLE ost_email_template 
ADD COLUMN `ticket_closed_subj` varchar(255) default '' NOT NULL,
ADD COLUMN `ticket_closed_body` text NOT NULL;</pre></div></div>

</li>
<li>Open your <strong>/include/staff/preference.inc.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>478
479
480
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;input type=&quot;checkbox&quot; name=&quot;overdue_alert_dept_members&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Department Members (spammy)
            &lt;/td&gt;
        &lt;/tr&gt;</pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>482
483
484
485
486
487
488
489
490
491
492
493
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span>
        <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>th valign<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;top&quot;</span><span style="color: #339933;">&gt;</span>Closed Ticket Alert<span style="color: #339933;">:&lt;/</span>th<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;</span>
              <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;radio&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;closed_alert_active&quot;</span>  value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1&quot;</span>   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;Enable
              &lt;input type=&quot;radio&quot; name=&quot;closed_alert_active&quot;  value=&quot;0&quot;   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #339933;">!</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;Disable
              &lt;br&gt;&lt;i&gt;Admin Email gets an alert by default. Select additional recipients below&lt;/i&gt;&amp;nbsp;&lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;br&gt;
              &lt;input type=&quot;checkbox&quot; name=&quot;closed_alert_assigned&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Assigned Staff
              &lt;input type=&quot;checkbox&quot; name=&quot;closed_alert_dept_manager&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Department Manager
              &lt;input type=&quot;checkbox&quot; name=&quot;closed_alert_dept_members&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt; Department Members (spammy)
            &lt;/td&gt;
        &lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span></pre></td></tr></table></div>

</li>
<li>Open your <strong>/include/class.config.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>376
377
378
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">function</span> alertDeptMembersONOverdueTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
    <span style="color: #000000; font-weight: bold;">function</span> alertONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> alertAssignedONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> alertDeptManagerONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> alertDeptMembersONClosedTicket<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>511
512
513
514
515
516
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_active'</span><span style="color: #009900;">&#93;</span>
                <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_laststaff'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_assigned'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_dept_manager'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'note_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'No target recipient(s) selected'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>518
519
520
521
522
523
524
525
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span>
                <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'No target recipient(s) selected'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>599
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            <span style="color: #0000ff;">',overdue_alert_dept_members='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

<p>replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>599
600
601
602
603
604
605
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            <span style="color: #0000ff;">',overdue_alert_dept_members='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'overdue_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010            </span>
            <span style="color: #0000ff;">',closed_alert_active='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_active'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>            
			<span style="color: #0000ff;">',closed_alert_assigned='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_assigned'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
            <span style="color: #0000ff;">',closed_alert_dept_manager='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_manager'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
            <span style="color: #0000ff;">',closed_alert_dept_members='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed_alert_dept_members'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

</li>
<li>Open <strong>/include/class.ticket.php</strong> file, and find this code:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>385
386
387
388
389
390
391
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//Close the ticket</span>
    <span style="color: #000000; font-weight: bold;">function</span> close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'UPDATE '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' SET status='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'closed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',staff_id=0,isoverdue=0,duedate=NULL,updated=NOW(),closed=NOW() '</span><span style="color: #339933;">.</span>
              <span style="color: #0000ff;">' WHERE ticket_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> db_affected_rows<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">:</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//Close the ticket</span>
    <span style="color: #000000; font-weight: bold;">function</span> close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'UPDATE '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' SET status='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'closed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',staff_id=0,isoverdue=0,duedate=NULL,updated=NOW(),closed=NOW() '</span><span style="color: #339933;">.</span>
              <span style="color: #0000ff;">' WHERE ticket_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//return (db_query($sql) &amp;&amp; db_affected_rows())?true:false;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 NOT FINISHED YET        </span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> db_affected_rows<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">//echo $sql;</span>
            <span style="color: #000088;">$dept</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDept</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$dept</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tplId</span><span style="color: #339933;">=</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTemplateId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$tplId</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultTemplateId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">//if requested &amp;&amp; enabled fire nasty alerts.</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT ticket_closed_subj,ticket_closed_body FROM '</span><span style="color: #339933;">.</span>EMAIL_TEMPLATE_TABLE<span style="color: #339933;">.</span>
                     <span style="color: #0000ff;">' WHERE cfg_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND tpl_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tplId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span>db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
                    <span style="color: #000088;">$body</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">replaceTemplateVars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$subj</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">replaceTemplateVars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subj</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAlertEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                        <span style="color: #000088;">$email</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #666666; font-style: italic;">//Fire and email to admin. No questions asked.</span>
                        <span style="color: #000088;">$alert</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%s</span>taff&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Admin'</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAdminEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #666666; font-style: italic;">/*** Build list of recipients and fire the alerts ***/</span>
                        <span style="color: #000088;">$recipients</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #666666; font-style: italic;">//Assigned staff... if any</span>
                        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAssigned</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertAssignedONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$recipients</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStaff</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertDeptMembersONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Alert assigned or dept members not both</span>
                            <span style="color: #666666; font-style: italic;">//All dept members.</span>
                            <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT staff_id FROM '</span><span style="color: #339933;">.</span>STAFF_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' WHERE dept_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$users</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$users</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span>db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$users</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                                    <span style="color: #000088;">$recipients</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Staff<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">//possible mem issues with a large number of staff?</span>
                            <span style="color: #009900;">&#125;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #666666; font-style: italic;">//Always blame the manager</span>
                        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">alertDeptManagerONClosedTicket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$dept</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$recipients</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #666666; font-style: italic;">//Ok...we are ready to go....</span>
                        <span style="color: #000088;">$sentlist</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$recipients</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$staff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$staff</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$staff</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAvailable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
                            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$sentlist</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//avoid duplicate emails.</span>
                            <span style="color: #000088;">$alert</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%s</span>taff&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFirstName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$staff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    Sys<span style="color: #339933;">::</span><span style="color: #990000;">log</span><span style="color: #009900;">&#40;</span>LOG_WARNING<span style="color: #339933;">,</span><span style="color: #0000ff;">'Template Fetch Error'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Unable to fetch 'closed' alert template #<span style="color: #006699; font-weight: bold;">$tplId</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 NOT FINISHED YET</span>
&nbsp;
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>/include/staff/template.inc.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>173
174
175
176
177
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">            &lt;tr&gt;
                &lt;th&gt;Message Body:&lt;/th&gt;
                &lt;td&gt;&lt;textarea rows=&quot;7&quot; cols=&quot;75&quot; name=&quot;ticket_overdue_body&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$tpl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/textarea&gt;
                    &amp;nbsp;&lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;/td&gt;
            &lt;/tr&gt;</pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span>
            <span style="color: #339933;">&lt;</span>tr <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;header&quot;</span><span style="color: #339933;">&gt;&lt;</span>td colspan<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">&gt;</span>Closed Ticket Alert<span style="color: #339933;">/</span>Notice<span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>tr <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;subheader&quot;</span><span style="color: #339933;">&gt;&lt;</span>td colspan<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">&gt;</span>Alert sent to staff on closed tickets<span style="color: #339933;">.&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;</span>th<span style="color: #339933;">&gt;</span>Subject<span style="color: #339933;">&lt;/</span>th<span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;</span>
                    <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> size<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;65&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ticket_closed_subj&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?=<span style="color: #006699; font-weight: bold;">$tpl</span>['ticket_closed_subj']?&gt;&quot;</span><span style="color: #339933;">&gt;</span>
                            <span style="color: #339933;">&amp;</span>nbsp<span style="color: #339933;">;&lt;</span>font <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;error&quot;</span><span style="color: #339933;">&gt;&amp;</span>nbsp<span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;th&gt;Message Body:&lt;/th&gt;
                &lt;td&gt;&lt;textarea rows=&quot;7&quot; cols=&quot;75&quot; name=&quot;ticket_closed_body&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$tpl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/textarea&gt;
                    &amp;nbsp;&lt;font class=&quot;error&quot;&gt;&amp;nbsp;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/font&gt;&lt;/td&gt;
            &lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010 ?&gt;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>/include/class.msgtpl.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>104
105
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_subj'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Subject required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Template message required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>107
108
109
110
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010        </span>
        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Subject required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'string'</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">'required'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Template message required'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>143
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>143
144
145
146
147
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
                 <span style="color: #0000ff;">',ticket_closed_subj='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
                 <span style="color: #0000ff;">',ticket_closed_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>213
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>213
214
215
216
217
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',ticket_overdue_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_overdue_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span>
                 <span style="color: #0000ff;">',ticket_closed_subj='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_subj'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
                 <span style="color: #0000ff;">',ticket_closed_body='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_closed_body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
<span style="color: #666666; font-style: italic;">// Closed Ticket Alert for Department Members, modified by Masino Sinaga, February 27, 2010</span></pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all for the modification! <img src='http://www.openscriptsolution.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>After you completed doing that modification, now you HAVE TO define the email template that will be sent to the staff when a ticket is closed. You can set it up via: <strong>Admin Panel -> Emails -> Templates</strong>, and then fill in the <strong>Closed Ticket Alert:</strong> directive.</p>
<p>For instance, in the <strong>Subject:</strong> directive, please fill ini with this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Closed Ticket Alert</pre></div></div>

<p>and in the <strong>Body:</strong> directive, fill in with this template:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">A ticket, #%ticket assigned to you or in your department has been closed.
&nbsp;
%url/scp/tickets.php?id=%id
&nbsp;
Thank you for your kindly cooperation so far.
&nbsp;
- Support Ticket System - powered by osTicket.</pre></div></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F02%2F27%2Fclosed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable%2F&amp;title=Closed%20Ticket%20Alert%20for%20All%20Department%20Members%20in%20osTicket%20v1.6%20ST%20%28Stable%29" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/02/27/closed-ticket-alert-for-all-department-members-in-osticket-v1-6-st-stable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
