Skip to content

Commit

Permalink
Rework entity change rules comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DidierViret committed Jun 28, 2023
1 parent 37445e4 commit d3fb614
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions orif/stock/Language/fr/stock_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
'unauthorized_entity_list' => 'Vous n\'êtes pas autorisé à consulter le(s) sites demandés',
'msg_err_unique_name' => 'Ce nom est déjà utilisé dans ce site',
'msg_err_unique_short_name' => 'Ce nom court est déjà utilisé dans ce site',
'msg_err_item_group_has_same_entity' => 'Le changement de site pour ce groupe d\'objets n\'est pas autorisé, car il est actuellement utilisé par d\'autres objets.',
'msg_err_stocking_place_has_same_entity'=> 'Le changement de site pour ce lieu de stockage n\'est pas autorisé, car il est actuellement utilisé par d\'autres objets.',
'msg_err_item_group_has_same_entity' => 'Ce groupe d\'objets ne peut pas être transféré sur un autre site, car des objets lui sont liés.',
'msg_err_stocking_place_has_same_entity'=> 'Ce lieu de stockage ne peut pas être transféré sur un autre site, car des objets lui sont liés.',

/** BTN */
'excel_export_btn' => 'Exporter',
Expand Down
20 changes: 11 additions & 9 deletions orif/stock/Validations/CustomRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CustomRules
*
* @param string $name = name to check
* @param string $params = contains every parameters needed separated with a comma
* @return boolean = TRUE if the name is unique, FALSE otherwise
* @return boolean = TRUE if the name is unique in the given entity, FALSE otherwise
*/
public function is_unique_group_name_by_entity(string $name, string $params) : bool
{
Expand All @@ -42,7 +42,7 @@ public function is_unique_group_name_by_entity(string $name, string $params) : b
*
* @param string $short name = short name to check
* @param string $params = contains every parameters needed separated with a comma
* @return boolean = TRUE if the short_name is unique, FALSE otherwise
* @return boolean = TRUE if the short_name is unique in the given entity, FALSE otherwise
*/
public function is_unique_group_short_name_by_entity(string $short_name, string $params) : bool
{
Expand All @@ -60,11 +60,11 @@ public function is_unique_group_short_name_by_entity(string $short_name, string
}

/**
* Checks that a name doesn't already exist in an entity
* Checks that a stocking place's name doesn't already exist in an entity
*
* @param string $name = name to check
* @param string $params = contains every parameters needed separated with a comma
* @return boolean = TRUE if the name is unique, FALSE otherwise
* @return boolean = TRUE if the name is unique in the given entity, FALSE otherwise
*/
public function is_unique_place_name_by_entity(string $name, string $params) : bool
{
Expand All @@ -82,11 +82,11 @@ public function is_unique_place_name_by_entity(string $name, string $params) : b
}

/**
* Checks that a short_name doesn't already exist in an entity
* Checks that a stocking place's short_name doesn't already exist in an entity
*
* @param string $short_name = short name to check
* @param string $params = contains every parameters needed separated with a comma
* @return boolean = TRUE if the short_name is unique, FALSE otherwise
* @return boolean = TRUE if the short_name is unique in the given entity, FALSE otherwise
*/
public function is_unique_place_short_name_by_entity(string $short_name, string $params) : bool
{
Expand All @@ -104,11 +104,12 @@ public function is_unique_place_short_name_by_entity(string $short_name, string
}

/**
* Checks that an entity change on an item_group does not affect any item
* Checks that an entity change on an item_group does not affect any item.
* The stocking place is also linked with the entity and we have to avoid data inconsistency.
*
* @param string $entity_id = entity id to check
* @param string $params = contains every parameters needed separated with a comma
* @return boolean = TRUE if the $entity_id equals fk_entity_id from the query or no result was found, FALSE otherwise
* @return boolean = TRUE if no item linked to a stocking place in the current entity is affected by the change. FALSE otherwise.
*/
public function item_group_has_same_entity(string $entity_id, string $params) : bool
{
Expand All @@ -133,10 +134,11 @@ public function item_group_has_same_entity(string $entity_id, string $params) :

/**
* Checks that an entity change on a stocking_place does not affect any item
* The item group is also linked with the entity and we have to avoid data inconsistency.
*
* @param string $entity_id = entity id to check
* @param string $params = contains every parameters needed separated with a comma
* @return boolean = TRUE if the $entity_id equals fk_entity_id from the query or no result was found, FALSE otherwise
* @return boolean = TRUE if no item linked to an item group in the current entity is affected by the change. FALSE otherwise.
*/
public function stocking_place_has_same_entity(string $entity_id, string $params) : bool
{
Expand Down

0 comments on commit d3fb614

Please sign in to comment.