Skip to content

Commit 5fc0e07

Browse files
authored
Fix(core): fix relation declaration (#526)
* Fix(core): fix relation declaration * adapt changelog
1 parent 6542a6b commit 5fc0e07

13 files changed

Lines changed: 29 additions & 27 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111

1212
- Fix `Validation` tab from `Order`
13+
- Fix invalid relations declared
14+
1315

1416
## [2.12.4] - 2025-12-02
1517

ajax/massreception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
]);
6363
echo "</td><td>";
6464
echo __s("Delivery status", "order") . "&nbsp;";
65-
PluginOrderDeliveryState::Dropdown(['name' => "plugin_order_deliverystates_id"]);
65+
PluginOrderDeliverystate::Dropdown(['name' => "plugin_order_deliverystates_id"]);
6666
echo "</td></tr>";
6767

6868
echo "<tr class='tab_bg_2'>";

front/ordertype.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030

3131
Session::checkLoginUser();
3232

33-
$dropdown = new PluginOrderOrderType();
33+
$dropdown = new PluginOrderOrdertype();
3434

3535
include(GLPI_ROOT . "/front/dropdown.common.php");

front/othertype.form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030

3131
Session::checkLoginUser();
3232

33-
$dropdown = new PluginOrderOtherType();
33+
$dropdown = new PluginOrderOthertype();
3434

3535
include(GLPI_ROOT . "/front/dropdown.common.form.php");

