*
* 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
@@ -139,10 +140,10 @@ class box_graph_product_distribution extends ModeleBoxes
if (! empty($conf->facture->enabled) && ! empty($user->rights->facture->lire))
{
-
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showinvoicenb)
{
+ $langs->load("bills");
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
$showpointvalue = 1; $nocolor = 0;
@@ -202,6 +203,7 @@ class box_graph_product_distribution extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showpropalnb)
{
+ $langs->load("propal");
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php';
$showpointvalue = 1; $nocolor = 0;
@@ -258,11 +260,10 @@ class box_graph_product_distribution extends ModeleBoxes
if (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire))
{
- $langs->load("orders");
-
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showordernb)
{
+ $langs->load("orders");
include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
$showpointvalue = 1; $nocolor = 0;
diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php
index c19235c2fb2..f28b0ec2c99 100644
--- a/htdocs/core/boxes/box_graph_propales_permonth.php
+++ b/htdocs/core/boxes/box_graph_propales_permonth.php
@@ -259,7 +259,6 @@ class box_graph_propales_permonth extends ModeleBoxes
'maxlength'=>500,
'text' => $mesg);
}
-
}
else {
$this->info_box_contents[0][0] = array(
diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php
index c23e9940377..ed62e127816 100644
--- a/htdocs/core/boxes/box_services_expired.php
+++ b/htdocs/core/boxes/box_services_expired.php
@@ -167,8 +167,6 @@ class box_services_expired extends ModeleBoxes
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
-
-
}
else
{
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index a37f6b1562b..f64e18abb32 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -735,7 +735,11 @@ class CMailFile
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
$result=$this->smtps->getErrors();
- if (empty($this->error) && empty($result)) $res=true;
+ if (empty($this->error) && empty($result))
+ {
+ dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG);
+ $res=true;
+ }
else
{
if (empty($this->error)) $this->error=$result;
@@ -798,6 +802,10 @@ class CMailFile
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res=false;
}
+ else
+ {
+ dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG);
+ }
}
else
{
diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php
index 161ce438e29..b731eb77169 100644
--- a/htdocs/core/class/comment.class.php
+++ b/htdocs/core/class/comment.class.php
@@ -360,7 +360,6 @@ class Comment extends CommonObject
$error++; $this->errors[]="Error ".$this->db->lasterror();
return -1;
}
-
}
return count($this->comments);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 4729e11ff85..aa318a48bcc 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1925,7 +1925,6 @@ abstract class CommonObject
dol_syslog(get_class($this).'::setMulticurrencyRate no updateline defined', LOG_DEBUG);
break;
}
-
}
}
@@ -2815,7 +2814,6 @@ abstract class CommonObject
$this->total_ttc -= $diff;
$total_tva_by_vats[$obj->vatrate] -= $diff;
$total_ttc_by_vats[$obj->vatrate] -= $diff;
-
}
}
@@ -4630,7 +4628,6 @@ abstract class CommonObject
dol_print_error($this->db, "Error generating document for ".__CLASS__.". Error: ".$obj->error, $obj->errors);
return -1;
}
-
}
else
{
@@ -5777,7 +5774,6 @@ abstract class CommonObject
}
$data[$obj->rowid]=$labeltoshow;
-
} else {
if (! $notrans) {
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -5806,7 +5802,6 @@ abstract class CommonObject
$this->db->free($resql);
$out=$form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%');
-
} else {
print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters. ';
}
@@ -6186,7 +6181,6 @@ abstract class CommonObject
}
}
$value=''.implode(' ', $toprint).' ';
-
} else {
dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
}
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 420b90926dd..fc7f6792274 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -348,32 +348,46 @@ class Conf
if (! empty($this->fournisseur))
{
$this->fournisseur->commande=new stdClass();
- $this->fournisseur->commande->dir_output=$rootfordata."/fournisseur/commande";
- $this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp";
+ $this->fournisseur->commande->multidir_output=array($this->entity => $rootfordata."/fournisseur/commande");
+ $this->fournisseur->commande->multidir_temp =array($this->entity => $rootfordata."/fournisseur/commande/temp");
+ $this->fournisseur->commande->dir_output=$rootfordata."/fournisseur/commande"; // For backward compatibility
+ $this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp"; // For backward compatibility
$this->fournisseur->facture=new stdClass();
- $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture";
- $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp";
+ $this->fournisseur->facture->multidir_output=array($this->entity => $rootfordata."/fournisseur/facture");
+ $this->fournisseur->facture->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp");
+ $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; // For backward compatibility
+ $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; // For backward compatibility
$this->supplierproposal=new stdClass();
- $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
- $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
+ $this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal");
+ $this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp");
+ $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility
+ $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility
$this->fournisseur->payment=new stdClass();
- $this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment";
- $this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp";
+ $this->fournisseur->payment->multidir_output=array($this->entity => $rootfordata."/fournisseur/payment");
+ $this->fournisseur->payment->multidir_temp =array($this->entity => $rootfordata."/fournisseur/payment/temp");
+ $this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment"; // For backward compatibility
+ $this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp"; // For backward compatibility
// To prepare split of module fournisseur into fournisseur + supplier_order + supplier_invoice
if (! empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // By default, if module supplier is on, we set new properties
{
$this->supplier_order=new stdClass();
$this->supplier_order->enabled=1;
- $this->supplier_order->dir_output=$rootfordata."/fournisseur/commande";
- $this->supplier_order->dir_temp=$rootfordata."/fournisseur/commande/temp";
+ $this->supplier_order->multidir_output=array($this->entity => $rootfordata."/fournisseur/commande");
+ $this->supplier_order->multidir_temp =array($this->entity => $rootfordata."/fournisseur/commande/temp");
+ $this->supplier_order->dir_output=$rootfordata."/fournisseur/commande"; // For backward compatibility
+ $this->supplier_order->dir_temp=$rootfordata."/fournisseur/commande/temp"; // For backward compatibility
$this->supplier_invoice=new stdClass();
$this->supplier_invoice->enabled=1;
- $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture";
- $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp";
+ $this->supplier_invoice->multidir_output=array($this->entity => $rootfordata."/fournisseur/facture");
+ $this->supplier_invoice->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp");
+ $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; // For backward compatibility
+ $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; // For backward compatibility
$this->supplierproposal=new stdClass();
- $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
- $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
+ $this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal");
+ $this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp");
+ $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility
+ $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility
}
}
diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php
index 297e48a940b..f4e74128747 100644
--- a/htdocs/core/class/ctyperesource.class.php
+++ b/htdocs/core/class/ctyperesource.class.php
@@ -188,8 +188,6 @@ class Ctyperesource
$this->code = $obj->code;
$this->label = $obj->label;
$this->active = $obj->active;
-
-
}
// Retrieve all extrafields for invoice
@@ -269,8 +267,6 @@ class Ctyperesource
$line->code = $obj->code;
$line->label = $obj->label;
$line->active = $obj->active;
-
-
}
$this->db->free($resql);
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index ad7b900b033..195bec09daf 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -704,7 +704,7 @@ class DolGraph
// Create graph
$classname='';
if (! isset($this->type[0]) || $this->type[0] == 'bars') $classname='BarPlot'; // Only one type (first one) is supported by artichow
- else if ($this->type[0] == 'lines') $classname='LinePlot';
+ else if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $classname='LinePlot';
else $classname='TypeUnknown';
include_once ARTICHOW_PATH.$classname.'.class.php';
@@ -809,7 +809,7 @@ class DolGraph
$plot->SetYMin($this->MinValue);
}
- if ($this->type[0] == 'lines')
+ if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint')
{
$color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20);
$colorbis=new Color(min($this->datacolor[$i][0]+20,255),min($this->datacolor[$i][1]+20,255),min($this->datacolor[$i][2]+20,255),60);
@@ -840,8 +840,8 @@ class DolGraph
// solve a bug in Artichow with UTF8
if (count($this->Legend))
{
- if ($this->type[0] == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
- if ($this->type[0] == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
+ if ($this->type[0] == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
+ if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
}
$group->add($plot);
@@ -880,7 +880,7 @@ class DolGraph
* @param string $fileurl Url path to show image if saved onto disk. Never used here.
* @return void
*/
- private function draw_jflot($file,$fileurl)
+ private function draw_jflot($file, $fileurl)
{
// phpcs:enable
global $artichow_defaultfont;
@@ -1027,19 +1027,22 @@ class DolGraph
else
{
// Add code to support tooltips
+ // TODO: remove js css and use graph-tooltip-inner class instead by adding css in each themes
$this->stringtoshow.='
function showTooltip_'.$tag.'(x, y, contents) {
- $(\'\' + contents + \'
\').css({
+ $(\'\' + contents + \'
\').css({
position: \'absolute\',
display: \'none\',
- top: y + 5,
- left: x + 5,
- border: \'1px solid #ddd\',
- padding: \'2px\',
- \'background-color\': \'#ffe\',
+ top: y + 10,
+ left: x + 15,
+ border: \'1px solid #000\',
+ padding: \'5px\',
+ \'background-color\': \'#000\',
+ \'color\': \'#fff\',
+ \'font-weight\': \'bold\',
width: 200,
opacity: 0.80
- }).appendTo("body").fadeIn(20);
+ }).appendTo("body").fadeIn(100);
}
var previousPoint = null;
@@ -1080,12 +1083,13 @@ class DolGraph
if ($i > $firstlot) $this->stringtoshow.=', '."\n";
$color=sprintf("%02x%02x%02x",$this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]);
$this->stringtoshow.='{ ';
- if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->stringtoshow.='bars: { show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, ';
- if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->stringtoshow.='lines: { show: true, fill: false }, ';
+ if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, ';
+ if (isset($this->type[$i]) && ($this->type[$i] == 'lines' || $this->type[$i] == 'linesnopoint')) $this->stringtoshow.='lines: { show: true, fill: false }, points: { show: '.($this->type[$i] == 'linesnopoint' ? 'false' : 'true').' }, ';
$this->stringtoshow.='color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }';
$i++;
}
- $this->stringtoshow.="\n".' ], { series: { stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n";
+ // shadowSize: 0 -> Drawing is faster without shadows
+ $this->stringtoshow.="\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n";
// Xaxis
$this->stringtoshow.=', xaxis: { ticks: ['."\n";
@@ -1104,11 +1108,10 @@ class DolGraph
// Background color
$color1=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[0],$this->bgcolorgrid[2]);
$color2=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]);
- $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] } }'."\n";
+ $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#eee\', tickColor : \'#f3f3f3\' }'."\n";
//$this->stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this
$this->stringtoshow.='});'."\n";
$this->stringtoshow.='}'."\n";
-
}
$this->stringtoshow.='plotWithOptions_'.$tag.'();'."\n";
diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php
index 8734c4126e7..f38afc67807 100644
--- a/htdocs/core/class/dolreceiptprinter.class.php
+++ b/htdocs/core/class/dolreceiptprinter.class.php
@@ -484,7 +484,6 @@ class dolReceiptPrinter extends Escpos
$this->printer->cut();
//print ''.print_r($this->connector, true).' ';
$this->printer->close();
-
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
$error++;
@@ -621,7 +620,6 @@ class dolReceiptPrinter extends Escpos
// uncomment next line to see content sent to printer
//print ''.print_r($this->connector, true).' ';
$this->printer->close();
-
}
return $error;
}
diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php
index c5304fec31c..b30f79f0bba 100644
--- a/htdocs/core/class/emailsenderprofile.class.php
+++ b/htdocs/core/class/emailsenderprofile.class.php
@@ -413,7 +413,6 @@ class EmailSenderProfile extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 3f5b515e725..9ebdbd22836 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1392,7 +1392,6 @@ class ExtraFields
}
$data[$obj->rowid]=$labeltoshow;
-
} else {
if (! $notrans) {
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -1421,7 +1420,6 @@ class ExtraFields
$this->db->free($resql);
$out=$form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%');
-
} else {
print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters. ';
}
@@ -1715,7 +1713,6 @@ class ExtraFields
}
}
$value=''.implode(' ', $toprint).' ';
-
} else {
dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d42d1dde48f..70ffa6ea006 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3283,17 +3283,17 @@ class Form
if ($empty && empty($arraytypes['code'])) continue;
if ($format == 0) print '';
if ($format == 0) $value=($maxlength?dol_trunc($arraytypes['label'],$maxlength):$arraytypes['label']);
- if ($format == 1) $value=$arraytypes['code'];
- if ($format == 2) $value=($maxlength?dol_trunc($arraytypes['label'],$maxlength):$arraytypes['label']);
- if ($format == 3) $value=$arraytypes['code'];
+ elseif ($format == 1) $value=$arraytypes['code'];
+ elseif ($format == 2) $value=($maxlength?dol_trunc($arraytypes['label'],$maxlength):$arraytypes['label']);
+ elseif ($format == 3) $value=$arraytypes['code'];
print $value?$value:' ';
print ' ';
}
@@ -3806,18 +3806,18 @@ class Form
{
$more.=''.$input['label'].' '."\n";
}
- else if ($input['type'] == 'password')
+ elseif ($input['type'] == 'password')
{
$more.=''.$input['label'].' '."\n";
}
- else if ($input['type'] == 'select')
+ elseif ($input['type'] == 'select')
{
$more.='';
if (! empty($input['label'])) $more.=$input['label'].' ';
$more.=$this->selectarray($input['name'],$input['values'],$input['default'],1,0,0,$moreattr,0,0,0,'',$morecss);
$more.=' '."\n";
}
- else if ($input['type'] == 'checkbox')
+ elseif ($input['type'] == 'checkbox')
{
$more.='';
$more.=''.$input['label'].' ';
@@ -3828,7 +3828,7 @@ class Form
$more.=' /> ';
$more.=' '."\n";
}
- else if ($input['type'] == 'radio')
+ elseif ($input['type'] == 'radio')
{
$i=0;
foreach($input['values'] as $selkey => $selval)
@@ -3844,7 +3844,7 @@ class Form
$i++;
}
}
- else if ($input['type'] == 'date')
+ elseif ($input['type'] == 'date')
{
$more.=''.$input['label'].' ';
$more.='';
@@ -3856,7 +3856,7 @@ class Form
$formquestion[] = array('name'=>$input['name'].'hour');
$formquestion[] = array('name'=>$input['name'].'min');
}
- else if ($input['type'] == 'other')
+ elseif ($input['type'] == 'other')
{
$more.=' ';
if (! empty($input['label'])) $more.=$input['label'].' ';
@@ -3864,7 +3864,7 @@ class Form
$more.=' '."\n";
}
- else if ($input['type'] == 'onecolumn')
+ elseif ($input['type'] == 'onecolumn')
{
$more.='';
$more.=$input['value'];
@@ -4589,6 +4589,7 @@ class Form
*
* @param string $selected preselected currency code
* @param string $htmlname name of HTML select list
+ * @deprecated
* @return void
*/
function select_currency($selected='',$htmlname='currency_id')
@@ -4685,7 +4686,6 @@ class Form
$out.= '';
}
}
-
}
$out.= '';
@@ -4977,7 +4977,7 @@ class Form
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field.
* @param datetime $adddateof Add a link "Date of invoice" using the following date.
- * @return string|null Nothing or string if nooutput is 1
+ * @return string|void Nothing or string if nooutput is 1
* @deprecated
* @see form_date, select_month, select_year, select_dayofweek
*/
@@ -5375,7 +5375,7 @@ class Form
* if 'textselect' input hour is in text and input min is a combo
* @param integer $minunderhours If 1, show minutes selection under the hours
* @param int $nooutput Do not output html string but return it
- * @return string|null
+ * @return string|void
*/
function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0)
{
@@ -6958,7 +6958,6 @@ class Form
$ret.=' ';
$ret.='';
}
-
}
else dol_print_error('','Call of showphoto with wrong parameters modulepart='.$modulepart);
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index bfc67880a96..5824d2ca5ec 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -718,7 +718,6 @@ class FormFile
$reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']);
$out.= $hookmanager->resPrint;
}
-
}
// Get list of files
@@ -848,7 +847,6 @@ class FormFile
{
$out.=''.$langs->trans("None").' '."\n";
}
-
}
if ($headershown)
@@ -886,15 +884,13 @@ class FormFile
$out='';
$this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array());
+ $entity = 1; // Without multicompany
+
// Get object entity
- if (empty($conf->multicompany->enabled))
- {
- $entity = $conf->entity;
- }
- else
+ if (! empty($conf->multicompany->enabled))
{
preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir,'/').'$/', $filedir, $regs);
- $entity = ((! empty($regs[1]) && $regs[1] > 1) ? $regs[1] : $conf->entity);
+ $entity = ((! empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default
}
// Get list of files starting with name of ref (but not followed by "-" to discard uploaded files and get only generated files)
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 68da2dce777..a71a0a15da0 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -880,6 +880,20 @@ class FormMail extends Form
$out.= ''.$langs->trans("MailFile").' ';
$out.= '';
+
+ if ($this->withmaindocfile) // withmaindocfile is set to 1 or -1 to show the checkbox (-1 = checked or 1 = not checked)
+ {
+ if (GETPOSTISSET('sendmail'))
+ {
+ $this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1);
+ }
+ // If a template was selected, we use setup of template to define if join file checkbox is selected or not.
+ elseif (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
+ {
+ $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1);
+ }
+ }
+
if (! empty($this->withmaindocfile))
{
if ($this->withmaindocfile == 1)
@@ -888,7 +902,7 @@ class FormMail extends Form
}
if ($this->withmaindocfile == -1)
{
- $out.=' ';
+ $out.=' ';
}
$out.=' '.$langs->trans("JoinMainDoc").'. ';
}
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index f79e9eea53d..d2800ce1906 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -1212,7 +1212,6 @@ class FormOther
}
$boxlistb.= "\n";
-
}
return array('selectboxlist'=>count($boxactivated)?$selectboxlist:'', 'boxactivated'=>$boxactivated, 'boxlista'=>$boxlista, 'boxlistb'=>$boxlistb);
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index b2166453bbd..bc62ebc7604 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -490,7 +490,7 @@ class FormProjets
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
$linkedtothirdparty=false;
- if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true;
+ if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','payment_salary','payment_various','chargesociales'))) $linkedtothirdparty=true;
$sqlfilter='';
@@ -533,6 +533,9 @@ class FormProjets
$sql = 'SELECT t.rowid, t.label as ref';
$projectkey='fk_origin';
break;
+ case "payment_salary":
+ $sql = "SELECT t.rowid, t.num_payment as ref"; // TODO In a future fill and use real ref field
+ break;
case "payment_various":
$sql = "SELECT t.rowid, t.num_payment as ref";
break;
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 7a24e4928c7..18635aeee00 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -549,12 +549,10 @@ class Notify
if ($obj->type_target == 'touserid') {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_user, type, objet_type, type_target, objet_id, email)";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".($object->socid?$object->socid:'null').", ".$obj->cid.", '".$obj->type."', '".$object_type."', '".$obj->type_target."', ".$object->id.", '".$this->db->escape($obj->email)."')";
-
}
else {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, type_target, objet_id, email)";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".($object->socid?$object->socid:'null').", ".$obj->cid.", '".$obj->type."', '".$object_type."', '".$obj->type_target."', ".$object->id.", '".$this->db->escape($obj->email)."')";
-
}
if (! $this->db->query($sql))
{
diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php
index bad8d7ffdca..fd37476a26e 100644
--- a/htdocs/core/class/rssparser.class.php
+++ b/htdocs/core/class/rssparser.class.php
@@ -545,8 +545,6 @@ class RssParser
}
$this->incontent = $el;
-
-
}
// if inside an Atom content construct (e.g. content or summary) field treat tags as text
@@ -734,7 +732,6 @@ class RssParser
elseif ($this->inchannel) {
$this->concat($this->channel[ $el ], $text);
}
-
}
}
}
@@ -759,7 +756,6 @@ function xml2php($xml)
foreach($value->attributes() as $ak=>$av)
{
$child[$ak] = (string) $av;
-
}
//Let see if the new child is not in the array
diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php
index 7904f485d6a..e3b151f9874 100644
--- a/htdocs/core/class/utils.class.php
+++ b/htdocs/core/class/utils.class.php
@@ -343,7 +343,6 @@ class Utils
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
}
pclose($handlein);
-
}
diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php
index dd1553ec12f..a8483ec1401 100644
--- a/htdocs/core/db/mssql.class.php
+++ b/htdocs/core/db/mssql.class.php
@@ -374,7 +374,6 @@ class DoliDBMssql extends DoliDB
$query="ALTER TABLE [".$matches[1]."] ADD CONSTRAINT [".$matches[2]."] PRIMARY KEY CLUSTERED (".$matches[3].")";
}
}
-
}
if ($type=="auto" || $type='ddl')
@@ -416,7 +415,6 @@ class DoliDBMssql extends DoliDB
$sql='SET IDENTITY_INSERT ['.trim($matches[1]).'] ON;';
@mssql_query($sql, $this->db);
$post_query='SET IDENTITY_INSERT ['.trim($matches[1]).'] OFF;';
-
}
}
//print "";
diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php
index 6babfd881d4..97e799a2b69 100644
--- a/htdocs/core/db/sqlite3.class.php
+++ b/htdocs/core/db/sqlite3.class.php
@@ -260,7 +260,6 @@ class DoliDBSqlite3 extends DoliDB
// Pour l'instant les contraintes ne sont pas créées
dol_syslog(get_class().'::query line emptied');
$line = 'SELECT 0;';
-
}
//if (preg_match('/rowid\s+.*\s+PRIMARY\s+KEY,/i', $line)) {
@@ -445,7 +444,6 @@ class DoliDBSqlite3 extends DoliDB
// dummy statement
$query="SELECT 0";
-
} else {
$query=$this->convertSQLFromMysql($query,$type);
}
diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js
index 44180b42acb..3bd93555d76 100644
--- a/htdocs/core/js/timesheet.js
+++ b/htdocs/core/js/timesheet.js
@@ -222,20 +222,21 @@ function updateTotal(days,mode)
else jQuery('.totalDay'+days).removeClass("bold");
jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes()));
- var total = new Date(0);
- total.setHours(0);
- total.setMinutes(0);
+ var totalhour = 0;
+ var totalmin = 0;
for (var i=0; i<7; i++)
{
var taskTime= new Date(0);
result=parseTime(jQuery('.totalDay'+i).text(),taskTime);
if (result >= 0)
{
- total.setHours(total.getHours()+taskTime.getHours());
- total.setMinutes(total.getMinutes()+taskTime.getMinutes());
+ totalhour = totalhour + taskTime.getHours();
+ totalmin = totalmin + taskTime.getMinutes();
}
}
- jQuery('.totalDayAll').text(pad(total.getHours())+':'+pad(total.getMinutes()));
+ morehours = Math.floor(totalmin / 60);
+ totalmin = totalmin % 60;
+ jQuery('.totalDayAll').text(pad(morehours + totalhour)+':'+pad(totalmin));
}
else
{
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 4014adfc272..f92fd56a87b 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1233,7 +1233,6 @@ function activateModulesRequiredByCountry($country_code)
setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings');
}
-
}
else dol_syslog("Module ".get_class($objMod)." not qualified");
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 46e3922a0d0..fe9d15c8322 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -634,7 +634,6 @@ function getFormeJuridiqueLabel($code)
{
return $langs->trans("NotDefined");
}
-
}
}
diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php
index d9cad7f1c1e..06ceb2c96b0 100644
--- a/htdocs/core/lib/emailing.lib.php
+++ b/htdocs/core/lib/emailing.lib.php
@@ -46,7 +46,6 @@ function emailing_prepare_head(Mailing $object)
if ($object->nbemail > 0) $head[$h][1].= ' '.$object->nbemail.' ';
$head[$h][2] = 'targets';
$h++;
-
}
if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR))
diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php
index e55aaeb7516..20e257eee2f 100644
--- a/htdocs/core/lib/fichinter.lib.php
+++ b/htdocs/core/lib/fichinter.lib.php
@@ -76,7 +76,6 @@ function fichinter_prepare_head($object)
foreach($resources as $resource_obj)
{
$linked_resources = $object->getElementResources('fichinter',$object->id,$resource_obj);
-
}
}
}
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 7897041ebbf..1a114c62a01 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -781,7 +781,6 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep
$result=$tmpresult;
}
if ($result < 0) break;
-
}
}
closedir($dir_handle);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 7888338cdc2..d15d07e4c6e 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1223,7 +1223,6 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
$outmore.=''.$links[$i][1].' '."\n";
else
$outmore.=''.$links[$i][1].' '."\n";
-
}
else if (! empty($links[$i][1]))
{
@@ -3297,15 +3296,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if ($srconly) {
return $fullpathpicto;
}
- else {
// tag title is used for tooltip on , tag alt can be used with very simple text on image for bind people
- //$tmparray=array(0=>$titlealt);
- //if (empty($notitle) && preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
- //$title=$tmparray[0];
- //$alt=empty($tmparray[1])?'':$tmparray[1];
- $title = $titlealt;
- return ' '; // Alt is used for accessibility, title for popup
- }
+ return ' '; // Alt is used for accessibility, title for popup
}
/**
@@ -3932,7 +3924,6 @@ function dol_print_error($db='',$error='',$errors=null)
$out.='> '.$langs->transnoentities("RequestLastAccessInError").":\n".($db->lastqueryerror()?$db->lastqueryerror():$langs->transnoentities("ErrorNoRequestInError"))."\n";
$out.='> '.$langs->transnoentities("ReturnCodeLastAccessInError").":\n".($db->lasterrno()?$db->lasterrno():$langs->transnoentities("ErrorNoRequestInError"))."\n";
$out.='> '.$langs->transnoentities("InformationLastAccessInError").":\n".($db->lasterror()?$db->lasterror():$langs->transnoentities("ErrorNoRequestInError"))."\n";
-
}
$syslog.=", sql=".$db->lastquery();
$syslog.=", db_error=".$db->lasterror();
@@ -4994,7 +4985,6 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
else
{
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller), $obj->accountancy_code_sell,$obj->accountancy_code_buy);
-
}
}
@@ -5116,8 +5106,6 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
else
{
// TODO Read default product vat according to countrycode and product
-
-
}
}
@@ -5600,7 +5588,6 @@ function dolGetFirstLineOfText($text, $nboflines=1)
{
$firstline=preg_replace('/ ]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
$firstline=preg_replace('/]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters
-
}
else
{
@@ -7094,54 +7081,60 @@ function printCommonFooter($zone='private')
$relativepathstring = preg_replace('/^\//', '', $relativepathstring);
$relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
- foreach($user->default_values[$relativepathstring]['focus'] as $defkey => $defval)
+ if (!empty($user->default_values[$relativepathstring]['focus']))
{
- $qualified = 0;
- if ($defkey != '_noquery_')
+ foreach($user->default_values[$relativepathstring]['focus'] as $defkey => $defval)
{
- $tmpqueryarraytohave=explode('&', $defkey);
- $foundintru=0;
- foreach($tmpqueryarraytohave as $tmpquerytohave)
+ $qualified = 0;
+ if ($defkey != '_noquery_')
{
- if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
+ $tmpqueryarraytohave=explode('&', $defkey);
+ $foundintru=0;
+ foreach($tmpqueryarraytohave as $tmpquerytohave)
+ {
+ if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
+ }
+ if (! $foundintru) $qualified=1;
+ //var_dump($defkey.'-'.$qualified);
}
- if (! $foundintru) $qualified=1;
- //var_dump($defkey.'-'.$qualified);
- }
- else $qualified = 1;
+ else $qualified = 1;
- if ($qualified)
- {
- foreach($defval as $paramkey => $paramval)
+ if ($qualified)
{
- // Add property 'required' on input
- print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
+ foreach($defval as $paramkey => $paramval)
+ {
+ // Add property 'required' on input
+ print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
+ }
}
}
}
- foreach($user->default_values[$relativepathstring]['mandatory'] as $defkey => $defval)
+ if (!empty($user->default_values[$relativepathstring]['mandatory']))
{
- $qualified = 0;
- if ($defkey != '_noquery_')
+ foreach($user->default_values[$relativepathstring]['mandatory'] as $defkey => $defval)
{
- $tmpqueryarraytohave=explode('&', $defkey);
- $foundintru=0;
- foreach($tmpqueryarraytohave as $tmpquerytohave)
+ $qualified = 0;
+ if ($defkey != '_noquery_')
{
- if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
+ $tmpqueryarraytohave=explode('&', $defkey);
+ $foundintru=0;
+ foreach($tmpqueryarraytohave as $tmpquerytohave)
+ {
+ if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
+ }
+ if (! $foundintru) $qualified=1;
+ //var_dump($defkey.'-'.$qualified);
}
- if (! $foundintru) $qualified=1;
- //var_dump($defkey.'-'.$qualified);
- }
- else $qualified = 1;
+ else $qualified = 1;
- if ($qualified)
- {
- foreach($defval as $paramkey => $paramval)
+ if ($qualified)
{
- // Add property 'required' on input
- print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
- print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
+ foreach($defval as $paramkey => $paramval)
+ {
+ // Add property 'required' on input
+ print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
+ print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
+ }
}
}
}
diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php
index 3f09bd3410a..10d68475c97 100644
--- a/htdocs/core/lib/xcal.lib.php
+++ b/htdocs/core/lib/xcal.lib.php
@@ -263,7 +263,6 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
$comment ['enddate'] = $enddate;
fwrite($calfileh,"COMMENT:" . serialize ($comment) . "\n");
*/
-
}
}
diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php
index 6e13d55171c..4587dbae11b 100644
--- a/htdocs/core/login/functions_ldap.php
+++ b/htdocs/core/login/functions_ldap.php
@@ -203,7 +203,6 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
}
unset($usertmp);
}
-
}
if ($result == 1)
{
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 562ed99a020..bb13a0c2265 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -626,7 +626,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
}
}
-
}
@@ -807,7 +806,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/fichinter/card-red.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203);
$newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
}
-
}
@@ -1242,7 +1240,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (preg_match('/checks/',$leftmenu)) $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque);
if (preg_match('/checks/',$leftmenu)) $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank",$langs->trans("List"),1,$user->rights->banque->cheque);
}
-
}
/*
@@ -1349,7 +1346,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if ($usemenuhider || empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire);
$newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire);
}
-
}
/*
@@ -1380,7 +1376,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$titlenew = $langs->trans("NewLead");
}
- // Project affected to user
+ // Project assigned to user
$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user?'&search_project_user='.$search_project_user:''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects');
$newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user?'&search_project_user='.$search_project_user:''), $titlenew, 1, $user->rights->projet->creer);
@@ -1398,9 +1394,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', $langs->trans("List"), 2, $showmode);
}
- // All project i have permission on
$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
+ // Categories
+ if (! empty($conf->categorie->enabled))
+ {
+ $langs->load("categories");
+ $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
+ }
+
if (empty($conf->global->PROJECT_HIDE_TASKS))
{
// Project affected to user
@@ -1411,13 +1413,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user?'&search_project_user='.$search_project_user:''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire);
}
-
- // Categories
- if (! empty($conf->categorie->enabled))
- {
- $langs->load("categories");
- $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
- }
}
}
@@ -1571,7 +1566,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create",$langs->trans("New"),1,$user->rights->adherent->configurer);
$newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members",$langs->trans("List"),1,$user->rights->adherent->configurer);
}
-
}
// Add personalized menus and modules menus
@@ -1631,7 +1625,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$i++;
}
}
-
}
// Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index fa6e1b3084d..543dbd111bb 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -315,8 +315,6 @@ class MenuManager
}
print ''."\n";
}
-
-
}
//var_dump($submenu);
print '';
diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php
index 172b6c483c5..4d7296b276b 100644
--- a/htdocs/core/menus/standard/empty.php
+++ b/htdocs/core/menus/standard/empty.php
@@ -311,8 +311,6 @@ class MenuManager
}
print ''."\n";
}
-
-
}
//var_dump($submenu);
print '';
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 9f94288809d..dfaaa6b26b4 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -1175,7 +1175,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
dol_syslog(get_class($this)."::insert_boxes", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) $err++;
-
}
if (! $err && ! preg_match('/newboxdefonly/',$option))
{
@@ -1384,7 +1383,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$resql=$this->db->query($sql);
if (! $resql) $err++;
-
}
if (! $err)
@@ -1739,7 +1737,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
break;
}
else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO);
-
}
$this->db->free($resqlinsert);
@@ -1791,7 +1788,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$user->clearrights();
$user->getrights();
}
-
}
$this->db->free($resql);
}
diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php
index 9af073267ae..f2841a7ec8e 100644
--- a/htdocs/core/modules/cheque/modules_chequereceipts.php
+++ b/htdocs/core/modules/cheque/modules_chequereceipts.php
@@ -209,7 +209,6 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
dol_print_error($db,"chequereceipt_pdf_create Error: ".$obj->error);
return -1;
}
-
}
else
{
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index dff597c5593..a849d2a2c7a 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -488,7 +488,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
else {
try {
$odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
dol_syslog($e->getMessage(), LOG_INFO);
return -1;
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index ad77e9bea32..6047caa55b3 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -967,7 +967,6 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
-
}
}
}
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index 1c85adddfcc..0bf4b91365e 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -402,7 +402,6 @@ class pdf_eratosthene extends ModelePDFCommandes
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$height_note=$posyafter-$tab_top_newpage;
$pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1);
-
}
else // No pagebreak
{
@@ -424,7 +423,6 @@ class pdf_eratosthene extends ModelePDFCommandes
$posyafter = $tab_top_newpage;
}
-
}
$tab_height = $tab_height - $height_note;
@@ -1028,7 +1026,6 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
-
}
}
}
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index f70514b2912..5a19d821653 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -2,7 +2,8 @@
/* Copyright (C) 2010-2012 Laurent Destailleur
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2018 Ferran Marcet
-*
+ * Copyright (C) 2018 Frédéric France
+ *
* 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
* the Free Software Foundation; either version 3 of the License, or
@@ -354,6 +355,7 @@ class doc_generic_contract_odt extends ModelePDFContract
catch(Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -367,8 +369,9 @@ class doc_generic_contract_odt extends ModelePDFContract
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
foreach($tmparray as $key=>$value)
@@ -384,8 +387,9 @@ class doc_generic_contract_odt extends ModelePDFContract
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -419,9 +423,11 @@ class doc_generic_contract_odt extends ModelePDFContract
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -445,6 +451,7 @@ class doc_generic_contract_odt extends ModelePDFContract
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -456,7 +463,7 @@ class doc_generic_contract_odt extends ModelePDFContract
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
return -1;
}
@@ -464,7 +471,7 @@ class doc_generic_contract_odt extends ModelePDFContract
else {
try {
$odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
return -1;
}
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index 38696cb3cc2..6a1543af4cf 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -4,8 +4,8 @@
* Copyright (C) 2014 Marcos García
* Copyright (C) 2016 Charlie Benke
* Copyright (C) 2018 Philippe Grand
-
-*
+ * Copyright (C) 2018 Frédéric France
+ *
* 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
* the Free Software Foundation; either version 3 of the License, or
@@ -347,6 +347,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
catch(Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -362,6 +363,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
// Make substitutions into odt of user info
@@ -381,8 +383,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Make substitutions into odt of mysoc
@@ -402,8 +405,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Make substitutions into odt of thirdparty
@@ -421,8 +425,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of object + external modules
@@ -446,6 +451,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
@@ -478,9 +484,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -488,7 +496,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$odfHandler->mergeSegment($listlines);
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
$this->error=$e->getMessage();
dol_syslog($this->error, LOG_WARNING);
@@ -502,8 +510,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -515,16 +524,18 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
else {
try {
$odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index 5c663e61348..daa8d67e5d1 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -730,7 +730,6 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1);
-
}
// Total Weight
@@ -834,7 +833,6 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetXY($this->posxtotalht-1, $tab_top+1);
$pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxtotalht), 2, $outputlangs->transnoentities("TotalHT"),'','C');
}
-
}
}
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index f05c19885da..ec03a2cef8e 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -278,7 +278,7 @@ class pdf_standard extends ModeleExpenseReport
$pagenb=0;
$pdf->SetDrawColor(128,128,128);
- $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref_number));
+ $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Trips"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
@@ -479,7 +479,6 @@ class pdf_standard extends ModeleExpenseReport
$pagenb++;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
}
-
}
// Show square
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index a823bae2d4b..bfe22b93ae3 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -1,9 +1,10 @@
-* Copyright (C) 2012 Regis Houssin
-* Copyright (C) 2014 Marcos García
-* Copyright (C) 2016 Charlie Benke
-*
+ * Copyright (C) 2012 Regis Houssin
+ * Copyright (C) 2014 Marcos García
+ * Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2018 Frédéric France
+ *
* 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
* the Free Software Foundation; either version 3 of the License, or
@@ -355,9 +356,10 @@ class doc_generic_invoice_odt extends ModelePDFFactures
)
);
}
- catch(Exception $e)
+ catch (Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -371,8 +373,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
// Define substitution array
@@ -410,8 +413,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
@@ -444,9 +448,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -470,6 +476,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -483,14 +490,16 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$odfHandler->exportAsAttachedPDF($file);
}catch (Exception $e){
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
else {
try {
- $odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ $odfHandler->saveToDisk($file);
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index c4d69424cb2..797b48865c6 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1202,7 +1202,6 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
-
}
}
}
@@ -1225,7 +1224,6 @@ class pdf_crabe extends ModelePDFFactures
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
}
}
-
}
foreach($this->tva as $tvakey => $tvaval)
@@ -1516,9 +1514,7 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
-
}
-
}
if($conf->global->PRODUCT_USE_UNITS) {
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index d03d60f50fe..439f81ab02e 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -487,7 +487,6 @@ class pdf_sponge extends ModelePDFFactures
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$height_note=$posyafter-$tab_top_newpage;
$pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1);
-
}
else // No pagebreak
{
@@ -509,7 +508,6 @@ class pdf_sponge extends ModelePDFFactures
$posyafter = $tab_top_newpage;
}
-
}
$tab_height = $tab_height - $height_note;
@@ -787,7 +785,6 @@ class pdf_sponge extends ModelePDFFactures
$pagenb++;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
}
-
}
// Show square
@@ -1268,7 +1265,6 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
-
}
}
}
@@ -1291,7 +1287,6 @@ class pdf_sponge extends ModelePDFFactures
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
}
}
-
}
foreach($this->tva as $tvakey => $tvaval)
diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php
index b63326ca276..338b553166e 100644
--- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php
+++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php
@@ -44,7 +44,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays
/**
* @var string Nom du modele
* @deprecated
- * @see name
+ * @see $name
*/
public $nom='Immaculate';
diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php
index 98380d9fae5..f53e55be6fd 100644
--- a/htdocs/core/modules/holiday/mod_holiday_madonna.php
+++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php
@@ -45,7 +45,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays
/**
* @var string Nom du modele
* @deprecated
- * @see name
+ * @see $name
*/
public $nom='Madonna';
@@ -117,10 +117,10 @@ class mod_holiday_madonna extends ModelNumRefHolidays
* Return next value
*
* @param Societe $objsoc third party object
- * @param Object $contract contract object
+ * @param Object $holiday Holiday object
* @return string Value if OK, 0 if KO
*/
- function getNextValue($objsoc,$contract)
+ function getNextValue($objsoc, $holiday)
{
global $db,$conf;
@@ -143,7 +143,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays
return -1;
}
- $date=$contract->date_contrat;
+ $date=$holiday->date_debut;
$yymm = strftime("%y%m",$date);
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 34bff81e55c..6b2e480db86 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -466,7 +466,6 @@ class ImportCsv extends ModeleImports
}
}
}
-
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='zeroifnull')
{
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index 2c37caa5d40..f8b6aa99a82 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -493,7 +493,6 @@ class ImportXlsx extends ModeleImports
}
}
}
-
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='zeroifnull')
{
diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
index 4f6f3c4ecdb..91bd5127c1f 100644
--- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
@@ -69,7 +69,6 @@ class mailing_thirdparties_services_expired extends MailingTargets
$i++;
$this->arrayofproducts[$i]=$obj->ref;
}
-
}
else
{
diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php
index f57e7f12dfe..92153d83688 100644
--- a/htdocs/core/modules/modDav.class.php
+++ b/htdocs/core/modules/modDav.class.php
@@ -44,7 +44,7 @@ class modDav extends DolibarrModules
// Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
- $this->numero = 50310; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module
+ $this->numero = 50310;
// Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'dav';
@@ -104,7 +104,7 @@ class modDav extends DolibarrModules
// 1=>array('DAV_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
// );
$this->const = array(
- 1=>array('DAV_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
+ //1=>array('DAV_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
);
diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php
new file mode 100644
index 00000000000..6d266fbe6f7
--- /dev/null
+++ b/htdocs/core/modules/modEmailCollector.class.php
@@ -0,0 +1,323 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \defgroup dav Module dav
+ * \brief dav module descriptor.
+ *
+ * \file htdocs/dav/core/modules/modDav.class.php
+ * \ingroup dav
+ * \brief Description and activation file for module dav
+ */
+include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
+
+
+/**
+ * Description and activation class for module dav
+ */
+class modEmailCollector extends DolibarrModules
+{
+ /**
+ * Constructor. Define names, constants, directories, boxes, permissions
+ *
+ * @param DoliDB $db Database handler
+ */
+ public function __construct($db)
+ {
+ global $langs,$conf;
+
+ $this->db = $db;
+
+ // Id for module (must be unique).
+ // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
+ $this->numero = 50320;
+ // Key text used to identify module (for permissions, menus, etc...)
+ $this->rights_class = 'dav';
+
+ // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
+ // It is used to group modules by family in module setup page
+ $this->family = "interface";
+ // Module position in the family on 2 digits ('01', '10', '20', ...)
+ $this->module_position = '75';
+ // Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
+ //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
+
+ // Module label (no space allowed), used if translation string 'ModuledavName' not found (MyModue is name of module).
+ $this->name = preg_replace('/^mod/i','',get_class($this));
+ // Module description, used if translation string 'ModuledavDesc' not found (MyModue is name of module).
+ $this->description = "EmailCollectorDescription";
+ // Used only if file README.md and README-LL.md not found.
+ $this->descriptionlong = "EmailCollectorDescription";
+
+ // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
+ $this->version = 'development';
+ // Key used in llx_const table to save module status enabled/disabled (where DAV is value of property name of module in uppercase)
+ $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
+ // Name of image file used for this module.
+ // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
+ // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
+ $this->picto='generic';
+
+ // Defined all module parts (triggers, login, substitutions, menus, css, etc...)
+ // for default path (eg: /dav/core/xxxxx) (0=disable, 1=enable)
+ // for specific path of parts (eg: /dav/core/modules/barcode)
+ // for specific css file (eg: /dav/css/dav.css.php)
+ $this->module_parts = array();
+
+ // Data directories to create when module is enabled.
+ // Example: this->dirs = array("/dav/temp","/dav/subdir");
+ $this->dirs = array();
+
+ // Config pages. Put here list of php page, stored into dav/admin directory, to use to setup module.
+ $this->config_page_url = array("emailcollector.php");
+
+ // Dependencies
+ $this->hidden = false; // A condition to hide module
+ $this->depends = array(); // 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("admin");
+ $this->phpmin = array(5,4); // Minimum version of PHP required by module
+ $this->need_dolibarr_version = array(7,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'...)
+ $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
+ //$this->automatic_activation = array('FR'=>'davWasAutomaticallyActivatedBecauseOfYourCountryChoice');
+ //$this->always_enabled = true; // If true, can't be disabled
+
+ // Constants
+ // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
+ // Example: $this->const=array(0=>array('DAV_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
+ // 1=>array('DAV_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
+ // );
+ $this->const = array(
+ //1=>array('DAV_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
+ );
+
+
+ if (! isset($conf->dav) || ! isset($conf->dav->enabled))
+ {
+ $conf->dav=new stdClass();
+ $conf->dav->enabled=0;
+ }
+
+
+ // Array to add new pages in new tabs
+ $this->tabs = array();
+ // Example:
+ // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@dav:$user->rights->dav->read:/dav/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
+ // $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@dav:$user->rights->othermodule->read:/dav/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
+ // $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
+ //
+ // Where objecttype can be
+ // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
+ // 'contact' to add a tab in contact view
+ // 'contract' to add a tab in contract view
+ // 'group' to add a tab in group view
+ // 'intervention' to add a tab in intervention view
+ // 'invoice' to add a tab in customer invoice view
+ // 'invoice_supplier' to add a tab in supplier invoice view
+ // 'member' to add a tab in fundation member view
+ // 'opensurveypoll' to add a tab in opensurvey poll view
+ // 'order' to add a tab in customer order view
+ // 'order_supplier' to add a tab in supplier order view
+ // 'payment' to add a tab in payment view
+ // 'payment_supplier' to add a tab in supplier payment view
+ // 'product' to add a tab in product view
+ // 'propal' to add a tab in propal view
+ // 'project' to add a tab in project view
+ // 'stock' to add a tab in stock view
+ // 'thirdparty' to add a tab in third party view
+ // 'user' to add a tab in user view
+
+
+ // Dictionaries
+ $this->dictionaries=array();
+ /* Example:
+ $this->dictionaries=array(
+ 'langs'=>'mylangfile@dav',
+ 'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), // List of tables we want to see into dictonnary editor
+ 'tablib'=>array("Table1","Table2","Table3"), // Label of tables
+ 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), // Request to select fields
+ 'tabsqlsort'=>array("label ASC","label ASC","label ASC"), // Sort order
+ 'tabfield'=>array("code,label","code,label","code,label"), // List of fields (result of select to show dictionary)
+ 'tabfieldvalue'=>array("code,label","code,label","code,label"), // List of fields (list of fields to edit a record)
+ 'tabfieldinsert'=>array("code,label","code,label","code,label"), // List of fields (list of fields for insert)
+ 'tabrowid'=>array("rowid","rowid","rowid"), // Name of columns with primary key (try to always name it 'rowid')
+ 'tabcond'=>array($conf->dav->enabled,$conf->dav->enabled,$conf->dav->enabled) // Condition to show each dictionary
+ );
+ */
+
+
+ // Boxes/Widgets
+ // Add here list of php file(s) stored in dav/core/boxes that contains class to show a widget.
+ $this->boxes = array(
+ //0=>array('file'=>'davwidget1.php@dav','note'=>'Widget provided by dav','enabledbydefaulton'=>'Home'),
+ //1=>array('file'=>'davwidget2.php@dav','note'=>'Widget provided by dav'),
+ //2=>array('file'=>'davwidget3.php@dav','note'=>'Widget provided by dav')
+ );
+
+
+ // Cronjobs (List of cron jobs entries to add when module is enabled)
+ // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
+ //$this->cronjobs = array(
+ //0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/dav/class/myobject.class.php', 'objectname'=>'MyObject', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
+ //);
+ // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
+ // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
+ // );
+
+
+ // Permissions
+ $this->rights = array(); // Permission array used by this module
+
+ /*
+ $r=0;
+ $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
+ $this->rights[$r][1] = 'Read myobject of dav'; // Permission label
+ $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
+ $this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
+ $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
+
+ $r++;
+ $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
+ $this->rights[$r][1] = 'Create/Update myobject of dav'; // Permission label
+ $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
+ $this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
+ $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
+
+ $r++;
+ $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
+ $this->rights[$r][1] = 'Delete myobject of dav'; // Permission label
+ $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
+ $this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
+ $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
+ */
+
+ // Main menu entries
+ $this->menu = array(); // List of menus to add
+ $r=0;
+
+ // Add here entries to declare new menus
+
+ /* BEGIN MODULEBUILDER TOPMENU */
+ /*$this->menu[$r++]=array('fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
+ 'type'=>'top', // This is a Top menu entry
+ 'titre'=>'dav',
+ 'mainmenu'=>'dav',
+ 'leftmenu'=>'',
+ 'url'=>'/dav/davindex.php',
+ 'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+ 'position'=>1000+$r,
+ 'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->enabled' if entry must be visible if module is enabled.
+ 'perms'=>'1', // Use 'perms'=>'$user->rights->dav->level1->level2' if you want your menu with a permission rules
+ 'target'=>'',
+ 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
+ */
+ /* END MODULEBUILDER TOPMENU */
+
+ /* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
+ $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=dav', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
+ 'type'=>'left', // This is a Left menu entry
+ 'titre'=>'List MyObject',
+ 'mainmenu'=>'dav',
+ 'leftmenu'=>'dav_myobject_list',
+ 'url'=>'/dav/myobject_list.php',
+ 'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+ 'position'=>1000+$r,
+ 'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->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->dav->level1->level2' if you want your menu with a permission rules
+ 'target'=>'',
+ 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
+ $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=dav,fk_leftmenu=dav', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
+ 'type'=>'left', // This is a Left menu entry
+ 'titre'=>'New MyObject',
+ 'mainmenu'=>'dav',
+ 'leftmenu'=>'dav_myobject_new',
+ 'url'=>'/dav/myobject_page.php?action=create',
+ 'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+ 'position'=>1000+$r,
+ 'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->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->dav->level1->level2' if you want your menu with a permission rules
+ 'target'=>'',
+ 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
+ END MODULEBUILDER LEFTMENU MYOBJECT */
+
+
+ // Exports
+ $r=1;
+
+ /* BEGIN MODULEBUILDER EXPORT MYOBJECT */
+ /*
+ $langs->load("dav@dav");
+ $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@dav';
+ $keyforclass = 'MyObject'; $keyforclassfile='/mymobule/class/myobject.class.php'; $keyforelement='myobject';
+ include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
+ $keyforselect='myobject'; $keyforaliasextra='extra'; $keyforelement='myobject';
+ include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
+ //$this->export_dependencies_array[$r]=array('mysubobject'=>'ts.rowid', 't.myfield'=>array('t.myfield2','t.myfield3')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields)
+ $this->export_sql_start[$r]='SELECT DISTINCT ';
+ $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'myobject as t';
+ $this->export_sql_end[$r] .=' WHERE 1 = 1';
+ $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('myobject').')';
+ $r++; */
+ /* END MODULEBUILDER EXPORT MYOBJECT */
+ }
+
+ /**
+ * Function called when module is enabled.
+ * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
+ * It also creates data directories
+ *
+ * @param string $options Options when enabling module ('', 'noboxes')
+ * @return int 1 if OK, 0 if KO
+ */
+ public function init($options='')
+ {
+ //$this->_load_tables('/dav/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, '', '', 'dav@dav', '$conf->dav->enabled');
+ //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
+ //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->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, '', '', 'dav@dav', '$conf->dav->enabled');
+ //$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
+
+ $sql = array();
+
+ return $this->_init($sql, $options);
+ }
+
+ /**
+ * Function called when module is disabled.
+ * Remove from database constants, boxes and permissions from Dolibarr database.
+ * Data directories are not deleted
+ *
+ * @param string $options Options when enabling module ('', 'noboxes')
+ * @return int 1 if OK, 0 if KO
+ */
+ public function remove($options = '')
+ {
+ $sql = array();
+
+ return $this->_remove($sql, $options);
+ }
+}
diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php
index d4f79f1efcf..01b4e9d4474 100644
--- a/htdocs/core/modules/modStock.class.php
+++ b/htdocs/core/modules/modStock.class.php
@@ -173,7 +173,6 @@ class modStock extends DolibarrModules
$this->rights[9][3] = 0; // Permission by default for new user (0/1)
$this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
-
}
// Main menu entries
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 82b33d35240..979b6fbe7fd 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -1,7 +1,8 @@
* Copyright (C) 2012 Juanjo Menent
-*
+ * Copyright (C) 2018 Frédéric France
+ *
* 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
* the Free Software Foundation; either version 3 of the License, or
@@ -358,16 +359,17 @@ class doc_generic_product_odt extends ModelePDFProduct
$odfHandler = new odf(
$srctemplatepath,
array(
- 'PATH_TO_TMP' => $conf->produit->dir_temp,
- 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
- 'DELIMITER_LEFT' => '{',
- 'DELIMITER_RIGHT' => '}'
+ 'PATH_TO_TMP' => $conf->produit->dir_temp,
+ 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
+ 'DELIMITER_LEFT' => '{',
+ 'DELIMITER_RIGHT' => '}'
)
);
}
- catch(Exception $e)
+ catch (Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -382,8 +384,9 @@ class doc_generic_product_odt extends ModelePDFProduct
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
// Define substitution array
@@ -418,8 +421,9 @@ class doc_generic_product_odt extends ModelePDFProduct
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
@@ -440,11 +444,13 @@ class doc_generic_product_odt extends ModelePDFProduct
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
- catch(SegmentException $e)
+ catch (SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -452,7 +458,7 @@ class doc_generic_product_odt extends ModelePDFProduct
}
$odfHandler->mergeSegment($listlines);
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
$this->error=$e->getMessage();
dol_syslog($this->error, LOG_WARNING);
@@ -468,6 +474,7 @@ class doc_generic_product_odt extends ModelePDFProduct
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -479,16 +486,18 @@ class doc_generic_product_odt extends ModelePDFProduct
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
else {
try {
- $odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ $odfHandler->saveToDisk($file);
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index a350f643e9e..d2fa94ceb1e 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -596,10 +597,9 @@ class doc_generic_project_odt extends ModelePDFProjects
'DELIMITER_RIGHT' => '}'
)
);
- }
- catch(Exception $e)
- {
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -641,8 +641,9 @@ class doc_generic_project_odt extends ModelePDFProjects
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -672,9 +673,11 @@ class doc_generic_project_odt extends ModelePDFProjects
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -721,9 +724,11 @@ class doc_generic_project_odt extends ModelePDFProjects
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlinestaskres->merge();
@@ -768,9 +773,11 @@ class doc_generic_project_odt extends ModelePDFProjects
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlinestasktime->merge();
@@ -806,9 +813,11 @@ class doc_generic_project_odt extends ModelePDFProjects
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlinestasktime->merge();
@@ -835,11 +844,13 @@ class doc_generic_project_odt extends ModelePDFProjects
{
$listtasksfiles->setVars($key, $val, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
- catch(SegmentException $e)
+ catch (SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listtasksfiles->merge();
@@ -881,9 +892,11 @@ class doc_generic_project_odt extends ModelePDFProjects
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -938,9 +951,11 @@ class doc_generic_project_odt extends ModelePDFProjects
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -958,113 +973,113 @@ class doc_generic_project_odt extends ModelePDFProjects
//List of referent
$listofreferent = array(
- 'propal' => array(
- 'title' => "ListProposalsAssociatedProject",
- 'class' => 'Propal',
- 'table' => 'propal',
- 'test' => $conf->propal->enabled && $user->rights->propale->lire
- ),
- 'order' => array(
- 'title' => "ListOrdersAssociatedProject",
- 'class' => 'Commande',
- 'table' => 'commande',
- 'test' => $conf->commande->enabled && $user->rights->commande->lire
- ),
- 'invoice' => array(
- 'title' => "ListInvoicesAssociatedProject",
- 'class' => 'Facture',
- 'table' => 'facture',
- 'test' => $conf->facture->enabled && $user->rights->facture->lire
- ),
- 'invoice_predefined' => array(
- 'title' => "ListPredefinedInvoicesAssociatedProject",
- 'class' => 'FactureRec',
- 'table' => 'facture_rec',
- 'test' => $conf->facture->enabled && $user->rights->facture->lire
- ),
- 'proposal_supplier' => array(
- 'title' => "ListSupplierProposalsAssociatedProject",
- 'class' => 'SupplierProposal',
- 'table' => 'supplier_proposal',
- 'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire
- ),
- 'order_supplier' => array(
- 'title' => "ListSupplierOrdersAssociatedProject",
- 'table' => 'commande_fournisseur',
- 'class' => 'CommandeFournisseur',
- 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire
- ),
- 'invoice_supplier' => array(
- 'title' => "ListSupplierInvoicesAssociatedProject",
- 'table' => 'facture_fourn',
- 'class' => 'FactureFournisseur',
- 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire
- ),
- 'contract' => array(
- 'title' => "ListContractAssociatedProject",
- 'class' => 'Contrat',
- 'table' => 'contrat',
- 'test' => $conf->contrat->enabled && $user->rights->contrat->lire
- ),
- 'intervention' => array(
- 'title' => "ListFichinterAssociatedProject",
- 'class' => 'Fichinter',
- 'table' => 'fichinter',
- 'disableamount' => 1,
- 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire
- ),
- 'shipping' => array(
- 'title' => "ListShippingAssociatedProject",
- 'class' => 'Expedition',
- 'table' => 'expedition',
- 'disableamount' => 1,
- 'test' => $conf->expedition->enabled && $user->rights->expedition->lire
- ),
- 'trip' => array(
- 'title' => "ListTripAssociatedProject",
- 'class' => 'Deplacement',
- 'table' => 'deplacement',
- 'disableamount' => 1,
- 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire
- ),
- 'expensereport' => array(
- 'title' => "ListExpenseReportsAssociatedProject",
- 'class' => 'ExpenseReportLine',
- 'table' => 'expensereport_det',
- 'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire
- ),
- 'donation' => array(
- 'title' => "ListDonationsAssociatedProject",
- 'class' => 'Don',
- 'table' => 'don',
- 'test' => $conf->don->enabled && $user->rights->don->lire
- ),
- 'loan' => array(
- 'title' => "ListLoanAssociatedProject",
- 'class' => 'Loan',
- 'table' => 'loan',
- 'test' => $conf->loan->enabled && $user->rights->loan->read
- ),
- 'chargesociales' => array(
- 'title' => "ListSocialContributionAssociatedProject",
- 'class' => 'ChargeSociales',
- 'table' => 'chargesociales',
- 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id,
- 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire
- ),
- 'stock_mouvement' => array(
- 'title' => "ListMouvementStockProject",
- 'class' => 'MouvementStock',
- 'table' => 'stock_mouvement',
- 'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))
- ),
- 'agenda' => array(
- 'title' => "ListActionsAssociatedProject",
- 'class' => 'ActionComm',
- 'table' => 'actioncomm',
- 'disableamount' => 1,
- 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
- )
+ 'propal' => array(
+ 'title' => "ListProposalsAssociatedProject",
+ 'class' => 'Propal',
+ 'table' => 'propal',
+ 'test' => $conf->propal->enabled && $user->rights->propale->lire
+ ),
+ 'order' => array(
+ 'title' => "ListOrdersAssociatedProject",
+ 'class' => 'Commande',
+ 'table' => 'commande',
+ 'test' => $conf->commande->enabled && $user->rights->commande->lire
+ ),
+ 'invoice' => array(
+ 'title' => "ListInvoicesAssociatedProject",
+ 'class' => 'Facture',
+ 'table' => 'facture',
+ 'test' => $conf->facture->enabled && $user->rights->facture->lire
+ ),
+ 'invoice_predefined' => array(
+ 'title' => "ListPredefinedInvoicesAssociatedProject",
+ 'class' => 'FactureRec',
+ 'table' => 'facture_rec',
+ 'test' => $conf->facture->enabled && $user->rights->facture->lire
+ ),
+ 'proposal_supplier' => array(
+ 'title' => "ListSupplierProposalsAssociatedProject",
+ 'class' => 'SupplierProposal',
+ 'table' => 'supplier_proposal',
+ 'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire
+ ),
+ 'order_supplier' => array(
+ 'title' => "ListSupplierOrdersAssociatedProject",
+ 'table' => 'commande_fournisseur',
+ 'class' => 'CommandeFournisseur',
+ 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire
+ ),
+ 'invoice_supplier' => array(
+ 'title' => "ListSupplierInvoicesAssociatedProject",
+ 'table' => 'facture_fourn',
+ 'class' => 'FactureFournisseur',
+ 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire
+ ),
+ 'contract' => array(
+ 'title' => "ListContractAssociatedProject",
+ 'class' => 'Contrat',
+ 'table' => 'contrat',
+ 'test' => $conf->contrat->enabled && $user->rights->contrat->lire
+ ),
+ 'intervention' => array(
+ 'title' => "ListFichinterAssociatedProject",
+ 'class' => 'Fichinter',
+ 'table' => 'fichinter',
+ 'disableamount' => 1,
+ 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire
+ ),
+ 'shipping' => array(
+ 'title' => "ListShippingAssociatedProject",
+ 'class' => 'Expedition',
+ 'table' => 'expedition',
+ 'disableamount' => 1,
+ 'test' => $conf->expedition->enabled && $user->rights->expedition->lire
+ ),
+ 'trip' => array(
+ 'title' => "ListTripAssociatedProject",
+ 'class' => 'Deplacement',
+ 'table' => 'deplacement',
+ 'disableamount' => 1,
+ 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire
+ ),
+ 'expensereport' => array(
+ 'title' => "ListExpenseReportsAssociatedProject",
+ 'class' => 'ExpenseReportLine',
+ 'table' => 'expensereport_det',
+ 'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire
+ ),
+ 'donation' => array(
+ 'title' => "ListDonationsAssociatedProject",
+ 'class' => 'Don',
+ 'table' => 'don',
+ 'test' => $conf->don->enabled && $user->rights->don->lire
+ ),
+ 'loan' => array(
+ 'title' => "ListLoanAssociatedProject",
+ 'class' => 'Loan',
+ 'table' => 'loan',
+ 'test' => $conf->loan->enabled && $user->rights->loan->read
+ ),
+ 'chargesociales' => array(
+ 'title' => "ListSocialContributionAssociatedProject",
+ 'class' => 'ChargeSociales',
+ 'table' => 'chargesociales',
+ 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id,
+ 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire
+ ),
+ 'stock_mouvement' => array(
+ 'title' => "ListMouvementStockProject",
+ 'class' => 'MouvementStock',
+ 'table' => 'stock_mouvement',
+ 'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))
+ ),
+ 'agenda' => array(
+ 'title' => "ListActionsAssociatedProject",
+ 'class' => 'ActionComm',
+ 'table' => 'actioncomm',
+ 'disableamount' => 1,
+ 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
+ ),
);
//Insert reference
@@ -1116,11 +1131,11 @@ class doc_generic_project_odt extends ModelePDFProjects
if (!empty($element->total_ht)) {
$ref_array['amountht']=$element->total_ht;
$ref_array['amountttc']=$element->total_ttc;
- }else {
+ } else {
$ref_array['amountht']=0;
$ref_array['amountttc']=0;
}
- }else {
+ } else {
$ref_array['amountht']='';
$ref_array['amountttc']='';
}
@@ -1137,21 +1152,20 @@ class doc_generic_project_odt extends ModelePDFProjects
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
}
-
}
}
$odfHandler->mergeSegment($listlines);
}
- }
- catch(OdfException $e)
- {
+ } catch(OdfException $e) {
$this->error=$e->getMessage();
dol_syslog($this->error, LOG_WARNING);
return -1;
@@ -1163,9 +1177,8 @@ class doc_generic_project_odt extends ModelePDFProjects
{
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
+ } catch (OdfException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -1178,16 +1191,16 @@ class doc_generic_project_odt extends ModelePDFProjects
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
return -1;
}
- }
- else {
+ } else {
try {
- $odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ $odfHandler->saveToDisk($file);
+ } catch (Exception $e){
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 7df62bec482..c8c588d1f4f 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -560,9 +561,8 @@ class doc_generic_task_odt extends ModelePDFTask
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
- }
- catch(OdfException $e)
- {
+ } catch (OdfException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -577,15 +577,12 @@ class doc_generic_task_odt extends ModelePDFTask
complete_substitutions_array($tmparray, $outputlangs, $object);
foreach($tmparray as $key => $val)
{
- try
- {
+ try {
$odfHandler->setVars($key, $val, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
+ } catch (OdfException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
+ } catch(SegmentException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -623,15 +620,13 @@ class doc_generic_task_odt extends ModelePDFTask
foreach($tmparray as $key => $val)
{
- try
- {
+ try {
$listlinestaskres->setVars($key, $val, true, 'UTF-8');
+ } catch (OdfException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
}
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
+ catch (SegmentException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlinestaskres->merge();
@@ -677,9 +672,11 @@ class doc_generic_task_odt extends ModelePDFTask
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlinestasktime->merge();
@@ -710,9 +707,11 @@ class doc_generic_task_odt extends ModelePDFTask
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listtasksfiles->merge();
@@ -720,7 +719,6 @@ class doc_generic_task_odt extends ModelePDFTask
//$listlines->merge();
$odfHandler->mergeSegment($listtasksfiles);
-
}
catch(OdfException $e)
{
@@ -753,9 +751,11 @@ class doc_generic_task_odt extends ModelePDFTask
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -811,9 +811,11 @@ class doc_generic_task_odt extends ModelePDFTask
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -838,16 +840,18 @@ class doc_generic_task_odt extends ModelePDFTask
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
else {
try {
$odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index e27fc868155..5b87f744466 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -2,7 +2,8 @@
/* Copyright (C) 2010-2012 Laurent Destailleur
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2016 Charlie Benke
-*
+ * Copyright (C) 2018 Frédéric France
+ *
* 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
* the Free Software Foundation; either version 3 of the License, or
@@ -381,6 +382,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
catch(Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -395,8 +397,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
// Define substitution array
@@ -433,6 +436,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
@@ -465,9 +469,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -489,8 +495,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -502,16 +509,18 @@ class doc_generic_proposal_odt extends ModelePDFPropales
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
else {
try {
$odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index adb52867a36..8c2dfd21a89 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -1146,7 +1146,6 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
-
}
}
}
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index e43734039ca..464bef3da96 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -446,7 +446,6 @@ class pdf_cyan extends ModelePDFPropales
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$height_note=$posyafter-$tab_top_newpage;
$pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1);
-
}
else // No pagebreak
{
@@ -468,7 +467,6 @@ class pdf_cyan extends ModelePDFPropales
$posyafter = $tab_top_newpage;
}
-
}
$tab_height = $tab_height - $height_note;
@@ -1183,7 +1181,6 @@ class pdf_cyan extends ModelePDFPropales
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
-
}
}
}
diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php
index d051c173c6d..0ecf7d7ef38 100644
--- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php
+++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php
@@ -117,7 +117,6 @@ class modGeneratePassStandard extends ModeleGenPassword
$password .= $char;
$i++;
}
-
}
// done!
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index fbd4ac84e05..3650af12b24 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -1,6 +1,8 @@
* Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2018 Frédéric France
+ *
* 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
* the Free Software Foundation; either version 3 of the License, or
@@ -276,6 +278,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
catch(Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
//print $odfHandler->__toString()."\n";
@@ -323,9 +326,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -367,9 +372,10 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
// setVars failed, probably because key not found
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -380,8 +386,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -393,8 +400,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
@@ -413,6 +421,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$odfHandler->saveToDisk($file);
}catch (Exception $e){
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
index fb600eee268..c9c4350e050 100644
--- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
+++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
@@ -1,6 +1,7 @@
* Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -368,6 +369,7 @@ class doc_generic_stock_odt extends ModelePDFStock
catch(Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -382,8 +384,9 @@ class doc_generic_stock_odt extends ModelePDFStock
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
// Define substitution array
@@ -418,8 +421,9 @@ class doc_generic_stock_odt extends ModelePDFStock
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
@@ -442,9 +446,11 @@ class doc_generic_stock_odt extends ModelePDFStock
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -468,6 +474,7 @@ class doc_generic_stock_odt extends ModelePDFStock
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -479,16 +486,18 @@ class doc_generic_stock_odt extends ModelePDFStock
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
else {
try {
$odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
index 2fd86069d01..3c0d62be848 100644
--- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
+++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
@@ -713,7 +713,6 @@ class pdf_stdmovement extends ModelePDFMovement
// Total Qty
$pdf->SetXY($this->postotalht, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $totalunit, 0, 'R', 0);
-
}
else
{
diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
index e7d47f67bda..dec36d5adbd 100644
--- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -243,7 +243,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
return 0;
}
-
}
if (file_exists($dir))
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
index 8478fd70e89..d869b5dd72d 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -291,7 +291,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
return 0;
}
-
}
if (file_exists($dir))
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index 3bf35edbe13..05bfe535ac7 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2012 Laurent Destailleur
* Copyright (C) 2012 Juanjo Menent
* Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -367,16 +368,17 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$odfHandler = new odf(
$srctemplatepath,
array(
- 'PATH_TO_TMP' => $conf->supplier_proposal->dir_temp,
- 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
- 'DELIMITER_LEFT' => '{',
- 'DELIMITER_RIGHT' => '}'
+ 'PATH_TO_TMP' => $conf->supplier_proposal->dir_temp,
+ 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
+ 'DELIMITER_LEFT' => '{',
+ 'DELIMITER_RIGHT' => '}'
)
);
}
- catch(Exception $e)
+ catch (Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -390,8 +392,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
// Define substitution array
@@ -424,6 +427,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
@@ -456,9 +460,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
catch(SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@@ -482,6 +488,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_INFO);
}
}
@@ -493,16 +500,18 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
else {
try {
- $odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ $odfHandler->saveToDisk($file);
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index 31097dd8c34..544a1040c9f 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -997,7 +997,6 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
-
}
}
}
diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
index cacef2dcb55..f8b6e5cdaba 100644
--- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
+++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
@@ -1,6 +1,7 @@
* Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -333,16 +334,17 @@ class doc_generic_user_odt extends ModelePDFUser
$odfHandler = new odf(
$srctemplatepath,
array(
- 'PATH_TO_TMP' => $conf->user->dir_temp,
- 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
- 'DELIMITER_LEFT' => '{',
- 'DELIMITER_RIGHT' => '}'
+ 'PATH_TO_TMP' => $conf->user->dir_temp,
+ 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
+ 'DELIMITER_LEFT' => '{',
+ 'DELIMITER_RIGHT' => '}'
)
);
}
catch(Exception $e)
{
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_WARNING);
return -1;
}
@@ -377,6 +379,7 @@ class doc_generic_user_odt extends ModelePDFUser
}
catch(OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_WARNING);
}
}
@@ -387,8 +390,9 @@ class doc_generic_user_odt extends ModelePDFUser
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_WARNING);
}
}
@@ -400,16 +404,18 @@ class doc_generic_user_odt extends ModelePDFUser
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_WARNING);
return -1;
}
}
else {
try {
- $odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ $odfHandler->saveToDisk($file);
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_WARNING);
return -1;
}
}
diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
index 161c9abc3a6..1f7678371e5 100644
--- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
+++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
@@ -1,6 +1,7 @@
* Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -355,16 +356,15 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$odfHandler = new odf(
$srctemplatepath,
array(
- 'PATH_TO_TMP' => $conf->user->dir_temp,
- 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
- 'DELIMITER_LEFT' => '{',
- 'DELIMITER_RIGHT' => '}'
+ 'PATH_TO_TMP' => $conf->user->dir_temp,
+ 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
+ 'DELIMITER_LEFT' => '{',
+ 'DELIMITER_RIGHT' => '}'
)
);
- }
- catch(Exception $e)
- {
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_WARNING);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -378,8 +378,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_WARNING);
}
// Make substitutions into odt
@@ -414,8 +415,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_WARNING);
}
}
// Replace tags of lines
@@ -425,7 +427,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
try {
$listlines = $odfHandler->setSegment('lines');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
// We may arrive here if tags for lines not present into template
$foundtagforlines = 0;
@@ -446,15 +448,17 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
{
try
{
- if(!is_array($val)) {
+ if (!is_array($val)) {
$listlines->setVars($key, $val, true, 'UTF-8');
}
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_WARNING);
}
- catch(SegmentException $e)
+ catch (SegmentException $e)
{
+ dol_syslog($e->getMessage(), LOG_WARNING);
}
}
$listlines->merge();
@@ -471,39 +475,42 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// Replace labels translated
$tmparray=$outputlangs->get_translations_for_substitutions();
- foreach($tmparray as $key=>$value)
+ foreach($tmparray as $key => $value)
{
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
- catch(OdfException $e)
+ catch (OdfException $e)
{
+ dol_syslog($e->getMessage(), LOG_WARNING);
}
}
// Call the beforeODTSave hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
- $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ $parameters=array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
+ $reshook=$hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
- }catch (Exception $e){
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_WARNING);
return -1;
}
}
else {
try {
- $odfHandler->saveToDisk($file);
- }catch (Exception $e){
+ $odfHandler->saveToDisk($file);
+ } catch (Exception $e) {
$this->error=$e->getMessage();
+ dol_syslog($e->getMessage(), LOG_WARNING);
return -1;
}
}
- $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ $reshook=$hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
diff --git a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php
index ad32f1b9aa8..ae80389bd3a 100644
--- a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php
+++ b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php
@@ -68,7 +68,7 @@ $(document).ready(function(){
modal: true,
height: windowHeight,
width: windowWidth,
- title: "trans('LinesToImport'); ?>",
+ title: "transnoentities('LinesToImport'); ?>",
buttons: {
"trans('Import'); ?>": function() {
$( this ).dialog( "close" );
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 4a4301c5a5f..0d1fd84923c 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -169,7 +169,6 @@ if ($action == 'presend')
$formmail->withtouser = $listeuser;
$formmail->withtoccuser = $listeuser;
}
-
}
$formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste;
diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php
index d46e27e28af..a66e9ba270e 100644
--- a/htdocs/core/tpl/massactions_pre.tpl.php
+++ b/htdocs/core/tpl/massactions_pre.tpl.php
@@ -41,11 +41,12 @@ if ($massaction == 'presend')
{
$langs->load("mails");
+ $listofselectedid = array();
+ $listofselectedthirdparties = array();
+ $listofselectedref = array();
+
if (! GETPOST('cancel', 'alpha'))
{
- $listofselectedid = array();
- $listofselectedthirdparties = array();
- $listofselectedref = array();
foreach ($arrayofselected as $toselectid)
{
$result = $objecttmp->fetch($toselectid);
@@ -110,8 +111,8 @@ if ($massaction == 'presend')
} else {
$formmail->withtoreadonly = 1;
}
-
- $formmail->withoptiononeemailperrecipient = empty($liste)?0:((GETPOST('oneemailperrecipient')=='on')?1:-1);
+
+ $formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1);
$formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste;
$formmail->withtofree = empty($liste)?1:0;
$formmail->withtocc = 1;
diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php
index aff342191cb..59491c01b6f 100644
--- a/htdocs/core/tpl/resource_view.tpl.php
+++ b/htdocs/core/tpl/resource_view.tpl.php
@@ -98,7 +98,6 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '';
}
}
-
}
else {
print ' ";
print "\n";
-
}
else
{
diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php
index 777fa6cb893..8e92e1e6231 100644
--- a/htdocs/datapolicy/admin/setup.php
+++ b/htdocs/datapolicy/admin/setup.php
@@ -159,7 +159,6 @@ if ($action == 'edit')
print '';
print ' ';
}
-
}
print '';
@@ -185,7 +184,6 @@ else
print $form->textwithpicto($langs->trans($key),$langs->trans('DATAPOLICY_Tooltip_SETUP'));
print '' . ($conf->global->$key == '' ? $langs->trans('None') : $valTab[$conf->global->$key]) . ' ';
}
-
}
print '';
diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php
index 3bebdff9302..4914d248490 100644
--- a/htdocs/datapolicy/class/datapolicy.class.php
+++ b/htdocs/datapolicy/class/datapolicy.class.php
@@ -204,7 +204,6 @@ Class DataPolicy extends Contact
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
$contact->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$contact->update($contact->id);
-
} else {
dol_print_error($db);
}
@@ -348,7 +347,6 @@ Class DataPolicy extends Contact
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
$adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$adherent->update($user);
-
} else {
dol_print_error($db);
}
diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php
index f6de8b9b498..ab4b55b35dc 100644
--- a/htdocs/datapolicy/class/datapolicycron.class.php
+++ b/htdocs/datapolicy/class/datapolicycron.class.php
@@ -488,14 +488,12 @@ class DataPolicyCron
$ret = $object->delete();
}
}
-
}
$i++;
}
}
}
-
}
return true;
}
diff --git a/htdocs/datapolicy/mailing.php b/htdocs/datapolicy/mailing.php
index d65b2bdced4..e3f38b269be 100644
--- a/htdocs/datapolicy/mailing.php
+++ b/htdocs/datapolicy/mailing.php
@@ -31,8 +31,6 @@ if(!empty($idcontact)){
$contact = new Contact($db);
$contact->fetch($idcontact);
DataPolicy::sendMailDataPolicyContact($contact);
-
-
}else{
$contacts = new DataPolicy($db);
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index d9542dcaaf0..38465de95ca 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -375,7 +375,6 @@ if ($action == 'create')
print '';
}
print '' . "\n";
-
}
// Date
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index 177b2b82d8b..01aab513a6a 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -184,7 +184,6 @@ if ($object->id)
$permtoedit = $user->rights->don->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
-
}
else
{
diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php
index dde03cb461d..1c3a60e7e78 100644
--- a/htdocs/don/payment/card.php
+++ b/htdocs/don/payment/card.php
@@ -133,7 +133,6 @@ dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), -1, 'payment
if ($action == 'delete')
{
print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
-
}
/*
@@ -143,7 +142,6 @@ if ($action == 'valide')
{
$facid = GETPOST('facid','int');
print $form->formconfirm('card.php?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
-
}
diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php
index 224e674e9da..e71212e806a 100644
--- a/htdocs/don/stats/index.php
+++ b/htdocs/don/stats/index.php
@@ -259,6 +259,7 @@ print '';
print '
';
//}
+print '
';
print '
';
print '';
print ''.$langs->trans("Year").' ';
@@ -293,6 +294,7 @@ foreach ($data as $val)
}
print '
';
+print '
';
print '
';
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index 9038b74cb2a..d3fdd115ffa 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -680,7 +680,6 @@ class EcmDirectory // extends CommonObject
}
}
$i++;
-
}
}
else
diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php
index 5dab56b29a0..922c06f0cc2 100644
--- a/htdocs/ecm/dir_add_card.php
+++ b/htdocs/ecm/dir_add_card.php
@@ -290,7 +290,6 @@ if (empty($action) || $action == 'delete_section')
if ($action == 'delete_section')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
-
}
// Construit fiche rubrique
diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php
index 982fa045d32..7c3473117fc 100644
--- a/htdocs/ecm/dir_card.php
+++ b/htdocs/ecm/dir_card.php
@@ -271,7 +271,6 @@ if ($action == 'update' && ! GETPOST('cancel','alpha'))
$upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
$section = $relativepath;
}
-
}
}
diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php
index b1b45141f4f..959a4bc5b8d 100644
--- a/htdocs/ecm/file_card.php
+++ b/htdocs/ecm/file_card.php
@@ -390,7 +390,6 @@ if ($action == 'edit')
if ($action == 'delete_file')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($section), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1);
-
}
if ($action != 'edit')
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 382312e4434..ea5e5c13ff2 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -343,7 +343,6 @@ dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans
if ($action == 'delete' && empty($conf->use_javascript_ajax))
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
-
}
// Start container of all panels
diff --git a/htdocs/emailcollector/index.html b/htdocs/emailcollector/index.html
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/htdocs/emailcollector/index.html
@@ -0,0 +1 @@
+
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 69deecdf4c0..292bf5e1de8 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -316,7 +316,6 @@ if (empty($reshook))
unset($_POST["options_" . $key]);
}
}
-
}
//var_dump($batch_line[2]);
@@ -859,7 +858,6 @@ if (empty($reshook))
$mode='emailfromshipment';
$trackid='shi'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
-
}
@@ -1421,7 +1419,6 @@ if ($action == 'create')
print '';
print '('.$stock.')';
-
}
else
{
@@ -1522,7 +1519,6 @@ if ($action == 'create')
}
}
}
-
}
if ($subj == 0) // Line not shown yet, we show it
{
@@ -1669,13 +1665,11 @@ else if ($id || $ref)
}
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
-
}
// Confirm cancelation
if ($action == 'annuler')
{
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
-
}
// Call Hook formConfirm
@@ -1826,7 +1820,6 @@ else if ($id || $ref)
print '
';
print '
';
print '';
-
}
else
{
@@ -1864,7 +1857,6 @@ else if ($id || $ref)
print '
';
print '
';
print '';
-
}
else
{
@@ -2536,7 +2528,6 @@ else if ($id || $ref)
{
print '
id.'&action=delete">'.$langs->trans("Delete").' ';
}
-
}
print '
';
diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php
index 109b847fc62..834c0bf2bda 100644
--- a/htdocs/expedition/class/api_shipments.class.php
+++ b/htdocs/expedition/class/api_shipments.class.php
@@ -661,7 +661,6 @@ class Shipments extends DolibarrApi
if (!isset($data[$field]))
throw new RestException(400, "$field field missing");
$shipment[$field] = $data[$field];
-
}
return $shipment;
}
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 77df09ee276..99b288e3703 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -77,14 +77,39 @@ class Expedition extends CommonObject
public $picto = 'sending';
public $socid;
+
+ /**
+ * @var string Customer ref
+ */
public $ref_customer;
+
+ /**
+ * @var string internal ref
+ */
public $ref_int;
+
public $brouillon;
+
+ /**
+ * @var int warehouse id
+ */
public $entrepot_id;
public $lines=array();
+
+ /**
+ * @var string Tracking number
+ */
public $tracking_number;
+
+ /**
+ * @var string Tracking url
+ */
public $tracking_url;
public $billed;
+
+ /**
+ * @var string name of pdf model
+ */
public $model_pdf;
public $trueWeight;
@@ -383,7 +408,6 @@ class Expedition extends CommonObject
$this->db->rollback();
return -1*$error;
}
-
}
else
{
@@ -760,7 +784,6 @@ class Expedition extends CommonObject
$this->error=$this->db->error();
return -2;
}
-
}
// Change status of order to "shipment in process"
@@ -2129,7 +2152,6 @@ class Expedition extends CommonObject
if ($result < 0) {
$error++;
}
-
} else {
$error++;
$this->errors[]=$this->db->lasterror;
@@ -2256,7 +2278,6 @@ class Expedition extends CommonObject
$error++;
}
}
-
} else {
$error++;
$this->errors[]=$this->db->lasterror();
@@ -2343,14 +2364,19 @@ class ExpeditionLigne extends CommonObjectLine
*/
public $table_element='expeditiondet';
+ /**
+ * @deprecated
+ * @see fk_origin_line
+ */
+ public $origin_line_id;
+
/**
* @var int ID
*/
public $fk_origin_line;
/**
- * Id of shipment
- * @var int
+ * @var int Id of shipment
*/
public $fk_expedition;
@@ -2359,51 +2385,120 @@ class ExpeditionLigne extends CommonObjectLine
*/
public $db;
- // From llx_expeditiondet
- var $qty;
- var $qty_shipped;
- var $fk_product;
- var $detail_batch;
- /**
- * Id of warehouse
- * @var int
- */
+ /**
+ * @var float qty asked From llx_expeditiondet
+ */
+ public $qty;
+
+ /**
+ * @var float qty shipped
+ */
+ public $qty_shipped;
+
+ /**
+ * @var int Id of product
+ */
+ public $fk_product;
+ public $detail_batch;
+
+ /**
+ * @var int Id of warehouse
+ */
public $entrepot_id;
- // From llx_commandedet or llx_propaldet
- var $qty_asked;
+ /**
+ * @var float qty asked From llx_commandedet or llx_propaldet
+ */
+ public $qty_asked;
+
+ /**
+ * @deprecated
+ * @see product_ref
+ */
+ public $ref;
+
+ /**
+ * @var string product ref
+ */
public $product_ref;
- public $product_label;
- public $product_desc;
-
- // Invoicing
- var $remise_percent;
- var $total_ht; // Total net of tax
- var $total_ttc; // Total with tax
- var $total_tva; // Total VAT
- var $total_localtax1; // Total Local tax 1
- var $total_localtax2; // Total Local tax 2
-
-
-
- // Deprecated
- /**
- * @deprecated
- * @see fk_origin_line
- */
- var $origin_line_id;
- /**
- * @deprecated
- * @see product_ref
- */
- var $ref;
/**
* @deprecated
* @see product_label
*/
- var $libelle;
+ public $libelle;
+
+ /**
+ * @var string product label
+ */
+ public $product_label;
+
+ /**
+ * @var string product description
+ * @deprecated
+ * @see product_desc
+ */
+ public $desc;
+
+ /**
+ * @var string product description
+ */
+ public $product_desc;
+
+ /**
+ * @var float weight
+ */
+ public $weight;
+ public $weight_units;
+
+ /**
+ * @var float weight
+ */
+ public $length;
+ public $length_units;
+
+ /**
+ * @var float weight
+ */
+ public $surface;
+ public $surface_units;
+
+ /**
+ * @var float weight
+ */
+ public $volume;
+ public $volume_units;
+
+ // Invoicing
+ public $remise_percent;
+ public $tva_tx;
+
+ /**
+ * @var float total without tax
+ */
+ public $total_ht;
+
+ /**
+ * @var float total with tax
+ */
+ public $total_ttc;
+
+ /**
+ * @var float total vat
+ */
+ public $total_tva;
+
+ /**
+ * @var float total localtax 1
+ */
+ public $total_localtax1;
+
+ /**
+ * @var float total localtax 2
+ */
+ public $total_localtax2;
+
/**
* Constructor
@@ -2454,7 +2549,7 @@ class ExpeditionLigne extends CommonObjectLine
*
* @param User $user User that modify
* @param int $notrigger 1 = disable triggers
- * @return int <0 if KO, line id >0 if OK
+ * @return int <0 if KO, line id >0 if OK
*/
function insert($user=null, $notrigger=0)
{
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index acc2b5e1142..ce31e760b7f 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -265,7 +265,6 @@ if ($id > 0 || ! empty($ref))
$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break;
}
-
}
// End of page
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 327a9394b77..c3632ca57fd 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -160,7 +160,6 @@ if (empty($reshook))
setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
$error++;
}
-
}
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 33e1dd97f7b..920b5508e59 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -215,7 +215,6 @@ if (empty($reshook))
}
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
-
}
/*
@@ -257,7 +256,6 @@ if ($id > 0 || ! empty($ref))
if ($action == 'cloture')
{
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture");
-
}
// Call Hook formConfirm
@@ -908,7 +906,6 @@ if ($id > 0 || ! empty($ref))
print '
';
$somethingshown=1;
-
}
else
{
diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php
index a167a447d7d..43cf63cd3b3 100644
--- a/htdocs/expedition/stats/index.php
+++ b/htdocs/expedition/stats/index.php
@@ -259,6 +259,8 @@ print '
';
print '
';
//}
+
+print '
';
print '
';
print '';
print ''.$langs->trans("Year").' ';
@@ -298,6 +300,7 @@ foreach ($data as $val)
}
print '
';
+print '
';
print '
';
diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php
index 27b01cc6f55..f716e06a5b2 100644
--- a/htdocs/expedition/stats/month.php
+++ b/htdocs/expedition/stats/month.php
@@ -27,6 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionstats.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
+$year = GETPOST('year', 'int');
+
/*
* View
@@ -39,10 +41,10 @@ $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
$mesg = '';
-print load_fiche_titre($langs->trans("StatisticsOfSendings").' '.$_GET["year"], $mesg);
+print load_fiche_titre($langs->trans("StatisticsOfSendings").' '.$year, $mesg);
$stats = new ExpeditionStats($db);
-$data = $stats->getNbExpeditionByMonth($_GET["year"]);
+$data = $stats->getNbExpeditionByMonth($year);
dol_mkdir($conf->expedition->dir_temp);
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 62315912209..d16674f67d0 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -356,7 +356,10 @@ if (empty($reshook))
$filename=array(); $filedir=array(); $mimetype=array();
// SUBJECT
- $subject = $langs->transnoentities("ExpenseReportWaitingForApproval");
+ $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
+
+ $subject = $societeName." - ".$langs->transnoentities("ExpenseReportWaitingForApproval");
// CONTENT
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
@@ -472,7 +475,10 @@ if (empty($reshook))
$filename=array(); $filedir=array(); $mimetype=array();
// SUBJECT
- $subject = $langs->transnoentities("ExpenseReportWaitingForReApproval");
+ $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
+
+ $subject = $societeName." - ".$langs->transnoentities("ExpenseReportWaitingForReApproval");
// CONTENT
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
@@ -594,7 +600,10 @@ if (empty($reshook))
$filename=array(); $filedir=array(); $mimetype=array();
// SUBJECT
- $subject = $langs->transnoentities("ExpenseReportApproved");
+ $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
+
+ $subject = $societeName." - ".$langs->transnoentities("ExpenseReportApproved");
// CONTENT
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
@@ -713,7 +722,10 @@ if (empty($reshook))
$filename=array(); $filedir=array(); $mimetype=array();
// SUBJECT
- $subject = $langs->transnoentities("ExpenseReportRefused");
+ $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
+
+ $subject = $societeName." - ".$langs->transnoentities("ExpenseReportRefused");
// CONTENT
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
@@ -842,7 +854,10 @@ if (empty($reshook))
$filename=array(); $filedir=array(); $mimetype=array();
// SUBJECT
- $subject = $langs->transnoentities("ExpenseReportCanceled");
+ $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
+
+ $subject = $societeName." - ".$langs->transnoentities("ExpenseReportCanceled");
// CONTENT
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
@@ -1008,19 +1023,15 @@ if (empty($reshook))
$filename=array(); $filedir=array(); $mimetype=array();
// SUBJECT
- $subject = $langs->transnoentities("ExpenseReportPaid");
+ $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
+
+ $subject = $societeName." - ".$langs->transnoentities("ExpenseReportPaid");
// CONTENT
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
$message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
- // CONTENT
- $message = "Bonjour {$destinataire->firstname},\n\n";
- $message.= "Votre note de frais \"{$object->ref}\" vient d'être payée.\n";
- $message.= "- Payeur : {$expediteur->firstname} {$expediteur->lastname}\n";
- $message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
- $message.= "Bien cordialement,\n' SI";
-
// Generate pdf before attachment
$object->setDocModel($user,"");
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
@@ -1167,7 +1178,6 @@ if (empty($reshook))
unset($fk_projet);
unset($date);
-
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -1559,7 +1569,6 @@ else
$userfee->fetch($user->id);
print $userfee->getNomUrl(-1);
print '';
-
}
// Other attributes
@@ -2232,17 +2241,13 @@ else
print '';
dol_fiche_end();
-
} // end edit or not edit
-
} // end of if result
else
{
dol_print_error($db);
}
-
} //fin si id > 0
-
}
/*
@@ -2456,7 +2461,6 @@ if ($action != 'presend')
$somethingshown = $formactions->showactions($object, 'expensereport', null);
print '
';
-
}
// Presend form
diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php
index 80c22fb961a..e6475665fb8 100644
--- a/htdocs/expensereport/class/api_expensereports.class.php
+++ b/htdocs/expensereport/class/api_expensereports.class.php
@@ -522,7 +522,6 @@ class ExpenseReports extends DolibarrApi
if (!isset($data[$field]))
throw new RestException(400, "$field field missing");
$expensereport[$field] = $data[$field];
-
}
return $expensereport;
}
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 6cc7b13ee7c..2b343dd0074 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -719,7 +719,6 @@ class ExpenseReport extends CommonObject
$auser->fetch($obj->fk_user_approve);
$this->user_approve = $auser;
}
-
}
$this->db->free($resql);
}
@@ -891,7 +890,6 @@ class ExpenseReport extends CommonObject
print '
'.$langs->trans("TotalTTC").' : '.price($total_TTC).' ';
print '
';
print '';
-
}
else
{
diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php
index 35f1fef7b5b..605affed253 100644
--- a/htdocs/expensereport/class/paymentexpensereport.class.php
+++ b/htdocs/expensereport/class/paymentexpensereport.class.php
@@ -165,7 +165,6 @@ class PaymentExpenseReport extends CommonObject
{
$error++;
}
-
}
if ($totalamount != 0 && ! $error)
diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php
index 16db5311028..6cfb3a2f7bc 100644
--- a/htdocs/expensereport/document.php
+++ b/htdocs/expensereport/document.php
@@ -132,7 +132,6 @@ if ($object->id)
$permtoedit = $user->rights->expensereport->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
-
}
else
{
diff --git a/htdocs/expensereport/export_csv.php b/htdocs/expensereport/export_csv.php
index f018a23e478..3a104ca77b4 100644
--- a/htdocs/expensereport/export_csv.php
+++ b/htdocs/expensereport/export_csv.php
@@ -60,7 +60,6 @@ if($num < 1) {
$insert.= ")";
$req = $db->query($insert);
-
}
@@ -176,7 +175,6 @@ if (isset($_POST['action']))
$ligne.= "--->, {$objet2->rowid}, {$objet2->libelle}, {$objet2->comments}, {$objet2->total_ht}, {$objet2->total_tva}, {$objet2->total_ttc}\n";
}
}
-
}
$ligne = $outputlangs->convToOutputCharset($ligne);
@@ -185,11 +183,9 @@ if (isset($_POST['action']))
fclose($open);
print '
Télécharger le fichier expensereport-'.$dateselected.'.csv ';
-
} else {
print '
'.$langs->trans('NoTripsToExportCSV').' ';
-
}
}
}
diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php
index 758dd89afe2..9a947b8596e 100644
--- a/htdocs/expensereport/index.php
+++ b/htdocs/expensereport/index.php
@@ -219,7 +219,6 @@ if ($result)
$i++;
}
-
}
else
{
diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php
index 88272072ada..f75a0f8bb31 100644
--- a/htdocs/expensereport/payment/card.php
+++ b/htdocs/expensereport/payment/card.php
@@ -129,7 +129,6 @@ dol_fiche_head($head, 'payment', $langs->trans("ExpenseReportPayment"), -1, 'pay
if ($action == 'delete')
{
print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
-
}
/*
@@ -139,7 +138,6 @@ if ($action == 'valide')
{
$facid = $_GET['facid'];
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
-
}
$linkback = '';
diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php
index 5136dff3cce..046bb522ae2 100644
--- a/htdocs/expensereport/payment/payment.php
+++ b/htdocs/expensereport/payment/payment.php
@@ -150,7 +150,6 @@ if ($action == 'add_payment')
$error++;
}
}
-
}
if (! $error)
diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php
index b97129a5779..e53757be1db 100644
--- a/htdocs/expensereport/stats/index.php
+++ b/htdocs/expensereport/stats/index.php
@@ -246,6 +246,7 @@ print '';
print '';
print '
';
+print '
';
print '
';
print '';
print ''.$langs->trans("Year").' ';
@@ -281,7 +282,7 @@ foreach ($data as $val)
}
print '
';
-
+print '
';
print '
';
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index 6d65418be3c..f0060ffd029 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -208,7 +208,6 @@ if ($action=='selectfield') // Selection of field at step 2
setEventMessages($warnings, null, 'warnings');
}
-
}
if ($action=='unselectfield')
{
@@ -683,7 +682,6 @@ if ($step == 2 && $datatoexport)
}
print '
';
-
}
if ($step == 3 && $datatoexport)
@@ -858,7 +856,6 @@ if ($step == 3 && $datatoexport)
// il n'est pas obligatoire de filtrer les champs
print '
'.$langs->trans("NextStep").' ';
print '
';
-
}
if ($step == 4 && $datatoexport)
@@ -1162,7 +1159,6 @@ if ($step == 5 && $datatoexport)
if ($action == 'remove_file')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
-
}
print '
';
diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php
index 66f693858c9..0113f7fbea6 100644
--- a/htdocs/fichinter/card-rec.php
+++ b/htdocs/fichinter/card-rec.php
@@ -420,7 +420,6 @@ if ($action == 'create') {
$i++;
}
$db->free($result);
-
} else
print $db->error();
print "";
@@ -439,7 +438,6 @@ if ($action == 'create') {
}
else
dol_print_error('', "Error, no invoice ".$object->id);
-
} elseif ($action == 'selsocforcreatefrommodel') {
print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'title_commercial.png');
dol_fiche_head('');
@@ -574,11 +572,9 @@ if ($action == 'create') {
print $contratstatic->getNomUrl(0, '', 1);
} else
print " ";
-
}
print '';
print '';
-
}
print "";
print '
';
@@ -775,7 +771,6 @@ if ($action == 'create') {
print '
';
} else
print $langs->trans("ErrorRecordNotFound");
-
} else {
/*
* List mode
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 75866d586f6..5896a5c5723 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -378,10 +378,8 @@ if (empty($reshook))
$error++;
break;
}
-
}
}
-
}
else
{
@@ -1099,7 +1097,6 @@ if ($action == 'create')
print '';
}
-
}
else if ($id > 0 || ! empty($ref))
{
@@ -1471,8 +1468,6 @@ else if ($id > 0 || ! empty($ref))
$line->fetch_optionals();
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>5));
-
-
}
// Line in update mode
@@ -1519,8 +1514,6 @@ else if ($id > 0 || ! empty($ref))
$line->fetch_optionals();
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>5));
-
-
}
$i++;
@@ -1711,7 +1704,6 @@ else if ($id > 0 || ! empty($ref))
print '
';
}
-
}
}
}
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index d8be14c298a..05a139e2a9a 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -882,7 +882,6 @@ class Fichinter extends CommonObject
$muser->fetch($obj->fk_user_modification);
$this->user_modification = $muser;
}
-
}
$this->db->free($resql);
}
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index d3b2ea6f78e..b69aa5952fa 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -185,7 +185,6 @@ if ($id > 0 || ! empty($ref))
$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break;
}
-
}
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index d52ed81da48..42273785a61 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -168,7 +168,6 @@ if ($object->id)
$permtoedit = $user->rights->ficheinter->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
-
}
else
{
diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php
index b3d5247e67d..f4df5f3c5f8 100644
--- a/htdocs/fichinter/stats/index.php
+++ b/htdocs/fichinter/stats/index.php
@@ -271,6 +271,7 @@ print '
';
print '
';
//}
+print '
';
print '
';
print '';
print ''.$langs->trans("Year").' ';
@@ -316,6 +317,7 @@ foreach ($data as $val)
}
print '
';
+print '
';
print '
';
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index ce9665cc6c8..ced75842606 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -2132,7 +2132,6 @@ class CommandeFournisseur extends CommonOrder
$this->errors[]='ErrorCantSetReceptionToTotalDoneWithReceptionToApprove';
dol_syslog('ErrorCantSetReceptionToTotalDoneWithReceptionToApprove', LOG_DEBUG);
}
-
}
if (! $error && ! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS_NEED_APPROVE) && ($type == 'tot')) // Accept to move to reception done, only if status of all line are ok (refuse denied)
{
@@ -3088,7 +3087,6 @@ class CommandeFournisseur extends CommonOrder
{
$close++;
}
-
}
}
@@ -3112,8 +3110,6 @@ class CommandeFournisseur extends CommonOrder
}
return 4;
}
-
-
}
else
{//all the products are not received
@@ -3123,7 +3119,6 @@ class CommandeFournisseur extends CommonOrder
}
return 4;
}
-
}
else
{
diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
index 2bcdce36b3c..c7b5d00c797 100644
--- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
@@ -279,8 +279,6 @@ class CommandeFournisseurDispatch extends CommonObject
$this->batch = $obj->batch;
$this->eatby = $this->db->jdate($obj->eatby);
$this->sellby = $this->db->jdate($obj->sellby);
-
-
}
$this->db->free($resql);
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index f4c37a1113c..58230038fcc 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -680,7 +680,6 @@ class FactureFournisseur extends CommonInvoice
$this->error=$this->db->lasterror();
return -3;
}
-
}
else
{
@@ -3152,7 +3151,6 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->db->commit();
return $this->id;
-
}
else
{
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index fcf7332dbd0..a366faa0400 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -262,7 +262,6 @@ class PaiementFourn extends Paiement
$this->error=$this->db->lasterror();
$error++;
}
-
}
else
{
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 134856112d4..70fcaf004fb 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -221,7 +221,6 @@ if (empty($reshook))
//$newstatus=3; // Submited
// TODO If there is at least one reception, we can set to Received->Received partially
$newstatus=4; // Received partially
-
}
else if ($object->statut == 6) $newstatus=2; // Canceled->Approved
else if ($object->statut == 7) $newstatus=3; // Canceled->Process running
@@ -700,7 +699,6 @@ if (empty($reshook))
dol_print_error($db,$object->error);
exit;
}
-
}
// Remove a product line
@@ -1443,7 +1441,6 @@ if ($action=='create')
// Object source contacts list
$srccontactslist = $objectsrc->liste_contact(- 1, 'external', 1);
-
}
else
{
@@ -1700,7 +1697,6 @@ elseif (! empty($object->id))
if ($action == 'delete')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2);
-
}
// Clone confirmation
@@ -1712,7 +1708,6 @@ elseif (! empty($object->id))
);
// Paiement incomplet. On demande si motif = escompte ou autre
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);
-
}
// Confirmation de la validation
@@ -1791,14 +1786,12 @@ elseif (! empty($object->id))
if ($action == 'refuse')
{
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1);
-
}
// Confirmation de l'annulation
if ($action == 'cancel')
{
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1);
-
}
// Confirmation de l'envoi de la commande
@@ -1806,7 +1799,6 @@ elseif (! empty($object->id))
{
$date_com = dol_mktime(GETPOST('rehour'),GETPOST('remin'),GETPOST('resec'),GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear"));
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2);
-
}
// Confirmation to delete line
@@ -2449,7 +2441,6 @@ elseif (! empty($object->id))
{
print '
id.'&action=delete">'.$langs->trans("Delete").' ';
}
-
}
print "
";
@@ -2724,7 +2715,6 @@ elseif (! empty($object->id))
}
}
}
-
}
elseif ($user_status_code == "PERMISSION_DENIED")
{
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index 85739bdb6ef..c69c92ead29 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -192,7 +192,6 @@ if ($id > 0 || ! empty($ref))
// Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';
-
}
else
{
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 8aa4da9c307..eb299d6a94d 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -175,7 +175,6 @@ if ($object->id > 0)
$permtoedit = $user->rights->fournisseur->commande->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
-
}
else
{
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 06857526731..7158d7b2c0e 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -263,7 +263,6 @@ if (empty($reshook))
$res = $object->create($user);
if($res > 0) $nb_bills_created++;
-
}
if ($object->id > 0)
diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php
index 9b9743f201f..5456627384e 100644
--- a/htdocs/fourn/commande/orderstoinvoice.php
+++ b/htdocs/fourn/commande/orderstoinvoice.php
@@ -261,7 +261,6 @@ if (($action == 'create' || $action == 'add') && ! $error) {
$error++;
break;
}
-
}
}
@@ -270,7 +269,6 @@ if (($action == 'create' || $action == 'add') && ! $error) {
header('Location: ' . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $id);
exit();
}
-
} else {
$db->rollback();
$action = 'create';
diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php
index a6adb0bad27..3225ce63714 100644
--- a/htdocs/fourn/contact.php
+++ b/htdocs/fourn/contact.php
@@ -123,7 +123,6 @@ if ($result)
}
print "";
$db->free($result);
-
}
else
{
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index af7f21f3628..9df540da197 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -525,7 +525,6 @@ if (empty($reshook))
{
$error++;
}
-
}
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT)
{
@@ -543,7 +542,6 @@ if (empty($reshook))
break;
}
}
-
}
if (empty($error))
@@ -757,7 +755,6 @@ if (empty($reshook))
$object->update_price(1);
}
-
}
if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0)
@@ -1669,7 +1666,6 @@ if ($action == 'create')
// Replicate extrafields
$objectsrc->fetch_optionals($originid);
$object->array_options = $objectsrc->array_options;
-
}
}
else
@@ -2257,7 +2253,6 @@ else
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1);
-
}
// Confirmation edit (back to draft)
@@ -2293,27 +2288,23 @@ else
);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateBill'), $langs->trans('ConfirmUnvalidateBill', $object->ref), 'confirm_edit', $formquestion, 1, 1);
-
}
// Confirmation set paid
if ($action == 'paid')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1);
-
}
// Confirmation de la suppression de la facture fournisseur
if ($action == 'delete')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
-
}
if ($action == 'deletepaiement')
{
$payment_id = GETPOST('paiement_id');
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 1);
-
}
// Confirmation to delete line
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index cb17be828ca..58e5630c0d6 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -266,7 +266,6 @@ if ($id > 0 || ! empty($ref))
// Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';
-
}
else
{
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 4239331d0a6..d38a7992bd8 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -157,7 +157,6 @@ if ($object->id > 0)
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
-
}
print '
';
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index 2e14a5187e4..4582f403b02 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -294,7 +294,6 @@ if ($user->rights->fournisseur->facture->lire)
{
dol_print_error($db);
}
-
}
// End of page
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 3fa525415bb..e1bd120b0b4 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -1132,7 +1132,6 @@ if ($resql)
else print ' ';
}
print '';
-
}
}
diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php
index 22b3e307ab3..9cc5fb27b84 100644
--- a/htdocs/fourn/paiement/card.php
+++ b/htdocs/fourn/paiement/card.php
@@ -166,7 +166,6 @@ if ($result > 0)
if ($action == 'delete')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
-
}
/*
@@ -175,7 +174,6 @@ if ($result > 0)
if ($action == 'valide')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
-
}
$linkback = '' . $langs->trans("BackToList") . ' ';
@@ -345,7 +343,6 @@ if ($result > 0)
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
{
print ''.$langs->trans('Valid').' ';
-
}
}
}
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 7c9527f3a9a..64b9fb0a8ea 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -235,7 +235,6 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De
$action='';
}
}
-
}
else
{
@@ -339,7 +338,6 @@ if ($action == 'download')
{
setEventMessages($langs->transnoentitiesnoconv('FailedToGetFile',$remotefile), null, 'errors');
}
-
}
else
{
@@ -408,7 +406,6 @@ else
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
-
}
// Confirmation de la suppression d'une ligne categorie
@@ -610,7 +607,6 @@ else
$i++;
$nbofentries++;
}
-
}
print "
";
@@ -808,7 +804,6 @@ function ftp_isdir($connect_id,$dir)
{
ftp_cdup($connect_id);
return 1;
-
}
else
{
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 9c89124c577..a1bf6e3fa6a 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
// Get parameters
$action=GETPOST('action', 'alpha');
$id=GETPOST('id', 'int');
+$ref=GETPOST('ref', 'alpha');
$fuserid = (GETPOST('fuserid','int')?GETPOST('fuserid','int'):$user->id);
// Protection if external user
@@ -325,7 +326,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights-
}
}
-// Si envoi de la demande
+// Action validate (+ send email for approval)
if ($action == 'confirm_send')
{
$object = new Holiday($db);
@@ -745,7 +746,6 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes')
}
}
}
-
}
@@ -761,7 +761,7 @@ $listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->tran
llxHeader('', $langs->trans('CPTitreMenu'));
-if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create')
+if ((empty($id) && empty($ref)) || $action == 'add' || $action == 'request' || $action == 'create')
{
// Si l'utilisateur n'a pas le droit de faire une demande
if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
@@ -998,9 +998,9 @@ else
else
{
// Affichage de la fiche d'une demande de congés payés
- if ($id > 0)
+ if (($id > 0) || $ref)
{
- $object->fetch($id);
+ $result = $object->fetch($id, $ref);
$valideur = new User($db);
$valideur->fetch($object->fk_validator);
@@ -1064,7 +1064,7 @@ else
$linkback='
'.$langs->trans("BackToList").' ';
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref');
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
print '
';
@@ -1260,7 +1260,7 @@ else
}
// Si envoi en validation
- if ($action == 'sendToValidate' && $object->statut == 1)
+ if ($action == 'sendToValidate' && $object->statut == Holiday::STATUS_DRAFT)
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1);
}
@@ -1291,10 +1291,10 @@ else
}
- if ($action == 'edit' && $object->statut == 1)
+ if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT)
{
print '
';
- if ($cancreate && $object->statut == 1)
+ if ($cancreate && $object->statut == Holiday::STATUS_DRAFT)
{
print ' ';
}
@@ -1346,23 +1346,19 @@ else
print '
';
}
-
} else {
print '
';
print $langs->trans('ErrorUserViewCP');
print ' ';
print '
';
}
-
} else {
print '
';
print $langs->trans('ErrorIDFicheCP');
print ' ';
print '
';
}
-
}
-
}
// End of page
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index bc964ec7fc6..6dd49b52a93 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -4,6 +4,7 @@
* Copyright (C) 2012-2016 Regis Houssin
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2016 Juanjo Menent
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -57,7 +58,7 @@ class Holiday extends CommonObject
/**
* @deprecated
- * @see id
+ * @see $id
*/
public $rowid;
@@ -77,7 +78,7 @@ class Holiday extends CommonObject
public $date_fin=''; // Date end in PHP server TZ
public $date_debut_gmt=''; // Date start in GMT
public $date_fin_gmt=''; // Date end in GMT
- public $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
+ public $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
public $statut=''; // 1=draft, 2=validated, 3=approved
/**
@@ -154,6 +155,67 @@ class Holiday extends CommonObject
}
+ /**
+ * Returns the reference to the following non used Order depending on the active numbering module
+ * defined into HOLIDAY_ADDON
+ *
+ * @param Societe $objsoc third party object
+ * @return string Holiday free reference
+ */
+ function getNextNumRef($objsoc)
+ {
+ global $langs, $conf;
+ $langs->load("order");
+
+ if (empty($conf->global->HOLIDAY_ADDON))
+ {
+ $conf->global->HOLIDAY_ADDON = 'mod_holiday_madonna';
+ }
+
+ if (! empty($conf->global->HOLIDAY_ADDON))
+ {
+ $mybool=false;
+
+ $file = $conf->global->HOLIDAY_ADDON.".php";
+ $classname = $conf->global->HOLIDAY_ADDON;
+
+ // Include file with class
+ $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
+ foreach ($dirmodels as $reldir)
+ {
+ $dir = dol_buildpath($reldir."core/modules/holiday/");
+
+ // Load file with numbering class (if found)
+ $mybool|=@include_once $dir.$file;
+ }
+
+ if ($mybool === false)
+ {
+ dol_print_error('',"Failed to include file ".$file);
+ return '';
+ }
+
+ $obj = new $classname();
+ $numref = $obj->getNextValue($objsoc,$this);
+
+ if ($numref != "")
+ {
+ return $numref;
+ }
+ else
+ {
+ $this->error=$obj->error;
+ //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
+ return "";
+ }
+ }
+ else
+ {
+ print $langs->trans("Error")." ".$langs->trans("Error_HOLIDAY_ADDON_NotDefined");
+ return "";
+ }
+ }
+
/**
* Update balance of vacations and check table of users for holidays is complete. If not complete.
*
@@ -271,14 +333,16 @@ class Holiday extends CommonObject
* Load object in memory from database
*
* @param int $id Id object
+ * @param string $ref Ref object
* @return int <0 if KO, >0 if OK
*/
- function fetch($id)
+ function fetch($id, $ref='')
{
global $langs;
$sql = "SELECT";
$sql.= " cp.rowid,";
+ $sql.= " cp.ref,";
$sql.= " cp.fk_user,";
$sql.= " cp.date_create,";
$sql.= " cp.description,";
@@ -300,7 +364,8 @@ class Holiday extends CommonObject
$sql.= " cp.fk_type,";
$sql.= " cp.entity";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp";
- $sql.= " WHERE cp.rowid = ".$id;
+ if ($id > 0) $sql.= " WHERE cp.rowid = ".$id;
+ else $sql.=" WHERE cp.ref = '".$this->db->escape($ref)."'";
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
@@ -312,7 +377,7 @@ class Holiday extends CommonObject
$this->id = $obj->rowid;
$this->rowid = $obj->rowid; // deprecated
- $this->ref = $obj->rowid;
+ $this->ref = ($obj->ref?$obj->ref:$obj->rowid);
$this->fk_user = $obj->fk_user;
$this->date_create = $this->db->jdate($obj->date_create);
$this->description = $obj->description;
@@ -361,6 +426,7 @@ class Holiday extends CommonObject
$sql = "SELECT";
$sql.= " cp.rowid,";
+ $sql.= " cp.ref,";
$sql.= " cp.fk_user,";
$sql.= " cp.fk_type,";
@@ -427,7 +493,8 @@ class Holiday extends CommonObject
$obj = $this->db->fetch_object($resql);
$tab_result[$i]['rowid'] = $obj->rowid;
- $tab_result[$i]['ref'] = $obj->rowid;
+ $tab_result[$i]['ref'] = ($obj->ref?$obj->ref:$obj->rowid);
+
$tab_result[$i]['fk_user'] = $obj->fk_user;
$tab_result[$i]['fk_type'] = $obj->fk_type;
$tab_result[$i]['date_create'] = $this->db->jdate($obj->date_create);
@@ -487,6 +554,7 @@ class Holiday extends CommonObject
$sql = "SELECT";
$sql.= " cp.rowid,";
+ $sql.= " cp.ref,";
$sql.= " cp.fk_user,";
$sql.= " cp.fk_type,";
@@ -552,7 +620,7 @@ class Holiday extends CommonObject
$obj = $this->db->fetch_object($resql);
$tab_result[$i]['rowid'] = $obj->rowid;
- $tab_result[$i]['ref'] = $obj->rowid;
+ $tab_result[$i]['ref'] = ($obj->ref?$obj->ref:$obj->rowid);
$tab_result[$i]['fk_user'] = $obj->fk_user;
$tab_result[$i]['fk_type'] = $obj->fk_type;
$tab_result[$i]['date_create'] = $this->db->jdate($obj->date_create);
@@ -611,68 +679,25 @@ class Holiday extends CommonObject
global $conf, $langs;
$error=0;
- // Update request
+ // Define new ref
+ if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref) || $this->ref == $this->id))
+ {
+ $num = $this->getNextNumRef(null);
+ }
+ else
+ {
+ $num = $this->ref;
+ }
+ $this->newref = $num;
+
+ // Update status
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET";
-
- $sql.= " description= '".$this->db->escape($this->description)."',";
-
- if(!empty($this->date_debut)) {
- $sql.= " date_debut = '".$this->db->idate($this->date_debut)."',";
- } else {
- $error++;
- }
- if(!empty($this->date_fin)) {
- $sql.= " date_fin = '".$this->db->idate($this->date_fin)."',";
- } else {
- $error++;
- }
- $sql.= " halfday = ".$this->halfday.",";
if(!empty($this->statut) && is_numeric($this->statut)) {
$sql.= " statut = ".$this->statut.",";
} else {
$error++;
}
- if(!empty($this->fk_validator)) {
- $sql.= " fk_validator = '".$this->db->escape($this->fk_validator)."',";
- } else {
- $error++;
- }
- if(!empty($this->date_valid)) {
- $sql.= " date_valid = '".$this->db->idate($this->date_valid)."',";
- } else {
- $sql.= " date_valid = NULL,";
- }
- if(!empty($this->fk_user_valid)) {
- $sql.= " fk_user_valid = '".$this->db->escape($this->fk_user_valid)."',";
- } else {
- $sql.= " fk_user_valid = NULL,";
- }
- if(!empty($this->date_refuse)) {
- $sql.= " date_refuse = '".$this->db->idate($this->date_refuse)."',";
- } else {
- $sql.= " date_refuse = NULL,";
- }
- if(!empty($this->fk_user_refuse)) {
- $sql.= " fk_user_refuse = '".$this->db->escape($this->fk_user_refuse)."',";
- } else {
- $sql.= " fk_user_refuse = NULL,";
- }
- if(!empty($this->date_cancel)) {
- $sql.= " date_cancel = '".$this->db->idate($this->date_cancel)."',";
- } else {
- $sql.= " date_cancel = NULL,";
- }
- if(!empty($this->fk_user_cancel)) {
- $sql.= " fk_user_cancel = '".$this->db->escape($this->fk_user_cancel)."',";
- } else {
- $sql.= " fk_user_cancel = NULL,";
- }
- if(!empty($this->detail_refuse)) {
- $sql.= " detail_refuse = '".$this->db->escape($this->detail_refuse)."'";
- } else {
- $sql.= " detail_refuse = NULL";
- }
-
+ $sql.= " ref = '".$num."'";
$sql.= " WHERE rowid= ".$this->id;
$this->db->begin();
@@ -1696,7 +1721,6 @@ class Holiday extends CommonObject
$this->error="Error ".$this->db->lasterror();
return -1;
}
-
}
else
{
@@ -1738,7 +1762,6 @@ class Holiday extends CommonObject
return -1;
}
}
-
}
else
{ // Si faux donc return array
diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php
index 655a3ff5d2a..5f33e24e8c6 100644
--- a/htdocs/holiday/document.php
+++ b/htdocs/holiday/document.php
@@ -111,7 +111,7 @@ if ($object->id)
$linkback=''.$langs->trans("BackToList").' ';
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref');
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
print '';
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index fcd5cc9d8b0..f155f513a18 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -512,7 +512,7 @@ print '';
print "\n";
print '
';
-print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"cp.rowid","",$param,'',$sortfield,$sortorder);
+print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"cp.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre("DateCreateCP",$_SERVER["PHP_SELF"],"cp.date_create","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("Employee",$_SERVER["PHP_SELF"],"cp.fk_user","",$param,'',$sortfield,$sortorder);
print_liste_field_titre("ValidatorCP",$_SERVER["PHP_SELF"],"cp.fk_validator","",$param,'',$sortfield,$sortorder);
@@ -546,7 +546,7 @@ elseif (! empty($holiday->holiday) && !empty($mysoc->country_id))
{
// Leave request
$holidaystatic->id=$infos_CP['rowid'];
- $holidaystatic->ref=$infos_CP['rowid'];
+ $holidaystatic->ref=($infos_CP['ref']?$infos_CP['ref']:$infos_CP['rowid']);
// User
$userstatic->id=$infos_CP['fk_user'];
@@ -605,7 +605,6 @@ elseif (! empty($holiday->holiday) && !empty($mysoc->country_id))
print '';
print ' '."\n";
-
}
}
diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php
index e9b98deb1f9..53fab6a825f 100644
--- a/htdocs/holiday/month_report.php
+++ b/htdocs/holiday/month_report.php
@@ -189,7 +189,6 @@ else
print '' . dol_escape_htmltag(dolGetFirstLineOfText($obj->description)) . ' ';
print '';
}
-
}
print '';
print '';
diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php
index c9cc2e6c16f..124d26baf92 100644
--- a/htdocs/holiday/view_log.php
+++ b/htdocs/holiday/view_log.php
@@ -124,7 +124,6 @@ foreach($cp->logs as $logs_CP)
print ''.price2num($logs_CP['prev_solde'],5).' '.$langs->trans('days').' ';
print ''.price2num($logs_CP['new_solde'],5).' '.$langs->trans('days').' ';
print ''."\n";
-
}
if ($log_holiday == '2')
diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php
index f7ebef5e623..5b15c1fb8bc 100644
--- a/htdocs/hrm/admin/admin_establishment.php
+++ b/htdocs/hrm/admin/admin_establishment.php
@@ -124,7 +124,6 @@ if ($result)
$i++;
}
-
}
else
{
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
index 56a6c20176a..d7f591da027 100644
--- a/htdocs/hrm/establishment/card.php
+++ b/htdocs/hrm/establishment/card.php
@@ -334,7 +334,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteEstablishment"),$langs->trans("ConfirmDeleteEstablishment"),"confirm_delete");
-
}
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index 6d1e16433cf..45d10d16d8b 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -236,7 +236,6 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
$i++;
}
-
}
else
{
@@ -309,7 +308,6 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
$i++;
}
-
}
else
{
@@ -382,7 +380,6 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
$i++;
}
-
}
else
{
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index a9c1fc2317a..54aaa8a60a5 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -488,7 +488,6 @@ if ($step == 3 && $datatoimport)
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
-
}
print '
';
@@ -662,7 +661,6 @@ if ($step == 4 && $datatoimport)
header("Location: ".$_SERVER["PHP_SELF"].'?step=3'.$param.'&filetoimport='.urlencode($relativepath));
exit;
}
-
}
if (GETPOST('update')) {
@@ -1162,7 +1160,6 @@ if ($step == 4 && $datatoimport)
print '';
print '';
}
-
}
@@ -1609,7 +1606,6 @@ if ($step == 5 && $datatoimport)
print ''.$langs->trans("RunImportFile").' ';
}
print ' ';
-
}
print '';
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index f220978e4db..c2eb06bffb7 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -568,9 +568,7 @@ else
print ''."\n";
print '
';
}
-
}
-
}
print '';
print '
'.$langs->trans("Link").' ';
-
}
print '';
diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php
index 529ad7e33ec..c4b2bb12111 100644
--- a/htdocs/printing/admin/printing.php
+++ b/htdocs/printing/admin/printing.php
@@ -313,7 +313,6 @@ if ($mode == 'test' && $user->admin)
else {
print $langs->trans('PleaseConfigureDriverfromList');
}
-
} else {
print $langs->trans('PleaseSelectaDriverfromList');
}
@@ -357,7 +356,6 @@ if ($mode == 'userconf' && $user->admin)
print '';
dol_fiche_end();
-
}
// End of page
diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php
index e0faaaf83e5..730a8fd31f2 100644
--- a/htdocs/product/admin/price_rules.php
+++ b/htdocs/product/admin/price_rules.php
@@ -92,7 +92,6 @@ if ($_POST) {
setEventMessages($langs->trans('ErrorSavingChanges'), null, 'errors');
}
}
-
}
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index 2cdb5c1ca52..45f938431c3 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -127,7 +127,6 @@ if ($action == 'other')
$res = dolibarr_set_const($db, $rule, 0, 'chaine', 0, '', $conf->entity);
}
}
-
}
$value = GETPOST('PRODUIT_SOUSPRODUITS','alpha');
diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php
index a153e9f1ab6..b0c62c81d4f 100644
--- a/htdocs/product/admin/product_tools.php
+++ b/htdocs/product/admin/product_tools.php
@@ -267,7 +267,6 @@ if ($action == 'convert')
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
-
}
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index d51a4fa494c..31d2d7509c9 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -477,7 +477,6 @@ if (empty($reshook))
$action = 'edit';
}
}
-
}
}
@@ -1943,7 +1942,6 @@ else
dol_fiche_end();
}
-
}
else if ($action != 'create')
{
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 44222dc3c9e..805d5d214a2 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -2387,7 +2387,6 @@ class Product extends CommonObject
$this->stats_commande['nb']+=$pFather->stats_commande['nb'];
$this->stats_commande['rows']+=$pFather->stats_commande['rows'];
$this->stats_commande['qty']+=$pFather->stats_commande['qty'] * $qtyCoef;
-
}
}
}
@@ -3552,7 +3551,6 @@ class Product extends CommonObject
dol_print_error($this->db);
return -1;
}
-
} else {
return false;
}
@@ -4856,7 +4854,6 @@ class Product extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php
index f2aabb86876..b5d2d639ae4 100644
--- a/htdocs/product/class/propalmergepdfproduct.class.php
+++ b/htdocs/product/class/propalmergepdfproduct.class.php
@@ -207,8 +207,6 @@ class Propalmergepdfproduct extends CommonObject
$this->datec = $this->db->jdate($obj->datec);
$this->tms = $this->db->jdate($obj->tms);
$this->import_key = $obj->import_key;
-
-
}
$this->db->free($resql);
@@ -283,11 +281,7 @@ class Propalmergepdfproduct extends CommonObject
}else {
$this->lines[$obj->file_name]=$line;
}
-
-
}
-
-
}
$this->db->free($resql);
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 5f91a0e369e..d2ef4210e9c 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -407,7 +407,6 @@ if ($id > 0 || ! empty($ref))
{
print '
';
print '
';
-
}
else{
print '
'.$nb_of_subproduct.' ';
@@ -634,7 +633,6 @@ if ($id > 0 || ! empty($ref))
}
$i++;
}
-
}
else
{
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index 0b5b7fa6f16..d0bc7b3f9be 100644
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -113,7 +113,6 @@ if (empty($reshook))
// Action submit/delete file/link
include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
-
}
if ($action=='filemerge')
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 71cf2636661..2089193e208 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -152,7 +152,6 @@ if (! empty($conf->product->enabled))
$statProducts.= '
';
$statProducts.= ''.$langs->trans("ProductsOnSellAndOnBuy").' '.round($prodser[0][3]).' ';
$statProducts.= " ";
-
}
if (! empty($conf->service->enabled))
{
@@ -168,7 +167,6 @@ if (! empty($conf->service->enabled))
$statServices.= '
';
$statServices.= ''.$langs->trans("ServicesOnSellAndOnBuy").' '.round($prodser[1][3]).' ';
$statServices.= " ";
-
}
$total=0;
if ($type == '0')
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index 39df52a8208..1bc98d32d93 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -477,7 +477,6 @@ class Inventory extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/product/inventory/tpl/inventory.tpl.php b/htdocs/product/inventory/tpl/inventory.tpl.php
index 1946e63918d..30dc02a17d6 100644
--- a/htdocs/product/inventory/tpl/inventory.tpl.php
+++ b/htdocs/product/inventory/tpl/inventory.tpl.php
@@ -165,7 +165,6 @@ if (empty($conf) || ! is_object($conf))
global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUI
else print vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true);*/
print '';
}
-
}
else
{
@@ -1410,7 +1409,6 @@ if ($action == 'edit_price' && $object->getRights()->creer)
print ' ';
print '
';
print '';
-
}
}
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index 27ac0c4d522..662873b7cf8 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -317,7 +317,6 @@ if ($resql)
foreach($warehouses_list as &$wh) {
print_liste_field_titre($wh['label'], '', '','','','align="right"');
}
-
}
}
if ($virtualdiffersfromphysical) print_liste_field_titre("VirtualStock",$_SERVER["PHP_SELF"], "",$param,"",'align="right"',$sortfield,$sortorder);
@@ -395,7 +394,6 @@ if ($resql)
print '';
$db->free($resql);
-
}
else
{
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index 518a19d8407..24aa1864a02 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -421,7 +421,6 @@ if ($resql)
print '';
$db->free($resql);
-
}
else
{
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index b24a37c4fe2..25e22faabcc 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -332,7 +332,6 @@ else
print '
'.$langs->trans("ParentWarehouse").' ';
print $e->getNomUrl(3);
print ' ';
-
}
// Description
@@ -567,7 +566,6 @@ else
print '
';
print '
';
print '';
-
}
else
{
@@ -658,7 +656,6 @@ else
print '
';
print '';
-
}
}
}
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index b2a78a9cd3e..3f298aed85d 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -416,11 +416,9 @@ class Entrepot extends CommonObject
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
-
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index 395c192311f..7991477e146 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -469,7 +469,6 @@ class MouvementStock extends CommonObject
{
$fk_product_stock = $this->db->last_insert_id(MAIN_DB_PREFIX."product_stock");
}
-
}
// Update detail stock for batch product
diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php
index 740afcb5f04..aaae328de48 100644
--- a/htdocs/product/stock/class/productstockentrepot.class.php
+++ b/htdocs/product/stock/class/productstockentrepot.class.php
@@ -202,8 +202,6 @@ class ProductStockEntrepot extends CommonObject
$this->seuil_stock_alerte = $obj->seuil_stock_alerte;
$this->desiredstock = $obj->desiredstock;
$this->import_key = $obj->import_key;
-
-
}
// Retreive all extrafield
diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php
index 20054d8896b..c85f40ef9c2 100644
--- a/htdocs/product/stock/index.php
+++ b/htdocs/product/stock/index.php
@@ -97,7 +97,6 @@ if ($result)
$i++;
}
$db->free($result);
-
}
print "";
}
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 07b4f5dcac3..beb3135d9f4 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -88,7 +88,6 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
if ($id > 0 || ! empty($ref))
{
$result = $object->fetch($id, $ref);
-
}
if(empty($id) && !empty($object->id)) $id = $object->id;
@@ -144,7 +143,6 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
$pse->seuil_stock_alerte = $seuil_stock_alerte;
$pse->desiredstock = $desiredstock;
if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs');
-
} else {
// Create
@@ -153,14 +151,11 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
$pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
$pse->desiredstock = GETPOST('desiredstock');
if($pse->create($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseCreated'), null, 'mesgs');
-
}
-
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
-
}
if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->creer))
@@ -171,7 +166,6 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c
if($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs');
$action = '';
-
}
// Set stock limit
@@ -799,7 +793,6 @@ if (empty($reshook))
print '';
}
-
}
@@ -927,7 +920,6 @@ if (! $variants) {
}
}
$i++;
-
}
} else dol_print_error($db);
diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php
index 5ee52ce337a..f72a28dbc90 100644
--- a/htdocs/product/stock/productlot_card.php
+++ b/htdocs/product/stock/productlot_card.php
@@ -256,7 +256,6 @@ if (empty($reshook))
$upload_dir = $conf->productbatch->multidir_output[$conf->entity];
$permissioncreate = $usercancreate;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
-
}
@@ -414,7 +413,6 @@ if (empty($action))
$somethingshown=$formfile->numoffiles;
print '';
-
}
// End of page
diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php
index 6a3925c4a55..1ce4f9ba224 100644
--- a/htdocs/product/stock/productlot_document.php
+++ b/htdocs/product/stock/productlot_document.php
@@ -95,7 +95,6 @@ if (empty($reshook))
// Action submit/delete file/link
include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
-
}
$permtoedit = $user->rights->produit->creer;
@@ -156,8 +155,6 @@ if ($object->id)
$permission = ( $user->rights->produit->creer );
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
-
-
}
else
{
diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php
index 4e3a245060c..09524c5066a 100644
--- a/htdocs/product/stock/valo.php
+++ b/htdocs/product/stock/valo.php
@@ -128,7 +128,6 @@ if ($result)
print ''.price(price2num($totalsell,'MT'),1,$langs,0,0,-1,$conf->currency).' ';
print ' ';
print "\n";
-
}
$db->free($result);
@@ -150,7 +149,6 @@ if ($result)
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_stock&file='.$file;
print ' ';
}
-
}
else
{
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 4c344786553..9f18f644e4c 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -276,7 +276,6 @@ if ($action == 'edit')
print '';
print '';
-
}
else if ($action != 'add')
{
diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php
index 2ed1bb1498f..e43700287cb 100644
--- a/htdocs/projet/activity/index.php
+++ b/htdocs/projet/activity/index.php
@@ -325,7 +325,6 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH))
print '';
print ''.convertSecondToTime($row->nb, 'allhourmin').' ';
print "\n";
-
}
$db->free($resql);
}
@@ -376,7 +375,6 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR))
print '';
print ''.convertSecondToTime($row->nb, 'allhourmin').' ';
print "\n";
-
}
$db->free($resql);
}
@@ -570,7 +568,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
{
dol_print_error($db);
}
-
}
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index e2632fe244e..7aaa6805189 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -333,7 +333,6 @@ if (empty($reshook))
if (GETPOST('socid','int') > 0) $object->fetch_thirdparty(GETPOST('socid','int'));
else unset($object->thirdparty);
}
-
}
// Build doc
diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php
index 6deacab7204..a1f2ce6d26c 100644
--- a/htdocs/projet/class/api_projects.class.php
+++ b/htdocs/projet/class/api_projects.class.php
@@ -598,7 +598,6 @@ class Projects extends DolibarrApi
if (!isset($data[$field]))
throw new RestException(400, "$field field missing");
$object[$field] = $data[$field];
-
}
return $object;
}
diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php
index 294c0f0faae..050e7313e95 100644
--- a/htdocs/projet/class/api_tasks.class.php
+++ b/htdocs/projet/class/api_tasks.class.php
@@ -610,7 +610,6 @@ class Tasks extends DolibarrApi
if (!isset($data[$field]))
throw new RestException(400, "$field field missing");
$object[$field] = $data[$field];
-
}
return $object;
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index eaf1ad6ea67..514abd4c5ec 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -565,11 +565,11 @@ class Project extends CommonObject
if ($type == 'agenda')
{
- $sql = "SELECT id as rowid FROM " . MAIN_DB_PREFIX . "actioncomm WHERE fk_project IN (". $ids .")";
+ $sql = "SELECT id as rowid FROM " . MAIN_DB_PREFIX . "actioncomm WHERE fk_project IN (". $ids .") AND entity IN (".getEntity('agenda').")";
}
elseif ($type == 'expensereport')
{
- $sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND ed.fk_projet IN (". $ids .")";
+ $sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND e.entity IN (".getEntity('expensereport').") AND ed.fk_projet IN (". $ids .")";
}
elseif ($type == 'project_task')
{
@@ -581,11 +581,11 @@ class Project extends CommonObject
}
elseif ($type == 'stock_mouvement')
{
- $sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms WHERE ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1";
+ $sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms, " . MAIN_DB_PREFIX . "entrepot as e WHERE e.rowid = ms.fk_entrepot AND e.entity IN (".getEntity('stock').") AND ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1";
}
else
{
- $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$projectkey." IN (". $ids .")";
+ $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$projectkey." IN (". $ids .") AND entity IN (".getEntity($type).")";
}
if ($dates > 0)
@@ -1501,7 +1501,6 @@ class Project extends CommonObject
$tab_conv_child_parent[$tasktoclone->id] = $new_task_id;
}
}
-
}
//Parse all clone node to be sure to update new parent
@@ -1959,7 +1958,6 @@ class Project extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php
index 472fb26eaf0..9766935d4d0 100644
--- a/htdocs/projet/class/projectstats.class.php
+++ b/htdocs/projet/class/projectstats.class.php
@@ -498,7 +498,6 @@ class ProjectStats extends Stats
} else {
$res[$key]=array($total_row[0],0);
}
-
}
// var_dump($res);print ' ';
return $res;
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index a4ef7965851..c5a7a334eb0 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -1568,7 +1568,6 @@ class Task extends CommonObject
{
$clone_task->date_end = $now + $clone_task->date_end - $orign_project_dt_start;
}
-
}
if (!$clone_prog)
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index 68c9b530c88..4b9aaf58b8b 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -240,6 +240,14 @@ if ($id > 0 || ! empty($ref))
print nl2br($object->description);
print '';
+ // Bill time
+ if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
+ {
+ print ''.$langs->trans("BillTime").' ';
+ print yn($object->bill_time);
+ print ' ';
+ }
+
// Categories
if ($conf->categorie->enabled) {
print ''.$langs->trans("Categories").' ';
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index e585acd7d85..af9f7c2d8fc 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -152,7 +152,6 @@ if ($object->id > 0)
$permission = ($userWrite > 0);
$permtoedit = ($userWrite > 0);
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
-
}
else
{
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index b6398068db1..b8017b45048 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -217,6 +217,14 @@ print ' '.$langs->trans("Description").' ';
print nl2br($object->description);
print ' ';
+// Bill time
+if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
+{
+ print ''.$langs->trans("BillTime").' ';
+ print yn($object->bill_time);
+ print ' ';
+}
+
// Categories
if($conf->categorie->enabled) {
print ''.$langs->trans("Categories").' ';
@@ -451,7 +459,7 @@ $listofreferent=array(
'disableamount'=>0,
'urlnew'=>DOL_URL_ROOT.'/compta/salaries/card.php?action=create&projectid='.$id,
'lang'=>'salaries',
- 'buttonnew'=>'AddSalariesPayment',
+ 'buttonnew'=>'AddSalaryPayment',
'testnew'=>$user->rights->salaries->write,
'test'=>$conf->salaries->enabled && $user->rights->salaries->read),
'variouspayment'=>array(
@@ -489,7 +497,6 @@ $resHook = $hookmanager->executeHooks('completeListOfReferent', $parameters, $ob
if(!empty($hookmanager->resArray)) {
$listofreferent = array_merge($listofreferent, $hookmanager->resArray);
-
}
if ($action=="addelement")
@@ -687,8 +694,8 @@ foreach ($listofreferent as $key => $value)
// and the final balance
print ' ';
print ''.$langs->trans("Profit").' ';
-print ''.price($balance_ht).' ';
-print ''.price($balance_ttc).' ';
+print ''.price(price2num($balance_ht, 'MT')).' ';
+print ''.price(price2num($balance_ttc, 'MT')).' ';
print ' ';
print "";
@@ -873,7 +880,9 @@ foreach ($listofreferent as $key => $value)
{
if (empty($conf->global->PROJECT_DISABLE_UNLINK_FROM_OVERVIEW) || $user->admin) // PROJECT_DISABLE_UNLINK_FROM_OVERVIEW is empty by defaut, so this test true
{
- print 'id . '">' . img_picto($langs->trans('Unlink'), 'unlink') . ' ';
+ print 'id . '" class="reposition">';
+ print img_picto($langs->trans('Unlink'), 'unlink');
+ print ' ';
}
}
print "\n";
@@ -896,16 +905,16 @@ foreach ($listofreferent as $key => $value)
$element_doc = $element->element;
$filename=dol_sanitizeFileName($element->ref);
- $filedir=$conf->{$element_doc}->dir_output . '/' . dol_sanitizeFileName($element->ref);
+ $filedir=$conf->{$element_doc}->multidir_output[$element->entity] . '/' . dol_sanitizeFileName($element->ref);
if ($element_doc === 'order_supplier') {
$element_doc='commande_fournisseur';
- $filedir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($element->ref);
+ $filedir = $conf->fournisseur->commande->multidir_output[$element->entity].'/'.dol_sanitizeFileName($element->ref);
}
else if ($element_doc === 'invoice_supplier') {
$element_doc='facture_fournisseur';
$filename = get_exdir($element->id,2,0,0,$element,'product').dol_sanitizeFileName($element->ref);
- $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($element->id,2,0,0,$element,'invoice_supplier').dol_sanitizeFileName($element->ref);
+ $filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.get_exdir($element->id,2,0,0,$element,'invoice_supplier').dol_sanitizeFileName($element->ref);
}
print ''.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'
';
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index a93fac0edbd..5a13b16560d 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -888,7 +888,6 @@ while ($i < min($num,$limit))
if (! $i) $totalarray['nbfield']++;
print "\n";
-
}
$i++;
diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php
index 46c6248ebd3..831917a76f6 100644
--- a/htdocs/projet/stats/index.php
+++ b/htdocs/projet/stats/index.php
@@ -302,6 +302,7 @@ print '';
print '';
print ' ';
+print '';
print '
';
print '';
print ''.$langs->trans("Year").' ';
@@ -348,6 +349,7 @@ foreach ($data_all_year as $val)
}
print '
';
+print '
';
print '';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index bffe5f4a373..31f860dbf9b 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -91,13 +91,14 @@ $planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60;
$userAccess=0;
-$parameters=array('id'=>$id);
-$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
-if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/*
* Actions
*/
+$parameters=array('id'=>$id);
+$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
@@ -404,6 +405,14 @@ if ($id > 0 || ! empty($ref))
print nl2br($object->description);
print '';
+ // Bill time
+ if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
+ {
+ print '
'.$langs->trans("BillTime").' ';
+ print yn($object->bill_time);
+ print ' ';
+ }
+
// Categories
if($conf->categorie->enabled) {
print ''.$langs->trans("Categories").' ';
@@ -490,7 +499,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Planned workload
print ' '.$langs->trans("PlannedWorkload").' ';
- print $form->select_duration('planned_workload', $planned_workload?$planned_workload : $object->planned_workload,0,'text');
+ print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text');
print ' ';
// Progress
@@ -506,11 +515,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Other options
$parameters=array();
- $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
+
if (empty($reshook) && ! empty($extrafields_task->attribute_label))
{
- print $object->showOptionals($extrafields_task,'edit');
+ print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project
}
print '';
@@ -524,7 +534,6 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '';
print '';
-
}
else if ($id > 0 || ! empty($ref))
{
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
index 19ba461fbe4..ba54b35a59e 100644
--- a/htdocs/projet/tasks/comment.php
+++ b/htdocs/projet/tasks/comment.php
@@ -275,7 +275,6 @@ if ($id > 0 || ! empty($ref))
// Include comment tpl view
include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_comment.tpl.php';
-
}
}
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 3272c43ad10..d86c8b469ae 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -518,7 +518,6 @@ if ($id > 0 || ! empty($ref))
}
}
print "";
-
}
else
{
diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php
index 68b52339ebb..020a7969a64 100644
--- a/htdocs/projet/tasks/stats/index.php
+++ b/htdocs/projet/tasks/stats/index.php
@@ -167,6 +167,8 @@ print '';
print '';
print '
';
+
+print '
';
print '
';
print '';
print ''.$langs->trans("Year").' ';
@@ -195,6 +197,7 @@ foreach ($data_all_year as $val)
}
print '
';
+print '
';
print '
';
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index e432fcdf7fd..7ff93c7b4da 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -399,8 +399,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print nl2br($projectstatic->description);
print '';
+ // Bill time
+ if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
+ {
+ print '
'.$langs->trans("BillTime").' ';
+ print yn($projectstatic->bill_time);
+ print ' ';
+ }
+
// Categories
- if($conf->categorie->enabled) {
+ if ($conf->categorie->enabled) {
print '
'.$langs->trans("Categories").' ';
print $form->showCategories($projectstatic->id,'project',1);
print " ";
@@ -1090,7 +1098,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
if (isset($task_time->total_ht)) print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency);
print '';
if (! $i) $totalarray['nbfield']++;
- if (! $i) $totalarray['totalvaluefield']=$totalarray['nbfield'];
+ if (! $i) $totalarray['totalvaluebilledfield']=$totalarray['nbfield'];
$totalarray['totalvaluebilled'] += $valuebilled;
}
@@ -1152,6 +1160,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
}
elseif ($totalarray['totaldurationfield'] == $i) print '
'.convertSecondToTime($totalarray['totalduration'],'allhourmin').' ';
elseif ($totalarray['totalvaluefield'] == $i) print '
'.price($totalarray['totalvalue']).' ';
+ elseif ($totalarray['totalvaluebilledfield'] == $i) print '
'.price($totalarray['totalvaluebilled']).' ';
else print '
';
}
print '';
diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php
index 320a8e3895a..df207e87d85 100644
--- a/htdocs/public/cron/cron_run_jobs.php
+++ b/htdocs/public/cron/cron_run_jobs.php
@@ -169,7 +169,6 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs)>0))
dol_syslog("cron_run_jobs.php::reprogram_jobs Error".$cronjob->error, LOG_ERR);
exit;
}
-
}
}
echo "Result: ".($nbofjobs)." jobs - ".($nbofjobslaunchedok+$nbofjobslaunchedko)." launched = ".$nbofjobslaunchedok." OK + ".$nbofjobslaunchedko." KO";
diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php
index 9f03f9e293e..86db4b089aa 100644
--- a/htdocs/public/donations/donateurs_code.php
+++ b/htdocs/public/donations/donateurs_code.php
@@ -99,7 +99,6 @@ if ($resql)
$i++;
}
print "";
-
}
else
{
diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php
index 23511974137..0b79f656450 100644
--- a/htdocs/public/emailing/mailing-read.php
+++ b/htdocs/public/emailing/mailing-read.php
@@ -86,7 +86,6 @@ if (! empty($tag))
dol_syslog("public/emailing/mailing-read.php : Mail read contact : ".$sql, LOG_DEBUG);
$resql=$db->query($sql);
-
}
$db->close();
diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php
index eda1aaf2c68..bc8fd0cde17 100644
--- a/htdocs/public/members/public_card.php
+++ b/htdocs/public/members/public_card.php
@@ -113,7 +113,6 @@ if ($id > 0)
print '';
}
-
}
diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php
index e8db916ad91..277cd1ada78 100644
--- a/htdocs/public/onlinesign/newonlinesign.php
+++ b/htdocs/public/onlinesign/newonlinesign.php
@@ -120,7 +120,6 @@ $creditor = $mysoc->name;
if ($action == 'dosign')
{
// TODO
-
}
@@ -256,8 +255,6 @@ if ($source == 'proposal')
print '
';
print '
';
print ''."\n";
-
-
}
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 47cdc8bb31e..0975186eb03 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -620,7 +620,6 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
header("Location: ".$urlok);
exit;
}
-
}
diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php
index e1b160541b2..45fd6489f92 100644
--- a/htdocs/public/stripe/ipn.php
+++ b/htdocs/public/stripe/ipn.php
@@ -234,28 +234,23 @@ elseif ($event->type == 'payout.paid') {
elseif ($event->type == 'charge.succeeded') {
//TODO: create fees
-
}
elseif ($event->type == 'customer.source.created') {
//TODO: save customer's source
-
}
elseif ($event->type == 'customer.source.updated') {
//TODO: update customer's source
-
}
elseif ($event->type == 'customer.source.delete') {
//TODO: delete customer's source
-
}
elseif ($event->type == 'charge.failed') {
$subject = 'Your payment has been received: '.$event->data->object->id.'';
$headers = 'From: "'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'" <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
-
}
elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated==true)) {
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
index 5ba98ae9f69..49cad87e990 100644
--- a/htdocs/resource/card.php
+++ b/htdocs/resource/card.php
@@ -171,7 +171,6 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
-
}
else
{
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index c6e25c4d837..ad3355e3972 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -384,7 +384,6 @@ class Dolresource extends CommonObject
if($obj->element_id && $obj->element_type) {
$this->objelement = fetchObjectByElement($obj->element_id,$obj->element_type);
}
-
}
$this->db->free($resql);
@@ -646,7 +645,6 @@ class Dolresource extends CommonObject
if($obj->element_id && $obj->element_type)
$line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type);
$this->lines[] = $line;
-
}
$this->db->free($resql);
}
diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php
index 6a32ba9f645..85ec5b96c79 100644
--- a/htdocs/resource/document.php
+++ b/htdocs/resource/document.php
@@ -135,7 +135,6 @@ if ($object->id)
$permission = $user->rights->resource->write;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
-
}
else
{
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index adbd8eec87f..a83e37bc0b4 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -462,7 +462,6 @@ else
if(file_exists(dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php')))
{
$res=@include dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php');
-
}
else
{
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index 49a9538e225..0166b6a233a 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -788,7 +788,6 @@ if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST))
{
print '
';
print img_picto($langs->trans("Activated"),'switch_on');
-
}
else
{
@@ -806,7 +805,6 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST))
{
print ' ';
print img_picto($langs->trans("Activated"),'switch_on');
-
}
else
{
@@ -826,7 +824,6 @@ if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD))
{
print ' ';
print img_picto($langs->trans("Activated"),'switch_on');
-
}
else
{
@@ -845,7 +842,6 @@ if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS))
{
print ' ';
print img_picto($langs->trans("Activated"),'switch_on');
-
}
else
{
diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php
index 2577f5bed5d..92d009db604 100644
--- a/htdocs/societe/canvas/actions_card_common.class.php
+++ b/htdocs/societe/canvas/actions_card_common.class.php
@@ -258,7 +258,6 @@ abstract class ActionsCardCommon
$this->tpl['localtax'].= '';
}
}
-
}
else
{
diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php
index 3e18b7944f2..09172f1ea5a 100644
--- a/htdocs/societe/canvas/company/actions_card_company.class.php
+++ b/htdocs/societe/canvas/company/actions_card_company.class.php
@@ -181,7 +181,6 @@ class ActionsCardCompany extends ActionsCardCommon
{
$this->tpl['tva_intra'] = $s;
}
-
}
else
{
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 1fbabc01462..5935a1d01a1 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -304,13 +304,13 @@ if (empty($reshook))
if (GETPOST('getcustomercode'))
{
// We defined value code_client
- $_POST["code_client"]="Acompleter";
+ $_POST["customer_code"]="Acompleter";
}
if (GETPOST('getsuppliercode'))
{
// We defined value code_fournisseur
- $_POST["code_fournisseur"]="Acompleter";
+ $_POST["supplier_code"]="Acompleter";
}
if($action=='set_localtax1')
@@ -371,7 +371,6 @@ if (empty($reshook))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors');
$error++;
-
}
if (! $error)
@@ -418,8 +417,8 @@ if (empty($reshook))
$object->idprof5 = trim(GETPOST('idprof5', 'alpha'));
$object->idprof6 = trim(GETPOST('idprof6', 'alpha'));
$object->prefix_comm = GETPOST('prefix_comm', 'alpha');
- $object->code_client = GETPOST('code_client', 'alpha');
- $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
+ $object->code_client = GETPOST('customer_code', 'alpha');
+ $object->code_fournisseur = GETPOST('supplier_code', 'alpha');
$object->capital = GETPOST('capital', 'alpha');
$object->barcode = GETPOST('barcode', 'alpha');
@@ -948,14 +947,14 @@ else
$object->client = GETPOST('client')?GETPOST('client'):$object->client;
if(empty($duplicate_code_error)) {
- $object->code_client = GETPOST('code_client', 'alpha');
+ $object->code_client = GETPOST('customer_code', 'alpha');
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
}
else {
setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings');
}
- $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
+ $object->code_fournisseur = GETPOST('supplier_code', 'alpha');
$object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'alpha');
@@ -1191,7 +1190,7 @@ else
print '';
$tmpcode=$object->code_client;
if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0);
- print ' ';
+ print ' ';
print ' ';
$s=$modCodeClient->getToolTip($langs,$object,0);
print $form->textwithpicto('',$s,1);
@@ -1219,7 +1218,7 @@ else
print '';
$tmpcode=$object->code_fournisseur;
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
- print ' ';
+ print ' ';
print ' ';
$s=$modCodeFournisseur->getToolTip($langs,$object,1);
print $form->textwithpicto('',$s,1);
@@ -1377,7 +1376,6 @@ else
print ' '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).' ';
print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1);
print ' ';
-
}
elseif($mysoc->localtax1_assuj=="1")
{
@@ -1572,9 +1570,9 @@ else
$object->name = GETPOST('name', 'alpha');
$object->prefix_comm = GETPOST('prefix_comm', 'alpha');
$object->client = GETPOST('client', 'int');
- $object->code_client = GETPOST('code_client', 'alpha');
+ $object->code_client = GETPOST('customer_code', 'alpha');
$object->fournisseur = GETPOST('fournisseur', 'int');
- $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
+ $object->code_fournisseur = GETPOST('supplier_code', 'alpha');
$object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'alpha');
@@ -1778,16 +1776,16 @@ else
$tmpcode=$object->code_client;
if (empty($tmpcode) && ! empty($object->oldcopy->code_client)) $tmpcode=$object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0);
- print ' ';
+ print ' ';
}
else if ($object->codeclient_modifiable())
{
- print ' ';
+ print ' ';
}
else
{
print $object->code_client;
- print ' ';
+ print ' ';
}
print '';
$s=$modCodeClient->getToolTip($langs,$object,0);
@@ -1818,16 +1816,16 @@ else
$tmpcode=$object->code_fournisseur;
if (empty($tmpcode) && ! empty($object->oldcopy->code_fournisseur)) $tmpcode=$object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
- print ' ';
+ print ' ';
}
else if ($object->codefournisseur_modifiable())
{
- print ' ';
+ print ' ';
}
else
{
print $object->code_fournisseur;
- print ' ';
+ print ' ';
}
print ' ';
$s=$modCodeFournisseur->getToolTip($langs,$object,1);
@@ -1973,7 +1971,6 @@ else
print '';
}
print ' ';
-
}
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
{
@@ -1986,7 +1983,6 @@ else
print '';
}
print '';
-
}
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
{
@@ -2380,7 +2376,6 @@ else
print ''.$object->localtax1_value.' ';
}
print '';
-
}
}
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
@@ -2403,7 +2398,6 @@ else
print ''.$object->localtax2_value.' ';
}
print '';
-
}
}
}
@@ -2729,7 +2723,6 @@ else
$trackid = 'thi'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
-
}
}
diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php
index 63b23d42f9e..4f9915a844c 100644
--- a/htdocs/societe/class/address.class.php
+++ b/htdocs/societe/class/address.class.php
@@ -138,7 +138,6 @@ class Address
$this->db->rollback();
return -2;
}
-
}
else
{
@@ -496,7 +495,6 @@ class Address
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php
index 365073726bc..42d1d616852 100644
--- a/htdocs/societe/class/api_thirdparties.class.php
+++ b/htdocs/societe/class/api_thirdparties.class.php
@@ -1070,7 +1070,6 @@ class Thirdparties extends DolibarrApi
foreach($account as $key => $value)
if(in_array($key, $fields)){
$object[$key] = $value;
-
}
$returnAccounts[] = $object;
}
@@ -1332,7 +1331,6 @@ class Thirdparties extends DolibarrApi
foreach($account as $key => $value)
if(in_array($key, $fields)){
$object[$key] = $value;
-
}
$returnAccounts[] = $object;
}
diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php
index 3a3b9126b7b..73210ade104 100644
--- a/htdocs/societe/class/companybankaccount.class.php
+++ b/htdocs/societe/class/companybankaccount.class.php
@@ -184,7 +184,6 @@ class CompanyBankAccount extends Account
{
return 1;
}
-
}
else
{
diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php
index 83303a3a41d..73242c9aa32 100644
--- a/htdocs/societe/class/companypaymentmode.class.php
+++ b/htdocs/societe/class/companypaymentmode.class.php
@@ -561,7 +561,6 @@ class CompanyPaymentMode extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index c91593b079f..dd1aada283b 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -611,7 +611,6 @@ class Societe extends CommonObject
$this->db->rollback();
return $result;
}
-
}
else
{
@@ -1001,7 +1000,6 @@ class Societe extends CommonObject
$sql .=",localtax1_value =".$this->localtax1_value;
}
else $sql .=",localtax1_value =0.000";
-
}
else $sql .=",localtax1_value =0.000";
@@ -1012,7 +1010,6 @@ class Societe extends CommonObject
$sql .=",localtax2_value =".$this->localtax2_value;
}
else $sql .=",localtax2_value =0.000";
-
}
else $sql .=",localtax2_value =0.000";
@@ -2098,11 +2095,11 @@ class Societe extends CommonObject
if (strpos($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP, 'profid5') !== false) $label.= '' . $langs->trans('ProfId5'.$this->country_code) . ': '. $this->idprof5;
if (strpos($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP, 'profid6') !== false) $label.= '' . $langs->trans('ProfId6'.$this->country_code) . ': '. $this->idprof6;
}
- if (! empty($this->code_client) && $this->client)
+ if (! empty($this->code_client) && ($this->client == 1 || $this->client == 3))
$label.= '' . $langs->trans('CustomerCode') . ': '. $this->code_client;
if (! empty($this->code_fournisseur) && $this->fournisseur)
$label.= '' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur;
- if (! empty($conf->accounting->enabled) && $this->client)
+ if (! empty($conf->accounting->enabled) && ($this->client == 1 || $this->client == 3))
$label.= '' . $langs->trans('CustomerAccountancyCode') . ': '. ($this->code_compta ? $this->code_compta : $this->code_compta_client);
if (! empty($conf->accounting->enabled) && $this->fournisseur)
$label.= '' . $langs->trans('SupplierAccountancyCode') . ': '. $this->code_compta_fournisseur;
@@ -3177,7 +3174,6 @@ class Societe extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php
index de228c576b5..78f934ecf2f 100644
--- a/htdocs/societe/class/societeaccount.class.php
+++ b/htdocs/societe/class/societeaccount.class.php
@@ -518,7 +518,6 @@ class SocieteAccount extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index b74b66a1a44..3a3fb8507c9 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -554,7 +554,6 @@ if ($sql_select)
{
print (! empty($objp->description) && $objp->description!=$objp->product_label)?' '.dol_htmlentitiesbr($objp->description):'';
}
-
} else {
if (! empty($objp->label) || ! empty($objp->description))
diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php
index 0fbc4368a87..a9b280a3f47 100644
--- a/htdocs/societe/price.php
+++ b/htdocs/societe/price.php
@@ -609,7 +609,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print "
";
print "";
-
}
}
diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php
index 0f26bf0e11a..73c1f7b86c8 100644
--- a/htdocs/stripe/charge.php
+++ b/htdocs/stripe/charge.php
@@ -221,7 +221,6 @@ if (!$rowid)
} elseif ($charge->paid=='1'){
print img_picto($langs->trans("".$charge->status.""),'statut4');
-
} else {
$label="Message: ".$charge->failure_message." ";
$label.="Réseau: ".$charge->outcome->network_status." ";
diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php
index f3c76be9d35..a74b2d52eef 100644
--- a/htdocs/stripe/class/actions_stripe.class.php
+++ b/htdocs/stripe/class/actions_stripe.class.php
@@ -109,7 +109,6 @@ class ActionsStripeconnect
$this->resprints.= $langs->trans("NoStripe");
}
$this->resprints.= ' ';
-
}
elseif (is_object($object) && $object->element == 'member'){
$this->resprints.= '';
diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php
index 0e9c3cbb4a8..d8e7168e5c0 100644
--- a/htdocs/stripe/class/stripe.class.php
+++ b/htdocs/stripe/class/stripe.class.php
@@ -284,7 +284,6 @@ class Stripe extends CommonObject
$this->error = $e->getMessage();
dol_syslog($this->error, LOG_WARNING);
}
-
}
elseif ($createifnotlinkedtostripe)
{
diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php
index fbf9784a6b3..9a7ecfd5470 100644
--- a/htdocs/stripe/payment.php
+++ b/htdocs/stripe/payment.php
@@ -350,7 +350,6 @@ if (empty($reshook))
$facture->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
-
}
if (! $error)
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 2f765c6c75f..248165727cf 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1303,7 +1303,6 @@ if ($action == 'create')
print '
';
}
-
} else {
/*
* Show object in view mode
diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php
index 3d10c47f6a1..fd490902049 100644
--- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php
+++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php
@@ -185,7 +185,6 @@ class Supplierproposals extends DolibarrApi
if (!isset($data[$field]))
throw new RestException(400, "$field field missing");
$propal[$field] = $data[$field];
-
}
return $propal;
}
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index adc2c8643ac..a05d0485aaf 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -1730,7 +1730,6 @@ class SupplierProposal extends CommonObject
{
$result = $this->updateOrCreatePriceFournisseur($user);
}
-
}
if ($statut == 4)
{
@@ -2138,11 +2137,8 @@ class SupplierProposal extends CommonObject
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
-
-
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php
index 7be0dcbc78a..881fae4d1a7 100644
--- a/htdocs/supplier_proposal/contact.php
+++ b/htdocs/supplier_proposal/contact.php
@@ -193,7 +193,6 @@ if ($id > 0 || ! empty($ref))
// Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';
-
}
else
{
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index d9ad2a590ac..9eba59317bc 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -1856,7 +1856,7 @@ foreach($mainmenuusedarray as $val)
}
form#login {
padding-bottom: 30px;
- font-size: 13px;
+ font-size: 14px;
vertical-align: middle;
}
.login_table_title {
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 2b760fcd894..80a79b0245a 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -1867,7 +1867,7 @@ a.tmenuimage {
}
form#login {
padding-bottom: 30px;
- font-size: 13px;
+ font-size: 14px;
vertical-align: middle;
}
.login_table_title {
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index b1fb2d31cef..1b43d0054b7 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -409,7 +409,6 @@ if ($projectid > 0) {
dol_fiche_end();
$object = $savobject;
-
} else {
print "ErrorRecordNotFound";
}
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 6a8e0d4f14a..a87438eda95 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -696,7 +696,6 @@ if ($action == 'create' || $action == 'adduserldap')
}
$liste[$key] = $label;
}
-
}
else
{
@@ -2593,7 +2592,6 @@ else
if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close();
}
-
}
if (! empty($conf->api->enabled) && ! empty($conf->use_javascript_ajax))
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index d2afacce54a..d1a8cae636b 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -870,7 +870,6 @@ class User extends CommonObject
// if we have already define a subperm like this $this->rights->$module->level1->level2 with llx_user_rights, we don't want override level1 because the level2 can be not define on user group
if (!is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = 1;
}
-
}
$i++;
}
@@ -2671,7 +2670,6 @@ class User extends CommonObject
}
$this->db->free($result);
-
}
else
{
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index 6719d6ca120..918d8c394ca 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -213,7 +213,6 @@ if ($id > 0)
}
print "\n";
-
}
// End of page
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 521b0e4022e..e0e6935bc48 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -316,7 +316,6 @@ if ($action == 'edit')
print ' ';
print ' ';
print '';
-
}
else
{
@@ -403,7 +402,6 @@ else
}
print '';
-
}
if ($action == 'edit')
diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php
index 0110d9db789..43700b281c7 100644
--- a/htdocs/variants/admin/admin.php
+++ b/htdocs/variants/admin/admin.php
@@ -41,7 +41,6 @@ if ($_POST) {
} else {
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
}
-
}
$title = $langs->trans('ModuleSetup').' '.$langs->trans('ProductAttributes');
diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php
index 8cb4e13b33e..1f04e5edb87 100644
--- a/htdocs/variants/card.php
+++ b/htdocs/variants/card.php
@@ -88,7 +88,6 @@ if ($_POST) {
header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
exit();
}
-
}
if ($confirm == 'yes') {
diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php
index a0aed832eac..ef9ec4997f3 100644
--- a/htdocs/variants/class/ProductCombination.class.php
+++ b/htdocs/variants/class/ProductCombination.class.php
@@ -736,7 +736,6 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
}
$i++;
}
-
}
return $label;
}
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index fb23921be25..79076e8ac50 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -210,12 +210,10 @@ if ($_POST) {
} else {
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
}
-
} else {
$db->commit();
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
}
-
}
elseif ($valueid > 0) {
@@ -286,11 +284,9 @@ if ($action === 'confirm_deletecombination') {
setEventMessages($langs->trans('ErrorCopyProductCombinations'), null, 'errors');
}
}
-
} else {
setEventMessages($langs->trans('ErrorDestinationProductNotFound'), null, 'errors');
}
-
}
diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php
index afed5c98b16..420c90147ea 100644
--- a/htdocs/variants/generator.php
+++ b/htdocs/variants/generator.php
@@ -123,7 +123,6 @@ if ($_POST) {
}
$db->rollback();
-
} else {
setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors');
}
diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php
index 6a581b2ca0d..a9edcb0557a 100644
--- a/htdocs/webservices/server_actioncomm.php
+++ b/htdocs/webservices/server_actioncomm.php
@@ -378,7 +378,6 @@ function getListActionCommType($authentication)
$objectresp = array(
'result'=>array('result_code'=>'OK', 'result_label'=>''),
'actioncommtypes'=>$resultarray);
-
}
else
{
diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php
index 685579c6674..a941c2aceff 100644
--- a/htdocs/webservices/server_category.php
+++ b/htdocs/webservices/server_category.php
@@ -250,9 +250,7 @@ function getCategory($authentication,$id)
'dir' => $pdir,
'photos' => $fille->liste_photos($dir,$nbmax=10)
);
-
}
-
}
// Create
diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php
index aed031fa9ca..03931701659 100644
--- a/htdocs/webservices/server_invoice.php
+++ b/htdocs/webservices/server_invoice.php
@@ -635,7 +635,6 @@ function createInvoice($authentication,$invoice)
$errorlabel=$new_invoice->error;
dol_syslog("Function: createInvoice error while creating".$errorlabel);
}
-
}
if ($error)
@@ -707,7 +706,6 @@ function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $re
$error++;
dol_syslog("Webservice server_invoice:: invoice creation from order failed", LOG_ERR);
}
-
}
}
else
diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php
index 8cbe54e0b29..d41b2880210 100644
--- a/htdocs/webservices/server_order.php
+++ b/htdocs/webservices/server_order.php
@@ -749,7 +749,6 @@ function createOrder($authentication,$order)
{
dol_syslog("Webservice server_order:: order creation failed", LOG_ERR);
$error++;
-
}
if ($order['status'] == 1) // We want order to have status validated
@@ -777,7 +776,6 @@ function createOrder($authentication,$order)
$errorcode='KO';
$errorlabel=$newobject->error;
}
-
}
if ($error)
@@ -831,7 +829,6 @@ function validOrder($authentication,$id='',$id_warehouse=0)
// Define output language
$outputlangs = $langs;
$order->generateDocument($order->modelpdf, $outputlangs);
-
}
else
{
@@ -848,7 +845,6 @@ function validOrder($authentication,$id='',$id_warehouse=0)
$errorcode='KO';
$errorlabel=$newobject->error;
}
-
}
else
{
@@ -857,7 +853,6 @@ function validOrder($authentication,$id='',$id_warehouse=0)
$errorcode='KO';
$errorlabel=$newobject->error;
}
-
}
if ($error)
@@ -926,7 +921,6 @@ function updateOrder($authentication,$order)
// Define output language
$outputlangs = $langs;
$object->generateDocument($order->modelpdf, $outputlangs);
-
}
}
if ($order['status'] == 0) $result=$object->set_reopen($fuser);
diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php
index 2154d2d8557..1e301350063 100644
--- a/htdocs/webservices/server_productorservice.php
+++ b/htdocs/webservices/server_productorservice.php
@@ -617,7 +617,6 @@ function createProductOrService($authentication,$product)
$errorcode='KO';
$errorlabel=$newobject->error;
}
-
}
if ($error)
@@ -806,7 +805,6 @@ function updateProductOrService($authentication,$product)
$errorcode='KO';
$errorlabel=$newobject->error;
}
-
}
if ($error)
@@ -1105,7 +1103,6 @@ function getProductsForCategory($authentication,$id,$lang='')
$iProduct++;
}
-
}
// Retour
@@ -1113,14 +1110,12 @@ function getProductsForCategory($authentication,$id,$lang='')
'result'=>array('result_code'=>'OK', 'result_label'=>''),
'products'=> $products
);
-
}
else
{
$errorcode='NORECORDS_FOR_ASSOCIATION'; $errorlabel='No products associated'.$sql;
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
dol_syslog("getProductsForCategory:: ".$c->error, LOG_DEBUG);
-
}
}
else
diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php
index c2236368d18..7f0b590ee9a 100644
--- a/htdocs/webservices/server_thirdparty.php
+++ b/htdocs/webservices/server_thirdparty.php
@@ -816,7 +816,6 @@ function deleteThirdParty($authentication,$id='',$ref='',$ref_ext='')
{
$error++;
$errorcode='NOT_FOUND'; $errorlabel='Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext;
-
}
}
else
diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php
index ab2d18427ff..81702c55456 100644
--- a/htdocs/webservices/server_user.php
+++ b/htdocs/webservices/server_user.php
@@ -733,7 +733,6 @@ function setUserPassword($authentication,$shortuser)
$error++;
$errorcode='NOT_FOUND'; $errorlabel='User not found';
}
-
}
else
{
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index f2bf4ad1888..4f969851ad4 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -1543,7 +1543,6 @@ if ($action == 'importsiteconfirm')
}
}
}
-
}
}
@@ -2659,7 +2658,6 @@ if ($action == 'editfile' || $action == 'file_manager')
include DOL_DOCUMENT_ROOT.'/core/tpl/filemanager.tpl.php';
print '';
-
}
if ($action == 'editmenu')
diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php
index 8ffefa0ca9a..6104cec3b55 100755
--- a/scripts/cron/cron_run_jobs.php
+++ b/scripts/cron/cron_run_jobs.php
@@ -223,7 +223,6 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs)>0))
dol_syslog("cron_run_jobs.php::reprogram_jobs Error ".$cronjob->error, LOG_ERR);
exit(-1);
}
-
}
else
{
diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php
index 95b06f187e8..c36e7ea1cc3 100755
--- a/scripts/emailings/mailing-send.php
+++ b/scripts/emailings/mailing-send.php
@@ -64,7 +64,6 @@ print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
if ($conf->global->MAILING_LIMIT_SENDBYCLI == '-1')
{
-
}
$user = new User($db);
@@ -329,7 +328,6 @@ if ($resql)
if (!empty($conf->global->MAILING_DELAY)) {
sleep($conf->global->MAILING_DELAY);
}
-
}
}
else
diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php
index 3e6eaaa4281..d7d4fbdeaaf 100755
--- a/scripts/members/sync_members_ldap2dolibarr.php
+++ b/scripts/members/sync_members_ldap2dolibarr.php
@@ -299,7 +299,6 @@ if ($result >= 0)
//print "yy".dol_print_date($datelast)."\n";
$crowid=$member->subscription($datelast, $pricelast, 0);
}
-
}
if (! $error || $forcecommit)
diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php
index 69322b2f350..eee15cdb7fa 100755
--- a/scripts/product/migrate_picture_path.php
+++ b/scripts/product/migrate_picture_path.php
@@ -140,7 +140,6 @@ function migrate_product_photospath($product)
{
dol_move($origin.'/'.$file, $destin.'/'.$file);
}
-
}
}
}
diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php
index c2b620b639b..349e19a1072 100644
--- a/test/phpunit/CodingSqlTest.php
+++ b/test/phpunit/CodingSqlTest.php
@@ -185,19 +185,16 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase
if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration')
{
// Test for migration files only
-
}
elseif ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/data')
{
// Test for data files only
-
}
else
{
if (preg_match('/\.key\.sql$/',$file))
{
// Test for key files only
-
}
else
{