From: <tim...@us...> - 2010-07-13 18:12:06
|
Revision: 3617 http://web-erp.svn.sourceforge.net/web-erp/?rev=3617&view=rev Author: tim_schofield Date: 2010-07-13 18:12:00 +0000 (Tue, 13 Jul 2010) Log Message: ----------- Bug fixes, correctly do the workflow, fix sql quoting errors and layout changes Modified Paths: -------------- trunk/MRPDemandTypes.php trunk/doc/Change.log.html Modified: trunk/MRPDemandTypes.php =================================================================== --- trunk/MRPDemandTypes.php 2010-07-13 18:11:40 UTC (rev 3616) +++ trunk/MRPDemandTypes.php 2010-07-13 18:12:00 UTC (rev 3617) @@ -15,6 +15,9 @@ $SelectedDT = trim(strtoupper($_GET['SelectedDT'])); } +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . + _('Inventory') . '" alt="">' . ' ' . $title . '</p>'; + if (isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -25,16 +28,16 @@ //first off validate inputs sensible - if (trim(strtoupper($_POST['mrpdemandtype']) == "WO") or + if (trim(strtoupper($_POST['mrpdemandtype']) == "WO") or trim(strtoupper($_POST['mrpdemandtype']) == "SO")) { $InputError = 1; prnMsg(_('The Demand Type is reserved for the system'),'error'); - } + } if (strlen($_POST['mrpdemandtype']) < 1) { $InputError = 1; prnMsg(_('The Demand Type code must be at least 1 character long'),'error'); - } + } if (strlen($_POST['Description'])<3) { $InputError = 1; prnMsg(_('The Demand Type description must be at least 3 characters long'),'error'); @@ -51,8 +54,8 @@ $msg = _('The demand type record has been updated'); } elseif ($InputError !=1) { - //Selected demand type is null cos no item selected on first time round so must be adding a - //record must be submitting new entries in the new work centre form + //Selected demand type is null cos no item selected on first time round so must be adding a + //record must be submitting new entries in the new work centre form $sql = "INSERT INTO mrpdemandtypes (mrpdemandtype, description) @@ -66,6 +69,7 @@ if ($InputError !=1){ $result = DB_query($sql,$db,_('The update/addition of the demand type failed because')); prnMsg($msg,'success'); + echo '<br>'; unset ($_POST['Description']); unset ($_POST['mrpdemandtype']); unset ($SelectedDT); @@ -76,7 +80,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'MRPDemands' - $sql= "SELECT COUNT(*) FROM mrpdemands + $sql= "SELECT COUNT(*) FROM mrpdemands WHERE mrpdemands.mrpdemandtype='$SelectedDT' GROUP BY mrpdemandtype"; $result = DB_query($sql,$db); @@ -87,13 +91,14 @@ $sql="DELETE FROM mrpdemandtypes WHERE mrpdemandtype='$SelectedDT'"; $result = DB_query($sql,$db); prnMsg(_('The selected demand type record has been deleted'),'succes'); + echo '<br>'; } // end of MRPDemands test } -if (!isset($SelectedDT)) { +if (!isset($SelectedDT) or isset($_GET['delete'])) { -//It could still be the second time the page has been run and a record has been selected -//for modification SelectedDT will exist because it was sent with the new call. If its +//It could still be the second time the page has been run and a record has been selected +//for modification SelectedDT will exist because it was sent with the new call. If its //the first time the page has been displayed with no parameters //then none of the above are true and the list of demand types will be displayed with //links to delete or edit each. These will call the same page again and allow update/input @@ -105,7 +110,7 @@ $result = DB_query($sql,$db); - echo "<table border=1> + echo "<table class=selection> <tr BGCOLOR =#800000><th>" . _('Demand Type') . "</th> <th>" . _('Description') . "</th> </tr></font>"; @@ -130,13 +135,13 @@ //end of ifs and buts! -if (isset($SelectedDT)) { +if (isset($SelectedDT) and !isset($_GET['delete'])) { echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Show all Demand Types') . '</a></div>'; } echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; -if (isset($SelectedDT)) { +if (isset($SelectedDT) and !isset($_GET['delete'])) { //editing an existing demand type $sql = "SELECT mrpdemandtype, @@ -152,13 +157,13 @@ echo '<input type=hidden name=SelectedDT value=' . $SelectedDT . '>'; echo "<input type=hidden name=mrpdemandtype value='" . $_POST['mrpdemandtype'] . "'>"; - echo '<table><tr><td>' ._('Demand Type') . ':</td><td>' . $_POST['mrpdemandtype'] . '</td></tr>'; + echo '<table class=selection><tr><td>' ._('Demand Type') . ':</td><td>' . $_POST['mrpdemandtype'] . '</td></tr>'; } else { //end of if $SelectedDT only do the else when a new record is being entered if (!isset($_POST['mrpdemandtype'])) { $_POST['mrpdemandtype'] = ''; } - echo '<table><tr> + echo '<table class=selection><tr> <td>' . _('Demand Type') . ":</td> <td><input type='Text' name='mrpdemandtype' size=6 maxlength=5 value='" . $_POST['mrpdemandtype'] . "'></td> </tr>" ; @@ -173,8 +178,8 @@ </tr> </table>"; -echo "<div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div>"; +echo "<br><div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div>"; echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-13 18:11:40 UTC (rev 3616) +++ trunk/doc/Change.log.html 2010-07-13 18:12:00 UTC (rev 3617) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>13/07/10 Tim: MRPDemandTypes.php - Bug fixes, correctly do the workflow, fix sql quoting errors and layout changes</p> <p>13/07/10 Tim: MRPDemands.php - Bug fixes, correctly do the workflow, fix sql quoting errors and layout changes</p> <p>13/07/10 Tim: MiscFunctions.js - Revert formatting changes till I can ascertain why the numbers only function stopped working</p> <p>12/07/10 Tim: MRPCreateDemand.php - Layout changes, sql quoting corrections</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |