|
@@ -108,7 +108,7 @@ discard block |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
120
|
120
|
$backtopage = GETPOST('backtopage', 'alpha'); |
|
121
|
121
|
$confirm = GETPOST('confirm', 'alpha'); |
|
122
|
122
|
$socid = GETPOSTINT('socid'); |
|
123
|
|
-$duration_value = GETPOST('duration_value') === '' ? null : GETPOSTINT('duration_value'); // duration value can be an empty string |
|
|
123
|
+$duration_value = GETPOST('duration_value') === '' ? null : GETPOSTINT('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'); |
|
@@ -497,7 +497,7 @@ discard block |
|
|
block discarded – undo |
|
497
|
497
|
// Quick edit for extrafields |
|
498
|
498
|
if ($action == 'update_extras' && $permissiontoeditextra) { |
|
499
|
499
|
// we may use oldcopy->hasBatch( in triggers so keep 1 |
|
500
|
|
- $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
|
500
|
+ $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
501
|
501
|
|
|
502
|
502
|
$attribute_name = GETPOST('attribute', 'aZ09'); |
|
503
|
503
|
|
|
@@ -656,7 +656,7 @@ discard block |
|
|
block discarded – undo |
|
656
|
656
|
$object->width = GETPOST('sizewidth'); |
|
657
|
657
|
$object->height = GETPOST('sizeheight'); |
|
658
|
658
|
$object->surface = GETPOST('surface'); |
|
659
|
|
- $object->surface_units = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit |
|
|
659
|
+ $object->surface_units = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit |
|
660
|
660
|
$object->volume = GETPOST('volume'); |
|
661
|
661
|
$object->volume_units = GETPOST('volume_units') === '' ? null : GETPOSTINT('volume_units'); // This is not the fk_unit but the power of unit |
|
662
|
662
|
$finished = GETPOSTINT('finished'); |
|
@@ -792,7 +792,7 @@ discard block |
|
|
block discarded – undo |
|
792
|
792
|
} else { |
|
793
|
793
|
if ($object->id > 0) { |
|
794
|
794
|
// Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy |
|
795
|
|
- $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
|
795
|
+ $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
796
|
796
|
|
|
797
|
797
|
if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { |
|
798
|
798
|
$object->ref = (string) $ref; |
|
@@ -924,7 +924,7 @@ discard block |
|
|
block discarded – undo |
|
924
|
924
|
$object->accountancy_code_buy_export = $accountancy_code_buy_export; |
|
925
|
925
|
} |
|
926
|
926
|
if ($object->isService()) { |
|
927
|
|
- $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; |
|
|
927
|
+ $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0; |
|
928
|
928
|
} |
|
929
|
929
|
|
|
930
|
930
|
|
|
@@ -1058,7 +1058,7 @@ discard block |
|
|
block discarded – undo |
|
1058
|
1058
|
$action = ""; |
|
1059
|
1059
|
|
|
1060
|
1060
|
$mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref); |
|
1061
|
|
- $mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.'; |
|
|
1061
|
+ $mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.'; |
|
1062
|
1062
|
setEventMessages($mesg, null, 'errors'); |
|
1063
|
1063
|
} else { |
|
1064
|
1064
|
setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors'); |
|
@@ -1073,7 +1073,7 @@ discard block |
|
|
block discarded – undo |
|
1073
|
1073
|
} else { |
|
1074
|
1074
|
$db->commit(); |
|
1075
|
1075
|
$db->close(); |
|
1076
|
|
- header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
|
1076
|
+ header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
1077
|
1077
|
exit; |
|
1078
|
1078
|
} |
|
1079
|
1079
|
} else { |
|
@@ -2284,9 +2284,9 @@ discard block |
|
|
block discarded – undo |
|
2284
|
2284
|
if (isModEnabled('productbatch') && $object->hasbatch()) { |
|
2285
|
2285
|
print '<tr><td><input type="hidden" id="stockable_product" name="stockable_product" value="on" /></td><td></td></tr>'; |
|
2286
|
2286
|
} else { |
|
2287
|
|
- print '<tr><td><label for="stockable_product">' . $langs->trans("StockableProduct") . '</label></td>'; |
|
|
2287
|
+ print '<tr><td><label for="stockable_product">'.$langs->trans("StockableProduct").'</label></td>'; |
|
2288
|
2288
|
$checked = empty($object->stockable_product) ? "" : "checked"; |
|
2289
|
|
- print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '. $checked . ' /></td></tr>'; |
|
|
2289
|
+ print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>'; |
|
2290
|
2290
|
} |
|
2291
|
2291
|
|
|
2292
|
2292
|
// Default warehouse |
|
@@ -2346,9 +2346,9 @@ discard block |
|
|
block discarded – undo |
|
2346
|
2346
|
print '</td></tr>'; |
|
2347
|
2347
|
|
|
2348
|
2348
|
if (isModEnabled('stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { |
|
2349
|
|
- print '<tr><td>' . $langs->trans("StockableProduct") . '</td>'; |
|
|
2349
|
+ print '<tr><td>'.$langs->trans("StockableProduct").'</td>'; |
|
2350
|
2350
|
$checked = $object->stockable_product == 1 ? "checked" : ""; |
|
2351
|
|
- print '<td><input type="checkbox" id="stockable_product" name="stockable_product" ' . $checked . ' /></td></tr>'; |
|
|
2351
|
+ print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>'; |
|
2352
|
2352
|
} |
|
2353
|
2353
|
} else { |
|
2354
|
2354
|
if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) { |
|
@@ -2419,7 +2419,7 @@ discard block |
|
|
block discarded – undo |
|
2419
|
2419
|
// Customs code |
|
2420
|
2420
|
if (!$object->isService() && !getDolGlobalString('PRODUCT_DISABLE_CUSTOMS_INFO')) { |
|
2421
|
2421
|
print '<tr><td class="wordbreak">'.$form->textwithpicto($langs->trans("CustomsCode"), $langs->trans("CustomsCodeHelp")).'</td>'; |
|
2422
|
|
- print '<td>' . img_picto('', 'fa-clipboard-check', 'class="pictofixedwidth"') . '<input name="customcode" class="maxwidth100onsmartphone" value="'.(GETPOSTISSET('customcode') ? GETPOST('customcode') : $object->customcode).'"></td></tr>'; |
|
|
2422
|
+ print '<td>'.img_picto('', 'fa-clipboard-check', 'class="pictofixedwidth"').'<input name="customcode" class="maxwidth100onsmartphone" value="'.(GETPOSTISSET('customcode') ? GETPOST('customcode') : $object->customcode).'"></td></tr>'; |
|
2423
|
2423
|
// Origin country |
|
2424
|
2424
|
print '<tr><td>'.$langs->trans("CountryOrigin").'</td>'; |
|
2425
|
2425
|
print '<td>'; |
|
@@ -2816,7 +2816,7 @@ discard block |
|
|
block discarded – undo |
|
2816
|
2816
|
|
|
2817
|
2817
|
// Stockable product / default warehouse |
|
2818
|
2818
|
if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) { |
|
2819
|
|
- print '<tr><td>' . $form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')) . '</td>'; |
|
|
2819
|
+ print '<tr><td>'.$form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')).'</td>'; |
|
2820
|
2820
|
print '<td><input type="checkbox" readonly disabled '.($object->stockable_product == 1 ? 'checked' : '').'></td></tr>'; |
|
2821
|
2821
|
|
|
2822
|
2822
|
if ($object->isStockManaged()) { |
|
@@ -2873,7 +2873,7 @@ discard block |
|
|
block discarded – undo |
|
2873
|
2873
|
$result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']); |
|
2874
|
2874
|
if ($result !== -1) { |
|
2875
|
2875
|
foreach ($measuringUnits->records as $record) { |
|
2876
|
|
- $durations[$record->short_label] = dol_ucfirst($record->label) . $plural; |
|
|
2876
|
+ $durations[$record->short_label] = dol_ucfirst($record->label).$plural; |
|
2877
|
2877
|
} |
|
2878
|
2878
|
} |
|
2879
|
2879
|
print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>'; |
|
@@ -3113,7 +3113,7 @@ discard block |
|
|
block discarded – undo |
|
3113
|
3113
|
} |
|
3114
|
3114
|
|
|
3115
|
3115
|
//Send |
|
3116
|
|
- print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); |
|
|
3116
|
+ print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); |
|
3117
|
3117
|
|
|
3118
|
3118
|
if (!isset($hookmanager->resArray['no_button_copy']) || $hookmanager->resArray['no_button_copy'] != 1) { |
|
3119
|
3119
|
if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { |
|
@@ -3295,7 +3295,7 @@ discard block |
|
|
block discarded – undo |
|
3295
|
3295
|
$modelmail = 'product_send'; |
|
3296
|
3296
|
$defaulttopic = $object->label; |
|
3297
|
3297
|
$diroutput = $conf->product->multidir_output[$object->entity ?? $conf->entity]; |
|
3298
|
|
- $trackid = 'prod' . $object->id; |
|
|
3298
|
+ $trackid = 'prod'.$object->id; |
|
3299
|
3299
|
|
|
3300
|
3300
|
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
|
3301
|
3301
|
} |