mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Fix some problem on new category/tag (#33632)
* FIX Supplier Invoice category - Wrong function on view/edit card * FIX Invoice category - Wrong link for manage category * FiIX Translation problem on category * FIX wrong cat --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
committed by
GitHub
parent
476b5d6e40
commit
67dff53958
@@ -200,7 +200,7 @@ class Categorie extends CommonObject
|
||||
'ticket' => 'TicketsCategoriesArea',
|
||||
'knowledgemanagement' => 'KnowledgemanagementsCategoriesArea',
|
||||
'fichinter' => 'FichintersCategoriesArea',
|
||||
'order' => 'OrderCategoriesArea',
|
||||
'order' => 'OrdersCategoriesArea',
|
||||
'invoice' => 'InvoicesCategoriesArea',
|
||||
'supplier_order' => 'SuppliersOrdersCategoriesArea',
|
||||
'supplier_invoice' => 'SuppliersInvoicesCategoriesArea'
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -80,6 +81,10 @@ if ($type == Categorie::TYPE_ACCOUNT) {
|
||||
$title = $langs->trans('ActionCommCategoriesArea');
|
||||
} elseif ($type == Categorie::TYPE_WEBSITE_PAGE) {
|
||||
$title = $langs->trans('WebsitePagesCategoriesArea');
|
||||
} elseif ($type == Categorie::TYPE_SUPPLIER_ORDER) {
|
||||
$title = $langs->trans('SuppliersOrdersCategoriesArea');
|
||||
} elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
|
||||
$title = $langs->trans('SuppliersInvoicesCategoriesArea');
|
||||
} else {
|
||||
$title = $langs->trans(ucfirst($type).'sCategoriesArea');
|
||||
}
|
||||
|
||||
@@ -1539,7 +1539,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
$langs->load("categories");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=14", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=17", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3277,16 +3277,6 @@ if ($action == 'create') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
|
||||
}
|
||||
|
||||
// Category
|
||||
if (isModEnabled('category')) {
|
||||
// Categories
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER_INVOICE, '', 'parent', 64, 0, 1);
|
||||
$arrayselected = GETPOST('categories', 'array');
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, '0');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
@@ -3584,6 +3574,41 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans("Categories");
|
||||
print '<td><td class="right">';
|
||||
if ($usercancreate) {
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$object->id.'&action=edittags&token='.newToken().'">'.img_edit().'</a>';
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER_INVOICE, '', 'parent', 64, 0, 1);
|
||||
if ($action == 'edittags') {
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="settags">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($object->id, Categorie::TYPE_SUPPLIER_INVOICE);
|
||||
$arrayselected = [];
|
||||
foreach ($cats as $cat) {
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, '0');
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER_INVOICE, 1);
|
||||
}
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
if ($object->status != $object::STATUS_DRAFT) {
|
||||
|
||||
@@ -18,6 +18,7 @@ AccountsCategoriesArea=Bank account tags/categories area
|
||||
ProjectsCategoriesArea=Project tags/categories area
|
||||
UsersCategoriesArea=User tags/categories area
|
||||
InvoicesCategoriesArea=Invoice tags/categories area
|
||||
OrdersCategoriesArea=Order tags/categories area
|
||||
SuppliersOrdersCategoriesArea=Supplier order tags/categories area
|
||||
SuppliersInvoicesCategoriesArea=Supplier invoice tags/categories area
|
||||
Bank_linesCategoriesArea==Bank lines tags/categories area
|
||||
|
||||
Reference in New Issue
Block a user