@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | |
| 110 | 110 | $parameters = array(); |
| 111 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 111 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 112 | 112 | // Delete Link |
| 113 | 113 | $permissiondellink = $user->hasRight('expedition', 'delivery', 'supprimer'); // Used by the include of actions_dellink.inc.php |
| 114 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 114 | +include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 115 | 115 | |
| 116 | 116 | if ($action == 'add' && $permissiontoadd) { |
| 117 | 117 | $array_options = array(); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | // Update extrafields |
| 213 | 213 | if ($action == 'update_extras' && $permissiontoadd) { |
| 214 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 214 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 215 | 215 | |
| 216 | 216 | // Fill array 'array_options' with data from update form |
| 217 | 217 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $morehtmlref = '<div class="refidno">'; |
| 349 | 349 | // Ref customer shipment |
| 350 | 350 | $morehtmlref .= $form->editfieldkey("RefCustomer", '', $expedition->ref_customer, $expedition, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1); |
| 351 | - $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->hasRight('expedition', 'creer'), 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 351 | + $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->hasRight('expedition', 'creer'), 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 352 | 352 | $morehtmlref .= '<br>'.$langs->trans("RefDeliveryReceipt").' : '.$object->ref; |
| 353 | 353 | // Thirdparty |
| 354 | 354 | $morehtmlref .= '<br>'.$expedition->thirdparty->getNomUrl(1); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 131 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 132 | 132 | $triggermodname = 'ASSET_MODIFY'; // Name of trigger action code to execute when we modify record |
| 133 | 133 | |
| 134 | 134 | // Action dispose object |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | if (GETPOSTISSET('supplier_invoice_id')) { |
| 201 | 201 | $object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => 1, 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',); |
| 202 | - print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOSTINT('supplier_invoice_id') . '">'; |
|
| 202 | + print '<input type="hidden" name="supplier_invoice_id" value="'.GETPOSTINT('supplier_invoice_id').'">'; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | print dol_get_fiche_head(array(), ''); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated), |
| 301 | 301 | array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat), |
| 302 | 302 | ); |
| 303 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1); |
|
| 303 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref.' - '.$object->label), 'confirm_disposal', $formquestion, 'yes', 1); |
|
| 304 | 304 | } elseif ($action == 'reopen') { |
| 305 | 305 | // Re-open |
| 306 | 306 | // Create an array for form |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | print '<table class="border centpercent tableforfield">'."\n"; |
| 345 | 345 | |
| 346 | 346 | // Common attributes |
| 347 | - $keyforbreak = 'date_acquisition'; // We change column just before this field |
|
| 347 | + $keyforbreak = 'date_acquisition'; // We change column just before this field |
|
| 348 | 348 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
| 349 | 349 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
| 350 | 350 | include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | |
| 363 | 363 | // Buttons for actions |
| 364 | 364 | if ($action != 'presend' && $action != 'editline') { |
| 365 | - print '<div class="tabsAction">' . "\n"; |
|
| 365 | + print '<div class="tabsAction">'."\n"; |
|
| 366 | 366 | $parameters = array(); |
| 367 | 367 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 368 | 368 | if ($reshook < 0) { |
@@ -372,26 +372,26 @@ discard block |
||
| 372 | 372 | if (empty($reshook)) { |
| 373 | 373 | // Send |
| 374 | 374 | if (empty($user->socid)) { |
| 375 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); |
|
| 375 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | if ($object->status == $object::STATUS_DRAFT) { |
| 379 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
| 379 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | // Clone |
| 383 | 383 | //print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', false && $permissiontoadd); |
| 384 | 384 | |
| 385 | 385 | if ($object->status == $object::STATUS_DRAFT) { |
| 386 | - print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disposal&token=' . newToken(), '', $permissiontoadd); |
|
| 386 | + print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disposal&token='.newToken(), '', $permissiontoadd); |
|
| 387 | 387 | } else { |
| 388 | - print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen&token=' . newToken(), '', $permissiontoadd); |
|
| 388 | + print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | // Delete (need delete permission, or if draft, just need create/modify permission) |
| 392 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 392 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 393 | 393 | } |
| 394 | - print '</div>' . "\n"; |
|
| 394 | + print '</div>'."\n"; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | // Select mail models is same action as presend |
@@ -249,7 +249,7 @@ |
||
| 249 | 249 | setEventMessages($object->error, $object->errors, 'errors'); |
| 250 | 250 | } |
| 251 | 251 | } elseif ($action == 'update_extras' && $user->hasRight('stock', 'creer')) { |
| 252 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 252 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 253 | 253 | |
| 254 | 254 | // Fill array 'array_options' with data from update form |
| 255 | 255 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $formbarcode = null; |
| 109 | 109 | |
| 110 | 110 | // Get parameters |
| 111 | -$id = GETPOSTINT('id'); |
|
| 111 | +$id = GETPOSTINT('id'); |
|
| 112 | 112 | if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) { |
| 113 | 113 | $ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null); |
| 114 | 114 | } else { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 121 | 121 | $confirm = GETPOST('confirm', 'alpha'); |
| 122 | 122 | $socid = GETPOSTINT('socid'); |
| 123 | -$duration_value = GETPOST('duration_value'); // duration value can be an empty string |
|
| 123 | +$duration_value = GETPOST('duration_value'); // duration value can be an empty string |
|
| 124 | 124 | $duration_unit = GETPOST('duration_unit', 'alpha'); |
| 125 | 125 | |
| 126 | 126 | $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | |
| 491 | 491 | // Quick edit for extrafields |
| 492 | 492 | if ($action == 'update_extras' && $usercancreate) { |
| 493 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 493 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 494 | 494 | |
| 495 | 495 | // Fill array 'array_options' with data from update form |
| 496 | 496 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -543,11 +543,11 @@ discard block |
||
| 543 | 543 | if (!$error) { |
| 544 | 544 | $units = GETPOSTINT('units'); |
| 545 | 545 | |
| 546 | - $object->entity = $conf->entity; |
|
| 547 | - $object->ref = (string) $ref; |
|
| 548 | - $object->label = GETPOST('label', $label_security_check); |
|
| 549 | - $object->price_base_type = GETPOST('price_base_type', 'aZ09'); |
|
| 550 | - $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; |
|
| 546 | + $object->entity = $conf->entity; |
|
| 547 | + $object->ref = (string) $ref; |
|
| 548 | + $object->label = GETPOST('label', $label_security_check); |
|
| 549 | + $object->price_base_type = GETPOST('price_base_type', 'aZ09'); |
|
| 550 | + $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; |
|
| 551 | 551 | if ($object->price_base_type == 'TTC') { |
| 552 | 552 | $object->price_ttc = GETPOSTFLOAT('price'); |
| 553 | 553 | } else { |
@@ -635,12 +635,12 @@ discard block |
||
| 635 | 635 | $object->duration_value = $duration_value; |
| 636 | 636 | $object->duration_unit = $duration_unit; |
| 637 | 637 | $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
| 638 | - $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
|
| 638 | + $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
|
| 639 | 639 | $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte') ? GETPOST('seuil_stock_alerte') : 0; |
| 640 | 640 | $object->desiredstock = GETPOST('desiredstock') ? GETPOST('desiredstock') : 0; |
| 641 | 641 | $object->canvas = GETPOST('canvas'); |
| 642 | 642 | $object->net_measure = GETPOST('net_measure'); |
| 643 | - $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit |
|
| 643 | + $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit |
|
| 644 | 644 | $object->weight = GETPOST('weight'); |
| 645 | 645 | $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit |
| 646 | 646 | $object->length = GETPOST('size'); |
@@ -783,10 +783,10 @@ discard block |
||
| 783 | 783 | } else { |
| 784 | 784 | if ($object->id > 0) { |
| 785 | 785 | //Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy |
| 786 | - $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 786 | + $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 787 | 787 | |
| 788 | 788 | if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { |
| 789 | - $object->ref = (string) $ref; |
|
| 789 | + $object->ref = (string) $ref; |
|
| 790 | 790 | } |
| 791 | 791 | $object->label = GETPOST('label', $label_security_check); |
| 792 | 792 | |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | $object->status_batch = GETPOSTINT('status_batch'); |
| 809 | 809 | $object->sell_or_eat_by_mandatory = GETPOSTINT('sell_or_eat_by_mandatory'); |
| 810 | 810 | $object->batch_mask = GETPOST('batch_mask', 'alpha'); |
| 811 | - $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
|
| 811 | + $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
|
| 812 | 812 | $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
| 813 | 813 | // removed from update view so GETPOST always empty |
| 814 | 814 | /* |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | } |
| 849 | 849 | |
| 850 | 850 | // managed_in_stock |
| 851 | - $object->stockable_product = (int) GETPOSTISSET('stockable_product'); |
|
| 851 | + $object->stockable_product = (int) GETPOSTISSET('stockable_product'); |
|
| 852 | 852 | |
| 853 | 853 | $units = GETPOSTINT('units'); |
| 854 | 854 | if ($units > 0) { |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | $object->accountancy_code_buy_export = $accountancy_code_buy_export; |
| 912 | 912 | } |
| 913 | 913 | if ($object->isService()) { |
| 914 | - $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; |
|
| 914 | + $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0; |
|
| 915 | 915 | } |
| 916 | 916 | |
| 917 | 917 | |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | $action = ""; |
| 1047 | 1047 | |
| 1048 | 1048 | $mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref); |
| 1049 | - $mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.'; |
|
| 1049 | + $mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.'; |
|
| 1050 | 1050 | setEventMessages($mesg, null, 'errors'); |
| 1051 | 1051 | } else { |
| 1052 | 1052 | setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors'); |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | } else { |
| 1062 | 1062 | $db->commit(); |
| 1063 | 1063 | $db->close(); |
| 1064 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
| 1064 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
| 1065 | 1065 | exit; |
| 1066 | 1066 | } |
| 1067 | 1067 | } else { |
@@ -2271,9 +2271,9 @@ discard block |
||
| 2271 | 2271 | if (isModEnabled('productbatch') && $object->hasbatch()) { |
| 2272 | 2272 | print '<td><input type="hidden" id="stockable_product" name="stockable_product" value="on" /></td></tr>'; |
| 2273 | 2273 | } else { |
| 2274 | - print '<tr><td valign="top">' . $langs->trans("StockableProduct") . '</td>'; |
|
| 2274 | + print '<tr><td valign="top">'.$langs->trans("StockableProduct").'</td>'; |
|
| 2275 | 2275 | $checked = $object->stockable_product == 1 ? "checked" : ""; |
| 2276 | - print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '. $checked . ' /></td></tr>'; |
|
| 2276 | + print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>'; |
|
| 2277 | 2277 | } |
| 2278 | 2278 | } |
| 2279 | 2279 | |
@@ -2315,9 +2315,9 @@ discard block |
||
| 2315 | 2315 | print '</td></tr>'; |
| 2316 | 2316 | |
| 2317 | 2317 | if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { |
| 2318 | - print '<tr><td valign="top">' . $langs->trans("StockableProduct") . '</td>'; |
|
| 2318 | + print '<tr><td valign="top">'.$langs->trans("StockableProduct").'</td>'; |
|
| 2319 | 2319 | $checked = $object->stockable_product == 1 ? "checked" : ""; |
| 2320 | - print '<td><input type="checkbox" id="stockable_product" name="stockable_product" ' . $checked . ' /></td></tr>'; |
|
| 2320 | + print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>'; |
|
| 2321 | 2321 | } |
| 2322 | 2322 | } else { |
| 2323 | 2323 | if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) { |
@@ -2805,7 +2805,7 @@ discard block |
||
| 2805 | 2805 | |
| 2806 | 2806 | // View stockable_product |
| 2807 | 2807 | if (($object->isProduct() || ($object->isService() && !empty($conf->global->STOCK_SUPPORTS_SERVICES))) && isModEnabled('stock') && !$object->hasbatch()) { |
| 2808 | - print '<tr><td valign="top">' . $form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')) . '</td>'; |
|
| 2808 | + print '<tr><td valign="top">'.$form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')).'</td>'; |
|
| 2809 | 2809 | print '<td><input type="checkbox" readonly disabled '.($object->stockable_product == 1 ? 'checked' : '').'></td></tr>'; |
| 2810 | 2810 | } |
| 2811 | 2811 | |
@@ -2843,7 +2843,7 @@ discard block |
||
| 2843 | 2843 | $result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']); |
| 2844 | 2844 | if ($result !== -1) { |
| 2845 | 2845 | foreach ($measuringUnits->records as $record) { |
| 2846 | - $durations[$record->short_label] = dol_ucfirst($record->label) . $plural; |
|
| 2846 | + $durations[$record->short_label] = dol_ucfirst($record->label).$plural; |
|
| 2847 | 2847 | } |
| 2848 | 2848 | } |
| 2849 | 2849 | print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>'; |
@@ -3089,7 +3089,7 @@ discard block |
||
| 3089 | 3089 | } |
| 3090 | 3090 | |
| 3091 | 3091 | //Send |
| 3092 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); |
|
| 3092 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); |
|
| 3093 | 3093 | |
| 3094 | 3094 | if (!isset($hookmanager->resArray['no_button_copy']) || $hookmanager->resArray['no_button_copy'] != 1) { |
| 3095 | 3095 | if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { |
@@ -3271,7 +3271,7 @@ discard block |
||
| 3271 | 3271 | $modelmail = 'product_send'; |
| 3272 | 3272 | $defaulttopic = $object->label; |
| 3273 | 3273 | $diroutput = $conf->product->multidir_output[$object->entity]; |
| 3274 | - $trackid = 'prod' . $object->id; |
|
| 3274 | + $trackid = 'prod'.$object->id; |
|
| 3275 | 3275 | |
| 3276 | 3276 | include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
| 3277 | 3277 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $line_id = GETPOSTINT('lineid') ? GETPOSTINT('lineid') : 0; |
| 96 | 96 | $facid = GETPOSTINT('facid'); |
| 97 | 97 | |
| 98 | -$action = GETPOST('action', 'alpha'); |
|
| 98 | +$action = GETPOST('action', 'alpha'); |
|
| 99 | 99 | //Select mail models is same action as presend |
| 100 | 100 | if (GETPOST('modelselected')) { |
| 101 | 101 | $action = 'presend'; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | if ($action == 'update_extras' && $permissiontoadd) { |
| 276 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 276 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 277 | 277 | |
| 278 | 278 | // Fill array 'array_options' with data from update form |
| 279 | 279 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | |
| 355 | 355 | // Loop lines to calculate $totalqty |
| 356 | 356 | for ($i = 1; $i <= $num; $i++) { |
| 357 | - $idl = "idl".$i; // id line source |
|
| 357 | + $idl = "idl".$i; // id line source |
|
| 358 | 358 | |
| 359 | 359 | //$sub_qty = array(); |
| 360 | 360 | //$subtotalqty = 0; |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | //$j = 0; |
| 363 | 363 | //$batch = "batchl".$i."_0"; |
| 364 | 364 | //$stockLocation = "ent1".$i."_0"; |
| 365 | - $qty = "qtyl".$i; // qty |
|
| 365 | + $qty = "qtyl".$i; // qty |
|
| 366 | 366 | |
| 367 | 367 | //reception line for product with no batch management and no multiple stock location |
| 368 | 368 | if (GETPOST($qty, 'alpha') > 0) { |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | if ($totalqty > 0) { // There is at least one thing to ship |
| 378 | 378 | for ($i = 1; $i <= $num; $i++) { |
| 379 | - $idl = "idl".$i; // id line source |
|
| 379 | + $idl = "idl".$i; // id line source |
|
| 380 | 380 | $lineToTest = ''; |
| 381 | 381 | $lineId = GETPOSTINT($idl); |
| 382 | 382 | foreach ($objectsrc->lines as $linesrc) { |
@@ -1011,35 +1011,35 @@ discard block |
||
| 1011 | 1011 | $reg = array(); |
| 1012 | 1012 | if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { |
| 1013 | 1013 | $numAsked++; |
| 1014 | - $paramSuffix = $reg[1] . '_' . $reg[2]; |
|
| 1014 | + $paramSuffix = $reg[1].'_'.$reg[2]; |
|
| 1015 | 1015 | $suffix2numAsked[$paramSuffix] = $numAsked; |
| 1016 | 1016 | |
| 1017 | 1017 | // $numline=$reg[2] + 1; // line of product |
| 1018 | 1018 | $numline = $numAsked; |
| 1019 | 1019 | |
| 1020 | - $prod = "product_" . $paramSuffix; |
|
| 1021 | - $qty = "qty_" . $paramSuffix; |
|
| 1022 | - $ent = "entrepot_" . $paramSuffix; |
|
| 1023 | - $pu = "pu_" . $paramSuffix; // This is unit price including discount |
|
| 1024 | - $fk_commandefourndet = "fk_commandefourndet_" . $paramSuffix; |
|
| 1020 | + $prod = "product_".$paramSuffix; |
|
| 1021 | + $qty = "qty_".$paramSuffix; |
|
| 1022 | + $ent = "entrepot_".$paramSuffix; |
|
| 1023 | + $pu = "pu_".$paramSuffix; // This is unit price including discount |
|
| 1024 | + $fk_commandefourndet = "fk_commandefourndet_".$paramSuffix; |
|
| 1025 | 1025 | $dispatchLines[$numAsked] = array('paramSuffix' => $paramSuffix, 'prod' => GETPOSTINT($prod), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' => GETPOSTINT($ent), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' => GETPOST('comment'), 'fk_commandefourndet' => GETPOSTINT($fk_commandefourndet)); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | // with batch module enabled and product with lot/serial |
| 1029 | 1029 | if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) { |
| 1030 | 1030 | $numAsked++; |
| 1031 | - $paramSuffix = $reg[1] . '_' . $reg[2]; |
|
| 1031 | + $paramSuffix = $reg[1].'_'.$reg[2]; |
|
| 1032 | 1032 | $suffix2numAsked[$paramSuffix] = $numAsked; |
| 1033 | 1033 | |
| 1034 | 1034 | // eat-by date dispatch |
| 1035 | 1035 | // $numline=$reg[2] + 1; // line of product |
| 1036 | 1036 | $numline = $numAsked; |
| 1037 | 1037 | |
| 1038 | - $prod = 'product_batch_' . $paramSuffix; |
|
| 1039 | - $qty = 'qty_' . $paramSuffix; |
|
| 1040 | - $ent = 'entrepot_' . $paramSuffix; |
|
| 1041 | - $pu = 'pu_' . $paramSuffix; |
|
| 1042 | - $lot = 'lot_number_' . $paramSuffix; |
|
| 1038 | + $prod = 'product_batch_'.$paramSuffix; |
|
| 1039 | + $qty = 'qty_'.$paramSuffix; |
|
| 1040 | + $ent = 'entrepot_'.$paramSuffix; |
|
| 1041 | + $pu = 'pu_'.$paramSuffix; |
|
| 1042 | + $lot = 'lot_number_'.$paramSuffix; |
|
| 1043 | 1043 | $dDLUO = dol_mktime(12, 0, 0, GETPOSTINT('dluo_'.$paramSuffix.'month'), GETPOSTINT('dluo_'.$paramSuffix.'day'), GETPOSTINT('dluo_'.$paramSuffix.'year')); |
| 1044 | 1044 | $dDLC = dol_mktime(12, 0, 0, GETPOSTINT('dlc_'.$paramSuffix.'month'), GETPOSTINT('dlc_'.$paramSuffix.'day'), GETPOSTINT('dlc_'.$paramSuffix.'year')); |
| 1045 | 1045 | $fk_commandefourndet = 'fk_commandefourndet_'.$paramSuffix; |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | // Note that if an extrafield with the same name exists in the origin supplier order line, the value |
| 1074 | 1074 | // from the HTTP query will be ignored |
| 1075 | 1075 | foreach ($suffix2numAsked as $suffix => $n) { |
| 1076 | - $dispatchLines[$n]['array_options'] = $extrafields->getOptionalsFromPost('receptiondet_batch', '_' . $suffix, ''); |
|
| 1076 | + $dispatchLines[$n]['array_options'] = $extrafields->getOptionalsFromPost('receptiondet_batch', '_'.$suffix, ''); |
|
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | print '<script type="text/javascript"> |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | |
| 1179 | 1179 | print '<input type="hidden" name="productl'.$indiceAsked.'" value="'.$line->fk_product.'">'; |
| 1180 | 1180 | |
| 1181 | - if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1181 | + if (!array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1182 | 1182 | print '<input type="hidden" name="productid'.$indiceAsked.'" value="'.$line->fk_product.'">'; |
| 1183 | 1183 | |
| 1184 | 1184 | // Show product and description |
@@ -1200,7 +1200,7 @@ discard block |
||
| 1200 | 1200 | print '</td>'; |
| 1201 | 1201 | } else { |
| 1202 | 1202 | print "<td>"; |
| 1203 | - if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1203 | + if (!array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1204 | 1204 | if ($type == 1) { |
| 1205 | 1205 | $text = img_object($langs->trans('Service'), 'service'); |
| 1206 | 1206 | } else { |
@@ -1229,7 +1229,7 @@ discard block |
||
| 1229 | 1229 | |
| 1230 | 1230 | // Qty in source purchase order line |
| 1231 | 1231 | print '<td class="center">'; |
| 1232 | - if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1232 | + if (!array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1233 | 1233 | print $line->qty; |
| 1234 | 1234 | } |
| 1235 | 1235 | print '<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.'" value="'.$line->id.'">'; |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | // Qty already received |
| 1242 | 1242 | print '<td class="center">'; |
| 1243 | 1243 | $quantityDelivered = $objectsrc->receptions[$line->id]; |
| 1244 | - if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1244 | + if (!array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice |
|
| 1245 | 1245 | print $quantityDelivered; |
| 1246 | 1246 | } |
| 1247 | 1247 | print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">'; |
@@ -2079,7 +2079,7 @@ discard block |
||
| 2079 | 2079 | $detail = $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $batchinfo); |
| 2080 | 2080 | } |
| 2081 | 2081 | } |
| 2082 | - print $detail . '</td>'; |
|
| 2082 | + print $detail.'</td>'; |
|
| 2083 | 2083 | } else { |
| 2084 | 2084 | print '<td></td>'; |
| 2085 | 2085 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | $result = restrictedArea($user, 'expensereport', $object->id, 'expensereport'); |
| 165 | 165 | |
| 166 | -$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php |
|
| 166 | +$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php |
|
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | /* |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | if ($overlappingExpenseReportID > 0) { |
| 316 | 316 | $error++; |
| 317 | - setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'. $langs->trans('ShowTrip').'</a>', null, 'errors'); |
|
| 317 | + setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'.$langs->trans('ShowTrip').'</a>', null, 'errors'); |
|
| 318 | 318 | $action = 'create'; |
| 319 | 319 | } |
| 320 | 320 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | if ($action == 'update_extras' && $permissiontoadd) { |
| 368 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 368 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 369 | 369 | |
| 370 | 370 | // Fill array 'array_options' with data from update form |
| 371 | 371 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -478,10 +478,10 @@ discard block |
||
| 478 | 478 | $mesg = ''; |
| 479 | 479 | $mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($emailFrom), dol_escape_htmltag($emailTo)); |
| 480 | 480 | if (!empty($mailfile->error)) { |
| 481 | - $mesg .= '<br>' . $mailfile->error; |
|
| 481 | + $mesg .= '<br>'.$mailfile->error; |
|
| 482 | 482 | } |
| 483 | 483 | if (!empty($mailfile->errors) && is_array($mailfile->errors)) { |
| 484 | - $mesg .= '<br>' . implode('<br>', $mailfile->errors); |
|
| 484 | + $mesg .= '<br>'.implode('<br>', $mailfile->errors); |
|
| 485 | 485 | } |
| 486 | 486 | setEventMessages($mesg, null, 'errors'); |
| 487 | 487 | } else { |
@@ -2392,7 +2392,7 @@ discard block |
||
| 2392 | 2392 | } |
| 2393 | 2393 | } |
| 2394 | 2394 | |
| 2395 | - $tredited = 'tredited'; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
| 2395 | + $tredited = 'tredited'; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
| 2396 | 2396 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; |
| 2397 | 2397 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; |
| 2398 | 2398 | |
@@ -2447,7 +2447,7 @@ discard block |
||
| 2447 | 2447 | |
| 2448 | 2448 | // Quantity |
| 2449 | 2449 | print '<td class="right">'; |
| 2450 | - print '<input type="text" min="0" class="input_qty right maxwidth50" name="qty" value="'.dol_escape_htmltag((string) $line->qty).'" />'; // We must be able to enter decimal qty |
|
| 2450 | + print '<input type="text" min="0" class="input_qty right maxwidth50" name="qty" value="'.dol_escape_htmltag((string) $line->qty).'" />'; // We must be able to enter decimal qty |
|
| 2451 | 2451 | print '</td>'; |
| 2452 | 2452 | |
| 2453 | 2453 | //print '<td class="right">'.$langs->trans('AmountHT').'</td>'; |
@@ -2552,7 +2552,7 @@ discard block |
||
| 2552 | 2552 | print '</script>'."\n"; |
| 2553 | 2553 | print '</td></tr>'; |
| 2554 | 2554 | |
| 2555 | - $tredited = ''; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
| 2555 | + $tredited = ''; // Case the addfile and linkto file is used for edit (used by following tpl) |
|
| 2556 | 2556 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; |
| 2557 | 2557 | include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; |
| 2558 | 2558 | |
@@ -343,7 +343,7 @@ |
||
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | if ($action == 'update_extras' && $permissiontoadd) { |
| 346 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 346 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 347 | 347 | |
| 348 | 348 | // Fill array 'array_options' with data from update form |
| 349 | 349 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $action = GETPOST('action', 'aZ09'); |
| 67 | 67 | $cancel = GETPOST('cancel', 'alpha'); |
| 68 | 68 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 69 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 69 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 70 | 70 | $confirm = GETPOST('confirm', 'alpha'); |
| 71 | 71 | $rowid = GETPOSTINT('rowid'); |
| 72 | 72 | $id = GETPOST('id') ? GETPOSTINT('id') : $rowid; |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | // Create new object |
| 307 | 307 | if ($result > 0 && !$error) { |
| 308 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 308 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 309 | 309 | |
| 310 | 310 | // Change values |
| 311 | 311 | $object->civility_id = trim(GETPOST("civility_id", 'alphanohtml')); |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | $object->gender = trim(GETPOST("gender", 'alphanohtml')); |
| 315 | 315 | $object->login = trim(GETPOST("login", 'alphanohtml')); |
| 316 | 316 | if (GETPOSTISSET('pass')) { |
| 317 | - $object->pass = trim(GETPOST("pass", 'password')); // For password, we must use 'none' |
|
| 317 | + $object->pass = trim(GETPOST("pass", 'password')); // For password, we must use 'none' |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | $object->societe = trim(GETPOST("societe", 'alphanohtml')); // deprecated |
@@ -369,10 +369,10 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | // Check if we need to also synchronize password information |
| 372 | - $nosyncuserpass = 1; // no by default |
|
| 372 | + $nosyncuserpass = 1; // no by default |
|
| 373 | 373 | if (GETPOSTISSET('pass')) { |
| 374 | 374 | if ($object->user_id) { // If member is linked to a user |
| 375 | - $nosyncuserpass = 0; // We may try to sync password |
|
| 375 | + $nosyncuserpass = 0; // We may try to sync password |
|
| 376 | 376 | if ($user->id == $object->user_id) { |
| 377 | 377 | if (!$user->hasRight('user', 'self', 'password')) { |
| 378 | 378 | $nosyncuserpass = 1; // Disable synchronizing |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $email = preg_replace('/\s+/', '', GETPOST("member_email", 'aZ09arobase')); |
| 483 | 483 | $url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
| 484 | 484 | $login = GETPOST("member_login", 'alphanohtml'); |
| 485 | - $pass = GETPOST("password", 'password'); // For password, we use 'none' |
|
| 485 | + $pass = GETPOST("password", 'password'); // For password, we use 'none' |
|
| 486 | 486 | $photo = GETPOST("photo", 'alphanohtml'); |
| 487 | 487 | $morphy = GETPOST("morphy", 'alphanohtml'); |
| 488 | 488 | $public = GETPOSTINT("public"); |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | if ($action == 'update_extras' && $user->hasRight('adherent', 'creer')) { |
| 865 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 865 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 866 | 866 | $attribute_name = GETPOST('attribute', 'restricthtml'); |
| 867 | 867 | |
| 868 | 868 | // Fill array 'array_options' with data from update form |
@@ -1362,7 +1362,7 @@ discard block |
||
| 1362 | 1362 | $maxfilesizearray = getMaxFileSizeArray(); |
| 1363 | 1363 | $maxmin = $maxfilesizearray['maxmin']; |
| 1364 | 1364 | if ($maxmin > 0) { |
| 1365 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 1365 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 1366 | 1366 | } |
| 1367 | 1367 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 1368 | 1368 | print '</td></tr>'; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 119 | 119 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
| 120 | 120 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
| 121 | -$confirm = GETPOST('confirm', 'alpha'); |
|
| 121 | +$confirm = GETPOST('confirm', 'alpha'); |
|
| 122 | 122 | |
| 123 | 123 | $dol_openinpopup = ''; |
| 124 | 124 | if (!empty($backtopagejsfields)) { |
@@ -165,12 +165,12 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // Permissions |
| 168 | -$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 169 | -$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 168 | +$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 169 | +$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 170 | 170 | $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); |
| 171 | -$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 171 | +$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 172 | 172 | $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php |
| 173 | -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 173 | +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 174 | 174 | |
| 175 | 175 | // Security check |
| 176 | 176 | $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) { |
| 219 | 219 | $soc_origin_id = GETPOSTINT('soc_origin'); |
| 220 | - $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 220 | + $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 221 | 221 | |
| 222 | 222 | if ($soc_origin_id <= 0) { |
| 223 | 223 | $langs->load('errors'); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | if ($action == 'update_extras' && $permissiontoadd) { |
| 266 | 266 | $object->fetch($socid); |
| 267 | 267 | |
| 268 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 268 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 269 | 269 | |
| 270 | 270 | // Fill array 'array_options' with data from update form |
| 271 | 271 | $extrafields->fetch_name_optionals_label($object->table_element); |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | if (!$error) { |
| 323 | 323 | if ($action == 'update') { // Test on permission not required here |
| 324 | 324 | $ret = $object->fetch($socid); |
| 325 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 325 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 326 | 326 | } else { |
| 327 | 327 | $object->canvas = $canvas; |
| 328 | 328 | } |
@@ -333,19 +333,19 @@ discard block |
||
| 333 | 333 | $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); |
| 334 | 334 | $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
| 335 | 335 | // Add non official properties |
| 336 | - $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 337 | - $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 336 | + $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 337 | + $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 338 | 338 | } else { |
| 339 | - $object->name = GETPOST('name', 'alphanohtml'); |
|
| 339 | + $object->name = GETPOST('name', 'alphanohtml'); |
|
| 340 | 340 | } |
| 341 | 341 | $object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity); |
| 342 | - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 342 | + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 343 | 343 | $object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent; |
| 344 | 344 | $object->address = GETPOST('address', 'alphanohtml'); |
| 345 | - $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 346 | - $object->town = GETPOST('town', 'alphanohtml'); |
|
| 347 | - $object->country_id = GETPOSTINT('country_id'); |
|
| 348 | - $object->state_id = GETPOSTINT('state_id'); |
|
| 345 | + $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 346 | + $object->town = GETPOST('town', 'alphanohtml'); |
|
| 347 | + $object->country_id = GETPOSTINT('country_id'); |
|
| 348 | + $object->state_id = GETPOSTINT('state_id'); |
|
| 349 | 349 | |
| 350 | 350 | $object->socialnetworks = array(); |
| 351 | 351 | if (isModEnabled('socialnetworks')) { |
@@ -357,10 +357,10 @@ discard block |
||
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | $object->phone = GETPOST('phone', 'alpha'); |
| 360 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 360 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 361 | 361 | $object->fax = GETPOST('fax', 'alpha'); |
| 362 | 362 | $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
| 363 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 363 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 364 | 364 | $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
| 365 | 365 | $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); |
| 366 | 366 | $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); |
@@ -370,13 +370,13 @@ discard block |
||
| 370 | 370 | $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); |
| 371 | 371 | $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); |
| 372 | 372 | $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); |
| 373 | - $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 373 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 374 | 374 | $object->capital = GETPOSTFLOAT('capital'); |
| 375 | 375 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
| 376 | 376 | |
| 377 | 377 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 378 | 378 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 379 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 379 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 380 | 380 | $object->status = GETPOSTINT('status'); |
| 381 | 381 | |
| 382 | 382 | // Local Taxes |
@@ -386,9 +386,9 @@ discard block |
||
| 386 | 386 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
| 387 | 387 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
| 388 | 388 | |
| 389 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 389 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 390 | 390 | $object->effectif_id = GETPOSTINT('effectif_id'); |
| 391 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
| 391 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
| 392 | 392 | |
| 393 | 393 | $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 |
| 394 | 394 | |
@@ -397,8 +397,8 @@ discard block |
||
| 397 | 397 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
| 398 | 398 | $prospectcustomer = $customer + $prospect; |
| 399 | 399 | |
| 400 | - $object->client = $prospectcustomer; |
|
| 401 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 400 | + $object->client = $prospectcustomer; |
|
| 401 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 402 | 402 | |
| 403 | 403 | if ($action == 'add') { |
| 404 | 404 | // for prospect, customer or supplier |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | if ($object->fournisseur > 0) { |
| 421 | - $object->cond_reglement_supplier_id = $paymentTermId; |
|
| 421 | + $object->cond_reglement_supplier_id = $paymentTermId; |
|
| 422 | 422 | |
| 423 | 423 | $filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method) |
| 424 | 424 | if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) { |
@@ -428,15 +428,15 @@ discard block |
||
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 432 | - $object->default_lang = GETPOST('default_lang'); |
|
| 431 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 432 | + $object->default_lang = GETPOST('default_lang'); |
|
| 433 | 433 | |
| 434 | 434 | // Webservices url/key |
| 435 | 435 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
| 436 | 436 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
| 437 | 437 | |
| 438 | 438 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 439 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 439 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 440 | 440 | |
| 441 | 441 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 442 | 442 | $object->accountancy_code_sell = ''; |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | 447 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 448 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 448 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 449 | 449 | |
| 450 | 450 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 451 | 451 | $object->accountancy_code_buy = ''; |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | // Delete third party |
| 839 | 839 | if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) { |
| 840 | 840 | $object->fetch($socid); |
| 841 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 841 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 842 | 842 | $result = $object->delete($socid, $user); |
| 843 | 843 | |
| 844 | 844 | if ($result > 0) { |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | } else { |
| 917 | 917 | $db->commit(); |
| 918 | 918 | $db->close(); |
| 919 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
| 919 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
| 920 | 920 | exit; |
| 921 | 921 | } |
| 922 | 922 | } else { |
@@ -1097,21 +1097,21 @@ discard block |
||
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | $object->phone = GETPOST('phone', 'alpha'); |
| 1100 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 1100 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 1101 | 1101 | $object->fax = GETPOST('fax', 'alpha'); |
| 1102 | 1102 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
| 1103 | 1103 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
| 1104 | - $object->capital = GETPOSTFLOAT('capital'); |
|
| 1104 | + $object->capital = GETPOSTFLOAT('capital'); |
|
| 1105 | 1105 | $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables |
| 1106 | 1106 | if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { |
| 1107 | 1107 | $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 1108 | 1108 | } |
| 1109 | - $object->cond_reglement_id = $paymentTermId; |
|
| 1109 | + $object->cond_reglement_id = $paymentTermId; |
|
| 1110 | 1110 | $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables |
| 1111 | 1111 | if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { |
| 1112 | 1112 | $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 1113 | 1113 | } |
| 1114 | - $object->mode_reglement_id = $paymentTypeId; |
|
| 1114 | + $object->mode_reglement_id = $paymentTypeId; |
|
| 1115 | 1115 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
| 1116 | 1116 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
| 1117 | 1117 | $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); |
@@ -1124,7 +1124,7 @@ discard block |
||
| 1124 | 1124 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
| 1125 | 1125 | |
| 1126 | 1126 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 1127 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1127 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1128 | 1128 | $object->status = GETPOSTINT('status'); |
| 1129 | 1129 | |
| 1130 | 1130 | //Local Taxes |
@@ -1140,7 +1140,7 @@ discard block |
||
| 1140 | 1140 | $object->default_lang = GETPOST('default_lang'); |
| 1141 | 1141 | |
| 1142 | 1142 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 1143 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1143 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1144 | 1144 | |
| 1145 | 1145 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 1146 | 1146 | $object->accountancy_code_sell = ''; |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | } |
| 1150 | 1150 | } |
| 1151 | 1151 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 1152 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 1152 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 1153 | 1153 | |
| 1154 | 1154 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 1155 | 1155 | $object->accountancy_code_buy = ''; |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | |
| 1275 | 1275 | print '<script type="text/javascript">'; |
| 1276 | 1276 | print '$(document).ready(function () { |
| 1277 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
| 1277 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
| 1278 | 1278 | |
| 1279 | 1279 | init_customer_categ(); |
| 1280 | 1280 | $("#customerprospect").change(function() { |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>'; |
| 1348 | 1348 | |
| 1349 | 1349 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">'; |
| 1350 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1350 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1351 | 1351 | // 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 |
| 1352 | 1352 | // 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. |
| 1353 | 1353 | /* |
@@ -1719,7 +1719,7 @@ discard block |
||
| 1719 | 1719 | print '<td></td>'; |
| 1720 | 1720 | print '<td></td>'; |
| 1721 | 1721 | } |
| 1722 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1722 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1723 | 1723 | 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>'; |
| 1724 | 1724 | print '</tr>'; |
| 1725 | 1725 | } |
@@ -1767,7 +1767,7 @@ discard block |
||
| 1767 | 1767 | // Vat is used |
| 1768 | 1768 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
| 1769 | 1769 | print '<td>'; |
| 1770 | - 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 |
|
| 1770 | + 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 |
|
| 1771 | 1771 | print '</td>'; |
| 1772 | 1772 | if ($conf->browser->layout == 'phone') { |
| 1773 | 1773 | print '</tr><tr>'; |
@@ -1808,7 +1808,7 @@ discard block |
||
| 1808 | 1808 | |
| 1809 | 1809 | // VAT reverse charge by default |
| 1810 | 1810 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 1811 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
| 1811 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
| 1812 | 1812 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 1813 | 1813 | print '</td></tr>'; |
| 1814 | 1814 | } |
@@ -1817,21 +1817,21 @@ discard block |
||
| 1817 | 1817 | //TODO: Place into a function to control showing by country or study better option |
| 1818 | 1818 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 1819 | 1819 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
| 1820 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1820 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1821 | 1821 | print '</td>'; |
| 1822 | 1822 | if ($conf->browser->layout == 'phone') { |
| 1823 | 1823 | print '</tr><tr>'; |
| 1824 | 1824 | } |
| 1825 | 1825 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
| 1826 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1826 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1827 | 1827 | print '</td></tr>'; |
| 1828 | 1828 | } elseif ($mysoc->localtax1_assuj == "1") { |
| 1829 | 1829 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1830 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1830 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1831 | 1831 | print '</td></tr>'; |
| 1832 | 1832 | } elseif ($mysoc->localtax2_assuj == "1") { |
| 1833 | 1833 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1834 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1834 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1835 | 1835 | print '</td></tr>'; |
| 1836 | 1836 | } |
| 1837 | 1837 | |
@@ -2071,7 +2071,7 @@ discard block |
||
| 2071 | 2071 | $prefixSupplierIsUsed = false; |
| 2072 | 2072 | } |
| 2073 | 2073 | |
| 2074 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 2074 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 2075 | 2075 | |
| 2076 | 2076 | if (GETPOSTISSET('name')) { |
| 2077 | 2077 | // We overwrite with values if posted |
@@ -2099,10 +2099,10 @@ discard block |
||
| 2099 | 2099 | } |
| 2100 | 2100 | |
| 2101 | 2101 | $object->phone = GETPOST('phone', 'alpha'); |
| 2102 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2102 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2103 | 2103 | $object->fax = GETPOST('fax', 'alpha'); |
| 2104 | 2104 | $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); |
| 2105 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 2105 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 2106 | 2106 | $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); |
| 2107 | 2107 | $object->capital = GETPOSTFLOAT('capital'); |
| 2108 | 2108 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
@@ -2118,16 +2118,16 @@ discard block |
||
| 2118 | 2118 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
| 2119 | 2119 | |
| 2120 | 2120 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 2121 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2121 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2122 | 2122 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 2123 | - $object->status = GETPOSTINT('status'); |
|
| 2123 | + $object->status = GETPOSTINT('status'); |
|
| 2124 | 2124 | |
| 2125 | 2125 | // Webservices url/key |
| 2126 | 2126 | $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); |
| 2127 | 2127 | $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); |
| 2128 | 2128 | |
| 2129 | 2129 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 2130 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2130 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2131 | 2131 | |
| 2132 | 2132 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 2133 | 2133 | $object->accountancy_code_sell = ''; |
@@ -2136,7 +2136,7 @@ discard block |
||
| 2136 | 2136 | } |
| 2137 | 2137 | } |
| 2138 | 2138 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 2139 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2139 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2140 | 2140 | |
| 2141 | 2141 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 2142 | 2142 | $object->accountancy_code_buy = ''; |
@@ -2218,7 +2218,7 @@ discard block |
||
| 2218 | 2218 | } |
| 2219 | 2219 | }); |
| 2220 | 2220 | |
| 2221 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
| 2221 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
| 2222 | 2222 | |
| 2223 | 2223 | init_customer_categ(); |
| 2224 | 2224 | $("#customerprospect").change(function() { |
@@ -2597,14 +2597,14 @@ discard block |
||
| 2597 | 2597 | |
| 2598 | 2598 | // VAT is used |
| 2599 | 2599 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
| 2600 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2600 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2601 | 2601 | print '</td></tr>'; |
| 2602 | 2602 | |
| 2603 | 2603 | // Local Taxes |
| 2604 | 2604 | //TODO: Place into a function to control showing by country or study better option |
| 2605 | 2605 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 2606 | 2606 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
| 2607 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2607 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2608 | 2608 | if (!isOnlyOneLocalTax(1)) { |
| 2609 | 2609 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2610 | 2610 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2613,7 +2613,7 @@ discard block |
||
| 2613 | 2613 | print '</td>'; |
| 2614 | 2614 | print '</tr><tr>'; |
| 2615 | 2615 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
| 2616 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
| 2616 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
| 2617 | 2617 | if (!isOnlyOneLocalTax(2)) { |
| 2618 | 2618 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2619 | 2619 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2622,7 +2622,7 @@ discard block |
||
| 2622 | 2622 | print '</td></tr>'; |
| 2623 | 2623 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
| 2624 | 2624 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2625 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2625 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2626 | 2626 | if (!isOnlyOneLocalTax(1)) { |
| 2627 | 2627 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2628 | 2628 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2631,7 +2631,7 @@ discard block |
||
| 2631 | 2631 | print '</td></tr>'; |
| 2632 | 2632 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
| 2633 | 2633 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2634 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2634 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2635 | 2635 | if (!isOnlyOneLocalTax(2)) { |
| 2636 | 2636 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2637 | 2637 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2642,7 +2642,7 @@ discard block |
||
| 2642 | 2642 | |
| 2643 | 2643 | // VAT reverse charge by default |
| 2644 | 2644 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 2645 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
| 2645 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
| 2646 | 2646 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 2647 | 2647 | print '</td></tr>'; |
| 2648 | 2648 | } |
@@ -2811,7 +2811,7 @@ discard block |
||
| 2811 | 2811 | $maxfilesizearray = getMaxFileSizeArray(); |
| 2812 | 2812 | $maxmin = $maxfilesizearray['maxmin']; |
| 2813 | 2813 | if ($maxmin > 0) { |
| 2814 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2814 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2815 | 2815 | } |
| 2816 | 2816 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 2817 | 2817 | print '</td></tr>'; |
@@ -3047,7 +3047,7 @@ discard block |
||
| 3047 | 3047 | print '<tr><td>'; |
| 3048 | 3048 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
| 3049 | 3049 | print '</td><td>'; |
| 3050 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
| 3050 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
| 3051 | 3051 | print '</td>'; |
| 3052 | 3052 | print '</tr>'; |
| 3053 | 3053 | } |