@@ -69,6 +69,8 @@ class PluginFormcreatorEntityconfig extends CommonDBTM {
6969 const CONFIG_UI_FORM_MASONRY = 0 ;
7070 const CONFIG_UI_FORM_UNIFORM_HEIGHT = 1 ;
7171
72+ const CONFIG_SERVICE_CATALOG_HOME_SEARCH = 0 ;
73+ const CONFIG_SERVICE_CATALOG_HOME_ISSUE = 1 ;
7274
7375 /**
7476 * @var bool $dohistory maintain history
@@ -157,6 +159,12 @@ public static function getEnumUIForm() : array {
157159 self ::CONFIG_UI_FORM_UNIFORM_HEIGHT => __ ('Uniform height ' , 'formcreator ' ),
158160 ];
159161 }
162+ public static function getEnumServiceCatalogHome () : array {
163+ return [
164+ self ::CONFIG_SERVICE_CATALOG_HOME_SEARCH => __ ('Search for assistance ' , 'formcreator ' ),
165+ self ::CONFIG_SERVICE_CATALOG_HOME_ISSUE => __ ('User \'s assistance requests ' , 'formcreator ' ),
166+ ];
167+ }
160168
161169 public static function displayTabContentForItem (CommonGLPI $ item , $ tabnum = 1 , $ withtemplate = 0 ) {
162170 if ($ item ->getType () == 'Entity ' ) {
@@ -376,6 +384,22 @@ public function showFormForEntity(Entity $entity) {
376384 }
377385 echo '</td></tr> ' ;
378386
387+ // Service catalog home page
388+ $ elements = self ::getEnumServiceCatalogHome ();
389+ if ($ entityId == 0 ) {
390+ unset($ elements [self ::CONFIG_PARENT ]);
391+ }
392+ echo "<tr class='tab_bg_1'> " ;
393+ echo "<td> " .__ ('Service catalog home page ' , 'formcreator ' )."</td> " ;
394+ echo "<td> " ;
395+ Dropdown::showFromArray ('service_catalog_home ' , $ elements , ['value ' => $ this ->fields ['service_catalog_home ' ]]);
396+ if ($ this ->fields ['service_catalog_home ' ] == self ::CONFIG_PARENT ) {
397+ $ tid = self ::getUsedConfig ('service_catalog_home ' , $ entityId );
398+ echo '<br> ' ;
399+ Entity::inheritedValue ($ elements [$ tid ], true );
400+ }
401+ echo '</td></tr> ' ;
402+
379403 // Tiles Design
380404 $ elements = self ::getEnumUIForm ();
381405 if ($ entityId == 0 ) {
@@ -479,6 +503,56 @@ public function rawSearchOptions() {
479503 'massiveaction ' => true ,
480504 ];
481505
506+ $ tab [] = [
507+ 'id ' => '9 ' ,
508+ 'table ' => self ::getTable (),
509+ 'name ' => __ ('Service catalog home page ' , 'formcreator ' ),
510+ 'field ' => 'service_catalog_home ' ,
511+ 'datatype ' => 'integer ' ,
512+ 'nosearch ' => true ,
513+ 'massiveaction ' => false ,
514+ ];
515+
516+ $ tab [] = [
517+ 'id ' => '10 ' ,
518+ 'table ' => self ::getTable (),
519+ 'name ' => __ ('Default Form list mode ' , 'formcreator ' ),
520+ 'field ' => 'default_form_list_mode ' ,
521+ 'datatype ' => 'integer ' ,
522+ 'nosearch ' => true ,
523+ 'massiveaction ' => false ,
524+ ];
525+
526+ $ tab [] = [
527+ 'id ' => '11 ' ,
528+ 'table ' => self ::getTable (),
529+ 'name ' => __ ('Counters dashboard ' , 'formcreator ' ),
530+ 'field ' => 'is_dashboard_visible ' ,
531+ 'datatype ' => 'integer ' ,
532+ 'nosearch ' => true ,
533+ 'massiveaction ' => false ,
534+ ];
535+
536+ $ tab [] = [
537+ 'id ' => '12 ' ,
538+ 'table ' => self ::getTable (),
539+ 'name ' => __ ('Search issue ' , 'formcreator ' ),
540+ 'field ' => 'is_search_issue_visible ' ,
541+ 'datatype ' => 'integer ' ,
542+ 'nosearch ' => true ,
543+ 'massiveaction ' => false ,
544+ ];
545+
546+ $ tab [] = [
547+ 'id ' => '13 ' ,
548+ 'table ' => self ::getTable (),
549+ 'name ' => __ ('Tile design ' , 'formcreator ' ),
550+ 'field ' => 'tile_design ' ,
551+ 'datatype ' => 'integer ' ,
552+ 'nosearch ' => true ,
553+ 'massiveaction ' => false ,
554+ ];
555+
482556 return $ tab ;
483557 }
484558
0 commit comments