diff --git a/admin/setup.php b/admin/setup.php index 821231c..70a3d88 100644 --- a/admin/setup.php +++ b/admin/setup.php @@ -158,7 +158,7 @@ } if (GETPOST('product_service_set', 'alpha')) { - if ($conf->global->DOLISIRH_PRODUCT_SERVICE_SET == 0) { + if ($conf->global->DOLISIRH_PRODUCT_SERVICE_SET == 0 || $conf->global->DOLISIRH_PRODUCT_SERVICE_SET == 1) { require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; $product = new Product($db); @@ -166,12 +166,13 @@ $productOrServiceTimesheets = get_product_service_timesheet(); foreach ($productOrServiceTimesheets as $productOrServiceTimesheet) { - $product->ref = $productOrServiceTimesheet['name']; - $product->label = $productOrServiceTimesheet['name']; + $product->ref = $langs->transnoentities($productOrServiceTimesheet['name']); + $product->label = $langs->transnoentities($productOrServiceTimesheet['name']); + $product->type = $productOrServiceTimesheet['type']; $product->create($user); } - dolibarr_set_const($db, 'DOLISIRH_PRODUCT_SERVICE_SET', 1, 'integer', 0, '', $conf->entity); + dolibarr_set_const($db, 'DOLISIRH_PRODUCT_SERVICE_SET', 2, 'integer', 0, '', $conf->entity); } } @@ -242,10 +243,10 @@ print $langs->transnoentities('ProductServiceSetHelp'); print ''; print '