@@ -5431,7 +5431,9 @@ |
||
5431 | 5431 | $result = $bankstatic->fetch($selected); |
5432 | 5432 | if ($result) { |
5433 | 5433 | print $bankstatic->label; |
5434 | - if ($showibanbic) print ' (' . $bankstatic->iban . '/' .$bankstatic->bic. ')'; |
|
5434 | + if ($showibanbic) { |
|
5435 | + print ' (' . $bankstatic->iban . '/' .$bankstatic->bic. ')'; |
|
5436 | + } |
|
5435 | 5437 | } |
5436 | 5438 | } else { |
5437 | 5439 | print " "; |
@@ -88,10 +88,16 @@ discard block |
||
88 | 88 | { |
89 | 89 | // To provide debug information on line number processed |
90 | 90 | global $count; |
91 | - if (empty($count)) $count=1; |
|
92 | - else $count++; |
|
91 | + if (empty($count)) { |
|
92 | + $count=1; |
|
93 | + } else { |
|
94 | + $count++; |
|
95 | + } |
|
93 | 96 | |
94 | - if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps |
|
97 | + if (empty($this->savxml)) { |
|
98 | + $this->savxml = $this->xml; |
|
99 | + } |
|
100 | + // Sav content of line at first line merged, so we will reuse original for next steps |
|
95 | 101 | $this->xml = $this->savxml; |
96 | 102 | $tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values |
97 | 103 | |
@@ -123,7 +129,9 @@ discard block |
||
123 | 129 | $reg = '@\[!--\sIF\s' . preg_quote($key, '@') . '\s--\](.*)(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
124 | 130 | preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); |
125 | 131 | foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause |
126 | - if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml); |
|
132 | + if (!empty($match[3])) { |
|
133 | + $this->xml = str_replace($match[0], $match[3], $this->xml); |
|
134 | + } |
|
127 | 135 | } |
128 | 136 | // Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether) |
129 | 137 | $this->xml = preg_replace($reg, '', $this->xml); |
@@ -78,7 +78,10 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | $md5uniqid = md5(uniqid()); |
81 | - if ($this->config['PATH_TO_TMP']) $this->tmpdir = preg_replace('|[\/]$|', '', $this->config['PATH_TO_TMP']); // Remove last \ or / |
|
81 | + if ($this->config['PATH_TO_TMP']) { |
|
82 | + $this->tmpdir = preg_replace('|[\/]$|', '', $this->config['PATH_TO_TMP']); |
|
83 | + } |
|
84 | + // Remove last \ or / |
|
82 | 85 | $this->tmpdir .= ($this->tmpdir?'/':'').$md5uniqid; |
83 | 86 | $this->tmpfile = $this->tmpdir.'/'.$md5uniqid.'.odt'; // We keep .odt extension to allow OpenOffice usage during debug. |
84 | 87 | |
@@ -94,7 +97,9 @@ discard block |
||
94 | 97 | |
95 | 98 | // Load zip proxy |
96 | 99 | $zipHandler = $this->config['ZIP_PROXY']; |
97 | - if (!defined('PCLZIP_TEMPORARY_DIR')) define('PCLZIP_TEMPORARY_DIR', $this->tmpdir); |
|
100 | + if (!defined('PCLZIP_TEMPORARY_DIR')) { |
|
101 | + define('PCLZIP_TEMPORARY_DIR', $this->tmpdir); |
|
102 | + } |
|
98 | 103 | include_once 'zip/'.$zipHandler.'.php'; |
99 | 104 | if (! class_exists($this->config['ZIP_PROXY'])) { |
100 | 105 | throw new OdfException($this->config['ZIP_PROXY'] . ' class not found - check your php settings'); |
@@ -236,8 +241,12 @@ discard block |
||
236 | 241 | */ |
237 | 242 | private function _replaceHtmlWithOdtTag($tags, &$customStyles, &$fontDeclarations, $encode = false, $charset = '') |
238 | 243 | { |
239 | - if ($customStyles == null) $customStyles = array(); |
|
240 | - if ($fontDeclarations == null) $fontDeclarations = array(); |
|
244 | + if ($customStyles == null) { |
|
245 | + $customStyles = array(); |
|
246 | + } |
|
247 | + if ($fontDeclarations == null) { |
|
248 | + $fontDeclarations = array(); |
|
249 | + } |
|
241 | 250 | |
242 | 251 | $odtResult = ''; |
243 | 252 | |
@@ -556,10 +565,15 @@ discard block |
||
556 | 565 | */ |
557 | 566 | private function _parse($type = 'content') |
558 | 567 | { |
559 | - if ($type == 'content') $xml = &$this->contentXml; |
|
560 | - elseif ($type == 'styles') $xml = &$this->stylesXml; |
|
561 | - elseif ($type == 'meta') $xml = &$this->metaXml; |
|
562 | - else return; |
|
568 | + if ($type == 'content') { |
|
569 | + $xml = &$this->contentXml; |
|
570 | + } elseif ($type == 'styles') { |
|
571 | + $xml = &$this->stylesXml; |
|
572 | + } elseif ($type == 'meta') { |
|
573 | + $xml = &$this->metaXml; |
|
574 | + } else { |
|
575 | + return; |
|
576 | + } |
|
563 | 577 | |
564 | 578 | // Search all tags found into condition to complete $this->vars, so we will proceed all tests even if not defined |
565 | 579 | $reg='@\[!--\sIF\s([\[\]{}a-zA-Z0-9\.\,_]+)\s--\]@smU'; |
@@ -600,7 +614,9 @@ discard block |
||
600 | 614 | $reg = '@\[!--\sIF\s' . preg_quote($key, '@') . '\s--\](.*)(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
601 | 615 | preg_match_all($reg, $xml, $matches, PREG_SET_ORDER); |
602 | 616 | foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause |
603 | - if (!empty($match[3])) $xml = str_replace($match[0], $match[3], $xml); |
|
617 | + if (!empty($match[3])) { |
|
618 | + $xml = str_replace($match[0], $match[3], $xml); |
|
619 | + } |
|
604 | 620 | } |
605 | 621 | // Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether) |
606 | 622 | $xml = preg_replace($reg, '', $xml); |
@@ -754,7 +770,9 @@ discard block |
||
754 | 770 | */ |
755 | 771 | public function setMetaData() |
756 | 772 | { |
757 | - if (empty($this->creator)) $this->creator=''; |
|
773 | + if (empty($this->creator)) { |
|
774 | + $this->creator=''; |
|
775 | + } |
|
758 | 776 | |
759 | 777 | $this->metaXml = preg_replace('/<dc:date>.*<\/dc:date>/', '<dc:date>'.gmdate("Y-m-d\TH:i:s").'</dc:date>', $this->metaXml); |
760 | 778 | $this->metaXml = preg_replace('/<dc:creator>.*<\/dc:creator>/', '<dc:creator>'.htmlspecialchars($this->creator).'</dc:creator>', $this->metaXml); |
@@ -822,7 +840,9 @@ discard block |
||
822 | 840 | { |
823 | 841 | global $conf; |
824 | 842 | |
825 | - if ( $name == "" ) $name = "temp".md5(uniqid()); |
|
843 | + if ( $name == "" ) { |
|
844 | + $name = "temp".md5(uniqid()); |
|
845 | + } |
|
826 | 846 | |
827 | 847 | dol_syslog(get_class($this).'::exportAsAttachedPDF $name='.$name, LOG_DEBUG); |
828 | 848 | $this->saveToDisk($name); |
@@ -1381,7 +1381,9 @@ |
||
1381 | 1381 | $i = 0; |
1382 | 1382 | foreach ($fichinters as $fichinter) { |
1383 | 1383 | $i++; |
1384 | - if ($i > $limit) break; |
|
1384 | + if ($i > $limit) { |
|
1385 | + break; |
|
1386 | + } |
|
1385 | 1387 | |
1386 | 1388 | print "\t".'<tr class="oddeven">'."\n"; |
1387 | 1389 | print '<td class="nowrap tdtop">'; |