@@ -235,7 +235,7 @@ |
||
| 235 | 235 | if (!function_exists('simplexml_load_string')) { |
| 236 | 236 | throw new PrestaShopWebserviceException('Method simplexml_load_string not available. Your PHP does not support xml.'); |
| 237 | 237 | } |
| 238 | - $xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
| 238 | + $xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
| 239 | 239 | if (libxml_get_errors()) { |
| 240 | 240 | $msg = var_export(libxml_get_errors(), true); |
| 241 | 241 | libxml_clear_errors(); |
@@ -129,7 +129,9 @@ |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $object->fields['fk_member']['visible'] = 0; |
| 132 | -if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1; |
|
| 132 | +if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) { |
|
| 133 | + $object->fields['reason_decline_or_cancel']['visible'] = 1; |
|
| 134 | +} |
|
| 133 | 135 | $object->fields['note_public']['visible'] = 1; |
| 134 | 136 | |
| 135 | 137 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; |
| 34 | 34 | |
| 35 | 35 | // Load translation files required by the page |
| 36 | -$langs->loadLangs(array("companies","members","partnership", "other")); |
|
| 36 | +$langs->loadLangs(array("companies", "members", "partnership", "other")); |
|
| 37 | 37 | |
| 38 | 38 | // Get parameters |
| 39 | 39 | $id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Initialize technical objects |
| 55 | -$object = new Partnership($db); |
|
| 56 | -$extrafields = new ExtraFields($db); |
|
| 57 | -$adht = new AdherentType($db); |
|
| 55 | +$object = new Partnership($db); |
|
| 56 | +$extrafields = new ExtraFields($db); |
|
| 57 | +$adht = new AdherentType($db); |
|
| 58 | 58 | $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; |
| 59 | 59 | $hookmanager->initHooks(array('partnershipthirdparty', 'globalcard')); // Note that conf->hooks_modules contains array |
| 60 | 60 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | if ($backupold) { |
| 158 | 158 | dol_delete_file($filetpl.'.old'); |
| 159 | 159 | $result = dol_move($filetpl, $filetpl.'.old', 0, 1, 0, 0); |
| 160 | - if (! $result) { |
|
| 160 | + if (!$result) { |
|
| 161 | 161 | return false; |
| 162 | 162 | } |
| 163 | 163 | } else { |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; |
| 347 | 347 | $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n"; |
| 348 | 348 | $indexcontent .= "}\n"; |
| 349 | - $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of . |
|
| 349 | + $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of . |
|
| 350 | 350 | $indexcontent .= '// END PHP ?>'."\n"; |
| 351 | 351 | $result = file_put_contents($fileindexsub, $indexcontent); |
| 352 | 352 | if ($result === false) { |
@@ -109,7 +109,9 @@ discard block |
||
| 109 | 109 | $filename = basename($filealias); |
| 110 | 110 | foreach (explode(',', $object->otherlang) as $sublang) { |
| 111 | 111 | // Avoid to erase main alias file if $sublang is empty string |
| 112 | - if (empty(trim($sublang))) continue; |
|
| 112 | + if (empty(trim($sublang))) { |
|
| 113 | + continue; |
|
| 114 | + } |
|
| 113 | 115 | $filealiassub = $dirname.'/'.$sublang.'/'.$filename; |
| 114 | 116 | |
| 115 | 117 | $aliascontent = '<?php'."\n"; |
@@ -332,7 +334,9 @@ discard block |
||
| 332 | 334 | $dirname = dirname($fileindex); |
| 333 | 335 | foreach (explode(',', $object->otherlang) as $sublang) { |
| 334 | 336 | // Avoid to erase main alias file if $sublang is empty string |
| 335 | - if (empty(trim($sublang))) continue; |
|
| 337 | + if (empty(trim($sublang))) { |
|
| 338 | + continue; |
|
| 339 | + } |
|
| 336 | 340 | $fileindexsub = $dirname.'/'.$sublang.'/index.php'; |
| 337 | 341 | |
| 338 | 342 | // Same indexcontent than previously but with ../ instead of ./ for master and tpl file include/require_once. |
@@ -254,7 +254,7 @@ |
||
| 254 | 254 | // Clean data |
| 255 | 255 | // $this->knowledgerecord->abc = sanitizeVal($this->knowledgerecord->abc, 'alphanohtml'); |
| 256 | 256 | |
| 257 | - if ($this->knowledgerecord->create(DolibarrApiAccess::$user)<0) { |
|
| 257 | + if ($this->knowledgerecord->create(DolibarrApiAccess::$user) < 0) { |
|
| 258 | 258 | throw new RestException(500, "Error creating KnowledgeRecord", array_merge(array($this->knowledgerecord->error), $this->knowledgerecord->errors)); |
| 259 | 259 | } |
| 260 | 260 | return $this->knowledgerecord->id; |
@@ -220,7 +220,7 @@ |
||
| 220 | 220 | // Clean data |
| 221 | 221 | // $this->myobject->abc = sanitizeVal($this->myobject->abc, 'alphanohtml'); |
| 222 | 222 | |
| 223 | - if ($this->myobject->create(DolibarrApiAccess::$user)<0) { |
|
| 223 | + if ($this->myobject->create(DolibarrApiAccess::$user) < 0) { |
|
| 224 | 224 | throw new RestException(500, "Error creating MyObject", array_merge(array($this->myobject->error), $this->myobject->errors)); |
| 225 | 225 | } |
| 226 | 226 | return $this->myobject->id; |
@@ -366,7 +366,7 @@ |
||
| 366 | 366 | $param .= "&type_element=".urlencode($type_element); |
| 367 | 367 | |
| 368 | 368 | $total_qty = 0; |
| 369 | -$num=0; |
|
| 369 | +$num = 0; |
|
| 370 | 370 | if ($sql_select) { |
| 371 | 371 | $resql = $db->query($sql); |
| 372 | 372 | if (!$resql) { |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | $sql .= " AND ".$extrafieldsobjectprefix.$tmpkey." = '".$db->idate($crit)."'"; |
| 34 | 34 | } elseif (is_array($crit)) { |
| 35 | 35 | if ($crit['start'] !== '' && $crit['end'] !== '') { |
| 36 | - $sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." BETWEEN '". $db->idate($crit['start']). "' AND '".$db->idate($crit['end']) . "')"; |
|
| 36 | + $sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." BETWEEN '".$db->idate($crit['start'])."' AND '".$db->idate($crit['end'])."')"; |
|
| 37 | 37 | } elseif ($crit['start'] !== '') { |
| 38 | - $sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." >= '". $db->idate($crit['start'])."')"; |
|
| 38 | + $sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." >= '".$db->idate($crit['start'])."')"; |
|
| 39 | 39 | } elseif ($crit['end'] !== '') { |
| 40 | - $sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." <= '". $db->idate($crit['end'])."')"; |
|
| 40 | + $sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." <= '".$db->idate($crit['end'])."')"; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } elseif (in_array($typ, array('boolean'))) { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $mode_search = 2; // Search on a foreign key int |
| 58 | 58 | } |
| 59 | 59 | if (in_array($typ, array('sellist')) && !is_numeric($crit)) { |
| 60 | - $mode_search = 0;// Search on a foreign key string |
|
| 60 | + $mode_search = 0; // Search on a foreign key string |
|
| 61 | 61 | } |
| 62 | 62 | if (in_array($typ, array('chkbxlst', 'checkbox', 'select'))) { |
| 63 | 63 | $mode_search = 4; // Search on a multiselect field with sql type = text |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @var string Id to identify managed objects |
| 35 | 35 | */ |
| 36 | - public $element = 'undefined'; // Will be defined into constructor |
|
| 36 | + public $element = 'undefined'; // Will be defined into constructor |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @var string Name of table without prefix where object is stored |
| 40 | 40 | */ |
| 41 | - public $table_element = 'undefined'; // Will be defined into constructor |
|
| 41 | + public $table_element = 'undefined'; // Will be defined into constructor |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * @var CtyperesourceLine[] Lines |
@@ -717,8 +717,11 @@ |
||
| 717 | 717 | $this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
| 718 | 718 | break; |
| 719 | 719 | case 'DOL_PRINT_CURR_DATE': |
| 720 | - if (strlen($vals[$tplline]['value'])<2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
| 721 | - else $this->printer->text(date($vals[$tplline]['value'])."\n"); |
|
| 720 | + if (strlen($vals[$tplline]['value'])<2) { |
|
| 721 | + $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
| 722 | + } else { |
|
| 723 | + $this->printer->text(date($vals[$tplline]['value'])."\n"); |
|
| 724 | + } |
|
| 722 | 725 | break; |
| 723 | 726 | case 'DOL_LINE_FEED': |
| 724 | 727 | $this->printer->feed(); |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | if ($line->fk_product) { |
| 712 | 712 | $spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - strlen($line->subprice) - 10 - 1; |
| 713 | 713 | $spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0); |
| 714 | - $this->printer->text($line->ref . $spaces . $line->qty . str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT) . ' ' . str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT) . "\n"); |
|
| 714 | + $this->printer->text($line->ref.$spaces.$line->qty.str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT).' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
|
| 715 | 715 | $this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n \n"); |
| 716 | 716 | } else { |
| 717 | 717 | $spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - strlen($line->subprice) - 10 - 1; |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | $this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
| 781 | 781 | break; |
| 782 | 782 | case 'DOL_PRINT_CURR_DATE': |
| 783 | - if (strlen($vals[$tplline]['value'])<2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
| 783 | + if (strlen($vals[$tplline]['value']) < 2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
| 784 | 784 | else $this->printer->text(date($vals[$tplline]['value'])."\n"); |
| 785 | 785 | break; |
| 786 | 786 | case 'DOL_LINE_FEED': |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | $this->printer->getPrintConnector() -> write("\x1e"); |
| 871 | 871 | break; |
| 872 | 872 | case 'DOL_BEEP_ALTERNATIVE': //if DOL_BEEP not works |
| 873 | - $this->printer->getPrintConnector() -> write(Printer::ESC . "B" . chr(4) . chr(1)); |
|
| 873 | + $this->printer->getPrintConnector() -> write(Printer::ESC."B".chr(4).chr(1)); |
|
| 874 | 874 | break; |
| 875 | 875 | case 'DOL_PRINT_ORDER_LINES': |
| 876 | 876 | foreach ($object->lines as $line) { |
@@ -920,11 +920,11 @@ discard block |
||
| 920 | 920 | } |
| 921 | 921 | break; |
| 922 | 922 | default: |
| 923 | - $parameters = array('vals' => $vals[$tplline],'object' => $object,'nbcharactbyline' => $nbcharactbyline); |
|
| 923 | + $parameters = array('vals' => $vals[$tplline], 'object' => $object, 'nbcharactbyline' => $nbcharactbyline); |
|
| 924 | 924 | $action = ''; |
| 925 | 925 | $reshook = $hookmanager->executeHooks('sendToPrinterAfter', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 926 | 926 | |
| 927 | - if (!$reshook || $reshook < 0 ) { |
|
| 927 | + if (!$reshook || $reshook < 0) { |
|
| 928 | 928 | $this->printer->text($vals[$tplline]['tag']); |
| 929 | 929 | $this->printer->text($vals[$tplline]['value']); |
| 930 | 930 | $this->errors[] = 'UnknowTag: <'.strtolower($vals[$tplline]['tag']).'>'; |