Skip to content

Commit

Permalink
Fix typo in dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Oct 16, 2023
1 parent 07a0fc0 commit 58c87c1
Show file tree
Hide file tree
Showing 28 changed files with 43 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/CommonDBTM.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class CommonDBTM extends CommonGLPI
protected static $notable = false;

/**
* List of fields that must not be taken into account for dictionnary processing.
* List of fields that must not be taken into account for dictionary processing.
*
* @var string[]
*/
Expand Down
2 changes: 1 addition & 1 deletion src/CommonDropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ public function import(array $input)
/**
* Import a value in a dropdown table.
*
* This import a new dropdown if it doesn't exist - Play dictionnary if needed
* This import a new dropdown if it doesn't exist - Play dictionary if needed
*
* @param string $value Value of the new dropdown (need to be addslashes)
* @param integer $entities_id Entity in case of specific dropdown (default -1)
Expand Down
12 changes: 6 additions & 6 deletions src/Console/Rules/ReplayDictionnaryRulesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ protected function configure()
parent::configure();

$this->setName('rules:replay_dictionnary_rules');
$this->setDescription(__('Replay dictionnary rules on existing items'));
$this->setDescription(__('Replay dictionary rules on existing items'));

$this->addOption(
'dictionnary',
'd',
InputOption::VALUE_REQUIRED,
sprintf(
__('Dictionnary to use. Possible values are: %s'),
__('Dictionary to use. Possible values are: %s'),
implode(', ', $this->getDictionnaryTypes())
)
);
Expand All @@ -65,19 +65,19 @@ protected function configure()
'm',
InputOption::VALUE_REQUIRED,
__('If option is set, only items having given manufacturer ID will be processed.')
. "\n" . __('Currently only available for Software dictionnary.')
. "\n" . __('Currently only available for Software dictionary.')
);
}

protected function interact(InputInterface $input, OutputInterface $output)
{

if (empty($input->getOption('dictionnary'))) {
// Ask for dictionnary argument is empty
// Ask for dictionary argument is empty
/** @var \Symfony\Component\Console\Helper\QuestionHelper $question_helper */
$question_helper = $this->getHelper('question');
$question = new ChoiceQuestion(
__('Which dictionnary do you want to replay?'),
__('Which dictionary do you want to replay?'),
$this->getDictionnaryTypes()
);
$answer = $question_helper->ask(
Expand All @@ -100,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
|| !($rulecollection instanceof \RuleCollection)
) {
throw new \Symfony\Component\Console\Exception\InvalidArgumentException(
sprintf(__('Invalid "dictionnary" value.'))
sprintf(__('Invalid "dictionary" value.'))
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -2452,7 +2452,7 @@ public static function import($itemtype, $input)
/**
* Import a value in a dropdown table.
*
* This import a new dropdown if it doesn't exist - Play dictionnary if needed
* This import a new dropdown if it doesn't exist - Play dictionary if needed
*
* @param string $itemtype name of the class
* @param string $value Value of the new dropdown.
Expand Down
2 changes: 1 addition & 1 deletion src/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ public static function getRightsForForm(string $interface = 'all', string $form
'scope' => 'global'
]),
$fn_get_rights(RuleDictionnaryPrinter::class, 'central', [
'label' => __('Printers dictionnary'),
'label' => __('Printers dictionary'),
'scope' => 'global'
]),
]
Expand Down
4 changes: 2 additions & 2 deletions src/RuleCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class RuleCollection extends CommonDBTM
public $orderby = "ranking";
/// Processing several rules : use result of the previous one to computer the current one
public $use_output_rule_process_as_next_input = false;
/// Rule collection can be replay (for dictionnary)
/// Rule collection can be replay (for dictionary)
public $can_replay_rules = false;
/// List of rules of the rule collection
public $RuleList = null;
Expand Down Expand Up @@ -2052,7 +2052,7 @@ public function title()
* Get rulecollection classname by giving his itemtype
*
* @param $itemtype itemtype
* @param $check_dictionnary_type check if the itemtype is a dictionnary or not
* @param $check_dictionnary_type check if the itemtype is a dictionary or not
* (false by default)
*
* @return RuleCollection|null
Expand Down
5 changes: 1 addition & 4 deletions src/RuleDictionnaryComputerModelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

class RuleDictionnaryComputerModelCollection extends RuleDictionnaryDropdownCollection
{
// From RuleCollection
//public $rule_class_name = 'RuleDictionnaryComputerModel';

public $item_table = "glpi_computermodels";
public $menu_option = "model.computer";

Expand All @@ -46,6 +43,6 @@ class RuleDictionnaryComputerModelCollection extends RuleDictionnaryDropdownColl
**/
public function getTitle()
{
return __('Dictionnary of computer models');
return __('Dictionary of computer models');
}
}
5 changes: 1 addition & 4 deletions src/RuleDictionnaryComputerTypeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

class RuleDictionnaryComputerTypeCollection extends RuleDictionnaryDropdownCollection
{
// From RuleCollection
//public $rule_class_name = 'RuleDictionnaryComputerType';

public $item_table = "glpi_computertypes";
public $menu_option = "type.computer";

Expand All @@ -46,6 +43,6 @@ class RuleDictionnaryComputerTypeCollection extends RuleDictionnaryDropdownColle
**/
public function getTitle()
{
return __('Dictionnary of computer types');
return __('Dictionary of computer types');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryMonitorModelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryMonitorModelCollection extends RuleDictionnaryDropdownColle
**/
public function getTitle()
{
return __('Dictionnary of computer models');
return __('Dictionary of computer models');
}
}
5 changes: 1 addition & 4 deletions src/RuleDictionnaryMonitorTypeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

class RuleDictionnaryMonitorTypeCollection extends RuleDictionnaryDropdownCollection
{
// From RuleCollection
//public $rule_class_name = 'RuleDictionnaryMonitorType';

public $item_table = "glpi_monitortypes";
public $menu_option = "type.monitor";

Expand All @@ -46,6 +43,6 @@ class RuleDictionnaryMonitorTypeCollection extends RuleDictionnaryDropdownCollec
**/
public function getTitle()
{
return __('Dictionnary of monitor types');
return __('Dictionary of monitor types');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryNetworkEquipmentModelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryNetworkEquipmentModelCollection extends RuleDictionnaryDrop
**/
public function getTitle()
{
return __('Dictionnary of networking equipment models');
return __('Dictionary of networking equipment models');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryNetworkEquipmentTypeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryNetworkEquipmentTypeCollection extends RuleDictionnaryDropd
**/
public function getTitle()
{
return __('Dictionnary of network equipment types');
return __('Dictionary of network equipment types');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryOperatingSystemArchitectureCollection extends RuleDictionna
**/
public function getTitle()
{
return __('Dictionnary of operating system architectures');
return __('Dictionary of operating system architectures');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryOperatingSystemCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryOperatingSystemCollection extends RuleDictionnaryDropdownCo
**/
public function getTitle()
{
return __('Dictionnary of operating systems');
return __('Dictionary of operating systems');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryOperatingSystemEditionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryOperatingSystemEditionCollection extends RuleDictionnaryDro
**/
public function getTitle()
{
return __('Dictionnary of operating system editions');
return __('Dictionary of operating system editions');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryOperatingSystemServicePackCollection extends RuleDictionnar
**/
public function getTitle()
{
return __('Dictionnary of service packs');
return __('Dictionary of service packs');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryOperatingSystemVersionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryOperatingSystemVersionCollection extends RuleDictionnaryDro
**/
public function getTitle()
{
return __('Dictionnary of operating system versions');
return __('Dictionary of operating system versions');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryPeripheralModelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryPeripheralModelCollection extends RuleDictionnaryDropdownCo
**/
public function getTitle()
{
return __('Dictionnary of device models');
return __('Dictionary of device models');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryPeripheralTypeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryPeripheralTypeCollection extends RuleDictionnaryDropdownCol
**/
public function getTitle()
{
return __('Dictionnary of device types');
return __('Dictionary of device types');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryPhoneModelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryPhoneModelCollection extends RuleDictionnaryDropdownCollect
**/
public function getTitle()
{
return __('Dictionnary of phone models');
return __('Dictionary of phone models');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryPhoneTypeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryPhoneTypeCollection extends RuleDictionnaryDropdownCollecti
**/
public function getTitle()
{
return __('Dictionnary of phone types');
return __('Dictionary of phone types');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RuleDictionnaryPrinter extends Rule

public function getTitle()
{
return __('Dictionnary of printers');
return __('Dictionary of printers');
}


Expand Down
10 changes: 5 additions & 5 deletions src/RuleDictionnaryPrinterCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RuleDictionnaryPrinterCollection extends RuleCollection
**/
public function getTitle()
{
return __('Dictionnary of printers');
return __('Dictionary of printers');
}


Expand Down Expand Up @@ -130,7 +130,7 @@ public function replayRulesOnExistingDB($offset = 0, $maxtime = 0, $items = [],
}
}

//Replay printer dictionnary rules
//Replay printer dictionary rules
$res_rule = $this->processAllRules($input, [], []);

foreach (['manufacturer', 'is_global', 'name'] as $attr) {
Expand All @@ -157,7 +157,7 @@ public function replayRulesOnExistingDB($offset = 0, $maxtime = 0, $items = [],
foreach ($print_iterator as $result) {
$IDs[] = $result["id"];
}
//Replay dictionnary on all the printers
//Replay dictionary on all the printers
$this->replayDictionnaryOnPrintersByID($IDs, $res_rule);
}
}
Expand Down Expand Up @@ -204,7 +204,7 @@ public static function somethingHasChanged(array $res_rule, array $input)


/**
* Replay dictionnary on several printers
* Replay dictionary on several printers
*
* @param $IDs array of printers IDs to replay
* @param $res_rule array of rule results
Expand Down Expand Up @@ -266,7 +266,7 @@ public function putOldPrintersInTrash($IDS = [])


/**
* Replay dictionnary on one printer
* Replay dictionary on one printer
*
* @param &$new_printers array containing new printers already computed
* @param $res_rule array of rule results
Expand Down
2 changes: 1 addition & 1 deletion src/RuleDictionnaryPrinterModelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryPrinterModelCollection extends RuleDictionnaryDropdownColle
**/
public function getTitle()
{
return __('Dictionnary of printer models');
return __('Dictionary of printer models');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnaryPrinterTypeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class RuleDictionnaryPrinterTypeCollection extends RuleDictionnaryDropdownCollec
**/
public function getTitle()
{
return __('Dictionnary of printer types');
return __('Dictionary of printer types');
}
}
2 changes: 1 addition & 1 deletion src/RuleDictionnarySoftware.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class RuleDictionnarySoftware extends Rule
public function getTitle()
{
//TRANS: plural for software
return __('Dictionnary of software');
return __('Dictionary of software');
}


Expand Down
10 changes: 5 additions & 5 deletions src/RuleDictionnarySoftwareCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RuleDictionnarySoftwareCollection extends RuleCollection
public function getTitle()
{
//TRANS: software in plural
return __('Dictionnary of software');
return __('Dictionary of software');
}


Expand Down Expand Up @@ -173,12 +173,12 @@ public function replayRulesOnExistingDB($offset = 0, $maxtime = 0, $items = [],
}
}

//If manufacturer is set, then first run the manufacturer's dictionnary
//If manufacturer is set, then first run the manufacturer's dictionary
if (isset($input["manufacturer"])) {
$input["manufacturer"] = Manufacturer::processName($input["manufacturer"]);
}

//Replay software dictionnary rules
//Replay software dictionary rules
$res_rule = $this->processAllRules($input, [], []);

if (
Expand Down Expand Up @@ -209,7 +209,7 @@ public function replayRulesOnExistingDB($offset = 0, $maxtime = 0, $items = [],
foreach ($same_iterator as $result) {
$IDs[] = $result["id"];
}
//Replay dictionnary on all the software
//Replay dictionary on all the software
$this->replayDictionnaryOnSoftwaresByID($IDs, $res_rule);
}
}
Expand Down Expand Up @@ -302,7 +302,7 @@ public function replayDictionnaryOnSoftwaresByID(array $IDs, $res_rule = [])


/**
* Replay dictionnary on one software
* Replay dictionary on one software
*
* @param &$new_softs array containing new software already computed
* @param $res_rule array of rule results
Expand Down
4 changes: 2 additions & 2 deletions src/Software.php
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ public function addOrRestoreFromTrash(


/**
* Put software in trashbin because it's been removed by GLPI software dictionnary
* Put software in trashbin because it's been removed by GLPI software dictionary
*
* @param $ID the ID of the software to put in trashbin
* @param $comment the comment to add to the already existing software's comment (default '')
Expand All @@ -895,7 +895,7 @@ public function putInTrash($ID, $comment = '')
$input["softwarecategories_id"] = $CFG_GLPI["softwarecategories_id_ondelete"];
}

//Add dictionnary comment to the current comment
//Add dictionary comment to the current comment
$input["comment"] = (($this->fields["comment"] != '') ? "\n" : '') . $comment;

return $this->update($input);
Expand Down

0 comments on commit 58c87c1

Please sign in to comment.