hook.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ function plugin_order_install()
5757
$migration = new Migration(PLUGIN_ORDER_VERSION);
5858
$classes = ['PluginOrderConfig', 'PluginOrderBillState', 'PluginOrderBillType',
5959
'PluginOrderOrderState', 'PluginOrderOrder','PluginOrderOrder_Item',
60-
'PluginOrderReference', 'PluginOrderDeliveryState',
60+
'PluginOrderReference', 'PluginOrderDeliverystate',
6161
'PluginOrderNotificationTargetOrder',
6262
'PluginOrderOrder_Supplier', 'PluginOrderBill', 'PluginOrderOrderPayment',
63-
'PluginOrderOrderType', 'PluginOrderOther', 'PluginOrderOtherType',
63+
'PluginOrderOrdertype', 'PluginOrderOther', 'PluginOrderOthertype',
6464
'PluginOrderPreference', 'PluginOrderProfile', 'PluginOrderReference_Supplier',
6565
'PluginOrderSurveySupplier', 'PluginOrderOrderTax', 'PluginOrderDocumentCategory',
66-
'PluginOrderReferenceFree', 'PluginOrderAccountSection',
67-
'PluginOrderAnalyticNature',
66+
'PluginOrderReferenceFree', 'PluginOrderAccountsection',
67+
'PluginOrderAnalyticnature',
6868
];
6969
foreach ($classes as $class) {
7070
if ($plug = isPluginItemType($class)) {
@@ -122,13 +122,13 @@ function plugin_order_uninstall()
122122

123123
$classes = ['PluginOrderConfig', 'PluginOrderBill', 'PluginOrderBillState',
124124
'PluginOrderBillType', 'PluginOrderOrderState', 'PluginOrderOrder',
125-
'PluginOrderOrder_Item', 'PluginOrderReference', 'PluginOrderDeliveryState',
125+
'PluginOrderOrder_Item', 'PluginOrderReference', 'PluginOrderDeliverystate',
126126
'PluginOrderNotificationTargetOrder',
127127
'PluginOrderOrder_Supplier', 'PluginOrderOrderPayment','PluginOrderOrderTax',
128-
'PluginOrderOrderType', 'PluginOrderOther', 'PluginOrderOtherType',
128+
'PluginOrderOrdertype', 'PluginOrderOther', 'PluginOrderOthertype',
129129
'PluginOrderPreference', 'PluginOrderProfile', 'PluginOrderReference_Supplier',
130130
'PluginOrderSurveySupplier', 'PluginOrderDocumentCategory',
131-
'PluginOrderAccountSection', 'PluginOrderAnalyticNature',
131+
'PluginOrderAccountsection', 'PluginOrderAnalyticnature',
132132
];
133133
foreach ($classes as $class) {
134134
call_user_func([$class, 'uninstall']);
@@ -146,14 +146,14 @@ function plugin_order_getDropdown()
146146
if ($plugin->isActivated("order")) {
147147
return ['PluginOrderOrderTax' => __s("VAT", "order"),
148148
'PluginOrderOrderPayment' => __s("Payment conditions", "order"),
149-
'PluginOrderOrderType' => __s("Type"),
149+
'PluginOrderOrdertype' => __s("Type"),
150150
'PluginOrderOrderState' => __s("Order status", "order"),
151-
'PluginOrderOtherType' => __s("Other type of item", "order"),
152-
'PluginOrderDeliveryState' => __s("Delivery status", "order"),
151+
'PluginOrderOthertype' => __s("Other type of item", "order"),
152+
'PluginOrderDeliverystate' => __s("Delivery status", "order"),
153153
'PluginOrderBillState' => __s("Bill status", "order"),
154154
'PluginOrderBillType' => __s("Bill type", "order"),
155-
'PluginOrderAnalyticNature' => __s("Analytic nature", "order"),
156-
'PluginOrderAccountSection' => __s("Account section", "order"),
155+
'PluginOrderAnalyticnature' => __s("Analytic nature", "order"),
156+
'PluginOrderAccountsection' => __s("Account section", "order"),
157157
'PluginOrderDocumentCategory' => __s("Orders", "order"),
158158
];
159159
} else {

inc/accountsection.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232

33-
class PluginOrderAccountSection extends CommonDropdown
33+
class PluginOrderAccountsection extends CommonDropdown
3434
{
3535
public static $rightname = 'plugin_order_order';
3636

inc/analyticnature.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232

33-
class PluginOrderAnalyticNature extends CommonDropdown
33+
class PluginOrderAnalyticnature extends CommonDropdown
3434
{
3535
public static $rightname = 'plugin_order_order';
3636

inc/deliverystate.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232

33-
class PluginOrderDeliveryState extends CommonDropdown
33+
class PluginOrderDeliverystate extends CommonDropdown
3434
{
3535
public static function getTypeName($nb = 0)
3636
{

inc/order.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ public function showForm($ID, $options = [])
979979
/* type order */
980980
echo "<td>" . __s("Type") . ": </td><td>";
981981
if ($canedit) {
982-
PluginOrderOrderType::Dropdown([
982+
PluginOrderOrdertype::Dropdown([
983983
'name' => "plugin_order_ordertypes_id",
984984
'value' => $this->fields["plugin_order_ordertypes_id"],
985985
]);
@@ -1293,7 +1293,7 @@ public function showForm($ID, $options = [])
12931293
}
12941294

12951295
if ($canedit) {
1296-
PluginOrderAccountSection::Dropdown([
1296+
PluginOrderAccountsection::Dropdown([
12971297
'name' => "plugin_order_accountsections_id",
12981298
'value' => $this->fields["plugin_order_accountsections_id"],
12991299
]);

inc/order_item.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ public function showAddForm($plugin_order_orders_id)
509509
echo "</span></td>";
510510

511511
echo "<td " . ($config->isAnalyticNatureDisplayed() ? '' : 'style="display:none;"') . ">";
512-
PluginOrderAnalyticNature::Dropdown(['name' => "plugin_order_analyticnatures_id"]);
512+
PluginOrderAnalyticnature::Dropdown(['name' => "plugin_order_analyticnatures_id"]);
513513

514514
if ($config->isAnalyticNatureMandatory()) {
515515
echo " <span class='red'>*</span>";
@@ -589,7 +589,7 @@ public function showAddForm($plugin_order_orders_id)
589589
echo "</td>";
590590

591591
echo "<td " . ($config->isAnalyticNatureDisplayed() ? '' : 'style="display:none;"') . ">";
592-
PluginOrderAnalyticNature::Dropdown(['name' => "plugin_order_analyticnatures_id"]);
592+
PluginOrderAnalyticnature::Dropdown(['name' => "plugin_order_analyticnatures_id"]);
593593

594594
if ($config->isAnalyticNatureMandatory()) {
595595
echo " <span class='red'>*</span>";
@@ -662,7 +662,7 @@ public function showAddForm($plugin_order_orders_id)
662662

663663
$core_typefilename = GLPI_ROOT . "/src/" . $file . "Type.php";
664664
$plugin_typefilename = PLUGIN_ORDER_DIR . "/inc/" . strtolower($file) . "type.class.php";
665-
$itemtypeclass = "PluginOrderOtherType";
665+
$itemtypeclass = "PluginOrderOthertype";
666666

667667
if (
668668
file_exists($core_typefilename)

0 commit comments

Comments
 (0)