ITSM service catalog partservices

English! place to talk about OTRS development, programming and coding
Post Reply
kkgigiioo
OTRS newbie
Posts: 9
Joined: 06 Mar 2019, 09:26
OTRS Version?: 6.0.15

ITSM service catalog partservices

Post by kkgigiioo » 07 Mar 2019, 11:43

Hi,

I use OTRS v6.0 and it would be my job to display the partial services in ITSMServiceZoom. Of course, I copied the file to the Custom folder.
So far I have managed to write down what I thought was good, but unfortunately the headline of the board doesn't appear. I also looked at the console in the browser but did not write any errors.

Here I copy the code,what I wrote

Code: Select all

[% RenderBlockStart("Overview") %]
	<div class="WidgetSimple SpacingTop SpacingBottomMedium">
		<div class="Header">
			<div class="WidgetAction Toggle">
				<a href="#" title="[% Translate("Show or hide the content") | html %]>
					<i class="fa fa-caret-right"></i>
					<i class="fa fa-caret-down"></i>
				</a>
			</div>
			<h2>[% Translate("Associated Services") | html %]</h2>
		</div>
		<div class="Content">
			<table class="DataTable">
				<thead>
					<tr>
						<th>[% Translate("Service") | html %]</th>
						<th>[% Translate("Comment") | html %]</th>
						<th>[% Translate("Type") | html %]</th>
						<th>[% Translate("Changed") | html %]</th>
					</tr>
				</thead>
				<tbody>
[% RenderBlockStart("OverviewRow") %]
					<tr>
						<td>
							<a href="[% Env("Baselink") %]Action=AgentITSMServiceZoom;ServiceID=[% Data.ServiceID | uri %]">[% Data.Name | html %]</a>
						</td>
						<td title="[% Data.Comment | html %]">[% Data.Comment | truncate(100) | html %]</td>
						<td>[% Translate(Data.Type) | html %]</td>
						<td>[% Data.ChangeTime | Localize("TimeLog") %]</td>
					</tr>
[% RenderBlockEnd("OverviewRow") %]
				</tbody>
			</table>
		</div>
	</div>
[% RenderBlockEnd("Overview") %]
I've tried to use Service instead of Overview even though the table is not displayed. If I skip the RenderBlock section, the table appears, but the current service is displayed.
What's the problem, please help!

Thanx for help!

Regarts,
kkgigiioo

RStraub
OTRS guru
Posts: 2162
Joined: 13 Mar 2014, 09:16
OTRS Version?: 6.0.14
Real Name: Rolf Straub

Re: ITSM service catalog partservices

Post by RStraub » 07 Mar 2019, 11:54

This is hard to guess as you didn't mention files changed. I'm guessing you copied from AgentITSMSLAZoom the part of Service and ServiceRow.

A RenderBlock is only printed if the perl-module tells the Layouter to print it. Thus, if you add or change existing RenderBlocks, you will also need to change the perl module.

Here is a snippet from from the module AgentITSMSLAZoom.pm which dynamically creates an entry row:

Code: Select all

            # output row
            $LayoutObject->Block(
                Name => 'ServiceRow',
                Data => {
                    %{ $ServiceList{$ServiceID} },
                    CurInciSignal => $InciSignals{ $ServiceList{$ServiceID}->{CurInciStateType} },
                    CssClass      => $CssClass,
                },
            );
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS

kkgigiioo
OTRS newbie
Posts: 9
Joined: 06 Mar 2019, 09:26
OTRS Version?: 6.0.15

Re: ITSM service catalog partservices

Post by kkgigiioo » 07 Mar 2019, 12:09

Yes, you think well. I bought the code from AgentITSMSLAZoom.
So if I write the required LayoutObject instruction to AgentITSMServeceZoom.pm, will my problem be resolved?

Thank you in advance for your reply!

RStraub
OTRS guru
Posts: 2162
Joined: 13 Mar 2014, 09:16
OTRS Version?: 6.0.14
Real Name: Rolf Straub

Re: ITSM service catalog partservices

Post by RStraub » 07 Mar 2019, 12:15

Well... yes, if you do it properly ;)
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS

kkgigiioo
OTRS newbie
Posts: 9
Joined: 06 Mar 2019, 09:26
OTRS Version?: 6.0.15

Re: ITSM service catalog partservices

Post by kkgigiioo » 07 Mar 2019, 12:19

Okay, I'm trying to do it right. :)
Thank you very much for your help!

Post Reply