Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2018-08-28 02:36:15 +02:00
commit 9c6ce4b29d
124 changed files with 979 additions and 1021 deletions

View File

@ -158,6 +158,22 @@
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" /> <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<!-- Rules from PEAR Standard --> <!-- Rules from PEAR Standard -->

View File

@ -436,14 +436,14 @@ if ($mode == 'template' && $user->admin)
} }
// to remove after test // to remove after test
$object=new stdClass(); // $object=new stdClass();
$object->date_time = '2015-11-02 22:30:25'; // $object->date_time = '2015-11-02 22:30:25';
$object->id = 1234; // $object->id = 1234;
$object->customer_firstname = 'John'; // $object->customer_firstname = 'John';
$object->customer_lastname = 'Deuf'; // $object->customer_lastname = 'Deuf';
$object->vendor_firstname = 'Jim'; // $object->vendor_firstname = 'Jim';
$object->vendor_lastname = 'Big'; // $object->vendor_lastname = 'Big';
$object->barcode = '3700123862396'; // $object->barcode = '3700123862396';
//$printer->sendToPrinter($object, 1, 16); //$printer->sendToPrinter($object, 1, 16);
//setEventMessages($printer->error, $printer->errors, 'errors'); //setEventMessages($printer->error, $printer->errors, 'errors');

View File

@ -1692,4 +1692,3 @@ class ActionComm extends CommonObject
} }
} }

View File

