From: <rc...@us...> - 2016-10-24 01:18:54
|
Revision: 7653 http://sourceforge.net/p/web-erp/reponame/7653 Author: rchacon Date: 2016-10-24 01:18:52 +0000 (Mon, 24 Oct 2016) Log Message: ----------- Fixes column, adds buttons, formats code and moves form after selected table. Modified Paths: -------------- trunk/SecurityTokens.php trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/ConnectDB_postgres.inc trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/SecurityTokens.php =================================================================== --- trunk/SecurityTokens.php 2016-10-23 19:27:31 UTC (rev 7652) +++ trunk/SecurityTokens.php 2016-10-24 01:18:52 UTC (rev 7653) @@ -1,138 +1,157 @@ <?php +/* $Id: SecurityTokens.php 4424 2010-12-22 16:27:45Z tim_schofield $ */ +/* Administration of security tokens */ -/* $Id: SecurityTokens.php 4424 2010-12-22 16:27:45Z tim_schofield $*/ - include('includes/session.inc'); $Title = _('Maintain Security Tokens'); - +$ViewTopic = 'SecuritySchema'; +$BookMark = 'SecurityTokens';// Pending ? include('includes/header.inc'); -if (isset($_GET['SelectedToken'])) { - if ($_GET['Action']=='delete'){ +if(isset($_GET['SelectedToken'])) { + if($_GET['Action'] == 'delete'){ $Result = DB_query("SELECT script FROM scripts WHERE pagesecurity='" . $_GET['SelectedToken'] . "'"); - if (DB_num_rows($Result)>0){ - prnMsg(_('This secuirty token is currently used by the following scripts and cannot be deleted'),'error'); + if(DB_num_rows($Result)>0) { + prnMsg(_('This secuirty token is currently used by the following scripts and cannot be deleted'), 'error'); echo '<table> <tr>'; - $i=0; - while ($ScriptRow = DB_fetch_array($Result)){ - if ($i==5){ - $i=0; + $i = 0; + while($ScriptRow = DB_fetch_array($Result)) { + if($i == 5){ + $i = 0; echo '</tr> <tr>'; } $i++; - echo '<td>' . $ScriptRow['script'] . '</td>'; + echo '<td>', $ScriptRow['script'], '</td>'; } echo '</tr></table>'; } else { $Result = DB_query("DELETE FROM securitytokens WHERE tokenid='" . $_GET['SelectedToken'] . "'"); } - } else { // it must be an edit - $sql="SELECT tokenid, - tokenname + } else {// It must be an edit + $Sql = "SELECT tokenid, tokenname FROM securitytokens - WHERE tokenid='".$_GET['SelectedToken']."'"; - $Result= DB_query($sql); - $myrow = DB_fetch_array($Result,$db); - $_POST['TokenID']=$myrow['tokenid']; - $_POST['TokenDescription']=$myrow['tokenname']; + WHERE tokenid='" . $_GET['SelectedToken'] . "'"; + $Result = DB_query($Sql); + $MyRow = DB_fetch_array($Result); + $_POST['TokenID'] = $MyRow['tokenid']; + $_POST['TokenDescription'] = $MyRow['tokenname']; } } -if (!isset($_POST['TokenID'])){ - $_POST['TokenID']=''; - $_POST['TokenDescription']=''; +if(!isset($_POST['TokenID'])) { + $_POST['TokenID'] = ''; + $_POST['TokenDescription'] = ''; } -$InputError =0; +$InputError = 0; -if (isset($_POST['Submit']) OR isset($_POST['Update'])){ - if (!is_numeric($_POST['TokenID'])){ - prnMsg(_('The token ID is expected to be a number. Please enter a number for the token ID'),'error'); +if(isset($_POST['Submit']) OR isset($_POST['Update'])) { + if(!is_numeric($_POST['TokenID'])) { + prnMsg(_('The token ID is expected to be a number. Please enter a number for the token ID'), 'error'); $InputError = 1; + } - if (mb_strlen($_POST['TokenDescription'])==0){ - prnMsg(_('A token description must be entered'),'error'); + if(mb_strlen($_POST['TokenDescription']) == 0) { + prnMsg(_('A token description must be entered'), 'error'); $InputError = 1; } } -if (isset($_POST['Submit'])) { - - $TestSQL="SELECT tokenid FROM securitytokens WHERE tokenid='".$_POST['TokenID']."'"; - $TestResult=DB_query($TestSQL); - if (DB_num_rows($TestResult)!=0) { +if(isset($_POST['Submit'])) { + $TestSql = "SELECT tokenid FROM securitytokens WHERE tokenid='" . $_POST['TokenID'] . "'"; + $TestResult = DB_query($TestSql); + if(DB_num_rows($TestResult)!=0) { prnMsg( _('This token ID has already been used. Please use a new one') , 'warn'); $InputError = 1; } - if ($InputError == 0){ - $sql = "INSERT INTO securitytokens values('".$_POST['TokenID']."', '".$_POST['TokenDescription']."')"; - $Result= DB_query($sql); - $_POST['TokenID']=''; - $_POST['TokenDescription']=''; + if($InputError == 0) { + $Sql = "INSERT INTO securitytokens values('" . $_POST['TokenID'] . "', '" . $_POST['TokenDescription'] . "')"; + $Result = DB_query($Sql); + $_POST['TokenID'] = ''; + $_POST['TokenDescription'] = ''; } } -if (isset($_POST['Update']) AND $InputError == 0) { - $sql = "UPDATE securitytokens - SET tokenname='".$_POST['TokenDescription'] . "' - WHERE tokenid='".$_POST['TokenID']."'"; - $Result= DB_query($sql); - $_POST['TokenDescription']=''; - $_POST['TokenID']=''; +if(isset($_POST['Update']) AND $InputError == 0) { + $Sql = "UPDATE securitytokens + SET tokenname='" . $_POST['TokenDescription'] . "' + WHERE tokenid='" . $_POST['TokenID'] . "'"; + $Result = DB_query($Sql); + $_POST['TokenDescription'] = ''; + $_POST['TokenID'] = ''; } -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . - _('Print') . '" alt="" />' . ' ' . $Title . '</p> - <form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" id="form"> - <div> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> - <br /> - <table> - <tr>'; -if (isset($_GET['Action']) and $_GET['Action']=='edit') { - echo '<td>' . _('Description') . '</td> - <td><input type="text" size="50" autofocus="autofocus" required="required" maxlength="50" name="TokenDescription" value="'.$_POST['TokenDescription'] .'" /></td> - <td><input type="hidden" name="TokenID" value="'.$_GET['SelectedToken'].'" /> - <input type="submit" name="Update" value="' . _('Update') . '" />'; -} else { - echo '<td>' . _('Token ID') . '</td> - <td><input type="text" autofocus="autofocus" required="required" class="integer" name="TokenID" value="'.$_POST['TokenID'].'" /></td> +echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/maintenance.png" title="', // Icon image. + $Title, '" /> ', // Icon title. + $Title, '</p>';// Page title. + +echo '<table class="selection"> + <thead> + <tr> + <th>', _('Token ID'), '</th> + <th>', _('Description'), '</th> + <th class="noprint" colspan="2"> </th> </tr> - <tr> - <td>' . _('Description') . '</td> - <td><input type="text" required="required" size="50" maxlength="50" name="TokenDescription" value="'.$_POST['TokenDescription'] .'" title="' . _( - 'The security token description should describe which functions this token allows a user/role to access') . '" /></td> - <td><input type="submit" name="Submit" value="' . _('Insert') . '" />'; + </thead><tbody>'; +$Sql = "SELECT tokenid, tokenname FROM securitytokens ORDER BY tokenid"; +$Result = DB_query($Sql); +while($MyRow = DB_fetch_array($Result)) { + echo '<tr> + <td class="number">', $MyRow['tokenid'], '</td> + <td class="text">', htmlspecialchars($MyRow['tokenname'], ENT_QUOTES, 'UTF-8'), '</td> + <td class="noprint"><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '?SelectedToken=', $MyRow['tokenid'], '&Action=edit">', _('Edit'), '</a></td> + <td class="noprint"><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '?SelectedToken=', $MyRow['tokenid'], '&Action=delete" onclick="return confirm(\'', _('Are you sure you wish to delete this security token?'), '\');">', _('Delete'), '</a></td> + </tr>'; } +echo '</tbody></table>'; -echo '</td> - </tr> - </table> - <br />'; +echo '<br /> + <form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" id="form" method="post"> + <input name="FormID" type="hidden" value="' . $_SESSION['FormID'] . '" /> + <table class="noprint"> + <thead> + <tr> + <th colspan="2">'; -echo '</div> - </form>'; - -echo '<table class="selection">'; -echo '<tr> - <th>' . _('Token ID') . '</th> - <th>' . _('Description'). '</th> - </tr>'; - -$sql="SELECT tokenid, tokenname FROM securitytokens ORDER BY tokenid"; -$Result= DB_query($sql); - -while ($myrow = DB_fetch_array($Result,$db)){ - echo '<tr> - <td>' . $myrow['tokenid'] . '</td> - <td>' . htmlspecialchars($myrow['tokenname'],ENT_QUOTES,'UTF-8') . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?SelectedToken=' . $myrow['tokenid'] . '&Action=edit">' . _('Edit') . '</a></td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?SelectedToken=' . $myrow['tokenid'] . '&Action=delete" onclick="return confirm(\'' . _('Are you sure you wish to delete this security token?') . '\');">' . _('Delete') . '</a></td> - </tr>'; +if(isset($_GET['Action']) and $_GET['Action']=='edit') { + echo ('Edit'), '</th>', + '</tr> + </thead><tfoot>', + '<tr> + <td colspan="2" class="centre">', + '<button name="Update" type="submit" value="', _('Update'), '"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/tick.svg" /> ', _('Update'), '</button>', // "Update" button. + '</td>', + '</tr> + </tfoot><tbody>', + '<tr> + <td>', _('Token ID'), '</td> + <td>', $_GET['SelectedToken'], '<input name="TokenID" type="hidden" value="', $_GET['SelectedToken'], '" />'; +} else { + echo ('Insert'), '</th>', + '</tr> + </thead><tfoot>', + '<tr> + <td colspan="2" class="centre">', + '<button name="Submit" type="submit" value="', _('Insert'), '"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/tick.svg" /> ', _('Insert'), '</button>', // "Insert" button. + '</td>', + '</tr> + </tfoot><tbody>', + '<tr> + <td><label for="TokenID">', _('Token ID'), '</label></td> + <td><input autofocus="autofocus" class="number" id="TokenID" maxlength="4" name="TokenID" required="required" size="6" type="text" value="', $_POST['TokenID'], '" />'; } +echo '</td> + </tr> + <tr> + <td><label for="TokenDescription">', _('Description'), '</label></td> + <td><input id="TokenDescription" maxlength="50" name="TokenDescription" required="required" size="50" title="', _('The security token description should describe which functions this token allows a user/role to access'), '" type="text" value="', $_POST['TokenDescription'], '" /></td> + </tr> + </table> + </form>'; -echo '</table>'; - include('includes/footer.inc'); ?> Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2016-10-23 19:27:31 UTC (rev 7652) +++ trunk/includes/ConnectDB_mysql.inc 2016-10-24 01:18:52 UTC (rev 7653) @@ -1,6 +1,6 @@ <?php - /* $Id$ */ +/* Database abstraction for mysql */ define ('LIKE','LIKE'); @@ -122,9 +122,8 @@ Return $RowPointer; } -function DB_fetch_array (&$ResultIndex) { - - $RowPointer=mysql_fetch_array($ResultIndex); +function DB_fetch_array(&$ResultIndex) { + $RowPointer = mysql_fetch_array($ResultIndex); Return $RowPointer; } Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2016-10-23 19:27:31 UTC (rev 7652) +++ trunk/includes/ConnectDB_mysqli.inc 2016-10-24 01:18:52 UTC (rev 7653) @@ -1,6 +1,6 @@ <?php - /* $Id$ */ +/* Database abstraction for mysqli */ /* PeterMoulding.com 20071102 Change from mysql to mysqli; @@ -129,8 +129,8 @@ Return $RowPointer; } -function DB_fetch_array (&$ResultIndex) { - $RowPointer=mysqli_fetch_array($ResultIndex); +function DB_fetch_array(&$ResultIndex) { + $RowPointer = mysqli_fetch_array($ResultIndex); Return $RowPointer; } Modified: trunk/includes/ConnectDB_postgres.inc =================================================================== --- trunk/includes/ConnectDB_postgres.inc 2016-10-23 19:27:31 UTC (rev 7652) +++ trunk/includes/ConnectDB_postgres.inc 2016-10-24 01:18:52 UTC (rev 7653) @@ -1,6 +1,6 @@ <?php - /* $Id$ */ +/* Database abstraction for postgres */ define ('LIKE','ILIKE'); /* $PgConnStr = $PgConnStr = "host=".$host." dbname=".$_SESSION['DatabaseName']; */ @@ -84,8 +84,8 @@ Return $RowPointer; } -function DB_fetch_array (&$ResultIndex) { - $RowPointer=pg_fetch_array($ResultIndex); +function DB_fetch_array(&$ResultIndex) { + $RowPointer = pg_fetch_array($ResultIndex); Return $RowPointer; } Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2016-10-23 19:27:31 UTC (rev 7652) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2016-10-24 01:18:52 UTC (rev 7653) @@ -8,7 +8,7 @@ "Project-Id-Version: webERP 4.12.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-16 21:31+1200\n" -"PO-Revision-Date: 2016-10-23 13:23-0600\n" +"PO-Revision-Date: 2016-10-23 13:47-0600\n" "Last-Translator: Rafael E. Chacón <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -36535,7 +36535,7 @@ #: SystemParameters.php:500 msgid "Sales Order Allows Same Item Multiple Times" -msgstr "La Orden de Venta permite el mismo Artículo muchas veces" +msgstr "La orden de venta permite el mismo artículo varias veces" #: SystemParameters.php:508 msgid "Order Entry allows Line Item Narrative" @@ -36843,6 +36843,8 @@ "Set to Automatic - Supplier codes are automatically created - as a " "sequential number" msgstr "" +"Establecida en automático - los códigos de proveedores se crean " +"automáticamente - como un número secuencial" #: SystemParameters.php:714 msgid "Could not load tax categories table" @@ -36942,7 +36944,7 @@ #: SystemParameters.php:787 SystemParameters.php:792 msgid "The input must between 0 and 100" -msgstr "" +msgstr "La entrada debe ser entre 0 y 100" #: SystemParameters.php:787 msgid "integer between 0 and 100" @@ -37125,7 +37127,7 @@ #: SystemParameters.php:872 msgid "Number Of Month Must Be Shown" -msgstr "El número de mes se debe demostrar" +msgstr "Cantidad de meses a mostrar" #: SystemParameters.php:873 msgid "input must be positive integer" @@ -37136,8 +37138,8 @@ "Number of month must be shown on report can be changed with this parameters " "ex: in CustomerInquiry.php " msgstr "" -"La cantidad de meses a mostrar por omisión en el informe se puede cambiar " -"con este parámetro. E.g. en CustomerInquiry.php" +"La cantidad de meses a mostrar en un informe se puede cambiar con este " +"parámetro. E.g. en CustomerInquiry.php" #: SystemParameters.php:878 msgid "The directory where images are stored" |