[Weberp-svn] SF.net SVN: weberp:[4912] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-03-27 13:40:26
|
Revision: 4912 http://weberp.svn.sourceforge.net/weberp/?rev=4912&view=rev Author: tim_schofield Date: 2011-03-27 13:40:20 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Add field in www_users for whether a user can create tenders Modified Paths: -------------- trunk/WWW_Users.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/74.php Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-03-27 13:37:33 UTC (rev 4911) +++ trunk/WWW_Users.php 2011-03-27 13:40:20 UTC (rev 4912) @@ -136,6 +136,7 @@ salesman='" . $_POST['Salesman'] . "', pagesize='" . $_POST['PageSize'] . "', fullaccess='" . $_POST['Access'] . "', + cancreatetender='" . $_POST['CanCreateTender'] . "', theme='" . $_POST['Theme'] . "', language ='" . $_POST['UserLanguage'] . "', defaultlocation='" . $_POST['DefaultLocation'] ."', @@ -158,6 +159,7 @@ email, pagesize, fullaccess, + cancreatetender, defaultlocation, modulesallowed, displayrecordsmax, @@ -175,11 +177,12 @@ '" . $_POST['Email'] ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', + '" . $_POST['CanCreateTender'] . "', '" . $_POST['DefaultLocation'] ."', '" . $ModulesAllowed . "', '" . $_SESSION['DefaultDisplayRecordsMax'] . "', '" . $_POST['Theme'] . "', - '". $_POST['UserLanguage'] ."', + '" . $_POST['UserLanguage'] ."', '" . $_POST['PDFLanguage'] . "')"; prnMsg( _('A new user record has been inserted'), 'success' ); } @@ -201,6 +204,7 @@ unset($_POST['Password']); unset($_POST['PageSize']); unset($_POST['Access']); + unset($_POST['CanCreateTender']); unset($_POST['DefaultLocation']); unset($_POST['ModulesAllowed']); unset($_POST['Blocked']); @@ -250,6 +254,7 @@ salesman, lastvisitdate, fullaccess, + cancreatetender, pagesize, theme, language @@ -267,6 +272,7 @@ <th>" . _('Salesperson') . "</th> <th>" . _('Last Visit') . "</th> <th>" . _('Security Role') ."</th> + <th>" . _('Can Create Tender') ."</th> <th>" . _('Report Size') ."</th> <th>" . _('Theme') ."</th> <th>" . _('Language') ."</th> @@ -274,7 +280,7 @@ $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -290,7 +296,11 @@ } /*The SecurityHeadings array is defined in config.php */ - + if ($myrow['cancreatetender']==0) { + $CanCreateTender=_('No'); + } else { + $CanCreateTender=_('Yes'); + } printf("<td>%s</td> <td>%s</td> <td>%s</td> @@ -304,26 +314,28 @@ <td>%s</td> <td>%s</td> <td>%s</td> + <td>%s</td> <td><a href=\"%s&SelectedUser=%s\">" . _('Edit') . "</a></td> <td><a href=\"%s&SelectedUser=%s&delete=1\">" . _('Delete') . "</a></td> </tr>", - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[6], - $myrow[7], + $myrow['userid'], + $myrow['realname'], + $myrow['phone'], + $myrow['email'], + $myrow['customerid'], + $myrow['branchcode'], + $myrow['supplierid'], + $myrow['salesman'], $LastVisitDate, - $SecurityRoles[($myrow[9])], - $myrow[10], - $myrow[11], - $myrow[12], + $SecurityRoles[($myrow['fullaccess'])], + $CanCreateTender, + $myrow['pagesize'], + $myrow['theme'], + $myrow['language'], $_SERVER['PHP_SELF'] . "?" . SID, - $myrow[0], + $myrow['userid'], $_SERVER['PHP_SELF'] . "?" . SID, - $myrow[0]); + $myrow['userid']); } //END WHILE LIST LOOP echo '</table><br>'; @@ -351,6 +363,7 @@ salesman, pagesize, fullaccess, + cancreatetender, defaultlocation, modulesallowed, blocked, @@ -373,6 +386,7 @@ $_POST['Salesman'] = $myrow['salesman']; $_POST['PageSize'] = $myrow['pagesize']; $_POST['Access'] = $myrow['fullaccess']; + $_POST['CanCreateTender'] = $myrow['cancreatetender']; $_POST['DefaultLocation'] = $myrow['defaultlocation']; $_POST['ModulesAllowed'] = $myrow['modulesallowed']; $_POST['Theme'] = $myrow['theme']; @@ -436,6 +450,19 @@ } } echo '</select></td></tr>'; +echo '<tr><td>' . _('User Can Create Tenders') . ':</td><td><select name="CanCreateTender">'; + +if ($_POST['CanCreateTender']==0){ + echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; +} else { + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; +} +echo '</select></td></tr>'; + + +echo '</select></td></tr>'; echo '<input type="hidden" name="ID" value="'.$_SESSION['UserID'].'">'; echo '<tr><td>' . _('Default Location') . ':</td> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-27 13:37:33 UTC (rev 4911) +++ trunk/includes/session.inc 2011-03-27 13:40:20 UTC (rev 4912) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=73; +$DBVersion=74; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/74.php =================================================================== --- trunk/sql/mysql/updates/74.php (rev 0) +++ trunk/sql/mysql/updates/74.php 2011-03-27 13:40:20 UTC (rev 4912) @@ -0,0 +1,13 @@ +<?php + +/* Add extra field into www_users setting whether a user + * can create a tender. 0=No 1=Yes + */ + +AddColumn('cancreatetender', 'www_users', 'tinyint(1)', 'NOT NULL', '0', 'fullaccess', $db); + +$sql="UPDATE www_users SET cancreatetender=0"; + +UpdateDBNo(74, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |