@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | $this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace'; |
140 | 140 | |
141 | 141 | // For dolistore modules |
142 | - $this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/'); // 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/' |
|
142 | + $this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/'); // 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/' |
|
143 | 143 | $this->dolistore_api_key = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_KEY', 'dolistorepublicapi'); |
144 | - $this->shop_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com'); |
|
144 | + $this->shop_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com'); |
|
145 | 145 | |
146 | 146 | // For community modules |
147 | 147 | $this->file_source_url = "https://raw.githubusercontent.com/Dolibarr/dolibarr-community-modules/refs/heads/main/index.yaml"; |
@@ -204,12 +204,12 @@ discard block |
||
204 | 204 | $httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword); |
205 | 205 | } |
206 | 206 | |
207 | - $url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource; |
|
207 | + $url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource; |
|
208 | 208 | |
209 | 209 | $options['apikey'] = $this->dolistore_api_key; |
210 | 210 | |
211 | 211 | if ($options) { |
212 | - $url .= '?' . http_build_query($options); |
|
212 | + $url .= '?'.http_build_query($options); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | $response = getURLContent($url, 'GET', '', 1, $httpheader, array('https'), 0, -1, 5, 5); |
@@ -251,13 +251,13 @@ discard block |
||
251 | 251 | $modules = array(); |
252 | 252 | |
253 | 253 | if (!empty($this->cache_file) && file_exists($this->cache_file)) { |
254 | - dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG); |
|
254 | + dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG); |
|
255 | 255 | |
256 | 256 | $content = file_get_contents($this->cache_file); |
257 | 257 | if ($content !== false) { |
258 | 258 | $modules = $this->readYaml($content); |
259 | 259 | } else { |
260 | - dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR); |
|
260 | + dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR); |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
@@ -285,20 +285,20 @@ discard block |
||
285 | 285 | if (isset($resCategories['response']) && is_array($resCategories['response'])) { |
286 | 286 | $organized_tree = $resCategories['response']; |
287 | 287 | } else { |
288 | - return $html ; |
|
288 | + return $html; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | $html = ''; |
292 | 292 | foreach ($organized_tree as $key => $value) { |
293 | 293 | if ($value['label'] != "Versions" && $value['label'] != "Specials") { |
294 | - $html .= '<li' . ($current == $value['rowid'] ? ' class="active"' : '') . '>'; |
|
295 | - $html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>'; |
|
294 | + $html .= '<li'.($current == $value['rowid'] ? ' class="active"' : '').'>'; |
|
295 | + $html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>'; |
|
296 | 296 | if (isset($value['children'])) { |
297 | 297 | $html .= '<ul>'; |
298 | 298 | usort($value['children'], $this->buildSorter('position')); |
299 | 299 | foreach ($value['children'] as $key_children => $value_children) { |
300 | - $html .= '<li' . ($current == $value_children['rowid'] ? ' class="active"' : '') . '>'; |
|
301 | - $html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>'; |
|
300 | + $html .= '<li'.($current == $value_children['rowid'] ? ' class="active"' : '').'>'; |
|
301 | + $html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>'; |
|
302 | 302 | $html .= '</li>'; |
303 | 303 | } |
304 | 304 | $html .= '</ul>'; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | |
322 | 322 | $html = ""; |
323 | 323 | $last_month = dol_now() - (30 * 24 * 60 * 60); |
324 | - $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
324 | + $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
325 | 325 | |
326 | 326 | $this->products = array(); |
327 | 327 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $this->no_page = $options['no_page'] ?? 1; |
331 | 331 | $this->search = $options['search'] ?? ''; |
332 | 332 | |
333 | - $this->per_page = 11; // We fix number of products per page to 11 |
|
333 | + $this->per_page = 11; // We fix number of products per page to 11 |
|
334 | 334 | |
335 | 335 | // Length of $search must be at least 2 characters |
336 | 336 | if (!empty($this->search) && strlen(str_replace(' ', '', (string) $this->search)) < 2) { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $fileProducts = array(); |
372 | 372 | $fileProductsTotal = 0; |
373 | 373 | if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) { |
374 | - $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
374 | + $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
375 | 375 | |
376 | 376 | $fileProducts = $this->adaptData($fileProducts, 'githubcommunity'); |
377 | 377 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $download_link .= img_picto('', 'file-code', 'class="size2x paddingright"'); |
430 | 430 | $download_link .= '</a>'; |
431 | 431 | |
432 | - $urlview = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
432 | + $urlview = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
433 | 433 | if ($urlview) { |
434 | 434 | $download_link .= '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'" rel="noopener noreferrer">'; |
435 | 435 | $download_link .= img_picto('', 'url', 'class="size2x"'); |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | } |
448 | 448 | } |
449 | 449 | } elseif ($product['source'] === 'dolistore') { |
450 | - $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id']; |
|
450 | + $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$product['id']; |
|
451 | 451 | $download_link = '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$this->shop_url.'/product.php?id='.((int) $product["id"]).'">'; |
452 | 452 | $download_link .= img_picto('', 'url', 'class="size2x"'); |
453 | 453 | $download_link .= '</a>'; |
@@ -505,12 +505,12 @@ discard block |
||
505 | 505 | // Output the line |
506 | 506 | $html .= '<tr class="app oddeven nohover '.dol_escape_htmltag($compatible).'">'; |
507 | 507 | $html .= '<td class="center width150"><div class="newAppParent">'; |
508 | - $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
508 | + $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
509 | 509 | $html .= '</div></td>'; |
510 | 510 | $html .= '<td class="margeCote"><h2 class="appTitle">'; |
511 | 511 | $html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"])); |
512 | 512 | $html .= '<br><small>'; |
513 | - $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
513 | + $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
514 | 514 | $html .= '</small></h2>'; |
515 | 515 | $html .= '<small> '; |
516 | 516 | if (empty($product['tms'])) { |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | $this->numberOfProducts = count($this->products); |
545 | 545 | |
546 | - return $html ; |
|
546 | + return $html; |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | /** |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | * @param array<string, mixed> $b |
561 | 561 | * @return int |
562 | 562 | */ |
563 | - function (array $a, array $b) use ($key) { |
|
563 | + function(array $a, array $b) use ($key) { |
|
564 | 564 | $valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : ''; |
565 | 565 | $valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : ''; |
566 | 566 | |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | $pagelist .= '<li class="pagination">'; |
720 | 720 | $pagelist .= '<label for="page_input">Page </label>'; |
721 | 721 | if ($this->categorie != 0) { |
722 | - $pagelist .= '<input type="hidden" name="categorie" value="' . $this->categorie . '">'; |
|
722 | + $pagelist .= '<input type="hidden" name="categorie" value="'.$this->categorie.'">'; |
|
723 | 723 | } |
724 | 724 | $pagelist .= '<input type="text" id="page_input" name="no_page" value="'.($page).'" min="1" max="'.$nbpages.'" class="width40 page_input" oninput="if(this.value > '.$nbpages.') this.value='.$nbpages.'">'; |
725 | 725 | $pagelist .= ' / '.$nbpages; |
@@ -769,17 +769,17 @@ discard block |
||
769 | 769 | } |
770 | 770 | |
771 | 771 | // Get the predefined error message or use a default one |
772 | - $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code']; |
|
772 | + $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code']; |
|
773 | 773 | |
774 | 774 | // Append error details if available |
775 | 775 | if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) { |
776 | 776 | foreach ($request['response']['errors'] as $error) { |
777 | - $error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message']; |
|
777 | + $error_message .= ' - (Code '.$error['code'].'): '.$error['message']; |
|
778 | 778 | } |
779 | 779 | } |
780 | 780 | |
781 | 781 | if (!empty($request['curl_error_msg'])) { |
782 | - $error_message .= ' - ' . $request['curl_error_msg']; |
|
782 | + $error_message .= ' - '.$request['curl_error_msg']; |
|
783 | 783 | } |
784 | 784 | |
785 | 785 | // Return the formatted error message |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | if (!file_exists($cache_file) || filemtime($cache_file) < (dol_now() - $cache_time)) { |
808 | 808 | // We get remote url |
809 | 809 | $addheaders = array(); |
810 | - $result = getURLContent($file_source_url, 'GET', '', 1, $addheaders); // TODO Force timeout to 5 s on both connect and response. |
|
810 | + $result = getURLContent($file_source_url, 'GET', '', 1, $addheaders); // TODO Force timeout to 5 s on both connect and response. |
|
811 | 811 | if (!empty($result) && $result['http_code'] == 200) { |
812 | 812 | $yaml = $result['content']; |
813 | 813 | file_put_contents($cache_file, $yaml); |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | continue; |
913 | 913 | } |
914 | 914 | $adaptedPackage = [ |
915 | - 'ref' => str_replace(' ', '', $package['modulename'] . '-' . $package['current_version'] . '@' . |
|
915 | + 'ref' => str_replace(' ', '', $package['modulename'].'-'.$package['current_version'].'@'. |
|
916 | 916 | (array_key_exists('author', $package) ? $package['author'] : 'unkownauthor')), |
917 | 917 | 'label' => !empty($package['label'][substr($this->lang, 0, 2)]) |
918 | 918 | ? $package['label'][substr($this->lang, 0, 2)] |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | * |
1018 | 1018 | * @return int |
1019 | 1019 | */ |
1020 | - static function ($a, $b) { |
|
1020 | + static function($a, $b) { |
|
1021 | 1021 | return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); |
1022 | 1022 | } |
1023 | 1023 | ); |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | * |
1033 | 1033 | * @return bool |
1034 | 1034 | */ |
1035 | - static function ($package) use ($options) { |
|
1035 | + static function($package) use ($options) { |
|
1036 | 1036 | return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false; |
1037 | 1037 | } |
1038 | 1038 | ); |
@@ -1048,7 +1048,7 @@ discard block |
||
1048 | 1048 | * |
1049 | 1049 | * @return bool |
1050 | 1050 | */ |
1051 | - static function ($package) use ($options) { |
|
1051 | + static function($package) use ($options) { |
|
1052 | 1052 | return in_array($options['categorieid'], $package['category']); |
1053 | 1053 | } |
1054 | 1054 | ); |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | $cancel = GETPOST('cancel', 'alpha'); |
118 | 118 | $backtopage = GETPOST('backtopage', 'alpha'); |
119 | 119 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
120 | -$confirm = GETPOST('confirm', 'alpha'); |
|
121 | -$canvas = GETPOST('canvas', 'alpha'); |
|
120 | +$confirm = GETPOST('confirm', 'alpha'); |
|
121 | +$canvas = GETPOST('canvas', 'alpha'); |
|
122 | 122 | |
123 | 123 | $dol_openinpopup = ''; |
124 | 124 | |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | // Permissions |
164 | -$permissiontoread = $user->hasRight('societe', 'lire'); |
|
165 | -$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
164 | +$permissiontoread = $user->hasRight('societe', 'lire'); |
|
165 | +$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
166 | 166 | $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); |
167 | -$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
167 | +$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
168 | 168 | $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php |
169 | 169 | $permissiontoeditextra = $permissiontoadd; |
170 | 170 | if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); |
173 | 173 | } |
174 | 174 | |
175 | -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
175 | +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
176 | 176 | |
177 | 177 | // Security check |
178 | 178 | $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
202 | 202 | $backtopage = $backurlforlist; |
203 | 203 | } else { |
204 | - $backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__') . (!empty($canvas) ? "&canvas=" . $canvas : ""); |
|
204 | + $backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__').(!empty($canvas) ? "&canvas=".$canvas : ""); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) { |
221 | 221 | $soc_origin_id = GETPOSTINT('soc_origin'); |
222 | - $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
222 | + $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
223 | 223 | |
224 | 224 | if ($soc_origin_id <= 0) { |
225 | 225 | $langs->load('errors'); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | if ($action == 'update_extras' && $permissiontoeditextra) { |
268 | 268 | $object->fetch($socid); |
269 | 269 | |
270 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
270 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
271 | 271 | |
272 | 272 | $attribute_name = GETPOST('attribute', 'aZ09'); |
273 | 273 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | if (!$error) { |
324 | 324 | if ($action == 'update') { // Test on permission not required here |
325 | 325 | $ret = $object->fetch($socid); |
326 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
326 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
327 | 327 | } else { |
328 | 328 | $object->canvas = $canvas; |
329 | 329 | } |
@@ -334,19 +334,19 @@ discard block |
||
334 | 334 | $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); |
335 | 335 | $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
336 | 336 | // Add non official properties |
337 | - $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
338 | - $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
337 | + $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
338 | + $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
339 | 339 | } else { |
340 | - $object->name = GETPOST('name', 'alphanohtml'); |
|
340 | + $object->name = GETPOST('name', 'alphanohtml'); |
|
341 | 341 | } |
342 | 342 | $object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity); |
343 | - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
343 | + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
344 | 344 | $object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent; |
345 | 345 | $object->address = GETPOST('address', 'alphanohtml'); |
346 | - $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
347 | - $object->town = GETPOST('town', 'alphanohtml'); |
|
348 | - $object->country_id = GETPOSTINT('country_id'); |
|
349 | - $object->state_id = GETPOSTINT('state_id'); |
|
346 | + $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
347 | + $object->town = GETPOST('town', 'alphanohtml'); |
|
348 | + $object->country_id = GETPOSTINT('country_id'); |
|
349 | + $object->state_id = GETPOSTINT('state_id'); |
|
350 | 350 | |
351 | 351 | $object->socialnetworks = array(); |
352 | 352 | if (isModEnabled('socialnetworks')) { |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | } |
359 | 359 | |
360 | 360 | $object->phone = GETPOST('phone', 'alpha'); |
361 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
361 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
362 | 362 | $object->fax = GETPOST('fax', 'alpha'); |
363 | 363 | $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
364 | - $object->no_email = GETPOSTINT("no_email"); |
|
364 | + $object->no_email = GETPOSTINT("no_email"); |
|
365 | 365 | $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
366 | 366 | $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); |
367 | 367 | $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); |
@@ -371,13 +371,13 @@ discard block |
||
371 | 371 | $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); |
372 | 372 | $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); |
373 | 373 | $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); |
374 | - $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
374 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
375 | 375 | $object->capital = GETPOSTFLOAT('capital'); |
376 | 376 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
377 | 377 | |
378 | 378 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
379 | 379 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
380 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
380 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
381 | 381 | $object->status = GETPOSTINT('status'); |
382 | 382 | |
383 | 383 | // Local Taxes |
@@ -387,9 +387,9 @@ discard block |
||
387 | 387 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
388 | 388 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
389 | 389 | |
390 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
390 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
391 | 391 | $object->effectif_id = GETPOSTINT('effectif_id'); |
392 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
392 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
393 | 393 | |
394 | 394 | $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type |
395 | 395 | |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
399 | 399 | $prospectcustomer = $customer + $prospect; |
400 | 400 | |
401 | - $object->client = $prospectcustomer; |
|
402 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
401 | + $object->client = $prospectcustomer; |
|
402 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
403 | 403 | |
404 | 404 | if ($action == 'add') { |
405 | 405 | // for prospect, customer or supplier |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | if ($object->fournisseur > 0) { |
422 | - $object->cond_reglement_supplier_id = $paymentTermId; |
|
422 | + $object->cond_reglement_supplier_id = $paymentTermId; |
|
423 | 423 | |
424 | 424 | $filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method) |
425 | 425 | if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) { |
@@ -429,15 +429,15 @@ discard block |
||
429 | 429 | } |
430 | 430 | } |
431 | 431 | |
432 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
433 | - $object->default_lang = GETPOST('default_lang'); |
|
432 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
433 | + $object->default_lang = GETPOST('default_lang'); |
|
434 | 434 | |
435 | 435 | // Webservices url/key |
436 | 436 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
437 | 437 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
438 | 438 | |
439 | 439 | if (GETPOSTISSET('accountancy_code_sell')) { |
440 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
440 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
441 | 441 | |
442 | 442 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
443 | 443 | $object->accountancy_code_sell = ''; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | } |
447 | 447 | } |
448 | 448 | if (GETPOSTISSET('accountancy_code_buy')) { |
449 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
449 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
450 | 450 | |
451 | 451 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
452 | 452 | $object->accountancy_code_buy = ''; |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | // Delete third party |
822 | 822 | if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) { |
823 | 823 | $object->fetch($socid); |
824 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
824 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
825 | 825 | $result = $object->delete($socid, $user); |
826 | 826 | |
827 | 827 | if ($result > 0) { |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | } else { |
900 | 900 | $db->commit(); |
901 | 901 | $db->close(); |
902 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
902 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
903 | 903 | exit; |
904 | 904 | } |
905 | 905 | } else { |
@@ -1080,21 +1080,21 @@ discard block |
||
1080 | 1080 | } |
1081 | 1081 | |
1082 | 1082 | $object->phone = GETPOST('phone', 'alpha'); |
1083 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1083 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
1084 | 1084 | $object->fax = GETPOST('fax', 'alpha'); |
1085 | 1085 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
1086 | 1086 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
1087 | - $object->capital = GETPOSTFLOAT('capital'); |
|
1087 | + $object->capital = GETPOSTFLOAT('capital'); |
|
1088 | 1088 | $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1089 | 1089 | if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { |
1090 | 1090 | $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
1091 | 1091 | } |
1092 | - $object->cond_reglement_id = $paymentTermId; |
|
1092 | + $object->cond_reglement_id = $paymentTermId; |
|
1093 | 1093 | $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables |
1094 | 1094 | if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { |
1095 | 1095 | $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
1096 | 1096 | } |
1097 | - $object->mode_reglement_id = $paymentTypeId; |
|
1097 | + $object->mode_reglement_id = $paymentTypeId; |
|
1098 | 1098 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
1099 | 1099 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
1100 | 1100 | $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); |
@@ -1107,7 +1107,7 @@ discard block |
||
1107 | 1107 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
1108 | 1108 | |
1109 | 1109 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
1110 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1110 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
1111 | 1111 | $object->status = GETPOSTINT('status'); |
1112 | 1112 | |
1113 | 1113 | //Local Taxes |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | $object->default_lang = GETPOST('default_lang'); |
1124 | 1124 | |
1125 | 1125 | if (GETPOSTISSET('accountancy_code_sell')) { |
1126 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1126 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
1127 | 1127 | |
1128 | 1128 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
1129 | 1129 | $object->accountancy_code_sell = ''; |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | } |
1133 | 1133 | } |
1134 | 1134 | if (GETPOSTISSET('accountancy_code_buy')) { |
1135 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1135 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
1136 | 1136 | |
1137 | 1137 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
1138 | 1138 | $object->accountancy_code_buy = ''; |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | |
1258 | 1258 | print '<script type="text/javascript">'; |
1259 | 1259 | print '$(document).ready(function () { |
1260 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
1260 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
1261 | 1261 | |
1262 | 1262 | init_customer_categ(); |
1263 | 1263 | $("#customerprospect").change(function() { |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>'; |
1330 | 1330 | |
1331 | 1331 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">'; |
1332 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1332 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
1333 | 1333 | // This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php |
1334 | 1334 | // on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input. |
1335 | 1335 | /* |
@@ -1449,8 +1449,8 @@ discard block |
||
1449 | 1449 | |
1450 | 1450 | // Prospect/Customer/Supplier |
1451 | 1451 | $selected = $object->client; |
1452 | - $selectedcustomer = (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 || getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 ? 1 : 0); |
|
1453 | - $selectedprospect = (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 || getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 ? 1 : 0); |
|
1452 | + $selectedcustomer = (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 1 || getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 ? 1 : 0); |
|
1453 | + $selectedprospect = (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 2 || getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 ? 1 : 0); |
|
1454 | 1454 | switch ($selected) { |
1455 | 1455 | case 1: |
1456 | 1456 | $selectedcustomer = 1; |
@@ -1702,7 +1702,7 @@ discard block |
||
1702 | 1702 | print '<td></td>'; |
1703 | 1703 | print '<td></td>'; |
1704 | 1704 | } |
1705 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1705 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
1706 | 1706 | print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
1707 | 1707 | print '</tr>'; |
1708 | 1708 | } |
@@ -1750,7 +1750,7 @@ discard block |
||
1750 | 1750 | // Vat is used |
1751 | 1751 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
1752 | 1752 | print '<td>'; |
1753 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation |
|
1753 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation |
|
1754 | 1754 | print '</td>'; |
1755 | 1755 | if ($conf->browser->layout == 'phone') { |
1756 | 1756 | print '</tr><tr>'; |
@@ -1791,7 +1791,7 @@ discard block |
||
1791 | 1791 | |
1792 | 1792 | // VAT reverse charge by default |
1793 | 1793 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
1794 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
1794 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
1795 | 1795 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
1796 | 1796 | print '</td></tr>'; |
1797 | 1797 | } |
@@ -1800,21 +1800,21 @@ discard block |
||
1800 | 1800 | //TODO: Place into a function to control showing by country or study better option |
1801 | 1801 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
1802 | 1802 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
1803 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1803 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1804 | 1804 | print '</td>'; |
1805 | 1805 | if ($conf->browser->layout == 'phone') { |
1806 | 1806 | print '</tr><tr>'; |
1807 | 1807 | } |
1808 | 1808 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
1809 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1809 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1810 | 1810 | print '</td></tr>'; |
1811 | 1811 | } elseif ($mysoc->localtax1_assuj == "1") { |
1812 | 1812 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1813 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
1813 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
1814 | 1814 | print '</td></tr>'; |
1815 | 1815 | } elseif ($mysoc->localtax2_assuj == "1") { |
1816 | 1816 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
1817 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
1817 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
1818 | 1818 | print '</td></tr>'; |
1819 | 1819 | } |
1820 | 1820 | |
@@ -2051,7 +2051,7 @@ discard block |
||
2051 | 2051 | $prefixSupplierIsUsed = false; |
2052 | 2052 | } |
2053 | 2053 | |
2054 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
2054 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
2055 | 2055 | |
2056 | 2056 | if (GETPOSTISSET('name')) { |
2057 | 2057 | // We overwrite with values if posted |
@@ -2079,10 +2079,10 @@ discard block |
||
2079 | 2079 | } |
2080 | 2080 | |
2081 | 2081 | $object->phone = GETPOST('phone', 'alpha'); |
2082 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2082 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
2083 | 2083 | $object->fax = GETPOST('fax', 'alpha'); |
2084 | 2084 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
2085 | - $object->no_email = GETPOSTINT("no_email"); |
|
2085 | + $object->no_email = GETPOSTINT("no_email"); |
|
2086 | 2086 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
2087 | 2087 | $object->capital = GETPOSTFLOAT('capital'); |
2088 | 2088 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
@@ -2098,16 +2098,16 @@ discard block |
||
2098 | 2098 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
2099 | 2099 | |
2100 | 2100 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
2101 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2101 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
2102 | 2102 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
2103 | - $object->status = GETPOSTINT('status'); |
|
2103 | + $object->status = GETPOSTINT('status'); |
|
2104 | 2104 | |
2105 | 2105 | // Webservices url/key |
2106 | 2106 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
2107 | 2107 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
2108 | 2108 | |
2109 | 2109 | if (GETPOSTISSET('accountancy_code_sell')) { |
2110 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2110 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
2111 | 2111 | |
2112 | 2112 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
2113 | 2113 | $object->accountancy_code_sell = ''; |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | } |
2117 | 2117 | } |
2118 | 2118 | if (GETPOSTISSET('accountancy_code_buy')) { |
2119 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2119 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
2120 | 2120 | |
2121 | 2121 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
2122 | 2122 | $object->accountancy_code_buy = ''; |
@@ -2198,7 +2198,7 @@ discard block |
||
2198 | 2198 | } |
2199 | 2199 | }); |
2200 | 2200 | |
2201 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
2201 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
2202 | 2202 | |
2203 | 2203 | init_customer_categ(); |
2204 | 2204 | $("#customerprospect").change(function() { |
@@ -2384,7 +2384,7 @@ discard block |
||
2384 | 2384 | $colspan = 3; |
2385 | 2385 | } |
2386 | 2386 | |
2387 | - print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>'; |
|
2387 | + print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>'; |
|
2388 | 2388 | print '<table class="nobordernopadding"><tr><td>'; |
2389 | 2389 | $tmpcode = $object->code_client ?? ''; |
2390 | 2390 | if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { |
@@ -2401,7 +2401,7 @@ discard block |
||
2401 | 2401 | print '</tr><tr>'; |
2402 | 2402 | } |
2403 | 2403 | |
2404 | - print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>'; |
|
2404 | + print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>'; |
|
2405 | 2405 | |
2406 | 2406 | if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { |
2407 | 2407 | print '<table class="nobordernopadding"><tr><td>'; |
@@ -2582,14 +2582,14 @@ discard block |
||
2582 | 2582 | |
2583 | 2583 | // VAT is used |
2584 | 2584 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
2585 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2585 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2586 | 2586 | print '</td></tr>'; |
2587 | 2587 | |
2588 | 2588 | // Local Taxes |
2589 | 2589 | //TODO: Place into a function to control showing by country or study better option |
2590 | 2590 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
2591 | 2591 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
2592 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2592 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2593 | 2593 | if (!isOnlyOneLocalTax(1)) { |
2594 | 2594 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2595 | 2595 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2598,7 +2598,7 @@ discard block |
||
2598 | 2598 | print '</td>'; |
2599 | 2599 | print '</tr><tr>'; |
2600 | 2600 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
2601 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
2601 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
2602 | 2602 | if (!isOnlyOneLocalTax(2)) { |
2603 | 2603 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2604 | 2604 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2607,7 +2607,7 @@ discard block |
||
2607 | 2607 | print '</td></tr>'; |
2608 | 2608 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
2609 | 2609 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2610 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2610 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2611 | 2611 | if (!isOnlyOneLocalTax(1)) { |
2612 | 2612 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2613 | 2613 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2616,7 +2616,7 @@ discard block |
||
2616 | 2616 | print '</td></tr>'; |
2617 | 2617 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
2618 | 2618 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
2619 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
2619 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
2620 | 2620 | if (!isOnlyOneLocalTax(2)) { |
2621 | 2621 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
2622 | 2622 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2627,7 +2627,7 @@ discard block |
||
2627 | 2627 | |
2628 | 2628 | // VAT reverse charge by default |
2629 | 2629 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
2630 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
2630 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
2631 | 2631 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
2632 | 2632 | print '</td></tr>'; |
2633 | 2633 | } |
@@ -2782,7 +2782,7 @@ discard block |
||
2782 | 2782 | $maxfilesizearray = getMaxFileSizeArray(); |
2783 | 2783 | $maxmin = $maxfilesizearray['maxmin']; |
2784 | 2784 | if ($maxmin > 0) { |
2785 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2785 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
2786 | 2786 | } |
2787 | 2787 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
2788 | 2788 | print '</td></tr>'; |
@@ -3018,7 +3018,7 @@ discard block |
||
3018 | 3018 | print '<tr><td>'; |
3019 | 3019 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
3020 | 3020 | print '</td><td>'; |
3021 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
3021 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
3022 | 3022 | print '</td>'; |
3023 | 3023 | print '</tr>'; |
3024 | 3024 | } |