@@ -472,8 +472,8 @@ public function getTicketsForDisplay($options) {
472
472
$ item = $ ticket ;
473
473
}
474
474
} else {
475
- // multiple tickets, ticket specified, then substitute the ticket to the form answer
476
475
if (isset ($ options ['tickets_id ' ])) {
476
+ // multiple tickets, ticket specified, then substitute the ticket to the form answer
477
477
$ ticket = Ticket::getById ((int ) $ options ['tickets_id ' ]);
478
478
if ($ ticket ) {
479
479
$ item = $ ticket ;
@@ -645,17 +645,50 @@ public function rawSearchOptions() {
645
645
'massiveaction ' => false ,
646
646
'joinparams ' => [
647
647
'beforejoin ' => [
648
- 'table ' => TicketValidation::getTable (),
649
- 'joinparams ' => [
650
- 'jointype ' => 'child ' ,
651
- 'beforejoin ' => [
652
- 'table ' => Ticket::getTable (),
653
- 'joinparams ' => [
654
- 'jointype ' => 'itemtype_item_revert ' ,
655
- 'specific_itemtype ' => Ticket::class,
648
+ [
649
+ 'table ' => TicketValidation::getTable (),
650
+ 'joinparams ' => [
651
+ 'jointype ' => 'child ' ,
652
+ 'beforejoin ' => [
653
+ 'table ' => Ticket::getTable (),
654
+ 'joinparams ' => [
655
+ 'jointype ' => 'itemtype_item_revert ' ,
656
+ 'specific_itemtype ' => Ticket::class,
657
+ ]
656
658
]
657
659
]
658
- ]
660
+ ],
661
+ [
662
+ 'table ' => TicketValidation::getTable (),
663
+ 'joinparams ' => [
664
+ 'jointype ' => 'child ' ,
665
+ 'beforejoin ' => [
666
+ 'table ' => Ticket::getTable (),
667
+ 'joinparams ' => [
668
+ 'jointype ' => 'empty ' ,
669
+ 'condition ' => [
670
+ new \QueryExpression (
671
+ '1=1 '
672
+ ),
673
+ ],
674
+ 'beforejoin ' => [
675
+ 'table ' => Item_Ticket::getTable (),
676
+ 'joinparams ' => [
677
+ 'jointype ' => 'itemtype_item ' ,
678
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
679
+ 'beforejoin ' => [
680
+ 'table ' => PluginFormcreatorFormAnswer::getTable (),
681
+ 'joinparams ' => [
682
+ 'jointype ' => 'itemtype_item_revert ' ,
683
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
684
+ ],
685
+ ],
686
+ ],
687
+ ],
688
+ ],
689
+ ]
690
+ ]
691
+ ],
659
692
],
660
693
]
661
694
];
@@ -800,6 +833,149 @@ public function rawSearchOptions() {
800
833
}
801
834
}
802
835
836
+ $ tab [] = [
837
+ 'id ' => '42 ' ,
838
+ 'table ' => User::getTable (),
839
+ 'field ' => 'name ' ,
840
+ 'name ' => __ ('Ticket requester ' , 'formcreator ' ),
841
+ 'massiveaction ' => false ,
842
+ 'datatype ' => 'dropdown ' ,
843
+ 'forcegroupby ' => true ,
844
+ 'joinparams ' => [
845
+ 'jointype ' => 'empty ' ,
846
+ 'beforejoin ' => [
847
+ 'table ' => Ticket_User::getTable (),
848
+ 'joinparams ' => [
849
+ 'jointype ' => 'child ' ,
850
+ 'condition ' => [
851
+ 'NEWTABLE.type ' => CommonITILActor::REQUESTER ,
852
+ ],
853
+ 'beforejoin ' => [
854
+ 'table ' => Ticket::getTable (),
855
+ 'joinparams ' => [
856
+ 'jointype ' => 'empty ' ,
857
+ 'condition ' => [
858
+ new \QueryExpression (
859
+ '1=1 '
860
+ ),
861
+ ],
862
+ 'beforejoin ' => [
863
+ 'table ' => Item_Ticket::getTable (),
864
+ 'joinparams ' => [
865
+ 'jointype ' => 'itemtype_item ' ,
866
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
867
+ 'beforejoin ' => [
868
+ 'table ' => PluginFormcreatorFormAnswer::getTable (),
869
+ 'joinparams ' => [
870
+ 'jointype ' => 'itemtype_item_revert ' ,
871
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
872
+ ],
873
+ ],
874
+ ],
875
+ ],
876
+ ],
877
+ ],
878
+ ],
879
+ ],
880
+ ],
881
+ ];
882
+
883
+ $ tab [] = [
884
+ 'id ' => '43 ' ,
885
+ 'table ' => User::getTable (),
886
+ 'field ' => 'name ' ,
887
+ 'name ' => __ ('Ticket observer ' , 'formcreator ' ),
888
+ 'massiveaction ' => false ,
889
+ 'nosearch ' => true ,
890
+ 'datatype ' => 'dropdown ' ,
891
+ 'forcegroupby ' => true ,
892
+ 'joinparams ' => [
893
+ 'jointype ' => 'empty ' ,
894
+ 'beforejoin ' => [
895
+ 'table ' => Ticket_User::getTable (),
896
+ 'joinparams ' => [
897
+ 'jointype ' => 'child ' ,
898
+ 'condition ' => [
899
+ 'NEWTABLE.type ' => CommonITILActor::OBSERVER ,
900
+ ],
901
+ 'beforejoin ' => [
902
+ 'table ' => Ticket::getTable (),
903
+ 'joinparams ' => [
904
+ 'jointype ' => 'empty ' ,
905
+ 'condition ' => [
906
+ new \QueryExpression (
907
+ '1=1 '
908
+ ),
909
+ ],
910
+ 'beforejoin ' => [
911
+ 'table ' => Item_Ticket::getTable (),
912
+ 'joinparams ' => [
913
+ 'jointype ' => 'itemtype_item ' ,
914
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
915
+ 'beforejoin ' => [
916
+ 'table ' => PluginFormcreatorFormAnswer::getTable (),
917
+ 'joinparams ' => [
918
+ 'jointype ' => 'itemtype_item_revert ' ,
919
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
920
+ ],
921
+ ],
922
+ ],
923
+ ],
924
+ ],
925
+ ],
926
+ ],
927
+ ],
928
+ ],
929
+ ];
930
+
931
+ $ tab [] = [
932
+ 'id ' => '44 ' ,
933
+ 'table ' => User::getTable (),
934
+ 'field ' => 'name ' ,
935
+ 'name ' => __ ('Ticket technician ' , 'formcreator ' ),
936
+ 'massiveaction ' => false ,
937
+ 'nosearch ' => true ,
938
+ 'datatype ' => 'dropdown ' ,
939
+ 'forcegroupby ' => true ,
940
+ 'joinparams ' => [
941
+ 'jointype ' => 'empty ' ,
942
+ 'beforejoin ' => [
943
+ 'table ' => Ticket_User::getTable (),
944
+ 'joinparams ' => [
945
+ 'jointype ' => 'child ' ,
946
+ 'condition ' => [
947
+ 'NEWTABLE.type ' => CommonITILActor::ASSIGN ,
948
+ ],
949
+ 'beforejoin ' => [
950
+ 'table ' => Ticket::getTable (),
951
+ 'joinparams ' => [
952
+ 'jointype ' => 'empty ' ,
953
+ 'condition ' => [
954
+ new \QueryExpression (
955
+ '1=1 '
956
+ ),
957
+ ],
958
+ 'beforejoin ' => [
959
+ 'table ' => Item_Ticket::getTable (),
960
+ 'joinparams ' => [
961
+ 'jointype ' => 'itemtype_item ' ,
962
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
963
+ 'beforejoin ' => [
964
+ 'table ' => PluginFormcreatorFormAnswer::getTable (),
965
+ 'joinparams ' => [
966
+ 'jointype ' => 'itemtype_item_revert ' ,
967
+ 'specific_itemtype ' => PluginFormcreatorFormAnswer::class,
968
+ ],
969
+ ],
970
+ ],
971
+ ],
972
+ ],
973
+ ],
974
+ ],
975
+ ],
976
+ ],
977
+ ];
978
+
803
979
return $ tab ;
804
980
}
805
981
0 commit comments