Skip to content

Commit

Permalink
Fix indentation after PHPCBF
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jun 28, 2018
1 parent 2df0688 commit 911af54
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 65 deletions.
6 changes: 3 additions & 3 deletions ajax/dropdownReplaceFindDevice.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@
$outputval = sprintf(__('%1$s (%2$s)'), $outputval, $ID);
}
array_push($options, ['id' => $ID,
'text' => $outputval,
'title' => $title]);
'text' => $outputval,
'title' => $title]);
$count++;
}


echo json_encode(['results' => $options,
'count' => $count]);
'count' => $count]);
6 changes: 3 additions & 3 deletions ajax/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

case 'set' :
Group::dropdown(['value' => $_POST["groups_id"],
'entity' => $_POST["entities_id"],
'entity_sons' => $_POST["entity_sons"],
'emptylabel' => __('None')]);
'entity' => $_POST["entities_id"],
'entity_sons' => $_POST["entity_sons"],
'emptylabel' => __('None')]);
break;
}
}
8 changes: 4 additions & 4 deletions ajax/locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
$_POST["templates_id"],
$_POST["entity"]);
Location::dropdown(['value' => ($location == '' ? 0 : $location),
'comments' => 1,
'entity' => $_POST["entity"],
'toadd' => [-1 => __('Keep previous location', 'uninstall'),
0 => __('Empty location', 'uninstall')]]);
'comments' => 1,
'entity' => $_POST["entity"],
'toadd' => [-1 => __('Keep previous location', 'uninstall'),
0 => __('Empty location', 'uninstall')]]);
}
10 changes: 5 additions & 5 deletions inc/model.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function showForm($ID, $options = []) {
$value = $this->fields["transfers_id"];
}
Transfer::dropdown(['value' => $value,
'display_emptychoice' => false]);
'display_emptychoice' => false]);
} else {
echo "<td></td>";
echo "<td></td>";
Expand All @@ -241,7 +241,7 @@ function showForm($ID, $options = []) {
echo "<tr class='tab_bg_1'><td>" . __('New status of the computer', 'uninstall') ."</td>";
echo "<td>";
State::dropdown(['value' => $this->fields['states_id'],
'emptylabel' => __('None')]);
'emptylabel' => __('None')]);
echo "</td></tr>";

echo "<tr class='tab_bg_1'>";
Expand All @@ -266,9 +266,9 @@ function showForm($ID, $options = []) {
echo "<span id='show_groups' name='show_groups'>";
if ($this->fields['groups_id'] != -1) {
Group::dropdown(['value' => $this->fields["groups_id"],
'entity' => $this->fields["entities_id"],
'entity_sons' => $entities,
'emptylabel' => __('None')]);
'entity' => $this->fields["entities_id"],
'entity_sons' => $entities,
'emptylabel' => __('None')]);
} else {
echo Dropdown::EMPTY_VALUE;
}
Expand Down
11 changes: 5 additions & 6 deletions inc/preference.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ function showFormUserPreferences() {
$value = (isset($this->fields["locations_id"]) ? $this->fields["locations_id"] : 0);

Location::dropdown(['name' => "id[$pref_ID][locations_id]",
'value' => ($value == '' ? 0 : $value),
'comments' => 1,
'entity' => $entity,
'toadd' => [-1 => __('Keep previous location',
'uninstall'),
0 => __('Empty location', 'uninstall')]]);
'value' => ($value == '' ? 0 : $value),
'comments' => 1,
'entity' => $entity,
'toadd' => [-1 => __('Keep previous location', 'uninstall'),
0 => __('Empty location', 'uninstall')]]);

