Merge pull request #9886 from frederic34/catchblockempty
fill empty catch with log
This commit is contained in:
commit
5935a420a8
@ -488,7 +488,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
dol_syslog($e->getMessage(), LOG_INFO);
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* 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)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -367,8 +369,9 @@ class doc_generic_contract_odt extends ModelePDFContract
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
$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)
|
foreach($tmparray as $key=>$value)
|
||||||
@ -384,8 +387,9 @@ class doc_generic_contract_odt extends ModelePDFContract
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
catch(SegmentException $e)
|
catch(SegmentException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$listlines->merge();
|
$listlines->merge();
|
||||||
@ -445,6 +451,7 @@ class doc_generic_contract_odt extends ModelePDFContract
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -464,7 +471,7 @@ class doc_generic_contract_odt extends ModelePDFContract
|
|||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,8 @@
|
|||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* 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)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -362,6 +363,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make substitutions into odt of user 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');
|
$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
|
// Make substitutions into odt of mysoc
|
||||||
@ -402,8 +405,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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
|
// Make substitutions into odt of thirdparty
|
||||||
@ -421,8 +425,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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
|
// Replace tags of object + external modules
|
||||||
@ -446,6 +451,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
@ -478,9 +484,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -488,7 +496,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
$odfHandler->mergeSegment($listlines);
|
$odfHandler->mergeSegment($listlines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
dol_syslog($this->error, LOG_WARNING);
|
dol_syslog($this->error, LOG_WARNING);
|
||||||
@ -502,8 +510,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <ely@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <ely@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* 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();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -371,8 +373,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define substitution array
|
// Define substitution array
|
||||||
@ -410,8 +413,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
@ -444,9 +448,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -470,6 +476,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -483,14 +490,16 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@products.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@products.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -365,9 +366,10 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -382,8 +384,9 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define substitution array
|
// Define substitution array
|
||||||
@ -418,8 +421,9 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
@ -440,11 +444,13 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
{
|
{
|
||||||
$listlines->setVars($key, $val, true, 'UTF-8');
|
$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();
|
$listlines->merge();
|
||||||
@ -452,7 +458,7 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
}
|
}
|
||||||
$odfHandler->mergeSegment($listlines);
|
$odfHandler->mergeSegment($listlines);
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
dol_syslog($this->error, LOG_WARNING);
|
dol_syslog($this->error, LOG_WARNING);
|
||||||
@ -468,6 +474,7 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -596,10 +597,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
'DELIMITER_RIGHT' => '}'
|
'DELIMITER_RIGHT' => '}'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// 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');
|
$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)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
catch(SegmentException $e)
|
catch(SegmentException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,9 +724,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
catch(SegmentException $e)
|
catch(SegmentException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$listlinestaskres->merge();
|
$listlinestaskres->merge();
|
||||||
@ -768,9 +773,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
catch(SegmentException $e)
|
catch(SegmentException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$listlinestasktime->merge();
|
$listlinestasktime->merge();
|
||||||
@ -806,9 +813,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
catch(SegmentException $e)
|
catch(SegmentException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$listlinestasktime->merge();
|
$listlinestasktime->merge();
|
||||||
@ -835,11 +844,13 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
{
|
{
|
||||||
$listtasksfiles->setVars($key, $val, true, 'UTF-8');
|
$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();
|
$listtasksfiles->merge();
|
||||||
@ -881,9 +892,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -938,9 +951,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -1064,7 +1079,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
'table' => 'actioncomm',
|
'table' => 'actioncomm',
|
||||||
'disableamount' => 1,
|
'disableamount' => 1,
|
||||||
'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
|
'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
//Insert reference
|
//Insert reference
|
||||||
@ -1116,11 +1131,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
if (!empty($element->total_ht)) {
|
if (!empty($element->total_ht)) {
|
||||||
$ref_array['amountht']=$element->total_ht;
|
$ref_array['amountht']=$element->total_ht;
|
||||||
$ref_array['amountttc']=$element->total_ttc;
|
$ref_array['amountttc']=$element->total_ttc;
|
||||||
}else {
|
} else {
|
||||||
$ref_array['amountht']=0;
|
$ref_array['amountht']=0;
|
||||||
$ref_array['amountttc']=0;
|
$ref_array['amountttc']=0;
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
$ref_array['amountht']='';
|
$ref_array['amountht']='';
|
||||||
$ref_array['amountttc']='';
|
$ref_array['amountttc']='';
|
||||||
}
|
}
|
||||||
@ -1137,9 +1152,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -1148,9 +1165,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
$odfHandler->mergeSegment($listlines);
|
$odfHandler->mergeSegment($listlines);
|
||||||
}
|
}
|
||||||
}
|
} catch(OdfException $e) {
|
||||||
catch(OdfException $e)
|
|
||||||
{
|
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
dol_syslog($this->error, LOG_WARNING);
|
dol_syslog($this->error, LOG_WARNING);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1162,9 +1177,8 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
}
|
} catch (OdfException $e) {
|
||||||
catch(OdfException $e)
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1177,16 +1191,16 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e){
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -560,9 +561,8 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
{
|
{
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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);
|
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||||
foreach($tmparray as $key => $val)
|
foreach($tmparray as $key => $val)
|
||||||
{
|
{
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$odfHandler->setVars($key, $val, true, 'UTF-8');
|
$odfHandler->setVars($key, $val, true, 'UTF-8');
|
||||||
}
|
} catch (OdfException $e) {
|
||||||
catch(OdfException $e)
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
{
|
} catch(SegmentException $e) {
|
||||||
}
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
catch(SegmentException $e)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,15 +620,13 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
|
|
||||||
foreach($tmparray as $key => $val)
|
foreach($tmparray as $key => $val)
|
||||||
{
|
{
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$listlinestaskres->setVars($key, $val, true, 'UTF-8');
|
$listlinestaskres->setVars($key, $val, true, 'UTF-8');
|
||||||
|
} catch (OdfException $e) {
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (SegmentException $e) {
|
||||||
{
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
|
||||||
catch(SegmentException $e)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$listlinestaskres->merge();
|
$listlinestaskres->merge();
|
||||||
@ -677,9 +672,11 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
catch(SegmentException $e)
|
catch(SegmentException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$listlinestasktime->merge();
|
$listlinestasktime->merge();
|
||||||
@ -710,9 +707,11 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
}
|
}
|
||||||
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();
|
$listtasksfiles->merge();
|
||||||
@ -752,9 +751,11 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -810,9 +811,11 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -837,16 +840,18 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||||||
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* 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)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -395,8 +397,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define substitution array
|
// Define substitution array
|
||||||
@ -433,6 +436,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
@ -465,9 +469,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -489,8 +495,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2011 Laurent Destailleur <ely@users.sourceforge.net>
|
/* Copyright (C) 2010-2011 Laurent Destailleur <ely@users.sourceforge.net>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -276,6 +278,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//print $odfHandler->__toString()."\n";
|
//print $odfHandler->__toString()."\n";
|
||||||
@ -323,9 +326,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -367,9 +372,10 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
// setVars failed, probably because key not found
|
// setVars failed, probably because key not found
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,8 +386,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -413,6 +421,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@stocks.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@stocks.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -368,6 +369,7 @@ class doc_generic_stock_odt extends ModelePDFStock
|
|||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -382,8 +384,9 @@ class doc_generic_stock_odt extends ModelePDFStock
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define substitution array
|
// Define substitution array
|
||||||
@ -418,8 +421,9 @@ class doc_generic_stock_odt extends ModelePDFStock
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
@ -442,9 +446,11 @@ class doc_generic_stock_odt extends ModelePDFStock
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -468,6 +474,7 @@ class doc_generic_stock_odt extends ModelePDFStock
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -374,9 +375,10 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -390,8 +392,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define substitution array
|
// Define substitution array
|
||||||
@ -424,6 +427,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
@ -456,9 +460,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||||||
}
|
}
|
||||||
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();
|
$listlines->merge();
|
||||||
@ -482,6 +488,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -343,6 +344,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,6 +379,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch(OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,8 +390,9 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$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)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -361,10 +362,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
'DELIMITER_RIGHT' => '}'
|
'DELIMITER_RIGHT' => '}'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// After construction $odfHandler->contentXml contains content and
|
// After construction $odfHandler->contentXml contains content and
|
||||||
@ -378,8 +378,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
try {
|
try {
|
||||||
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make substitutions into odt
|
// Make substitutions into odt
|
||||||
@ -414,8 +415,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace tags of lines
|
// Replace tags of lines
|
||||||
@ -425,7 +427,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
try {
|
try {
|
||||||
$listlines = $odfHandler->setSegment('lines');
|
$listlines = $odfHandler->setSegment('lines');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
// We may arrive here if tags for lines not present into template
|
// We may arrive here if tags for lines not present into template
|
||||||
$foundtagforlines = 0;
|
$foundtagforlines = 0;
|
||||||
@ -446,15 +448,17 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(!is_array($val)) {
|
if (!is_array($val)) {
|
||||||
$listlines->setVars($key, $val, true, 'UTF-8');
|
$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();
|
$listlines->merge();
|
||||||
@ -471,39 +475,42 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
|
|
||||||
// Replace labels translated
|
// Replace labels translated
|
||||||
$tmparray=$outputlangs->get_translations_for_substitutions();
|
$tmparray=$outputlangs->get_translations_for_substitutions();
|
||||||
foreach($tmparray as $key=>$value)
|
foreach($tmparray as $key => $value)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
catch(OdfException $e)
|
catch (OdfException $e)
|
||||||
{
|
{
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$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
|
$reshook=$hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
// Write new file
|
// Write new file
|
||||||
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
$odfHandler->exportAsAttachedPDF($file);
|
$odfHandler->exportAsAttachedPDF($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
$odfHandler->saveToDisk($file);
|
$odfHandler->saveToDisk($file);
|
||||||
}catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
$this->error=$e->getMessage();
|
$this->error=$e->getMessage();
|
||||||
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
return -1;
|
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))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user