[TEP-COMMIT] [CVS admin] Fix bug 1642

mevans-OfajU3CKLf1/[email protected] 31 Oct 2004 09:57:46 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>admin/admin/includes/functions</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">general.php</a></tt></td><td align="right" id="added">+9</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.172&amp;content-type=text/vnd.viewcvs-markup">1.172</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php.diff?r1=1.172&amp;r2=1.173">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.173&amp;content-type=text/vnd.viewcvs-markup">1.173</a></td></tr>
</table>
<pre class="comment">
Fix <a href="http://www.oscommerce.com/community/bugs,1642">bug 1642</a>
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions">functions</a><br /></span>
<div class="fileheader"><big><b>general.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.172&amp;content-type=text/vnd.viewcvs-markup">1.172</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php.diff?r1=1.172&amp;r2=1.173">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.173&amp;content-type=text/vnd.viewcvs-markup">1.173</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.172 -r1.173
--- general.php	2004/10/28 19:00:22	1.172
+++ general.php	2004/10/31 09:57:44	1.173
@@ -885,9 +885,16 @@
</small></pre><pre class="diff" id="context">       $order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
       while ($order = tep_db_fetch_array($order_query)) {
         tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");
</pre><pre class="diff" id="removed">-      }
-    }
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="added">+        $products_query = tep_db_query("select products_quantity, products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$order['products_id'] . "'");
+        $products = tep_db_fetch_array($products_query);
+        
+        if ($products['products_quantity'] &gt;= '1' &amp;&amp; $products['products_status'] == '0') {
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '1' where products_id = '" . (int)$order['products_id'] . "'");
+        }
+      }
+    } 
+    
</pre><pre class="diff" id="context">     tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
     tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
     tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "'");
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; email">CVSspam</a> 0.2.9</small></center>
</body></html>


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click