Merge
This commit is contained in:
parent
f9377a4715
commit
bc669f1702
@ -38,7 +38,7 @@ $type=GETPOST('type');
|
|||||||
$action=GETPOST('action');
|
$action=GETPOST('action');
|
||||||
$confirm=GETPOST('confirm');
|
$confirm=GETPOST('confirm');
|
||||||
$removeelem = GETPOST('removeelem','int');
|
$removeelem = GETPOST('removeelem','int');
|
||||||
$elemid=GETPOST('elemid');
|
$elemid=GETPOST('elemid');
|
||||||
|
|
||||||
if ($id == "")
|
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';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
$newobject = new Product($db);
|
$newobject = new Product($db);
|
||||||
$result = $newobject->fetch($elemid);
|
$result = $newobject->fetch($elemid);
|
||||||
$elementtype = 'product';
|
$elementtype = 'product';
|
||||||
|
|
||||||
// TODO Add into categ
|
// TODO Add into categ
|
||||||
$result=$object->add_type($newobject,$elementtype);
|
$result=$object->add_type($newobject,$elementtype);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref));
|
setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
|
setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($object->error,$object->errors,'errors');
|
setEventMessages($object->error,$object->errors,'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -292,26 +292,26 @@ if ($object->type == 0)
|
|||||||
{
|
{
|
||||||
$showclassifyform=1; $typeid=0;
|
$showclassifyform=1; $typeid=0;
|
||||||
|
|
||||||
// Form to add record into a category
|
// Form to add record into a category
|
||||||
if ($showclassifyform)
|
if ($showclassifyform)
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||||
print '<input type="hidden" name="type" value="'.$typeid.'">';
|
print '<input type="hidden" name="type" value="'.$typeid.'">';
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="action" value="addintocategory">';
|
print '<input type="hidden" name="action" value="addintocategory">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="40%">';
|
print '<tr class="liste_titre"><td width="40%">';
|
||||||
print $langs->trans("AddProductServiceIntoCategory").' ';
|
print $langs->trans("AddProductServiceIntoCategory").' ';
|
||||||
print $form->select_produits('','elemid','',0,0,-1,2,'',1);
|
print $form->select_produits('','elemid','',0,0,-1,2,'',1);
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("ClassifyInCategory").'"></td>';
|
print '<input type="submit" class="button" value="'.$langs->trans("ClassifyInCategory").'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print "<table class='noborder' width='100%'>\n";
|
print "<table class='noborder' width='100%'>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user