@@ -637,12 +637,42 @@ push @ACL, (
637637 { GroupId => 'DutyTeam', # - principalId
638638 GroupDomain => 'UserDefined',
639639 Queue => 0,
640- Right => 'CreateSavedSearch ',
640+ Right => 'SeeOwnSavedSearch ',
641641 },
642642 { GroupId => 'DutyTeam', # - principalId
643643 GroupDomain => 'UserDefined',
644644 Queue => 0,
645- Right => 'EditSavedSearches',
645+ Right => 'AdminOwnSavedSearch',
646+ },
647+ { GroupId => 'DutyTeam', # - principalId
648+ GroupDomain => 'UserDefined',
649+ Queue => 0,
650+ Right => 'SeeGroupSavedSearch',
651+ },
652+ { GroupId => 'DutyTeam', # - principalId
653+ GroupDomain => 'UserDefined',
654+ Queue => 0,
655+ Right => 'AdminGroupSavedSearch',
656+ },
657+ { GroupId => 'DutyTeam', # - principalId
658+ GroupDomain => 'UserDefined',
659+ Queue => 0,
660+ Right => 'SeeOwnDashboard',
661+ },
662+ { GroupId => 'DutyTeam', # - principalId
663+ GroupDomain => 'UserDefined',
664+ Queue => 0,
665+ Right => 'AdminOwnDashboard',
666+ },
667+ { GroupId => 'DutyTeam', # - principalId
668+ GroupDomain => 'UserDefined',
669+ Queue => 0,
670+ Right => 'SeeGroupDashboard',
671+ },
672+ { GroupId => 'DutyTeam', # - principalId
673+ GroupDomain => 'UserDefined',
674+ Queue => 0,
675+ Right => 'AdminGroupDashboard',
646676 },
647677 { GroupId => 'DutyTeam', # - principalId
648678 GroupDomain => 'UserDefined',
@@ -652,7 +682,7 @@ push @ACL, (
652682 { GroupId => 'DutyTeam', # - principalId
653683 GroupDomain => 'UserDefined',
654684 Queue => 0,
655- Right => 'ShowSavedSearches ',
685+ Right => 'AdminSavedSearch ',
656686 },
657687);
658688
@@ -756,6 +786,63 @@ for my $cf (@CustomFields) {
756786 }
757787);
758788
789+ @Dashboards = (
790+ {
791+ Name => 'RTIR Homepage',
792+ Description => 'RTIR Homepage',
793+ Content => {
794+ Elements => [
795+ {
796+ Layout => 'col-md-8,col-md-4',
797+ Elements => [
798+ [
799+ {
800+ portlet_type => 'component',
801+ component => '/RTIR/Elements/NewReports',
802+ description => '/RTIR/Elements/NewReports',
803+ path => '/RTIR/Elements/NewReports',
804+ },
805+ {
806+ portlet_type => 'component',
807+ component => '/RTIR/Elements/UserDueIncidents',
808+ description => '/RTIR/Elements/UserDueIncidents',
809+ path => '/RTIR/Elements/UserDueIncidents',
810+ },
811+ {
812+ portlet_type => 'component',
813+ component => '/RTIR/Elements/NobodyDueIncidents',
814+ description => '/RTIR/Elements/NobodyDueIncidents',
815+ path => '/RTIR/Elements/NobodyDueIncidents',
816+ },
817+ {
818+ portlet_type => 'component',
819+ component => '/RTIR/Elements/DueIncidents',
820+ description => '/RTIR/Elements/DueIncidents',
821+ path => '/RTIR/Elements/DueIncidents',
822+ },
823+ ],
824+ [
825+ {
826+ portlet_type => 'component',
827+ component => '/RTIR/Elements/WorkWithConstituency',
828+ description => '/RTIR/Elements/WorkWithConstituency',
829+ path => '/RTIR/Elements/WorkWithConstituency',
830+ },
831+ {
832+ portlet_type => 'component',
833+ component => '/RTIR/Elements/QueueSummary',
834+ description => '/RTIR/Elements/QueueSummary',
835+ path => '/RTIR/Elements/QueueSummary',
836+ },
837+ ]
838+ ],
839+ }
840+ ],
841+ },
842+ }
843+ );
844+
845+
759846@Final = (
760847 sub {
761848 $| = 1;
@@ -815,67 +902,9 @@ for my $cf (@CustomFields) {
815902 },
816903 sub {
817904 my $dashboard = RT::Dashboard->new( RT->SystemUser );
818- my ( $ret, $msg ) = $dashboard->Save(
819- Name => 'RTIR Homepage',
820- Privacy => join( '-', ref( RT->System ), RT->System->Id ),
821- );
822-
823- if ($ret) {
824- my $panes = {
825- body => [
826- { pane => 'body',
827- portlet_type => 'component',
828- component => '/RTIR/Elements/NewReports',
829- description => '/RTIR/Elements/NewReports',
830- path => '/RTIR/Elements/NewReports',
831- },
832- { pane => 'body',
833- portlet_type => 'component',
834- component => '/RTIR/Elements/UserDueIncidents',
835- description => '/RTIR/Elements/UserDueIncidents',
836- path => '/RTIR/Elements/UserDueIncidents',
837- },
838- { pane => 'body',
839- portlet_type => 'component',
840- component => '/RTIR/Elements/NobodyDueIncidents',
841- description => '/RTIR/Elements/NobodyDueIncidents',
842- path => '/RTIR/Elements/NobodyDueIncidents',
843- },
844- { pane => 'body',
845- portlet_type => 'component',
846- component => '/RTIR/Elements/DueIncidents',
847- description => '/RTIR/Elements/DueIncidents',
848- path => '/RTIR/Elements/DueIncidents',
849- },
850- ],
851- sidebar => [
852- { pane => 'sidebar',
853- portlet_type => 'component',
854- component => '/RTIR/Elements/WorkWithConstituency',
855- description => '/RTIR/Elements/WorkWithConstituency',
856- path => '/RTIR/Elements/WorkWithConstituency',
857- },
858- { pane => 'sidebar',
859- portlet_type => 'component',
860- component => '/RTIR/Elements/QueueSummary',
861- description => '/RTIR/Elements/QueueSummary',
862- path => '/RTIR/Elements/QueueSummary',
863- },
864- { pane => 'sidebar',
865- portlet_type => 'component',
866- component => 'RefreshHomepage',
867- description => 'RefreshHomepage',
868- path => '/Elements/RefreshHomepage',
869- },
870- ]
871- };
872-
873- # fill content
874- my ( $ret, $msg ) = $dashboard->Update( Panes => $panes );
875- if ( !$ret ) {
876- RT->Logger->error("Couldn't update content for dashboard Homepage: $msg");
877- }
905+ my ( $ret, $msg ) = $dashboard->LoadByCols( Name => 'RTIR Homepage' );
878906
907+ if ( $ret ) {
879908 ( $ret, $msg ) = RT->System->SetAttribute(
880909 'Name' => 'RTIRDefaultDashboard',
881910 'Description' => 'RTIR Default Dashboard',
@@ -886,7 +915,7 @@ for my $cf (@CustomFields) {
886915 }
887916 }
888917 else {
889- RT->Logger->error("Couldn't create dashboard RTIR Homepage: $msg");
918+ RT->Logger->error("Couldn't load dashboard RTIR Homepage: $msg");
890919 }
891920 },
892921 sub {
0 commit comments