<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Inactive checkbox]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=3889</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=3889&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Inactive checkbox.]]></description>
		<lastBuildDate>Sat, 02 Mar 2013 18:41:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Inactive checkbox]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15868#p15868</link>
			<description><![CDATA[<p>Which version of FA are you using?</p><p>Lines 881 to 896 in <strong>ui_input.inc</strong> are:<br /></p><div class="codebox"><pre><code>function inactive_control_cell($id, $value, $table, $key)
{
    global    $Ajax;

    $name = &quot;Inactive&quot;. $id;
    $value = $value ? 1:0;

    if (check_value(&#039;show_inactive&#039;)) {
        if (isset($_POST[&#039;LInact&#039;][$id]) &amp;&amp; (get_post(&#039;_Inactive&#039;.$id.&#039;_update&#039;) || 
            get_post(&#039;Update&#039;)) &amp;&amp; (check_value(&#039;Inactive&#039;.$id) != $value)) {
            update_record_status($id, !$value, $table, $key);
        }
        echo &#039;&lt;td align=&quot;center&quot;&gt;&#039;. checkbox(null, $name, $value, true, &#039;&#039;, &quot;align=&#039;center&#039;&quot;)
             . hidden(&quot;LInact[$id]&quot;, $value, false) . &#039;&lt;/td&gt;&#039;;    
    }
}</code></pre></div><p>Your inverted ternery code - <strong>$value = $value ? 0:1;</strong> - will toggle the status.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 02 Mar 2013 18:41:59 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15868#p15868</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inactive checkbox]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15750#p15750</link>
			<description><![CDATA[<p>What kind of problem do you have with this helper?<br />The code was implemented back in 2009 and works fine up to day.</p><p>Janusz</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Fri, 22 Feb 2013 07:44:27 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15750#p15750</guid>
		</item>
		<item>
			<title><![CDATA[Inactive checkbox]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15747#p15747</link>
			<description><![CDATA[<p>The operation kinda failed if you&#039;re trying to set status from &quot;Inactive&quot; to &quot;Active&quot;;&nbsp; from &quot;checked&quot; to &quot;unchecked&quot; checkbox.</p><div class="quotebox"><blockquote><p>In this file -&gt; &quot;input_ui.inc&quot;</p><p>in this function -&gt; inactive_control_cell($id, $value, $table, $key)</p><p>at this line -&gt; update_record_status($id, !$value, $table, $key);</p></blockquote></div><p>Failed at <span style="color: #FF0000">!$value</span> variable because :</p><div class="quotebox"><blockquote><p>if you <span style="color: #FF0000">!$value</span> when $value = 0 &gt;&gt; it will return 1<br />if you <span style="color: #FF0000">!$value</span> when $value = 1 &gt;&gt; it will return empty string &gt;&gt; sql will failed to update update record status</p></blockquote></div><p>I guess if you change <span style="color: #FF0000"><strong>!$value</strong></span> to <span style="color: blue"><strong>$value ? 0:1</strong></span></p><p>That&#039;s kinda solve it.</p>]]></description>
			<author><![CDATA[null@example.com (evilive)]]></author>
			<pubDate>Fri, 22 Feb 2013 06:09:38 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15747#p15747</guid>
		</item>
	</channel>
</rss>
