';
diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php
index a38245d32c7..fada766f065 100644
--- a/htdocs/product/admin/price_rules.php
+++ b/htdocs/product/admin/price_rules.php
@@ -29,8 +29,9 @@ $langs->loadLangs(array('admin', 'products'));
$action = GETPOST('action', 'aZ09');
// Security check
-if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled)))
+if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled))) {
accessforbidden();
+}
$error = 0;
@@ -158,7 +159,7 @@ for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
- global->PRODUIT_MULTIPRICES_LIMIT; $i++): ?>
+ global->PRODUIT_MULTIPRICES_LIMIT; $i++) : ?>
\n";
-foreach ($dirproduct as $dirroot)
-{
+foreach ($dirproduct as $dirroot) {
$dir = dol_buildpath($dirroot, 0);
$handle = @opendir($dir);
- if (is_resource($handle))
- {
+ if (is_resource($handle)) {
// Loop on each module find in opened directory
- while (($file = readdir($handle)) !== false)
- {
- if (substr($file, 0, 16) == 'mod_codeproduct_' && substr($file, -3) == 'php')
- {
+ while (($file = readdir($handle)) !== false) {
+ if (substr($file, 0, 16) == 'mod_codeproduct_' && substr($file, -3) == 'php') {
$file = substr($file, 0, dol_strlen($file) - 4);
try {
dol_include_once($dirroot.$file.'.php');
- } catch (Exception $e)
- {
+ } catch (Exception $e) {
dol_syslog($e->getMessage(), LOG_ERR);
}
$modCodeProduct = new $file;
// Show modules according to features level
- if ($modCodeProduct->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
- if ($modCodeProduct->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
+ if ($modCodeProduct->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
+ continue;
+ }
+ if ($modCodeProduct->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
+ continue;
+ }
print '
\n";
clearstatcache();
-foreach ($dirmodels as $reldir)
-{
- foreach (array('', '/doc') as $valdir)
- {
+foreach ($dirmodels as $reldir) {
+ foreach (array('', '/doc') as $valdir) {
$dir = dol_buildpath($reldir."core/modules/product".$valdir);
- if (is_dir($dir))
- {
+ if (is_dir($dir)) {
$handle = opendir($dir);
- if (is_resource($handle))
- {
- while (($file = readdir($handle)) !== false)
- {
+ if (is_resource($handle)) {
+ while (($file = readdir($handle)) !== false) {
$filelist[] = $file;
}
closedir($handle);
arsort($filelist);
- foreach ($filelist as $file)
- {
- if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
- {
- if (file_exists($dir.'/'.$file))
- {
+ foreach ($filelist as $file) {
+ if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
+ if (file_exists($dir.'/'.$file)) {
$name = substr($file, 4, dol_strlen($file) - 16);
$classname = substr($file, 0, dol_strlen($file) - 12);
@@ -442,21 +424,26 @@ foreach ($dirmodels as $reldir)
$module = new $classname($db);
$modulequalified = 1;
- if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
- if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
+ if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
+ $modulequalified = 0;
+ }
+ if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
+ $modulequalified = 0;
+ }
- if ($modulequalified)
- {
+ if ($modulequalified) {
print '
';
// multiprix nombre de prix a proposer
-if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
-{
+if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
print '
';
-if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
-{
+if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
print '
';
*/
// View product description in thirdparty language
-if (!empty($conf->global->MAIN_MULTILANGS))
-{
+if (!empty($conf->global->MAIN_MULTILANGS)) {
print '
';
}
-if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
-{
+if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
print '
'."\n";
- if (is_dir($dir))
- {
+ if (is_dir($dir)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$handle = opendir($dir);
- if (is_resource($handle))
- {
- while (($file = readdir($handle)) !== false)
- {
- if (file_exists($dir.$file.'/product.'.$file.'.class.php'))
- {
+ if (is_resource($handle)) {
+ while (($file = readdir($handle)) !== false) {
+ if (file_exists($dir.$file.'/product.'.$file.'.class.php')) {
$classfile = $dir.$file.'/product.'.$file.'.class.php';
$classname = 'Product'.ucfirst($file);
@@ -742,8 +723,7 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY))
$module = $object->module;
- if ($conf->$module->enabled)
- {
+ if ($conf->$module->enabled) {
print '
';
+ }
+ if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) {
print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).' ';
} else {
print ' '.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).' ';
@@ -1199,8 +1256,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$parameters = array('colspan' => 3, 'cols' => '3');
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- if (empty($reshook))
- {
+ if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
}
@@ -1228,8 +1284,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
- if (!empty($conf->global->PRODUIT_MULTIPRICES))
- {
+ if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
// We do no show price array on create when multiprices enabled.
// We must set them on prices tab.
print '';
@@ -1269,8 +1324,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Accountancy codes
print '';
- if (!empty($conf->accounting->enabled))
- {
+ if (!empty($conf->accounting->enabled)) {
// Accountancy_code_sell
print ''.$langs->trans("ProductAccountancySellCode").' ';
print '';
@@ -1283,8 +1337,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
// Accountancy_code_sell_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
print '';
if ($type == 0) {
@@ -1299,8 +1352,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Accountancy_code_sell_export
print ' '.$langs->trans("ProductAccountancySellExportCode").' ';
print '';
- if ($type == 0)
- {
+ if ($type == 0) {
$accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT);
} else {
$accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT);
@@ -1311,17 +1363,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Accountancy_code_buy
print ' '.$langs->trans("ProductAccountancyBuyCode").' ';
print '';
- if ($type == 0) {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
- } else {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
- }
+ if ($type == 0) {
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
+ } else {
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
+ }
print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, '');
print ' ';
// Accountancy_code_buy_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
print '';
if ($type == 0) {
@@ -1336,8 +1387,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Accountancy_code_buy_export
print ' '.$langs->trans("ProductAccountancyBuyExportCode").' ';
print '';
- if ($type == 0)
- {
+ if ($type == 0) {
$accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT);
} else {
$accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT);
@@ -1346,12 +1396,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
} else // For external software
{
- if (!empty($accountancy_code_sell)) { $object->accountancy_code_sell = $accountancy_code_sell; }
- if (!empty($accountancy_code_sell_intra)) { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; }
- if (!empty($accountancy_code_sell_export)) { $object->accountancy_code_sell_export = $accountancy_code_sell_export; }
- if (!empty($accountancy_code_buy)) { $object->accountancy_code_buy = $accountancy_code_buy; }
- if (!empty($accountancy_code_buy_intra)) { $object->accountancy_code_buy_intra = $accountancy_code_buy_intra; }
- if (!empty($accountancy_code_buy_export)) { $object->accountancy_code_buy_export = $accountancy_code_buy_export; }
+ if (!empty($accountancy_code_sell)) {
+ $object->accountancy_code_sell = $accountancy_code_sell;
+ }
+ if (!empty($accountancy_code_sell_intra)) {
+ $object->accountancy_code_sell_intra = $accountancy_code_sell_intra;
+ }
+ if (!empty($accountancy_code_sell_export)) {
+ $object->accountancy_code_sell_export = $accountancy_code_sell_export;
+ }
+ if (!empty($accountancy_code_buy)) {
+ $object->accountancy_code_buy = $accountancy_code_buy;
+ }
+ if (!empty($accountancy_code_buy_intra)) {
+ $object->accountancy_code_buy_intra = $accountancy_code_buy_intra;
+ }
+ if (!empty($accountancy_code_buy_export)) {
+ $object->accountancy_code_buy_export = $accountancy_code_buy_export;
+ }
// Accountancy_code_sell
print ''.$langs->trans("ProductAccountancySellCode").' ';
@@ -1359,8 +1421,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
// Accountancy_code_sell_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
print ' ';
print ' ';
@@ -1377,8 +1438,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
// Accountancy_code_buy_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
print ' ';
print ' ';
@@ -1402,11 +1462,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
} elseif ($object->id > 0) {
/*
- * Product card
- */
+ * Product card
+ */
// Fiche en mode edition
- if ($action == 'edit' && $usercancreate)
- {
+ if ($action == 'edit' && $usercancreate) {
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -1421,8 +1480,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// We set country_id, country_code and country for the selected country
$object->country_id = GETPOST('country_id') ? GETPOST('country_id') : $object->country_id;
- if ($object->country_id)
- {
+ if ($object->country_id) {
$tmparray = getCountry($object->country_id, 'all');
$object->country_code = $tmparray['code'];
$object->country = $tmparray['label'];
@@ -1430,7 +1488,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$type = $langs->trans('Product');
- if ($object->isService()) $type = $langs->trans('Service');
+ if ($object->isService()) {
+ $type = $langs->trans('Service');
+ }
//print load_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), "");
// Main official, simple, and not duplicated code
@@ -1457,8 +1517,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Status To sell
print ''.$langs->trans("Status").' ('.$langs->trans("Sell").') ';
print '';
- if ($object->status)
- {
+ if ($object->status) {
print ''.$langs->trans("OnSell").' ';
print ''.$langs->trans("NotOnSell").' ';
} else {
@@ -1471,8 +1530,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Status To Buy
print ''.$langs->trans("Status").' ('.$langs->trans("Buy").') ';
print '';
- if ($object->status_buy)
- {
+ if ($object->status_buy) {
print ''.$langs->trans("ProductStatusOnBuy").' ';
print ''.$langs->trans("ProductStatusNotOnBuy").' ';
} else {
@@ -1483,10 +1541,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
// Batch number managment
- if ($conf->productbatch->enabled)
- {
- if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
- {
+ if ($conf->productbatch->enabled) {
+ if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print ''.$langs->trans("ManageLotSerial").' ';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
print $form->selectarray('status_batch', $statutarray, $object->status_batch);
@@ -1496,23 +1552,28 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Barcode
$showbarcode = empty($conf->barcode->enabled) ? 0 : 1;
- if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode = 0;
+ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
+ $showbarcode = 0;
+ }
- if ($showbarcode)
- {
+ if ($showbarcode) {
print ' '.$langs->trans('BarcodeType').' ';
if (GETPOSTISSET('fk_barcode_type')) {
- $fk_barcode_type = GETPOST('fk_barcode_type');
+ $fk_barcode_type = GETPOST('fk_barcode_type');
} else {
$fk_barcode_type = $object->barcode_type;
- if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
+ if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) {
+ $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
+ }
}
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
$formbarcode = new FormBarCode($db);
print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1);
print ' '.$langs->trans("BarcodeValue").' ';
$tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode;
- if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
+ if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) {
+ $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
+ }
print ' ';
print ' ';
}
@@ -1533,32 +1594,30 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
// Stock
- if ($object->isProduct() && !empty($conf->stock->enabled))
- {
+ if ($object->isProduct() && !empty($conf->stock->enabled)) {
// Default warehouse
print ''.$langs->trans("DefaultWarehouse").' ';
print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1);
print ' ';
print ' ';
/*
- print "".''.$langs->trans("StockLimit").' ';
- print ' ';
- print ' ';
+ print " ".''.$langs->trans("StockLimit").' ';
+ print ' ';
+ print ' ';
- print ''.$langs->trans("DesiredStock").' ';
- print ' ';
- print ' ';
- */
+ print ''.$langs->trans("DesiredStock").' ';
+ print ' ';
+ print ' ';
+ */
}
/*
- else
- {
- print ' ';
- print ' ';
- }*/
-
- if ($object->isService())
+ else
{
+ print ' ';
+ print ' ';
+ }*/
+
+ if ($object->isService()) {
// Duration
print ''.$langs->trans("Duration").' ';
print ' ';
@@ -1576,8 +1635,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
print ' ';
- if (empty($conf->global->PRODUCT_DISABLE_SIZE))
- {
+ if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
// Brut Length
print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").' ';
print ' x';
@@ -1586,16 +1644,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print $formproduct->selectMeasuringUnits("size_units", "size", $object->length_units, 0, 2);
print ' ';
}
- if (empty($conf->global->PRODUCT_DISABLE_SURFACE))
- {
+ if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) {
// Brut Surface
print ''.$langs->trans("Surface").' ';
print ' ';
print $formproduct->selectMeasuringUnits("surface_units", "surface", $object->surface_units, 0, 2);
print ' ';
}
- if (empty($conf->global->PRODUCT_DISABLE_VOLUME))
- {
+ if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) {
// Brut Volume
print ''.$langs->trans("Volume").' ';
print ' ';
@@ -1603,8 +1659,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
}
- if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE))
- {
+ if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) {
// Net Measure
print ''.$langs->trans("NetMeasure").' ';
print ' ';
@@ -1613,8 +1668,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
}
}
// Units
- if (!empty($conf->global->PRODUCT_USE_UNITS))
- {
+ if (!empty($conf->global->PRODUCT_USE_UNITS)) {
print ' '.$langs->trans('DefaultUnitToShow').' ';
print '';
print $form->selectUnits($object->fk_unit, 'units');
@@ -1622,22 +1676,23 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
}
// Custom code
- if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
- {
+ if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) {
print ' '.$langs->trans("CustomCode").' ';
// Origin country
print ''.$langs->trans("CountryOrigin").' ';
print '';
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone');
- if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
+ if ($user->admin) {
+ print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
+ }
print ' ';
// State
- if (empty($conf->global->PRODUCT_DISABLE_STATE))
- {
- if ($conf->browser->layout == 'phone') print '';
- if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
- {
+ if (empty($conf->global->PRODUCT_DISABLE_STATE)) {
+ if ($conf->browser->layout == 'phone') {
+ print ' ';
+ }
+ if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) {
print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).' ';
} else {
print ' '.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).' ';
@@ -1653,14 +1708,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$parameters = array('colspan' => ' colspan="3"', 'cols' => 3);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- if (empty($reshook))
- {
+ if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
}
// Tags-Categories
- if ($conf->categorie->enabled)
- {
+ if ($conf->categorie->enabled) {
print ' '.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
@@ -1676,8 +1729,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
}
// Note private
- if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB))
- {
+ if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
print ' '.$langs->trans("NoteNotVisibleOnBill").' ';
$doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
@@ -1692,8 +1744,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
- if (!empty($conf->accounting->enabled))
- {
+ if (!empty($conf->accounting->enabled)) {
// Accountancy_code_sell
print ''.$langs->trans("ProductAccountancySellCode").' ';
print '';
@@ -1701,8 +1752,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
// Accountancy_code_sell_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
print '';
print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1);
@@ -1722,8 +1772,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
// Accountancy_code_buy_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
print '';
print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1);
@@ -1743,8 +1792,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
// Accountancy_code_sell_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
print ' ';
print ' ';
@@ -1761,8 +1809,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
// Accountancy_code_buy_intra
- if ($mysoc->isInEEC())
- {
+ if ($mysoc->isInEEC()) {
print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
print ' ';
print ' ';
@@ -1787,7 +1834,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
} else {
// Fiche en mode visu
$showbarcode = empty($conf->barcode->enabled) ? 0 : 1;
- if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode = 0;
+ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
+ $showbarcode = 0;
+ }
$head = product_prepare_head($object);
$titre = $langs->trans("CardProduct".$object->type);
@@ -1799,7 +1848,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$object->next_prev_filter = " fk_product_type = ".$object->type;
$shownav = 1;
- if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav = 0;
+ if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
+ $shownav = 0;
+ }
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
@@ -1811,8 +1862,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
// Type
- if (!empty($conf->product->enabled) && !empty($conf->service->enabled))
- {
+ if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
@@ -1821,25 +1871,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print ' ';
}
- if ($showbarcode)
- {
+ if ($showbarcode) {
// Barcode type
print '';
print '';
print ' ';
- if ($action == 'editbarcodetype' || $action == 'editbarcode')
- {
+ if ($action == 'editbarcodetype' || $action == 'editbarcode') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
$formbarcode = new FormBarCode($db);
}
$fk_barcode_type='';
- if ($action == 'editbarcodetype')
- {
+ if ($action == 'editbarcodetype') {
print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type');
$fk_barcode_type = $object->barcode_type;
} else {
@@ -1854,13 +1903,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '';
print ' ';
- if ($action == 'editbarcode')
- {
+ if ($action == 'editbarcode') {
$tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode;
- if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
+ if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) {
+ $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
+ }
print '