Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GLPI
glpi
Commits
cd75be74
Commit
cd75be74
authored
Jun 28, 2017
by
Johan Cwiklinski
Committed by
Johan Cwiklinski
Jun 28, 2017
Browse files
Short array syntax (from phpcbf)
parent
bcc6bdd6
Changes
540
Hide whitespace changes
Inline
Side-by-side
ajax/autocompletion.php
View file @
cd75be74
...
...
@@ -58,9 +58,9 @@ if (!isset($item->fields[$_GET['field']]) || !$item->canView()) {
// Security : blacklist fields
if
(
in_array
(
$table
.
'.'
.
$_GET
[
'field'
],
array
(
'glpi_authldaps.rootdn'
,
'glpi_authldaps.rootdn_passwd'
,
[
'glpi_authldaps.rootdn'
,
'glpi_authldaps.rootdn_passwd'
,
'glpi_configs.value'
,
'glpi_mailcollectors.login'
,
'glpi_mailcollectors.passwd'
,
'glpi_users.name'
,
'glpi_users.password'
)
))
{
'glpi_mailcollectors.passwd'
,
'glpi_users.name'
,
'glpi_users.password'
]
))
{
exit
();
}
...
...
@@ -91,7 +91,7 @@ $query = "SELECT DISTINCT `".$_GET['field']."` AS VAL
$entity
ORDER BY `"
.
$_GET
[
'field'
]
.
"`"
;
$values
=
array
()
;
$values
=
[]
;
if
(
$result
=
$DB
->
query
(
$query
))
{
...
...
ajax/common.tabs.php
View file @
cd75be74
...
...
@@ -83,7 +83,7 @@ if ($item = getItemForItemtype($_GET['_itemtype'])) {
}
}
$notvalidoptions
=
array
(
'_glpi_tab'
,
'_itemtype'
,
'sort'
,
'order'
,
'withtemplate'
)
;
$notvalidoptions
=
[
'_glpi_tab'
,
'_itemtype'
,
'sort'
,
'order'
,
'withtemplate'
]
;
$options
=
$_GET
;
foreach
(
$notvalidoptions
as
$key
)
{
if
(
isset
(
$options
[
$key
]))
{
...
...
ajax/dropdownAllItems.php
View file @
cd75be74
...
...
@@ -56,11 +56,11 @@ if ($_POST["idtable"] && class_exists($_POST["idtable"])) {
$field_id
=
Html
::
cleanId
(
"dropdown_"
.
$_POST
[
"name"
]
.
$rand
);
$p
=
array
(
'value'
=>
0
,
$p
=
[
'value'
=>
0
,
'valuename'
=>
Dropdown
::
EMPTY_VALUE
,
'itemtype'
=>
$_POST
[
"idtable"
],
'display_emptychoice'
=>
true
,
'displaywith'
=>
array
(
'otherserial'
,
'serial'
))
;
'displaywith'
=>
[
'otherserial'
,
'serial'
]]
;
if
(
isset
(
$_POST
[
'value'
]))
{
$p
[
'value'
]
=
$_POST
[
'value'
];
}
...
...
@@ -79,8 +79,8 @@ if ($_POST["idtable"] && class_exists($_POST["idtable"])) {
$p
);
if
(
!
empty
(
$_POST
[
'showItemSpecificity'
]))
{
$params
=
array
(
'items_id'
=>
'__VALUE__'
,
'itemtype'
=>
$_POST
[
"idtable"
]
)
;
$params
=
[
'items_id'
=>
'__VALUE__'
,
'itemtype'
=>
$_POST
[
"idtable"
]
]
;
if
(
isset
(
$_POST
[
'entity_restrict'
]))
{
$params
[
'entity_restrict'
]
=
$_POST
[
'entity_restrict'
];
}
...
...
ajax/dropdownConnect.php
View file @
cd75be74
...
...
@@ -48,7 +48,7 @@ if (!isset($_POST['fromtype']) || !($fromitem = getItemForItemtype($_POST['fromt
$fromitem
->
checkGlobal
(
UPDATE
);
$used
=
array
()
;
$used
=
[]
;
if
(
isset
(
$_POST
[
"used"
]))
{
$used
=
$_POST
[
"used"
];
}
...
...
ajax/dropdownConnectNetworkPort.php
View file @
cd75be74
...
...
@@ -112,5 +112,5 @@ if (class_exists($_POST["itemtype"])
$values
[
$ID
]
=
$output_long
;
}
}
Dropdown
::
showFromArray
(
$_POST
[
'myname'
],
$values
,
array
(
'display_emptychoice'
=>
true
)
);
Dropdown
::
showFromArray
(
$_POST
[
'myname'
],
$values
,
[
'display_emptychoice'
=>
true
]
);
}
ajax/dropdownConnectNetworkPortDeviceType.php
View file @
cd75be74
...
...
@@ -47,14 +47,14 @@ if (class_exists($_POST["itemtype"])) {
$table
=
getTableForItemType
(
$_POST
[
"itemtype"
]);
$rand
=
mt_rand
();
$toupdate
=
array
(
'value_fieldname'
=>
'item'
,
$toupdate
=
[
'value_fieldname'
=>
'item'
,
'to_update'
=>
"results_item_
$rand
"
,
'url'
=>
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/dropdownConnectNetworkPort.php"
,
'moreparams'
=>
array
(
'networkports_id'
=>
$_POST
[
'networkports_id'
],
'moreparams'
=>
[
'networkports_id'
=>
$_POST
[
'networkports_id'
],
'itemtype'
=>
$_POST
[
'itemtype'
],
'myname'
=>
$_POST
[
'myname'
],
'instantiation_type'
=>
$_POST
[
'instantiation_type'
]
))
;
$params
=
array
(
'rand'
=>
$rand
,
'instantiation_type'
=>
$_POST
[
'instantiation_type'
]
]]
;
$params
=
[
'rand'
=>
$rand
,
'name'
=>
"items"
,
'entity'
=>
$_POST
[
"entity_restrict"
],
// Beware: '\n' inside condition is transformed to 'n' in SQL request
...
...
@@ -64,7 +64,7 @@ if (class_exists($_POST["itemtype"])) {
"WHERE `itemtype` = '"
.
$_POST
[
"itemtype"
]
.
"'"
.
"AND `instantiation_type`"
.
"= '"
.
$_POST
[
'instantiation_type'
]
.
"'))"
,
'toupdate'
=>
$toupdate
)
;
'toupdate'
=>
$toupdate
]
;
Dropdown
::
show
(
$_POST
[
'itemtype'
],
$params
);
...
...
ajax/dropdownInstallVersion.php
View file @
cd75be74
...
...
@@ -68,7 +68,7 @@ if ($_POST['softwares_id'] > 0) {
$result
=
$DB
->
query
(
$query
);
$number
=
$DB
->
numrows
(
$result
);
$values
=
array
()
;
$values
=
[]
;
if
(
$number
)
{
while
(
$data
=
$DB
->
fetch_assoc
(
$result
))
{
$ID
=
$data
[
'id'
];
...
...
@@ -85,5 +85,5 @@ if ($_POST['softwares_id'] > 0) {
}
}
Dropdown
::
showFromArray
(
$_POST
[
'myname'
],
$values
,
array
(
'display_emptychoice'
=>
true
)
);
Dropdown
::
showFromArray
(
$_POST
[
'myname'
],
$values
,
[
'display_emptychoice'
=>
true
]
);
}
ajax/dropdownItilActors.php
View file @
cd75be74
...
...
@@ -58,38 +58,38 @@ if (isset($_POST["type"])
}
}
$options
=
array
(
'name'
=>
'_itil_'
.
$_POST
[
"actortype"
]
.
'[users_id]'
,
$options
=
[
'name'
=>
'_itil_'
.
$_POST
[
"actortype"
]
.
'[users_id]'
,
'entity'
=>
$_POST
[
'entity_restrict'
],
'right'
=>
$right
,
'rand'
=>
$rand
,
'ldap_import'
=>
true
)
;
'ldap_import'
=>
true
]
;
if
(
$CFG_GLPI
[
"notifications_mailing"
])
{
$withemail
=
(
isset
(
$_POST
[
"allow_email"
])
?
$_POST
[
"allow_email"
]
:
false
);
$paramscomment
=
array
(
'value'
=>
'__VALUE__'
,
$paramscomment
=
[
'value'
=>
'__VALUE__'
,
'allow_email'
=>
$withemail
,
'field'
=>
"_itil_"
.
$_POST
[
"actortype"
],
'use_notification'
=>
$_POST
[
"use_notif"
]
)
;
'use_notification'
=>
$_POST
[
"use_notif"
]
]
;
// Fix rand value
$options
[
'rand'
]
=
$rand
;
$options
[
'toupdate'
]
=
array
(
'value_fieldname'
=>
'value'
,
$options
[
'toupdate'
]
=
[
'value_fieldname'
=>
'value'
,
'to_update'
=>
"notif_user_
$rand
"
,
'url'
=>
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/uemailUpdate.php"
,
'moreparams'
=>
$paramscomment
)
;
'moreparams'
=>
$paramscomment
]
;
}
if
((
$_POST
[
"itemtype"
]
==
'Ticket'
)
&&
(
$_POST
[
"actortype"
]
==
'assign'
))
{
$toupdate
=
array
()
;
$toupdate
=
[]
;
if
(
isset
(
$options
[
'toupdate'
])
&&
is_array
(
$options
[
'toupdate'
]))
{
$toupdate
[]
=
$options
[
'toupdate'
];
}
$toupdate
[]
=
array
(
'value_fieldname'
=>
'value'
,
$toupdate
[]
=
[
'value_fieldname'
=>
'value'
,
'to_update'
=>
"countassign_
$rand
"
,
'url'
=>
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/ticketassigninformation.php"
,
'moreparams'
=>
array
(
'users_id_assign'
=>
'__VALUE__'
))
;
'moreparams'
=>
[
'users_id_assign'
=>
'__VALUE__'
]]
;
$options
[
'toupdate'
]
=
$toupdate
;
}
...
...
@@ -124,18 +124,18 @@ if (isset($_POST["type"])
$cond
=
'`is_assign`'
;
}
$param
=
array
(
'name'
=>
'_itil_'
.
$_POST
[
"actortype"
]
.
'[groups_id]'
,
$param
=
[
'name'
=>
'_itil_'
.
$_POST
[
"actortype"
]
.
'[groups_id]'
,
'entity'
=>
$_POST
[
'entity_restrict'
],
'condition'
=>
$cond
,
'rand'
=>
$rand
)
;
'rand'
=>
$rand
]
;
if
((
$_POST
[
"itemtype"
]
==
'Ticket'
)
&&
(
$_POST
[
"actortype"
]
==
'assign'
))
{
$param
[
'toupdate'
]
=
array
(
'value_fieldname'
=>
'value'
,
$param
[
'toupdate'
]
=
[
'value_fieldname'
=>
'value'
,
'to_update'
=>
"countgroupassign_
$rand
"
,
'url'
=>
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/ticketassigninformation.php"
,
'moreparams'
=>
array
(
'groups_id_assign'
=>
'__VALUE__'
))
;
'moreparams'
=>
[
'groups_id_assign'
=>
'__VALUE__'
]]
;
}
$rand
=
Group
::
dropdown
(
$param
);
...
...
@@ -149,34 +149,34 @@ if (isset($_POST["type"])
break
;
case
"supplier"
:
$options
=
array
(
'name'
=>
'_itil_'
.
$_POST
[
"actortype"
]
.
'[suppliers_id]'
,
$options
=
[
'name'
=>
'_itil_'
.
$_POST
[
"actortype"
]
.
'[suppliers_id]'
,
'entity'
=>
$_POST
[
'entity_restrict'
],
'rand'
=>
$rand
)
;
'rand'
=>
$rand
]
;
if
(
$CFG_GLPI
[
"notifications_mailing"
])
{
$withemail
=
(
isset
(
$_POST
[
"allow_email"
])
?
$_POST
[
"allow_email"
]
:
false
);
$paramscomment
=
array
(
'value'
=>
'__VALUE__'
,
$paramscomment
=
[
'value'
=>
'__VALUE__'
,
'allow_email'
=>
$withemail
,
'field'
=>
'_itil_'
.
$_POST
[
"actortype"
],
'typefield'
=>
"supplier"
,
'use_notification'
=>
$_POST
[
"use_notif"
]
)
;
'use_notification'
=>
$_POST
[
"use_notif"
]
]
;
// Fix rand value
$options
[
'rand'
]
=
$rand
;
$options
[
'toupdate'
]
=
array
(
'value_fieldname'
=>
'value'
,
$options
[
'toupdate'
]
=
[
'value_fieldname'
=>
'value'
,
'to_update'
=>
"notif_supplier_
$rand
"
,
'url'
=>
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/uemailUpdate.php"
,
'moreparams'
=>
$paramscomment
)
;
'moreparams'
=>
$paramscomment
]
;
}
if
(
$_POST
[
"itemtype"
]
==
'Ticket'
)
{
$toupdate
=
array
()
;
$toupdate
=
[]
;
if
(
isset
(
$options
[
'toupdate'
])
&&
is_array
(
$options
[
'toupdate'
]))
{
$toupdate
[]
=
$options
[
'toupdate'
];
}
$toupdate
[]
=
array
(
'value_fieldname'
=>
'value'
,
$toupdate
[]
=
[
'value_fieldname'
=>
'value'
,
'to_update'
=>
"countassign_
$rand
"
,
'url'
=>
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/ticketassigninformation.php"
,
'moreparams'
=>
array
(
'suppliers_id_assign'
=>
'__VALUE__'
))
;
'moreparams'
=>
[
'suppliers_id_assign'
=>
'__VALUE__'
]]
;
$options
[
'toupdate'
]
=
$toupdate
;
}
...
...
ajax/dropdownMassiveActionAddActor.php
View file @
cd75be74
...
...
@@ -45,7 +45,7 @@ Session::checkRight('ticket', UPDATE);
if
(
$_POST
[
"actortype"
]
>
0
)
{
$ticket
=
new
Ticket
();
$rand
=
mt_rand
();
$ticket
->
showActorAddForm
(
$_POST
[
"actortype"
],
$rand
,
$_SESSION
[
'glpiactive_entity'
],
array
()
,
$ticket
->
showActorAddForm
(
$_POST
[
"actortype"
],
$rand
,
$_SESSION
[
'glpiactive_entity'
],
[]
,
true
,
false
,
false
);
echo
" <input type='submit' name='add_actor' class='submit' value=
\"
"
.
_sx
(
'button'
,
'Add'
)
.
"
\"
>"
;
}
ajax/dropdownMassiveActionAddValidator.php
View file @
cd75be74
...
...
@@ -45,9 +45,9 @@ if (isset($_POST["validatortype"])) {
switch
(
$_POST
[
"validatortype"
])
{
case
'user'
:
echo
"<input type='hidden' name='groups_id' value=0 />"
;
User
::
dropdown
(
array
(
'name'
=>
'users_id_validate'
,
User
::
dropdown
(
[
'name'
=>
'users_id_validate'
,
'entity'
=>
$_SESSION
[
"glpiactive_entity"
],
'right'
=>
array
(
'validate_request'
,
'validate_incident'
))
);
'right'
=>
[
'validate_request'
,
'validate_incident'
]]
);
echo
"<br><br>"
.
__
(
'Comments'
)
.
" "
;
echo
"<textarea name='comment_submission' cols='50' rows='6'></textarea> "
;
...
...
@@ -57,12 +57,12 @@ if (isset($_POST["validatortype"])) {
case
'group'
:
echo
"<input type='hidden' name='users_id_validate' value=0 />"
;
$rand
=
Group
::
dropdown
(
array
(
'name'
=>
'groups_id'
,
'entity'
=>
$_SESSION
[
"glpiactive_entity"
]
)
);
$rand
=
Group
::
dropdown
(
[
'name'
=>
'groups_id'
,
'entity'
=>
$_SESSION
[
"glpiactive_entity"
]
]
);
$param
=
array
(
'validatortype'
=>
'group_user'
,
$param
=
[
'validatortype'
=>
'group_user'
,
'groups_id'
=>
'__VALUE__'
,
'right'
=>
array
(
'validate_request'
,
'validate_incident'
))
;
'right'
=>
[
'validate_request'
,
'validate_incident'
]]
;
Ajax
::
updateItemOnSelectEvent
(
"dropdown_groups_id
$rand
"
,
"show_groups_users"
,
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/dropdownMassiveActionAddValidator.php"
,
...
...
@@ -73,14 +73,14 @@ if (isset($_POST["validatortype"])) {
case
'group_user'
:
$opt
=
array
(
'groups_id'
=>
$_POST
[
"groups_id"
],
$opt
=
[
'groups_id'
=>
$_POST
[
"groups_id"
],
'right'
=>
$_POST
[
'right'
],
'entity'
=>
$_SESSION
[
"glpiactive_entity"
]
)
;
'entity'
=>
$_SESSION
[
"glpiactive_entity"
]
]
;
$groups_users
=
TicketValidation
::
getGroupUserHaveRights
(
$opt
);
$users
=
array
()
;
$param
[
'values'
]
=
array
()
;
$users
=
[]
;
$param
[
'values'
]
=
[]
;
foreach
(
$groups_users
as
$data
)
{
$users
[
$data
[
'id'
]]
=
formatUserName
(
$data
[
'id'
],
$data
[
'name'
],
$data
[
'realname'
],
$data
[
'firstname'
]);
...
...
@@ -104,17 +104,17 @@ if (isset($_POST["validatortype"])) {
$param_button
[
'users_id_validate'
]
=
''
;
$param_button
[
'all_users'
]
=
1
;
$param_button
[
'groups_id'
]
=
$_POST
[
'groups_id'
];
$param_button
[
'right'
]
=
array
(
'validate_request'
,
'validate_incident'
)
;
$param_button
[
'right'
]
=
[
'validate_request'
,
'validate_incident'
]
;
$param_button
[
'entity'
]
=
$_SESSION
[
"glpiactive_entity"
];
Ajax
::
updateItemOnEvent
(
'all_users'
,
'show_groups_users'
,
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/dropdownMassiveActionAddValidator.php"
,
$param_button
,
array
(
'click'
)
);
$param_button
,
[
'click'
]
);
echo
" <a id='no_users' class='vsubmit'>"
.
__
(
'None'
)
.
"</a>"
;
$param_button
[
'all_users'
]
=
0
;
Ajax
::
updateItemOnEvent
(
'no_users'
,
'show_groups_users'
,
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/dropdownMassiveActionAddValidator.php"
,
$param_button
,
array
(
'click'
)
);
$param_button
,
[
'click'
]
);
}
echo
"<br><br>"
.
__
(
'Comments'
)
.
" "
;
...
...
ajax/dropdownMassiveActionAuthMethods.php
View file @
cd75be74
...
...
@@ -56,13 +56,13 @@ if ($_POST["authtype"] > 0) {
case
Auth
::
LDAP
:
case
Auth
::
EXTERNAL
:
AuthLDAP
::
dropdown
(
array
(
'name'
=>
"auths_id"
,
'condition'
=>
"`is_active` = 1"
)
);
AuthLDAP
::
dropdown
(
[
'name'
=>
"auths_id"
,
'condition'
=>
"`is_active` = 1"
]
);
break
;
case
Auth
::
MAIL
:
AuthMail
::
dropdown
(
array
(
'name'
=>
"auths_id"
,
'condition'
=>
"`is_active` = 1"
)
);
AuthMail
::
dropdown
(
[
'name'
=>
"auths_id"
,
'condition'
=>
"`is_active` = 1"
]
);
break
;
}
...
...
ajax/dropdownMassiveActionField.php
View file @
cd75be74
...
...
@@ -44,8 +44,8 @@ if (!isset($_POST["itemtype"]) || !($item = getItemForItemtype($_POST['itemtype'
}
if
(
InfoCom
::
canApplyOn
(
$_POST
[
"itemtype"
]))
{
Session
::
checkSeveralRightsOr
(
array
(
$_POST
[
"itemtype"
]
=>
UPDATE
,
"infocom"
=>
UPDATE
)
);
Session
::
checkSeveralRightsOr
(
[
$_POST
[
"itemtype"
]
=>
UPDATE
,
"infocom"
=>
UPDATE
]
);
}
else
{
$item
->
checkGlobal
(
UPDATE
);
}
...
...
@@ -80,8 +80,8 @@ if (isset($_POST["itemtype"])
// Specific for plugin which add link to core object
||
(
$plug
=
isPluginItemType
(
getItemTypeForTable
(
$search
[
'table'
]))))
{
$plugdisplay
=
Plugin
::
doOneHook
(
$plug
[
'plugin'
],
'MassiveActionsFieldsDisplay'
,
array
(
'itemtype'
=>
$_POST
[
"itemtype"
],
'options'
=>
$search
)
);
[
'itemtype'
=>
$_POST
[
"itemtype"
],
'options'
=>
$search
]
);
}
$fieldname
=
''
;
...
...
@@ -93,8 +93,8 @@ if (isset($_POST["itemtype"])
$fieldname
=
$search
[
"linkfield"
];
}
if
(
!
$plugdisplay
)
{
$options
=
array
()
;
$values
=
array
()
;
$options
=
[]
;
$values
=
[]
;
// For ticket template or aditional options of massive actions
if
(
isset
(
$_POST
[
'options'
]))
{
$options
=
$_POST
[
'options'
];
...
...
ajax/dropdownRubDocument.php
View file @
cd75be74
...
...
@@ -45,7 +45,7 @@ Session::checkCentralAccess();
// Make a select box
if
(
isset
(
$_POST
[
"rubdoc"
]))
{
$used
=
array
()
;
$used
=
[]
;
// Clean used array
if
(
isset
(
$_POST
[
'used'
])
&&
is_array
(
$_POST
[
'used'
])
&&
(
count
(
$_POST
[
'used'
])
>
0
))
{
...
...
@@ -75,11 +75,11 @@ if (isset($_POST["rubdoc"])) {
}
Dropdown
::
show
(
'Document'
,
array
(
'name'
=>
$_POST
[
'myname'
],
[
'name'
=>
$_POST
[
'myname'
],
'used'
=>
$used
,
'width'
=>
'50%'
,
'entity'
=>
intval
(
$_POST
[
'entity'
]),
'rand'
=>
intval
(
$_POST
[
'rand'
]),
'condition'
=>
"glpi_documents.documentcategories_id='"
.
intval
(
$_POST
[
"rubdoc"
])
.
"'"
)
);
'condition'
=>
"glpi_documents.documentcategories_id='"
.
intval
(
$_POST
[
"rubdoc"
])
.
"'"
]
);
}
ajax/dropdownSoftwareLicense.php
View file @
cd75be74
...
...
@@ -72,5 +72,5 @@ if ($_POST['softwares_id'] > 0) {
$values
[
$ID
]
=
$output
;
}
}
Dropdown
::
showFromArray
(
$_POST
[
'myname'
],
$values
,
array
(
'display_emptychoice'
=>
true
)
);
Dropdown
::
showFromArray
(
$_POST
[
'myname'
],
$values
,
[
'display_emptychoice'
=>
true
]
);
}
ajax/dropdownTicketCategories.php
View file @
cd75be74
...
...
@@ -42,7 +42,7 @@ if (strpos($_SERVER['PHP_SELF'], "dropdownTicketCategories.php")) {
die
(
"Sorry. You can't access this file directly"
);
}
$opt
=
array
(
'entity'
=>
$_POST
[
"entity_restrict"
]
)
;
$opt
=
[
'entity'
=>
$_POST
[
"entity_restrict"
]
]
;
if
(
$_SESSION
[
"glpiactiveprofile"
][
"interface"
]
==
"helpdesk"
)
{
$opt
[
'condition'
]
=
"`is_helpdeskvisible`='1' AND "
;
...
...
ajax/dropdownTrackingDeviceType.php
View file @
cd75be74
...
...
@@ -56,12 +56,12 @@ if (isset($_POST["itemtype"])
}
echo
"<br>"
;
$field_id
=
Html
::
cleanId
(
"dropdown_"
.
$_POST
[
'myname'
]
.
$rand
);
$p
=
array
(
'itemtype'
=>
$_POST
[
"itemtype"
],
$p
=
[
'itemtype'
=>
$_POST
[
"itemtype"
],
'entity_restrict'
=>
$_POST
[
'entity_restrict'
],
'table'
=>
$table
,
'multiple'
=>
$_POST
[
"multiple"
],
'myname'
=>
$_POST
[
"myname"
],
'rand'
=>
$_POST
[
"rand"
]
)
;
'rand'
=>
$_POST
[
"rand"
]
]
;
if
(
isset
(
$_POST
[
"used"
])
&&
!
empty
(
$_POST
[
"used"
]))
{
if
(
isset
(
$_POST
[
"used"
][
$_POST
[
"itemtype"
]]))
{
...
...
@@ -74,8 +74,8 @@ if (isset($_POST["itemtype"])
$p
);
// Auto update summary of active or just solved tickets
$params
=
array
(
'items_id'
=>
'__VALUE__'
,
'itemtype'
=>
$_POST
[
'itemtype'
]
)
;
$params
=
[
'items_id'
=>
'__VALUE__'
,
'itemtype'
=>
$_POST
[
'itemtype'
]
]
;
Ajax
::
updateItemOnSelectEvent
(
$field_id
,
"item_ticket_selection_information"
,
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/ticketiteminformation.php"
,
$params
);
...
...
ajax/dropdownValidator.php
View file @
cd75be74
...
...
@@ -45,25 +45,25 @@ if (isset($_POST["validatortype"])) {
switch
(
$_POST
[
"validatortype"
])
{
case
'user'
:
if
(
isset
(
$_POST
[
'users_id_validate'
][
'groups_id'
]))
{
$_POST
[
'users_id_validate'
]
=
array
()
;
$_POST
[
'users_id_validate'
]
=
[]
;
}
$value
=
(
isset
(
$_POST
[
'users_id_validate'
][
0
])
?
$_POST
[
'users_id_validate'
][
0
]
:
0
);
User
::
dropdown
(
array
(
'name'
=>
!
empty
(
$_POST
[
'name'
])
?
$_POST
[
'name'
]
.
'[]'
User
::
dropdown
(
[
'name'
=>
!
empty
(
$_POST
[
'name'
])
?
$_POST
[
'name'
]
.
'[]'
:
'users_id_validate[]'
,
'entity'
=>
$_POST
[
'entity'
],
'value'
=>
$value
,
'right'
=>
$_POST
[
'right'
]
)
);
'right'
=>
$_POST
[
'right'
]
]
);
break
;
case
'group'
:
$name
=
!
empty
(
$_POST
[
'name'
])
?
$_POST
[
'name'
]
.
'[groups_id]'
:
'groups_id'
;
$value
=
(
isset
(
$_POST
[
'users_id_validate'
][
'groups_id'
])
?
$_POST
[
'users_id_validate'
][
'groups_id'
]
:
$_POST
[
'groups_id'
]);
$rand
=
Group
::
dropdown
(
array
(
'name'
=>
$name
,
$rand
=
Group
::
dropdown
(
[
'name'
=>
$name
,
'value'
=>
$value
,
'entity'
=>
$_POST
[
"entity"
]
)
);
'entity'
=>
$_POST
[
"entity"
]
]
);
$param
=
array
(
'validatortype'
=>
'list_users'
)
;
$param
=
[
'validatortype'
=>
'list_users'
]
;
$param
[
'name'
]
=
!
empty
(
$_POST
[
'name'
])
?
$_POST
[
'name'
]
:
''
;
$param
[
'users_id_validate'
]
=
isset
(
$_POST
[
'users_id_validate'
])
?
$_POST
[
'users_id_validate'
]
:
''
;
...
...
@@ -85,15 +85,15 @@ if (isset($_POST["validatortype"])) {
case
'list_users'
:
if
(
isset
(
$_POST
[
'users_id_validate'
][
'groups_id'
]))
{
$_POST
[
'users_id_validate'
]
=
array
()
;
$_POST
[
'users_id_validate'
]
=
[]
;
}
$opt
=
array
(
'groups_id'
=>
$_POST
[
"groups_id"
],
$opt
=
[
'groups_id'
=>
$_POST
[
"groups_id"
],
'right'
=>
$_POST
[
'right'
],
'entity'
=>
$_POST
[
"entity"
]
)
;
'entity'
=>
$_POST
[
"entity"
]
]
;
$data_users
=
TicketValidation
::
getGroupUserHaveRights
(
$opt
);
$users
=
array
()
;
$param
[
'values'
]
=
array
()
;
$values
=
array
()
;
$users
=
[]
;
$param
[
'values'
]
=
[]
;
$values
=
[]
;
if
(
isset
(
$_POST
[
'users_id_validate'
])
&&
is_array
(
$_POST
[
'users_id_validate'
]))
{
$values
=
$_POST
[
'users_id_validate'
];
}
...
...
@@ -130,13 +130,13 @@ if (isset($_POST["validatortype"])) {
$param_button
[
'right'
]
=
$_POST
[
'right'
];
Ajax
::
updateItemOnEvent
(
'all_users'
,
'show_list_users'
,
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/dropdownValidator.php"
,
$param_button
,
array
(
'click'
)
);
$param_button
,
[
'click'
]
);
echo
" <a id='no_users' class='vsubmit'>"
.
__
(
'None'
)
.
"</a>"
;
$param_button
[
'all_users'
]
=
0
;
Ajax
::
updateItemOnEvent
(
'no_users'
,
'show_list_users'
,
$CFG_GLPI
[
"root_doc"
]
.
"/ajax/dropdownValidator.php"
,
$param_button
,
array
(
'click'
)
);
$param_button
,
[
'click'
]
);
}
break
;
}
...
...
ajax/entitytreesearch.php
View file @
cd75be74
...
...
@@ -43,7 +43,7 @@ header("Content-Type: application/json; charset=UTF-8");
Html
::
header_nocache
();
Session
::
checkLoginUser
();
$res
=
array
()
;
$res
=
[]
;
if
(
isset
(
$_POST
[
'str'
]))
{
$query
=
"SELECT *
...
...
ajax/entitytreesons.php
View file @
cd75be74
...
...
@@ -51,7 +51,7 @@ if (isset($_GET['node'])) {
$target
=
"central.php"
;
}
$nodes
=
array
()
;
$nodes
=
[]
;
// Get ancestors of current entity
$ancestors
=
getAncestorsOf
(
'glpi_entities'
,
$_SESSION
[
'glpiactive_entity'
]);
...
...
ajax/genericdate.php
View file @
cd75be74
...
...
@@ -46,9 +46,9 @@ Session::checkLoginUser();
if
(
isset
(
$_POST
[
'value'
])
&&
(
strcmp
(
$_POST
[
'value'
],
'0'
)
==
0
))
{
if
(
$_POST
[
'withtime'
])
{
Html
::
showDateTimeField
(
$_POST
[
'name'
],
array
(
'value'
=>
$_POST
[
'specificvalue'
]
)
);
Html
::
showDateTimeField
(
$_POST
[
'name'
],
[
'value'
=>
$_POST
[
'specificvalue'
]
]
);
}
else
{
Html
::
showDateField
(
$_POST
[
'name'
],
array
(
'value'
=>
$_POST
[
'specificvalue'
]
)
);
Html
::
showDateField
(
$_POST
[
'name'
],
[
'value'
=>
$_POST
[
'specificvalue'
]
]
);
}
}
else
{
...
...
Prev
1
2
3
4
5
…
27
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment