@@ -126,8 +126,8 @@ |
||
| 126 | 126 | public $usage_bill_time; // Is the time spent on project must be invoiced or not |
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | - * @var integer Event organization: Use Event Organization |
|
| 130 | - */ |
|
| 129 | + * @var integer Event organization: Use Event Organization |
|
| 130 | + */ |
|
| 131 | 131 | public $usage_organize_event; |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -156,7 +156,7 @@ |
||
| 156 | 156 | * $price Can be set to update AWP (Average Weighted Price) when you make a stock increase |
| 157 | 157 | * $dlc Eat-by date. Will be used if lot does not exists yet and will be created. |
| 158 | 158 | * $dluo Sell-by date. Will be used if lot does not exists yet and will be created. |
| 159 | - * |
|
| 159 | + * |
|
| 160 | 160 | * @param int $product_id Id product id {@min 1} {@from body} {@required true} |
| 161 | 161 | * @param int $warehouse_id Id warehouse {@min 1} {@from body} {@required true} |
| 162 | 162 | * @param float $qty Qty to add (Use negative value for a stock decrease) {@from body} {@required true} |
@@ -25,9 +25,11 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | - public function do() |
|
| 28 | + public function do { |
|
| 29 | + () |
|
| 29 | 30 | { |
| 30 | 31 | global $globalaaa, $globalbbb; |
| 32 | + } |
|
| 31 | 33 | echo 'dobbb'."\n"; |
| 32 | 34 | $globalaaa.='+bbb'; |
| 33 | 35 | $globalbbb.='+bbb'; |
@@ -27,8 +27,10 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | - public function do() |
|
| 30 | + public function do { |
|
| 31 | + () |
|
| 31 | 32 | { |
| 32 | 33 | echo 'doaaa'."\n"; |
| 33 | 34 | } |
| 35 | + } |
|
| 34 | 36 | } |
@@ -21,11 +21,11 @@ |
||
| 21 | 21 | protected $openned = false; |
| 22 | 22 | protected $filename; |
| 23 | 23 | protected $pclzip; |
| 24 | - /** |
|
| 25 | - * Class constructor |
|
| 26 | - * |
|
| 27 | - * @throws PclZipProxyException |
|
| 28 | - */ |
|
| 24 | + /** |
|
| 25 | + * Class constructor |
|
| 26 | + * |
|
| 27 | + * @throws PclZipProxyException |
|
| 28 | + */ |
|
| 29 | 29 | public function __construct($forcedir='') |
| 30 | 30 | { |
| 31 | 31 | if (! class_exists('PclZip')) { |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('ODTPHP_PATHTOPCLZIP')) define('ODTPHP_PATHTOPCLZIP','pclzip/'); |
|
| 2 | +if (! defined('ODTPHP_PATHTOPCLZIP')) { |
|
| 3 | + define('ODTPHP_PATHTOPCLZIP','pclzip/'); |
|
| 4 | +} |
|
| 3 | 5 | require_once ODTPHP_PATHTOPCLZIP.'pclzip.lib.php'; |
| 4 | 6 | require_once 'ZipInterface.php'; |
| 5 | 7 | class PclZipProxyException extends Exception |
@@ -32,7 +34,10 @@ discard block |
||
| 32 | 34 | throw new PclZipProxyException('PclZip class not loaded - PclZip library |
| 33 | 35 | is required for using PclZipProxy'); ; |
| 34 | 36 | } |
| 35 | - if ($forcedir) $this->tmpdir=preg_replace('|[//\/]$|','',$forcedir); // $this->tmpdir must not contains / at the end |
|
| 37 | + if ($forcedir) { |
|
| 38 | + $this->tmpdir=preg_replace('|[//\/]$|','',$forcedir); |
|
| 39 | + } |
|
| 40 | + // $this->tmpdir must not contains / at the end |
|
| 36 | 41 | } |
| 37 | 42 | |
| 38 | 43 | /** |
@@ -17,11 +17,11 @@ |
||
| 17 | 17 | { |
| 18 | 18 | protected $zipArchive; |
| 19 | 19 | protected $filename; |
| 20 | - /** |
|
| 21 | - * Class constructor |
|
| 22 | - * |
|
| 23 | - * @throws PhpZipProxyException |
|
| 24 | - */ |
|
| 20 | + /** |
|
| 21 | + * Class constructor |
|
| 22 | + * |
|
| 23 | + * @throws PhpZipProxyException |
|
| 24 | + */ |
|
| 25 | 25 | public function __construct() |
| 26 | 26 | { |
| 27 | 27 | if (! class_exists('ZipArchive')) { |
@@ -10,41 +10,41 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class SegmentIterator implements RecursiveIterator |
| 12 | 12 | { |
| 13 | - private $ref; |
|
| 14 | - private $key; |
|
| 15 | - public function __construct(array $ref) |
|
| 16 | - { |
|
| 17 | - $this->ref = $ref; |
|
| 18 | - $this->key = 0; |
|
| 19 | - $this->keys = array_keys($this->ref); |
|
| 20 | - } |
|
| 21 | - public function hasChildren() |
|
| 22 | - { |
|
| 23 | - return $this->valid() && $this->current() instanceof Segment; |
|
| 24 | - } |
|
| 25 | - public function current() |
|
| 26 | - { |
|
| 27 | - return $this->ref[$this->keys[$this->key]]; |
|
| 28 | - } |
|
| 29 | - function getChildren() |
|
| 30 | - { |
|
| 31 | - return new self($this->current()->children); |
|
| 32 | - } |
|
| 33 | - public function key() |
|
| 34 | - { |
|
| 35 | - return $this->key; |
|
| 36 | - } |
|
| 37 | - public function valid() |
|
| 38 | - { |
|
| 39 | - return array_key_exists($this->key, $this->keys); |
|
| 40 | - } |
|
| 41 | - public function rewind() |
|
| 42 | - { |
|
| 43 | - $this->key = 0; |
|
| 44 | - } |
|
| 45 | - public function next() |
|
| 46 | - { |
|
| 47 | - $this->key ++; |
|
| 48 | - } |
|
| 13 | + private $ref; |
|
| 14 | + private $key; |
|
| 15 | + public function __construct(array $ref) |
|
| 16 | + { |
|
| 17 | + $this->ref = $ref; |
|
| 18 | + $this->key = 0; |
|
| 19 | + $this->keys = array_keys($this->ref); |
|
| 20 | + } |
|
| 21 | + public function hasChildren() |
|
| 22 | + { |
|
| 23 | + return $this->valid() && $this->current() instanceof Segment; |
|
| 24 | + } |
|
| 25 | + public function current() |
|
| 26 | + { |
|
| 27 | + return $this->ref[$this->keys[$this->key]]; |
|
| 28 | + } |
|
| 29 | + function getChildren() |
|
| 30 | + { |
|
| 31 | + return new self($this->current()->children); |
|
| 32 | + } |
|
| 33 | + public function key() |
|
| 34 | + { |
|
| 35 | + return $this->key; |
|
| 36 | + } |
|
| 37 | + public function valid() |
|
| 38 | + { |
|
| 39 | + return array_key_exists($this->key, $this->keys); |
|
| 40 | + } |
|
| 41 | + public function rewind() |
|
| 42 | + { |
|
| 43 | + $this->key = 0; |
|
| 44 | + } |
|
| 45 | + public function next() |
|
| 46 | + { |
|
| 47 | + $this->key ++; |
|
| 48 | + } |
|
| 49 | 49 | } |
| 50 | 50 | |
@@ -156,17 +156,17 @@ |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | - * Function to replace macros for invoice short and long month, invoice year |
|
| 160 | - * |
|
| 161 | - * Substitution occur when the invoice is generated, not considering the invoice date |
|
| 162 | - * so do not (re)generate in a diferent date than the one that the invoice belongs to |
|
| 163 | - * Perhaps it would be better to use the invoice issued date but I still do not know |
|
| 164 | - * how to get it here |
|
| 165 | - * |
|
| 166 | - * Miguel Erill 09/04/2017 |
|
| 167 | - * |
|
| 168 | - * @param string $value String to convert |
|
| 169 | - */ |
|
| 159 | + * Function to replace macros for invoice short and long month, invoice year |
|
| 160 | + * |
|
| 161 | + * Substitution occur when the invoice is generated, not considering the invoice date |
|
| 162 | + * so do not (re)generate in a diferent date than the one that the invoice belongs to |
|
| 163 | + * Perhaps it would be better to use the invoice issued date but I still do not know |
|
| 164 | + * how to get it here |
|
| 165 | + * |
|
| 166 | + * Miguel Erill 09/04/2017 |
|
| 167 | + * |
|
| 168 | + * @param string $value String to convert |
|
| 169 | + */ |
|
| 170 | 170 | public function macroReplace($text) |
| 171 | 171 | { |
| 172 | 172 | include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
@@ -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' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $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); |
@@ -15,5 +15,5 @@ |
||
| 15 | 15 | // If possible, use a disk cache to enable attaching large attachments etc. |
| 16 | 16 | // You can override the default temporary directory by setting the TMPDIR environment variable. |
| 17 | 17 | if (@is_writable($tmpDir = sys_get_temp_dir())) { |
| 18 | - $preferences->setTempDir($tmpDir)->setCacheType('disk'); |
|
| 18 | + $preferences->setTempDir($tmpDir)->setCacheType('disk'); |
|
| 19 | 19 | } |