Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,19 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) {
// Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
9 changes: 8 additions & 1 deletion htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,19 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
// Call the ODTSubstitution hook
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) {
// Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,21 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
dol_syslog($e->getMessage(), LOG_INFO);
}

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

// Make substitutions into odt of user info
$tmparray = $this->get_substitutionarray_user($user, $outputlangs);
foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
//var_dump($value);exit;
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand All @@ -397,7 +404,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
if (preg_match('/logo$/', $key)) { // Image
//var_dump($value);exit;
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand All @@ -419,7 +426,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand All @@ -437,7 +444,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand All @@ -464,7 +471,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
if (preg_match('/logo$/', $key)) {
// Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,20 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

//var_dump($tmparray); exit;
foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
//var_dump($value);exit;
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
10 changes: 9 additions & 1 deletion htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,20 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $mode =
'substitutionarray' => &$tmparray
);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) {
// Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
9 changes: 8 additions & 1 deletion htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,19 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) {
// Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '')
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '')
$tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,19 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
// Call the ODTSubstitution hook
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
9 changes: 8 additions & 1 deletion htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,19 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

// Replace variables into document
foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

// retrieve the constant to apply a ratio for image size or set the ratio to 1
if (getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO')) {
$ratio = floatval(getDolGlobalString('MAIN_DOC_ODT_IMAGE_RATIO'));
} else {
$ratio = 1;
}

foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
$odfHandler->setImage($key, $value, $ratio);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
Expand Down
Loading