diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 14a63ffc837..c55f324ab06 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -38,7 +38,7 @@ $type=GETPOST('type');
$action=GETPOST('action');
$confirm=GETPOST('confirm');
$removeelem = GETPOST('removeelem','int');
-$elemid=GETPOST('elemid');
+$elemid=GETPOST('elemid');
if ($id == "")
{
@@ -121,32 +121,32 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
}
}
-if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
+if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
{
- require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
- $newobject = new Product($db);
- $result = $newobject->fetch($elemid);
+ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+ $newobject = new Product($db);
+ $result = $newobject->fetch($elemid);
$elementtype = 'product';
// TODO Add into categ
- $result=$object->add_type($newobject,$elementtype);
- if ($result >= 0)
- {
- setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref));
- }
- else
- {
- if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
- {
- setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
- }
- else
- {
- setEventMessages($object->error,$object->errors,'errors');
- }
- }
-
-}
+ $result=$object->add_type($newobject,$elementtype);
+ if ($result >= 0)
+ {
+ setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref));
+ }
+ else
+ {
+ if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
+ {
+ setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
+ }
+ else
+ {
+ setEventMessages($object->error,$object->errors,'errors');
+ }
+ }
+
+}
@@ -292,26 +292,26 @@ if ($object->type == 0)
{
$showclassifyform=1; $typeid=0;
- // Form to add record into a category
- if ($showclassifyform)
- {
+ // Form to add record into a category
+ if ($showclassifyform)
+ {
print '
';
- print '
| '; + print $langs->trans("AddProductServiceIntoCategory").' '; + print $form->select_produits('','elemid','',0,0,-1,2,'',1); + print ' | '; + print ' | '; + print '