Skip to content

Commit

Permalink
Clean Take pos module
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 28, 2018
1 parent a4ec613 commit aaa5efc
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 97 deletions.
20 changes: 5 additions & 15 deletions htdocs/core/modules/modTakePos.class.php
Expand Up @@ -101,7 +101,7 @@ public function __construct($db)
$this->depends = array('always'=>"modBanque", 'always'=>"modFacture", 'always'=>"modProduct", 'always'=>'modCategorie', 'FR'=>'modBlockedLog'); // List of module class names as string that must be enabled if this module is enabled
$this->requiredby = array(); // List of module ids to disable if this one is disabled
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
$this->langfiles = array("takepos@takepos");
$this->langfiles = array("cashdesk");
$this->phpmin = array(5,43); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(4,0); // Minimum version of Dolibarr required by module
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
Expand Down Expand Up @@ -230,7 +230,7 @@ public function __construct($db)
'mainmenu'=>'takepos',
'leftmenu'=>'',
'url'=>'/takepos/takepos.php',
'langs'=>'takepos@takepos', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->takepos->enabled', // Define condition to show or hide menu entry. Use '$conf->takepos->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->takepos->level1->level2' if you want your menu with a permission rules
Expand All @@ -246,7 +246,7 @@ public function __construct($db)
'mainmenu'=>'takepos',
'leftmenu'=>'takepos_myobject_list',
'url'=>'/takepos/myobject_list.php',
'langs'=>'takepos@takepos', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->takepos->enabled', // Define condition to show or hide menu entry. Use '$conf->takepos->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'$user->rights->takepos->level1->level2' if you want your menu with a permission rules
Expand All @@ -258,7 +258,7 @@ public function __construct($db)
'mainmenu'=>'takepos',
'leftmenu'=>'takepos_myobject_new',
'url'=>'/takepos/myobject_page.php?action=create',
'langs'=>'takepos@takepos', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->takepos->enabled', // Define condition to show or hide menu entry. Use '$conf->takepos->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'$user->rights->takepos->level1->level2' if you want your menu with a permission rules
Expand All @@ -272,7 +272,7 @@ public function __construct($db)

