Merge branch 'develop' into nospaceaftercomma

This commit is contained in:
Laurent Destailleur 2019-02-03 19:27:16 +01:00 committed by GitHub
commit a6dde3d6bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
87 changed files with 302 additions and 297 deletions

View File

@ -187,6 +187,9 @@
</rule> </rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" /> <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" /> <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties> <properties>
@ -429,5 +432,5 @@
<rule ref="PSR2.Classes.ClassDeclaration" /> <rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" /> <rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.Files.EndFileNewline.TooMany" /> <rule ref="PSR2.Files.EndFileNewline.TooMany" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
</ruleset> </ruleset>

View File

@ -94,7 +94,7 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
$idpays = $mysoc->country_id; $idpays = $mysoc->country_id;
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; $sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,";
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,"; $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
$sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; $sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";

View File

@ -319,6 +319,7 @@ class Mailing extends CommonObject
if ($result < 0) if ($result < 0)
{ {
$this->error=$object->error; $this->error=$object->error;
$this->errors=array_merge($this->errors, $object->errors);
$error++; $error++;
} }

View File

@ -1285,7 +1285,12 @@ class Propal extends CommonObject
// Create clone // Create clone
$object->context['createfromclone']='createfromclone'; $object->context['createfromclone']='createfromclone';
$result=$object->create($user); $result=$object->create($user);
if ($result < 0) $error++; if ($result < 0)
{
$this->error = $object->error;
$this->errors = array_merge($this->errors, $object->errors);
$error++;
}
if (! $error) if (! $error)
{ {

View File

@ -5015,7 +5015,7 @@ abstract class CommonObject
if ($this->array_options[$key] === '') $mandatorypb=true; if ($this->array_options[$key] === '') $mandatorypb=true;
if ($mandatorypb) if ($mandatorypb)
{ {
dol_syslog($this->error); dol_syslog("Mandatory extra field ".$key." is empty");
$this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel);
return -1; return -1;
} }

View File

@ -4,6 +4,7 @@
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -2654,10 +2655,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file; if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file;
} }
// Wrapping pour les mouvements stocks // Wrapping for stock movements
elseif ($modulepart == 'movement' || $modulepart == 'mouvement') elseif ($modulepart == 'movement' || $modulepart == 'mouvement')
{ {
if (empty($entity) || (empty($conf->stock->multidir_output[$entity]) )) return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); if (empty($entity) || empty($conf->stock->multidir_output[$entity])) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file))
{ {
$accessallowed=1; $accessallowed=1;

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr /* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -28,6 +29,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php'; require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("admin","cron","bills","members")); $langs->loadLangs(array("admin","cron","bills","members"));

View File

@ -54,3 +54,4 @@ Paymentnumpad=Payment Num Pad
Numberspad=Numbers Pad Numberspad=Numbers Pad
BillsCoinsPad=Bills and Coins Pad BillsCoinsPad=Bills and Coins Pad
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
TakeposNeedsCategories=TakePOS needs product categories to work

View File

@ -356,6 +356,7 @@ class Productbatch extends CommonObject
if ($result < 0) if ($result < 0)
{ {
$this->error=$object->error; $this->error=$object->error;
$this->errors=array_merge($this->errors, $object->errors);
$error++; $error++;
} }

View File

@ -924,6 +924,7 @@ class Productcustomerprice extends CommonObject
// Other options // Other options
if ($result < 0) { if ($result < 0) {
$this->error = $object->error; $this->error = $object->error;
$this->errors=array_merge($this->errors, $object->errors);
$error++; $error++;
} }

View File

@ -589,6 +589,7 @@ class Propalmergepdfproduct extends CommonObject
if ($result < 0) if ($result < 0)
{ {
$this->error=$object->error; $this->error=$object->error;
$this->errors=array_merge($this->errors, $object->errors);
$error++; $error++;
} }

View File

@ -722,18 +722,14 @@ class Project extends CommonObject
} }
} }
if (empty($error)) if (empty($error)) {
{
// We remove directory // We remove directory
$projectref = dol_sanitizeFileName($this->ref); $projectref = dol_sanitizeFileName($this->ref);
if ($conf->projet->dir_output) if ($conf->projet->dir_output) {
{
$dir = $conf->projet->dir_output . "/" . $projectref; $dir = $conf->projet->dir_output . "/" . $projectref;
if (file_exists($dir)) if (file_exists($dir)) {
{
$res = @dol_delete_dir_recursive($dir); $res = @dol_delete_dir_recursive($dir);
if (!$res) if (!$res) {
{
$this->errors[] = 'ErrorFailToDeleteDir'; $this->errors[] = 'ErrorFailToDeleteDir';
$error++; $error++;
} }
@ -955,48 +951,37 @@ class Project extends CommonObject
// phpcs:enable // phpcs:enable
global $langs; global $langs;
if ($mode == 0) if ($mode == 0) {
{
return $langs->trans($this->statuts_long[$statut]); return $langs->trans($this->statuts_long[$statut]);
} } elseif ($mode == 1) {
if ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]); return $langs->trans($this->statuts_short[$statut]);
} } elseif ($mode == 2) {
if ($mode == 2)
{
if ($statut == 0) if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_short[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($statut == 1) elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_short[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($statut == 2) elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_short[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_short[$statut]);
} } elseif ($mode == 3) {
if ($mode == 3)
{
if ($statut == 0) if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0'); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
if ($statut == 1) elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4'); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
if ($statut == 2) elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6'); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');
} } elseif ($mode == 4) {
if ($mode == 4)
{
if ($statut == 0) if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_long[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_long[$statut]);
if ($statut == 1) elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_long[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_long[$statut]);
if ($statut == 2) if ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_long[$statut]); return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_long[$statut]);
} } elseif ($mode == 5) {
if ($mode == 5)
{
if ($statut == 0) if ($statut == 0)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut0'); return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
if ($statut == 1) elseif ($statut == 1)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut4'); return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
if ($statut == 2) elseif ($statut == 2)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut6'); return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');
} }
} }

View File

@ -1,21 +1,11 @@
html,body { html,body {
padding:0; box-sizing: border-box;
padding:3px;
margin:0; margin:0;
height:100%; height:100%;
width:100%; width:100%;
} }
.row {
width:100%;
height:50%;
}
.row div {
width:33%;
height:100%;
float:left;
}
button.calcbutton { button.calcbutton {
display: inline-block; display: inline-block;
position: relative; position: relative;
@ -69,33 +59,36 @@ button.actionbutton {
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
overflow: visible; /* removes extra width in IE */ overflow: visible; /* removes extra width in IE */
width:32%; width:33%;
height:32%; height:33%;
} }
div.wrapper{ div.wrapper{
float:left; /* important */ float:left; /* important */
position:relative; /* important(so we can absolutely position the description div */ position:relative; /* important(so we can absolutely position the description div */
width:21.5%; width:25%;
height:23%; height:25%;
margin:1%; margin:0;
padding:1px;
border: 0.1em solid; border: 0.1em solid;
box-shadow: 3px 3px 2px #888; box-shadow: 3px 3px 2px #888;
text-align: center; text-align: center;
box-sizing: border-box;
background-color:#f0eeee;
} }
div.wrapper2{ div.wrapper2{
float:left; /* important */ float:left; /* important */
position:relative; /* important(so we can absolutely position the description div */ position:relative; /* important(so we can absolutely position the description div */
width:10.9%; width:12.5%;
height:23%; height:25%;
margin-top:0.5%; margin:0;
margin-bottom:0.5%; padding:1px;
margin-left:0.5%;
margin-right:0.5%;
border: 0.1em solid; border: 0.1em solid;
box-shadow: 3px 3px 2px #888; box-shadow: 2px 2px 1px #888;
text-align: center; text-align: center;
box-sizing: border-box;
background-color:#f0eeee;
} }
button:active{ button:active{
@ -124,8 +117,8 @@ div.description{
} }
.container{ .container{
width: 98%; width: 100%;
height: 98%; height: 100%;
margin: 0 auto; margin: 0 auto;
overflow: visible; overflow: visible;
box-sizing: border-box; box-sizing: border-box;
@ -145,10 +138,12 @@ div.description{
.div1{ .div1{
height:100%; height:100%;
width: 33%; width: 34%;
float: left; float: left;
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
overflow: auto;
background-color:white;
} }
.div2{ .div2{
@ -156,7 +151,6 @@ div.description{
width: 33%; width: 33%;
font-size: 0; font-size: 0;
float: left; float: left;
text-align: center;
padding-left: 10px; padding-left: 10px;
box-sizing: border-box; box-sizing: border-box;
} }
@ -165,7 +159,6 @@ div.description{
height: 100%; height: 100%;
width: 33%; width: 33%;
float: left; float: left;
text-align: center;
box-sizing: border-box; box-sizing: border-box;
} }
@ -175,6 +168,7 @@ div.description{
float: left; float: left;
box-sizing: border-box; box-sizing: border-box;
font-size: 6px; font-size: 6px;
padding:3px;
} }
.div5{ .div5{
@ -183,6 +177,7 @@ div.description{
float: left; float: left;
box-sizing: border-box; box-sizing: border-box;
font-size: 6px; font-size: 6px;
padding:10px;
} }
p.description_content{ p.description_content{

View File

@ -387,12 +387,12 @@ $( document ).ready(function() {
}); });
</script> </script>
<body style="overflow: hidden; background-color:#E8E8E8;"> <body style="overflow: hidden; background-color:#D1D1D1;">
<div class="container"> <div class="container">
<div class="row1"> <div class="row1">
<div id="poslines" class="div1" style="overflow: auto;"> <div id="poslines" class="div1">
</div> </div>
<div class="div2"> <div class="div2">
@ -415,6 +415,13 @@ $( document ).ready(function() {
</div> </div>
<?php <?php
// TakePOS setup check
if (empty($conf->global->CASHDESK_ID_THIRDPARTY) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB)) {
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
}
if (count($maincategories)==0) {
setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors');
}
// User menu and external TakePOS modules // User menu and external TakePOS modules
$menus = array(); $menus = array();
$r=0; $r=0;

View File

@ -197,7 +197,9 @@ class Users extends DolibarrApi
* *
* @param int $id Id of account to update * @param int $id Id of account to update
* @param array $request_data Datas * @param array $request_data Datas
* @return int * @return array
*
* @throws RestException
*/ */
function put($id, $request_data = null) function put($id, $request_data = null)
{ {