<?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; close</title>
	<atom:link href="http://www.openscriptsolution.com/tag/close/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>Only The Assignee Staff or Admin Can Close and Reopen Ticket in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/12/04/only-the-assignee-staff-or-admin-can-close-and-reopen-ticket-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/12/04/only-the-assignee-staff-or-admin-can-close-and-reopen-ticket-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 03:17:27 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[assignee]]></category>
		<category><![CDATA[close]]></category>
		<category><![CDATA[reopen]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[ticket]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=957</guid>
		<description><![CDATA[This following modification will add a small feature to limit the ability for staff to close the opened ticket or to reopen the closed ticket in osTicket v1.6 RC5. Only the assignee staff or admin can close and reopen the ticket. It means that if the current ticket has not been assigned to any staff, [...]]]></description>
			<content:encoded><![CDATA[<p>This following modification will add a small feature to limit the ability for staff to close the opened ticket or to reopen the closed ticket in osTicket v1.6 RC5. Only the assignee staff or admin can close and reopen the ticket. It means that if the current ticket has not been assigned to any staff, then only admin can close that ticket. Since there is no staff_id information for the closed tickets, then the closed ticket handling is similar with the unassigned tickets. Thus, this rule will be automatically being applied to such tickets. <span id="more-957"></span></p>
<ol>
<li>
Open your <strong>\include\class.ticket.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>361
362
363
364
365
366
367
368
369
370
371
372
373
</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>
    <span style="color: #666666; font-style: italic;">//set status to open on a closed ticket.</span>
    <span style="color: #000000; font-weight: bold;">function</span> reopen<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;">$thisuser</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;">'open'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',isanswered=0,updated=NOW(),reopened=NOW() 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>361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
</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: #666666; font-style: italic;">// MOD Only The Assignee Staff Or Admin Can Close The Ticket, </span>
	<span style="color: #666666; font-style: italic;">// by Masino Sinaga (http://www.openscriptsolution.com), December 4, 2009</span>
    	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$thisuser</span><span style="color: #339933;">;</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;">getStaffId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span><span style="color: #000088;">$thisuser</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: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isadmin</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: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>	
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</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: #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>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">//set status to open on a closed ticket.</span>
    <span style="color: #000000; font-weight: bold;">function</span> reopen<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    	<span style="color: #666666; font-style: italic;">// MOD Only The Assignee Staff Or Admin Can ReOpen The Ticket, </span>
	<span style="color: #666666; font-style: italic;">// by Masino Sinaga (http://www.openscriptsolution.com), December 4, 2009</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$thisuser</span><span style="color: #339933;">;</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;">getStaffId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span><span style="color: #000088;">$thisuser</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: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isadmin</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: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>	
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</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;">'open'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',isanswered=0,updated=NOW(),reopened=NOW() 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>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>\scp\tickets.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>210
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Problems closing the ticket. Try again'</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>210
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Problems closing the ticket or you are not allowed to close tickets.'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>224
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Problems reopening the ticket. Try again'</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>224
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Problems reopening the ticket or you are not allowed to reopen tickets.'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all, everyone! Enjoy the code and its result. <img src='http://www.openscriptsolution.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F12%2F04%2Fonly-the-assignee-staff-or-admin-can-close-and-reopen-ticket-in-osticket-v1-6-rc5%2F&amp;title=Only%20The%20Assignee%20Staff%20or%20Admin%20Can%20Close%20and%20Reopen%20Ticket%20in%20osTicket%20v1.6%20RC5" 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/2009/12/04/only-the-assignee-staff-or-admin-can-close-and-reopen-ticket-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Show the Amount at Closed Tickets Sub Tab of osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/11/06/show-the-amount-at-closed-tickets-sub-tab-of-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/11/06/show-the-amount-at-closed-tickets-sub-tab-of-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 01:33:04 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[amount]]></category>
		<category><![CDATA[close]]></category>
		<category><![CDATA[staff panel]]></category>
		<category><![CDATA[staff-side]]></category>
		<category><![CDATA[sub tab]]></category>
		<category><![CDATA[ticket]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=785</guid>
		<description><![CDATA[This simple modification was created since there was a good request on osTicket Discussion Forum about how to show the amount of tickets at the Closed Tickets sub tab under the Tickets tab in staff panel of osTicket. This modification applied to osTicket v1.6 RC5. Open your \scp\tickets.php file, and find this code: 442 ',count(overdue.ticket_id) [...]]]></description>
			<content:encoded><![CDATA[<p>This simple modification was created since there was a good request on <a href="http://www.osticket.com/forums/showthread.php?t=3022" target="_blank">osTicket Discussion Forum</a> about how to show the amount of tickets at the <strong>Closed Tickets</strong> sub tab under the <strong>Tickets</strong> tab in staff panel of osTicket. This modification applied to osTicket v1.6 RC5. <span id="more-785"></span></p>
<p>Open your <strong>\scp\tickets.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>442
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">     <span style="color: #0000ff;">',count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned '</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>442
443
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">     <span style="color: #0000ff;">',count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned '</span><span style="color: #339933;">.</span>
     <span style="color: #0000ff;">',count(closed.ticket_id) as closed '</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>448
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">     <span style="color: #0000ff;">'LEFT JOIN '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status=\'Open\' AND overdue.isoverdue=1 '</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>448
449
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">     <span style="color: #0000ff;">'LEFT JOIN '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status=\'Open\' AND overdue.isoverdue=1 '</span><span style="color: #339933;">.</span>
     <span style="color: #0000ff;">'LEFT JOIN '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' closed ON closed.ticket_id=ticket.ticket_id AND closed.status=\'closed\' '</span><span style="color: #339933;">.</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>489
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addSubMenu</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'desc'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Closed Tickets'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Closed Tickets'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'href'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tickets.php?status=closed'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'iconclass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'closedTickets'</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>489
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$nav</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addSubMenu</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'desc'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Closed Tickets ('</span><span style="color: #339933;">.</span><span style="color: #000088;">$stats</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'closed'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Closed Tickets'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'href'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tickets.php?status=closed'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'iconclass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'closedTickets'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now you should see the amount of the closed tickets following the <strong>Closed Tickets</strong> sub tab under the Tickets tab in staff panel.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F11%2F06%2Fshow-the-amount-at-closed-tickets-sub-tab-of-osticket-v1-6-rc5%2F&amp;title=Show%20the%20Amount%20at%20Closed%20Tickets%20Sub%20Tab%20of%20osTicket%20v1.6%20RC5" id="wpa2a_4"><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/2009/11/06/show-the-amount-at-closed-tickets-sub-tab-of-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Disable Close Ticket on Reply and on Internal Note in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/11/04/how-to-disable-close-ticket-on-reply-and-on-internal-note-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/11/04/how-to-disable-close-ticket-on-reply-and-on-internal-note-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 03:53:02 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[close]]></category>
		<category><![CDATA[department]]></category>
		<category><![CDATA[Internal Note]]></category>
		<category><![CDATA[reply]]></category>
		<category><![CDATA[staff-side]]></category>
		<category><![CDATA[ticket]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=770</guid>
		<description><![CDATA[Someone asked the question in osTicket Discussion Forum about how to disable close ticket feature on reply at the staff-side in osTicket System. Since nobody made it, then I created modification to make it happens. At the same time, I also modified for close ticket on post internal note. This modification will alter your department [...]]]></description>
			<content:encoded><![CDATA[<p>Someone asked the question in <a href="http://www.osticket.com/forums/showthread.php?t=3001" target="_blank">osTicket Discussion Forum</a> about how to disable close ticket feature on reply at the staff-side in osTicket System. Since nobody made it, then I created modification to make it happens. At the same time, I also modified for close ticket on post internal note. This modification will alter your department table by adding two new fields to store the setting for <strong>close ticket on reply</strong> and <strong>close ticket on post internal note</strong>. Thus, you can now define whether to enable or disable those both setting for the certain department in order whether to display or hide those options on the viewticket page from staff-side. <span id="more-770"></span></p>
<ol>
<li>
First of all, alter your <strong>ost_department</strong> table by using this following SQL script. Please note that the <strong>ost_</strong> is the table prefix name. It could be different with yours. In case it differs with yours, please adjust it by yourself, and please be kind of it!</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ALTER TABLE ost_department
ADD COLUMN `can_close_on_reply` tinyint(1) default 1 NOT NULL,
ADD COLUMN `can_close_on_internal_note` tinyint(1) default 1 NOT NULL;</pre></div></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>112
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <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>Autoresponders<span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        &lt;!-- MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009 --&gt;
        &lt;tr class=&quot;header&quot;&gt;&lt;td colspan=2&gt;Close Ticket&lt;/td&gt;&lt;/tr&gt;
        &lt;tr class=&quot;subheader&quot;&gt;&lt;td colspan=2&gt;
            Close Ticket will give the ability to department members (staff and manager) whether they can close the ticket on reply and on post internal note or not.
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;&lt;th&gt;Can Close on Reply:&lt;/th&gt;
            &lt;td&gt;
                &lt;input type=&quot;radio&quot; name=&quot;can_close_on_reply&quot;  value=&quot;1&quot;   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_reply'</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;can_close_on_reply&quot;  value=&quot;0&quot;   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #339933;">!</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_reply'</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;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;&lt;th&gt;Can Close on Internal Note:&lt;/th&gt;
            &lt;td&gt;
                &lt;input type=&quot;radio&quot; name=&quot;can_close_on_internal_note&quot;  value=&quot;1&quot;   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_internal_note'</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;can_close_on_internal_note&quot;  value=&quot;0&quot;   <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #339933;">!</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_internal_note'</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;/td&gt;
        &lt;/tr&gt;
        &lt;!-- MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009 --&gt;</pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>92
93
94
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">function</span> canAppendSignature<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: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">signature</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_append_signature'</span><span style="color: #009900;">&#93;</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>after the last line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>96
97
98
99
100
101
102
103
104
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">// MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009</span>
    <span style="color: #000000; font-weight: bold;">function</span> canCloseOnReply<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;">row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_reply'</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> canCloseOnInternalNote<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;">row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_internal_note'</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;">// MOD Can Close on Reply and Internal Note, by Masino Sinaga, Nov 4, 2009</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>247
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',can_append_signature='</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;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_append_signature'</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>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>247
248
249
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                 <span style="color: #0000ff;">',can_append_signature='</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;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_append_signature'</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;">',can_close_on_reply='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_reply'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #666666; font-style: italic;">// MOD Can Close on Reply, by Masino Sinaga, Nov 4, 2009</span>
                 <span style="color: #0000ff;">',can_close_on_internal_note='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'can_close_on_internal_note'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// MOD Can Close on Internal Note, by Masino Sinaga, Nov 4, 2009</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>328
329
330
331
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                        &lt;div style=&quot;margin-top: 3px;&quot;&gt;
                            &lt;label for=&quot;ticket_status&quot;&gt;&lt;b&gt;Ticket Status:&lt;/b&gt;&lt;/label&gt;
                            <span style="color: #000000; font-weight: bold;">&lt;?</span>
                            <span style="color: #000088;">$checked</span><span style="color: #339933;">=</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_status'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'checked'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Staff must explicitly check the box to change status..</span></pre></td></tr></table></div>

<p>before the first line of that code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>327
</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: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">canCloseOnReply</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;">// MOD Can Close for Dept basis, by Masino Sinaga, Nov 4, 2009 ?&gt;</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>337
338
339
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                            &lt;input type=&quot;checkbox&quot; name=&quot;ticket_status&quot; value=&quot;Reopen&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$checked</span><span style="color: #000000; font-weight: bold;">?&gt;</span> &gt; Reopen on Reply
                            <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
                        &lt;/div&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>340
</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: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>369
370
371
372
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                        <span style="color: #000000; font-weight: bold;">&lt;?</span>
                         <span style="color: #666666; font-style: italic;">//When the ticket is assigned Allow assignee, admin or ANY dept manager to close it</span>
                        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$ticket</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;">||</span> <span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isadmin</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #339933;">||</span> <span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$thisuser</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: #339933;">==</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStaffId</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: #000000; font-weight: bold;">?&gt;</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>373
</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: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dept</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">canCloseOnInternalNote</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;">// MOD Can Close for Dept basis, by Masino Sinaga, Nov 4, 2009 ?&gt;</span></pre></td></tr></table></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>381
382
383
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                            &lt;input type=&quot;checkbox&quot; name=&quot;ticket_status&quot; value=&quot;Reopen&quot; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$checked</span><span style="color: #000000; font-weight: bold;">?&gt;</span> &gt; Reopen Ticket
                            <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
                        &lt;/div&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>384
</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: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Have a nice code to you!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F11%2F04%2Fhow-to-disable-close-ticket-on-reply-and-on-internal-note-in-osticket-v1-6-rc5%2F&amp;title=How%20to%20Disable%20Close%20Ticket%20on%20Reply%20and%20on%20Internal%20Note%20in%20osTicket%20v1.6%20RC5" id="wpa2a_6"><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/2009/11/04/how-to-disable-close-ticket-on-reply-and-on-internal-note-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