echo "<input type='hidden' name='id[".$pref_ID."][id]' value='" . $pref_ID . "'>";
echo "</td></tr>";
Expand Down
16 changes: 8 additions & 8 deletions inc/profile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class PluginUninstallProfile extends Profile {
function getGeneralRights() {
$rights = [
[
'itemtype' => 'PluginUninstallProfile',
'label' => PluginUninstallUninstall::getTypeName(),
'field' => "uninstall:profile",
'rights' => [READ => __('Read'),
UPDATE => __('Write'),
self::RIGHT_REPLACE => PluginUninstallReplace::getTypeName()]
'itemtype' => 'PluginUninstallProfile',
'label' => PluginUninstallUninstall::getTypeName(),
'field' => "uninstall:profile",
'rights' => [READ => __('Read'),
UPDATE => __('Write'),
self::RIGHT_REPLACE => PluginUninstallReplace::getTypeName()]
],
];
return $rights;
Expand All @@ -72,7 +72,7 @@ function showForm($ID, $options = []) {

$rights = $this->getGeneralRights();
$profile->displayRightsChoiceMatrix($rights, ['canedit' => $canedit,
'default_class' => 'tab_bg_2']);
'default_class' => 'tab_bg_2']);
if ($canedit) {
$options['candel'] = false;
$this->showFormButtons($options);
Expand All @@ -82,7 +82,7 @@ function showForm($ID, $options = []) {
static function createFirstAccess($ID) {
self::addDefaultProfileInfos($ID,
['uninstall:profile' => UPDATE | READ | self::RIGHT_REPLACE,
'plugin_uninstall_replace' => 1], true);
'plugin_uninstall_replace' => 1], true);
}

/**
Expand Down
66 changes: 33 additions & 33 deletions inc/replace.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static function replace($type, $model_id, $tab_ids, $location) {
//States
if ($model->fields['states_id'] != 0) {
$olditem->update(['id' => $olditem_id,
'states_id' => $model->fields['states_id']],
'states_id' => $model->fields['states_id']],
false);
}

Expand Down Expand Up @@ -133,15 +133,15 @@ static function replace($type, $model_id, $tab_ids, $location) {
// Create & Attach new document to current item
$doc = new Document();
$input = ['name' => addslashes(__('Archive of old material', 'uninstall')),
'upload_file' => $name_out,
'comment' => addslashes($comment),
'add' => __('Add'),
'entities_id' => $newitem->getEntityID(),
'is_recursive' => $newitem->isRecursive(),
'link' => "",
'documentcategories_id' => 0,
'items_id' => $olditem_id,
'itemtype' => $type];
'upload_file' => $name_out,
'comment' => addslashes($comment),
'add' => __('Add'),
'entities_id' => $newitem->getEntityID(),
'is_recursive' => $newitem->isRecursive(),
'link' => "",
'documentcategories_id' => 0,
'items_id' => $olditem_id,
'itemtype' => $type];

//Attached the document to the old item, to generate an accurate name
$document_added = $doc->add($input);
Expand All @@ -150,9 +150,9 @@ static function replace($type, $model_id, $tab_ids, $location) {

$docItem = new Document_Item();
$docItemId = $docItem->add([
'documents_id' => $document_added,
'itemtype' => $type,
'items_id' => (int) $newitem_id,
'documents_id' => $document_added,
'itemtype' => $type,
'items_id' => (int) $newitem_id,
]);
}

Expand All @@ -161,7 +161,7 @@ static function replace($type, $model_id, $tab_ids, $location) {

if ($overwrite || empty($newitem->fields['name'])) {
$newitem->update(['id' => $newitem_id,
'name' => $olditem->getField('name')],
'name' => $olditem->getField('name')],
false);
}
}
Expand All @@ -172,7 +172,7 @@ static function replace($type, $model_id, $tab_ids, $location) {

if ($overwrite || empty($newitem->fields['serial'])) {
$newitem->update(['id' => $newitem_id,
'serial' => $olditem->getField('serial')],
'serial' => $olditem->getField('serial')],
false);
}
}
Expand All @@ -182,7 +182,7 @@ static function replace($type, $model_id, $tab_ids, $location) {

if ($overwrite || empty($newitem->fields['otherserial'])) {
$newitem->update(['id' => $newitem_id,
'otherserial' => $olditem->getField('otherserial')],
'otherserial' => $olditem->getField('otherserial')],
false);
}
}
Expand All @@ -194,8 +194,8 @@ static function replace($type, $model_id, $tab_ids, $location) {
$doc_item = new Document_Item();
foreach (self::getAssociatedDocuments($olditem) as $document) {
$doc_item->update(['id' => $document['assocID'],
'itemtype' => $type,
'items_id' => $newitem_id],
'itemtype' => $type,
'items_id' => $newitem_id],
false);
}

Expand All @@ -208,8 +208,8 @@ static function replace($type, $model_id, $tab_ids, $location) {
$contract_item = new Contract_Item();
foreach (self::getAssociatedContracts($olditem) as $contract) {
$contract_item->update(['id' => $contract['id'],
'itemtype' => $type,
'items_id' => $newitem_id],
'itemtype' => $type,
'items_id' => $newitem_id],
false);
}

Expand All @@ -232,8 +232,8 @@ static function replace($type, $model_id, $tab_ids, $location) {
// Update current Infocoms of old item
if ($infocom->getFromDBforDevice($type, $olditem_id)) {
$infocom->update(['id' => $infocom->getID(),
'itemtype' => $type,
'items_id' => $newitem_id],
'itemtype' => $type,
'items_id' => $newitem_id],
false);
}

Expand Down Expand Up @@ -269,8 +269,8 @@ static function replace($type, $model_id, $tab_ids, $location) {

if (count($resa_old->fields)) {
$resa_old->update(['id' => $resa_old->getID(),
'itemtype' => $type,
'items_id' => $newitem_id],
'itemtype' => $type,
'items_id' => $newitem_id],
false);
}
}
Expand Down Expand Up @@ -309,7 +309,7 @@ static function replace($type, $model_id, $tab_ids, $location) {
if ($newitem->isField('groups_id')
&& ($overwrite || empty($data['groups_id']))) {
$newitem->update(['id' => $newitem_id,
'groups_id' => $olditem->getField('groups_id')],
'groups_id' => $olditem->getField('groups_id')],
false);
}
}
Expand All @@ -321,7 +321,7 @@ static function replace($type, $model_id, $tab_ids, $location) {
$ticket_item = new Item_Ticket();
foreach (self::getAssociatedTickets($type, $olditem_id) as $ticket) {
$ticket_item->update(['id' => $ticket['id'],
'items_id' => $newitem_id],
'items_id' => $newitem_id],
false);
}

Expand All @@ -340,8 +340,8 @@ static function replace($type, $model_id, $tab_ids, $location) {
$netport_item = new NetworkPort();
foreach (self::getAssociatedNetports($type, $olditem_id) as $netport) {
$netport_item->update(['id' => $netport['id'],
'itemtype' => $type,
'items_id' => $newitem_id],
'itemtype' => $type,
'items_id' => $newitem_id],
false);
}

Expand All @@ -356,8 +356,8 @@ static function replace($type, $model_id, $tab_ids, $location) {

foreach ($connections as $connection) {
$comp_item->update(['id' => $connection['id'],
'computers_id' => $newitem_id,
'itemtype' => $itemtype],
'computers_id' => $newitem_id,
'itemtype' => $itemtype],
false);
}
}
Expand All @@ -372,7 +372,7 @@ static function replace($type, $model_id, $tab_ids, $location) {

default:
$olditem->update(['id' => $olditem_id,
'locations_id' => $location],
'locations_id' => $location],
false);
break;
}
Expand Down Expand Up @@ -691,8 +691,8 @@ static function showForm($type, $model_id, $tab_ids, $location) {

echo "<td>";
$type::dropdown(['name' => "newItems[$id]",
'displaywith' => ['serial', 'otherserial'],
'url' => $CFG_GLPI['root_doc']."/plugins/uninstall/ajax/dropdownReplaceFindDevice.php"]);
'displaywith' => ['serial', 'otherserial'],
'url' => $CFG_GLPI['root_doc']."/plugins/uninstall/ajax/dropdownReplaceFindDevice.php"]);
echo "</td></tr>";
}

Expand Down
6 changes: 3 additions & 3 deletions inc/uninstall.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static function uninstall($type, $model_id, $tab_ids, $location) {
if (in_array($type, $UNINSTALL_DIRECT_CONNECTIONS_TYPE)) {
$conn = new Computer_Item();
$conn->deleteByCriteria(['itemtype' => $type,
'items_id' => $id], true);
'items_id' => $id], true);
}

//--------------------//
Expand Down Expand Up @@ -636,8 +636,8 @@ static function showFormUninstallation($ID, $item, $user_id) {
echo "</td></tr>";

$params = ['templates_id' => '__VALUE__',
'entity' => $item->fields["entities_id"],
'users_id' => $_SESSION["glpiID"]];
'entity' => $item->fields["entities_id"],
'users_id' => $_SESSION["glpiID"]];

Ajax::updateItemOnSelectEvent("dropdown_model_id$rand", "show_objects",
$CFG_GLPI["root_doc"] . "/plugins/uninstall/ajax/locations.php",
Expand Down

0 comments on commit 911af54

Please sign in to comment.