@ -326,8 +326,6 @@ if ($object->fetch($id) >= 0)
} }
// Si le module mailing est qualifie // Si le module mailing est qualifie
if ($qualified)
{
if ($allowaddtarget) if ($allowaddtarget)
{ {
print '<form class="oddeven tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">'; print '<form class="oddeven tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';

View File

@ -16,9 +16,9 @@
*/ */
/** /**
* \file comm/mailing/class/html.formadvtragetemaling.class.php * \file comm/mailing/class/html.formadvtargetemailing.class.php
* \ingroup mailing * \ingroup mailing
* \brief Fichier de la classe des fonctions predefinie de composants html advtargetemaling * \brief Fichier de la classe des fonctions predefinies de composant html advtargetemailing
*/ */
/** /**

View File

@ -94,4 +94,3 @@ abstract class CommonObjectLine extends CommonObject
// For the moment we use the extends on CommonObject until PHP min is 5.4 so use Traits. // For the moment we use the extends on CommonObject until PHP min is 5.4 so use Traits.
} }

View File

@ -146,4 +146,3 @@ class FormPropal
print '</select>'; print '</select>';
} }
} }

View File

@ -281,5 +281,3 @@ function updateTotal(days,mode)
jQuery('.totalDay'+days).text(total); jQuery('.totalDay'+days).text(total);
} }
} }

View File

@ -191,5 +191,3 @@ function invoice_rec_prepare_head($object)
return $head; return $head;
} }

View File

@ -343,5 +343,3 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
return $error ? -1 : 1; return $error ? -1 : 1;
} }

View File

@ -520,4 +520,3 @@ function quotedPrintDecode($str)
$out = quoted_printable_decode($out); // Available with PHP 4+ $out = quoted_printable_decode($out); // Available with PHP 4+
return trim($out); return trim($out);
} }

View File

@ -173,4 +173,3 @@ class modPhpbarcode extends ModeleBarCode
} }
} }

View File

@ -215,4 +215,3 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
return -1; return -1;
} }
} }

View File

@ -721,4 +721,3 @@ class pdf_strato extends ModelePDFContract
} }
} }

View File

@ -1100,4 +1100,3 @@ class pdf_rouget extends ModelePdfExpedition
} }
} }

View File

@ -919,4 +919,3 @@ class pdf_standard extends ModeleExpenseReport
} }
} }

View File

@ -1843,4 +1843,3 @@ class pdf_crabe extends ModelePDFFactures
} }
} }

View File

@ -732,4 +732,3 @@ class pdf_soleil extends ModelePDFFicheinter
} }
} }

View File

@ -771,5 +771,3 @@ function cleansep($value)
{ {
return str_replace(array(',',';'),'/',$value); return str_replace(array(',',';'),'/',$value);
}; };

View File

@ -953,4 +953,3 @@ class pdf_typhon extends ModelePDFDeliveryOrder
} }
} }

View File

@ -148,4 +148,3 @@ class mailing_example extends MailingTargets
} }
} }

View File

@ -225,4 +225,3 @@ class mailing_pomme extends MailingTargets
} }
} }

View File

@ -1691,4 +1691,3 @@ class pdf_azur extends ModelePDFPropales
return ($tab_hl*7); return ($tab_hl*7);
} }
} }

View File

@ -1147,4 +1147,3 @@ class pdf_standard extends ModelePDFStock
} }
} }

View File

@ -1249,4 +1249,3 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
} }
} }

View File

@ -814,4 +814,3 @@ class pdf_standard extends ModelePDFSuppliersPayments
} }
} }

View File

@ -1496,4 +1496,3 @@ class pdf_aurore extends ModelePDFSupplierProposal
} }
} }

View File

@ -155,12 +155,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
if ($mailfile->error) if ($mailfile->error) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
} }
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {

View File

@ -148,7 +148,6 @@ if ($resql)
{ {
if (! $conf->use_javascript_ajax) if (! $conf->use_javascript_ajax)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>'; print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>';
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';

View File

@ -350,9 +350,7 @@ if (empty($reshook))
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
$idprod = $res->fk_product_child; $idprod = $res->fk_product_child;
} } else {
else
{
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++; $error ++;
} }

View File

@ -1160,9 +1160,7 @@ if (empty($reshook))
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
$idprod = $res->fk_product_child; $idprod = $res->fk_product_child;
} } else {
else
{
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++; $error ++;
} }

View File

@ -819,7 +819,6 @@ if ($resql)
if ($num > 0) if ($num > 0)
{ {
$i=0; $i=0;
$totalarray=array(); $totalarray=array();
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {

View File

@ -146,6 +146,7 @@ if ($year)
print '<td align="right">'.$langs->trans("Size").'</td>'; print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="right">'.$langs->trans("Date").'</td>'; print '<td align="right">'.$langs->trans("Date").'</td>';
print '</tr>'; print '</tr>';
if (is_resource($handle)) if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)

View File

@ -423,10 +423,11 @@ class MultiCurrency extends CommonObject
} }
/** /**
* Try get label of code in llx_currency then add rate * Try get label of code in llx_currency then add rate.
* *
* @param string $code currency code * @param string $code currency code
* @param double $rate new rate * @param double $rate new rate
*
* @return int -1 if KO, 1 if OK, 2 if label found and OK * @return int -1 if KO, 1 if OK, 2 if label found and OK
*/ */
function addRateFromDolibarr($code, $rate) function addRateFromDolibarr($code, $rate)
@ -594,7 +595,6 @@ class MultiCurrency extends CommonObject
return false; return false;
} }
/** /**
* With free account we can't set source then recalcul all rates to force another source * With free account we can't set source then recalcul all rates to force another source
* *

View File

@ -48,4 +48,3 @@
break; break;
} }

View File

@ -464,9 +464,7 @@ if (empty($reshook))
$sql .= " WHERE rowid = " . $rowid; $sql .= " WHERE rowid = " . $rowid;
$result = $db->query($sql); $result = $db->query($sql);
} } else {
else
{
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
} }
} }
@ -479,9 +477,7 @@ if (empty($reshook))
$sql .= " WHERE fk_product_price = " . $priceid; $sql .= " WHERE fk_product_price = " . $priceid;
$result = $db->query($sql); $result = $db->query($sql);
} } else {
else
{
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
} }
} }

View File

@ -583,4 +583,3 @@ class Productlot extends CommonObject
} }
} }

View File

@ -1176,4 +1176,3 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0)
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -1694,4 +1694,3 @@ htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix,$object);
llxFooter('', 'public'); llxFooter('', 'public');
$db->close(); $db->close();

View File

@ -349,4 +349,3 @@ elseif ($event->type == 'customer.deleted') {
$db->query($sql); $db->query($sql);
$db->commit(); $db->commit();
} }

View File

@ -226,12 +226,9 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
if ($mailfile->error || $mailfile->errors) if ($mailfile->error || $mailfile->errors) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
} }
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
@ -290,12 +287,9 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
if ($mailfile->error || $mailfile->errors) if ($mailfile->error || $mailfile->errors) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
} }
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
@ -316,9 +310,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
} }
} } else {
else
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }

View File

@ -121,8 +121,7 @@ if ($action == "view_ticketlist") {
} }
} }
if ($error || $errors) if ($error || $errors) {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }

View File

@ -112,8 +112,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
} }
} }
if ($error || $errors) if ($error || $errors) {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }

View File

@ -1619,12 +1619,9 @@ class Ticket extends CommonObject
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0);
if ($mailfile->error || $mailfile->errors) if ($mailfile->error || $mailfile->errors) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
if ($result > 0) { if ($result > 0) {
$nb_sent++; $nb_sent++;

View File

@ -376,5 +376,6 @@ if (! empty($id) || ! empty($ref)) {
// End of page // End of page
llxFooter(); llxFooter();
$db->close();
} }
$db->close();