Clean code

This commit is contained in:
Laurent Destailleur 2018-10-01 00:44:07 +02:00
parent 5f897eb7ee
commit fc4103b469
9 changed files with 33 additions and 27 deletions

View File

@ -42,9 +42,9 @@ if (! $user->rights->categorie->lire) accessforbidden();
$id=GETPOST('id','int');
$type=(GETPOST('type','aZ09') ? GETPOST('type','aZ09') : Categorie::TYPE_PRODUCT);
$catname=GETPOST('catname','alpha');
$action=GETPOST('action');
$printer1=GETPOST('printer1');
$printer2=GETPOST('printer2');
$action=GETPOST('action','alpha');
$printer1=GETPOST('printer1','alpha');
$printer2=GETPOST('printer2','alpha');
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility

View File

@ -35,8 +35,7 @@ if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id']))
}
// Security check
if (!$user->admin)
accessforbidden();
if (!$user->admin) accessforbidden();
$langs->load("admin");
$langs->load("cashdesk");

View File

@ -33,9 +33,9 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
require '../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$category = GETPOST('category');
$action = GETPOST('action');
$term = GETPOST('term');
$category = GETPOST('category','alpha');
$action = GETPOST('action','alpha');
$term = GETPOST('term','alpha');
/*

View File

@ -37,17 +37,23 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
$langs->loadLangs(array("companies", "commercial", "customers", "suppliers", "bills", "compta", "categories"));
$langs->loadLangs(array("companies", "commercial", "customers", "suppliers", "bills", "compta", "categories", "cashdesk"));
$action=GETPOST('action','alpha');
$massaction=GETPOST('massaction','alpha');
$show_files=GETPOST('show_files','int');
$confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
$idcustomer = GETPOST('idcustomer');
$place = GETPOST('place');
$idcustomer = GETPOST('idcustomer','int');
$place = GETPOST('place','int');
$_GET['optioncss'] = 'print';
/*
* Actions
*/
if ($action=="change") {
$sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where facnumber='(PROV-POS-".$place.")'";
$resql = $db->query($sql);

View File

@ -29,15 +29,15 @@ $_GET['theme']="md"; // Force theme. MD theme provides better look and feel to T
require '../main.inc.php'; // Load $user and permissions
$floor=GETPOST('floor');
$floor=GETPOST('floor','alpha');
if ($floor=="") $floor=1;
$id = GETPOST('id');
$action = GETPOST('action');
$left = GETPOST('left');
$top = GETPOST('top');
$place = GETPOST('place');
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$left = GETPOST('left','alpha');
$top = GETPOST('top','alpha');
$place = GETPOST('place','int');
$newname = GETPOST('newname');
$mode = GETPOST('mode');
$mode = GETPOST('mode','alpha');
if ($action=="getTables"){
$sql="SELECT * from ".MAIN_DB_PREFIX."takepos_floor_tables where floor=".$floor;

View File

@ -29,7 +29,8 @@ require '../main.inc.php'; // Load $user and permissions
$langs->load("bills");
$langs->load("cashdesk");
$place = GETPOST('place');
$place = GETPOST('place','int');
/*

View File

@ -32,13 +32,13 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
$langs->load("bills");
$langs->load("cashdesk");
$id = GETPOST('id');
$action = GETPOST('action');
$idproduct = GETPOST('idproduct');
$place = GETPOST('place');
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$idproduct = GETPOST('idproduct','int');
$place = GETPOST('place','int');
$number = GETPOST('number');
$idline = GETPOST('idline');
$desc = GETPOST('desc');
$desc = GETPOST('desc','alpha');
$pay = GETPOST('pay');
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where facnumber='(PROV-POS-".$place.")'";

View File

@ -30,7 +30,7 @@ $_GET['theme']="md"; // Force theme. MD theme provides better look and feel to T
require '../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
$place = GETPOST('place');
$place = GETPOST('place','int');
/*

View File

@ -32,9 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
$place = GETPOST('place');
$place = GETPOST('place','int');
if ($place=="") $place="0";
$action = GETPOST('action');
$action = GETPOST('action','alpha');
$langs->loadLangs(array("bills","orders","commercial","cashdesk"));