/* BEGIN MODULEBUILDER EXPORT MYOBJECT */
/*
$langs->load("takepos@takepos");
$langs->load("cashdesk");
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='MyObjectLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='myobject@takepos';
Expand Down Expand Up @@ -301,16 +301,6 @@ public function init($options='')
{
$this->_load_tables('/takepos/sql/');

// Create extrafields
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);

//$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'takepos@takepos', '$conf->takepos->enabled');
//$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'takepos@takepos', '$conf->takepos->enabled');
//$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'takepos@takepos', '$conf->takepos->enabled');
//$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1 '', 0, 0, '', '', 'takepos@takepos', '$conf->takepos->enabled');
//$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'takepos@takepos', '$conf->takepos->enabled');

$sql = array();

// Remove permissions and default values
Expand Down
6 changes: 3 additions & 3 deletions htdocs/langs/en_US/admin.lang
Expand Up @@ -620,7 +620,7 @@ Module50000Name=PayBox
Module50000Desc=Offer customers a PayBox online payment page (credit/debit cards). This can be used to allow your customers to make free payments or for a payment on a particular Dolibarr object (invoice, order, ...)
Module50100Name=Point of sales
Module50100Desc=Point of sales module (POS).
Module50150Name=Point of sales
Module50150Name=Point of salesaa
Module50150Desc=Point of sales module (Touch screen POS).
Module50200Name=Paypal
Module50200Desc=Offer customers a PayPal online payment page (PayPal account or credit/debit cards). This can be used to allow your customers to make free payments or for a payment on a particular Dolibarr object (invoice, order, ...)
Expand Down Expand Up @@ -1611,9 +1611,9 @@ CashDeskBankAccountForCheque= Default account to use to receive payments by cheq
CashDeskBankAccountForCB= Default account to use to receive payments by credit cards
CashDeskDoNotDecreaseStock=Disable stock decrease when a sell is done from Point of Sale (if "no", stock decrease is done for each sell done from POS, whatever is option set into module Stock).
CashDeskIdWareHouse=Force and restrict warehouse to use for stock decrease
StockDecreaseForPointOfSaleDisabled=Stock decrease from Point Of Sale disabled
StockDecreaseForPointOfSaleDisabled=Stock decrease from Point of Sale disabled
StockDecreaseForPointOfSaleDisabledbyBatch=Stock decrease in POS is not compatible with lot management
CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when making a sale from Point Of Sale. Hence a warehouse is required.
CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when making a sale from Point of Sale. Hence a warehouse is required.
##### Bookmark #####
BookmarkSetup=Bookmark module setup
BookmarkDesc=This module allows you to manage bookmarks. You can also add shortcuts to any Dolibarr pages or external web sites on your left menu.
Expand Down
9 changes: 9 additions & 0 deletions htdocs/langs/en_US/cashdesk.lang
Expand Up @@ -32,3 +32,12 @@ DeleteArticle=Click to remove this article
FilterRefOrLabelOrBC=Search (Ref/Label)
UserNeedPermissionToEditStockToUsePos=You ask to decrease stock on invoice creation, so user that uses POS needs to have permission to edit stock.
DolibarrReceiptPrinter=Dolibarr Receipt Printer
PointOfSale=Point of sales
CloseBill=Close Bill
Floors=Floors
Floor=Floor
AddTable=Add table
Place=Place
TakeboxNecesary='TakeBOX' application required
OrderPrinters=Order printers
SearchProduct=Search product
7 changes: 7 additions & 0 deletions htdocs/langs/es_ES/cashdesk.lang
Expand Up @@ -32,3 +32,10 @@ DeleteArticle=Haga clic para quitar este artículo
FilterRefOrLabelOrBC=Búsqueda (Ref/Etiq.)
UserNeedPermissionToEditStockToUsePos=Ha configurado el decremento de stock en la creación de facturas, por lo que el usuario que utilice el TPV deberá tener permiso para editar stock.
DolibarrReceiptPrinter=Impresora de tickets Dolibarr
CloseBill=Cerrar venta
Floors=Salones
Floor=Salón
AddTable=Añadir mesa
Place=Puesto
TakeboxNecesary=Aplicación 'TakeBOX' requerida
OrderPrinters=Impresoras de pedido
9 changes: 9 additions & 0 deletions htdocs/langs/fr_FR/cashdesk.lang
Expand Up @@ -32,3 +32,12 @@ DeleteArticle=Cliquez pour enlever cet article
FilterRefOrLabelOrBC=Recherche (Ref/Lib.)
UserNeedPermissionToEditStockToUsePos=Vous avez demandé de réduire le stock sur création de facture, aussi l'utilisateur qui utilise le Point De Vente doit avoir la permission d'éditer le stock.
DolibarrReceiptPrinter=Imprimante reçu
PointOfSale=Point de Vente
CloseBill=Fermer Bill
Floors=Étages
Floor=Étage
AddTable=Ajouter une table
Place=Endroit
TakeboxNecesary='TakeBOX' Application requise
OrderPrinters=Commande imprimantes
SearchProduct=Recherche produit
4 changes: 1 addition & 3 deletions htdocs/takepos/admin/about.php
Expand Up @@ -28,9 +28,7 @@
require_once '../lib/takepos.lib.php';

// Translations
$langs->load("errors");
$langs->load("admin");
$langs->load("takepos@takepos");
$langs->loadLangs(array("errors","admin","cashdesk"));

// Access control
if (! $user->admin) {
Expand Down
24 changes: 0 additions & 24 deletions htdocs/takepos/langs/en_US/takepos.lang

This file was deleted.

22 changes: 0 additions & 22 deletions htdocs/takepos/langs/es_ES/takepos.lang

This file was deleted.

24 changes: 0 additions & 24 deletions htdocs/takepos/langs/fr_FR/takepos.lang

This file was deleted.

2 changes: 1 addition & 1 deletion htdocs/takepos/lib/takepos.lib.php
Expand Up @@ -30,7 +30,7 @@ function takeposAdminPrepareHead()
{
global $langs, $conf;

$langs->load("takepos@takepos");
$langs->load("cashdesk");

$h = 0;
$head = array();
Expand Down
10 changes: 5 additions & 5 deletions htdocs/theme/eldy/style.css.php
Expand Up @@ -553,7 +553,7 @@
margin:0px;
}
form#addproduct {
padding-top: 6px;
padding-top: 10px;
}
div.float
{
Expand Down Expand Up @@ -1169,8 +1169,8 @@
table-layout: fixed;
}
#id-right, #id-left {
padding-top: 16px;
padding-bottom: 16px;
padding-top: 20px;
padding-bottom: 20px;

display: table-cell; /* DOL_XXX Empeche fonctionnement correct du scroll horizontal sur tableau, avec datatable ou CSS */
float: none;
Expand Down Expand Up @@ -1275,8 +1275,8 @@


div.fiche {
margin-<?php print $left; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'25':'6')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'24':'6')); ?>px;
margin-<?php print $left; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'30':'6')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'29':'6')); ?>px;
<?php if (! empty($dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
<?php if (! empty($dol_hide_leftmenu)) print 'margin-top: 12px;'."\n"; ?>
}
Expand Down

0 comments on commit aaa5efc

Please sign in to comment.