File tree Expand file tree Collapse file tree 6 files changed +23
-6
lines changed
Expand file tree Collapse file tree 6 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,8 @@ function plugin_manageentities_install()
323323 }
324324 }
325325
326+ $ DB ->runFile (PLUGIN_MANAGEENTITIES_DIR . "/install/sql/update-4.1.4.sql " );
327+
326328 $ rep_files_manageentities = GLPI_PLUGIN_DOC_DIR . "/manageentities " ;
327329 if (!is_dir ($ rep_files_manageentities )) {
328330 mkdir ($ rep_files_manageentities );
Original file line number Diff line number Diff line change 1+ UPDATE ` glpi_displaypreferences` SET ` itemtype` = ' GlpiPlugin\\ Manageentities\\ Directhelpdesk' WHERE ` glpi_displaypreferences` .` itemtype` = ' PluginManageentitiesDirecthelpdesk' ;
2+ UPDATE ` glpi_displaypreferences` SET ` itemtype` = ' GlpiPlugin\\ Manageentities\\ Contractday' WHERE ` glpi_displaypreferences` .` itemtype` = ' PluginManageentitiesContractday' ;
3+ UPDATE ` glpi_displaypreferences` SET ` itemtype` = ' GlpiPlugin\\ Manageentities\\ CriType' WHERE ` glpi_displaypreferences` .` itemtype` = ' PluginManageentitiesCriType' ;
Original file line number Diff line number Diff line change 1+ UPDATE ` glpi_documents_items` SET ` itemtype` = ' GlpiPlugin\\ Manageentities\\ Company' WHERE ` itemtype` = ' PluginManageentitiesCompany' ;
Original file line number Diff line number Diff line change 2121 <author >Infotel</author >
2222 </authors >
2323 <versions >
24+ <version >
25+ <num >4.1.4</num >
26+ <compatibility >~11.0</compatibility >
27+ <download_url >https://github.com/InfotelGLPI/manageentities/releases/download/4.1.4/glpi-manageentities-4.1.4.tar.bz2</download_url >
28+ </version >
2429 <version >
2530 <num >4.1.3</num >
2631 <compatibility >~11.0</compatibility >
Original file line number Diff line number Diff line change 2727 --------------------------------------------------------------------------
2828 */
2929
30- define ('PLUGIN_MANAGEENTITIES_VERSION ' , '4.1.3 ' );
30+ define ('PLUGIN_MANAGEENTITIES_VERSION ' , '4.1.4 ' );
3131
3232global $ CFG_GLPI ;
3333
@@ -173,9 +173,12 @@ function plugin_init_manageentities()
173173// $PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['manageentities'][] = 'scripts/manageentities_load_scripts.js';
174174// }
175175 $ PLUGIN_HOOKS ['post_init ' ]['manageentities ' ] = 'plugin_manageentities_postinit ' ;
176-
177- $ PLUGIN_HOOKS [Hooks::PRE_ITEM_FORM ]['manageentities ' ] = [Contract::class, 'preItemForm ' ];
178- $ PLUGIN_HOOKS [Hooks::PRE_ITEM_LIST ]['manageentities ' ] = [Contract::class, 'preItemForm ' ];
176+ if (Session::haveRightsOr ('plugin_manageentities ' , [READ , UPDATE ])
177+ && isset ($ _SESSION ['glpiactiveprofile ' ]['interface ' ])
178+ && $ _SESSION ['glpiactiveprofile ' ]['interface ' ] == 'central ' ) {
179+ $ PLUGIN_HOOKS [Hooks::PRE_ITEM_FORM ]['manageentities ' ] = [Contract::class, 'preItemForm ' ];
180+ $ PLUGIN_HOOKS [Hooks::PRE_ITEM_LIST ]['manageentities ' ] = [Contract::class, 'preItemForm ' ];
181+ }
179182 }
180183}
181184
Original file line number Diff line number Diff line change @@ -497,7 +497,8 @@ function displayAlertforEntity($instID)
497497 ],
498498 'WHERE ' => [
499499 'glpi_contracts.is_deleted ' => 0 ,
500- $ this ->getTable () . '.entities_id ' => $ instID
500+ 'NOT ' => [$ this ->getTable () . '.date_signature ' => null ],
501+ 'glpi_contracts.entities_id ' => $ instID
501502 ],
502503 'ORDERBY ' => [
503504 'glpi_contracts.begin_date ' ,
@@ -766,7 +767,9 @@ static public function preItemForm($params)
766767 $ entities_id = $ item ->fields ['entities_id ' ];
767768 }
768769 $ out = "" ;
769- if (isset ($ entities_id )) {
770+ if (isset ($ entities_id )
771+ && $ _SESSION ['glpiactiveprofile ' ]['interface ' ] == 'central '
772+ && Session::haveRight ('plugin_manageentities ' , UPDATE )) {
770773// $sons = getSonsOf("glpi_entities", $entities_id);
771774// if (count($sons) > 1) {
772775// return false;
You can’t perform that action at this time.
0 commit comments