Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
d669c370
Commit
d669c370
authored
May 16, 2022
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zendesk API Issue Fix
parent
b87826cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
logic.php
logic/support/logic.php
+13
-15
model.php
logic/support/model.php
+9
-0
No files found.
logic/support/logic.php
View file @
d669c370
...
@@ -87,14 +87,7 @@ class LogicSupport extends SupportModelClass {
...
@@ -87,14 +87,7 @@ class LogicSupport extends SupportModelClass {
$this
->
getSendParamsForAdmin
(
$rs
)
$this
->
getSendParamsForAdmin
(
$rs
)
);
);
if
(
$this
->
isLoopData
(
$rs
)){
$template
[
"full_name"
]
=
$this
->
getInquirerName
();
$rowData
=
$this
->
getRowData
(
$rs
);
$firstName
=
$this
->
getColumnData
(
$rowData
,
PARAM_FIRST_NAME
);
$lastName
=
$this
->
getColumnData
(
$rowData
,
PARAM_LAST_NAME
);
$template
[
"full_name"
]
=
"
{
$firstName
}
{
$lastName
}
"
;
}
$errorDetails
=
[];
$errorDetails
=
[];
if
(
!
$this
->
createZendeskTicket
(
$template
,
$errorDetails
)){
if
(
!
$this
->
createZendeskTicket
(
$template
,
$errorDetails
)){
...
@@ -103,8 +96,9 @@ class LogicSupport extends SupportModelClass {
...
@@ -103,8 +96,9 @@ class LogicSupport extends SupportModelClass {
"Response String:
{
$errorDetails
[
"response_str"
]
}
\n\n
"
.
"Response String:
{
$errorDetails
[
"response_str"
]
}
\n\n
"
.
"Ticket Body:
\n\n
{
$errorDetails
[
"ticket_body"
]
}
"
;
"Ticket Body:
\n\n
{
$errorDetails
[
"ticket_body"
]
}
"
;
$this
->
notifyErrorToSlack
(
$details
);
$this
->
sendNotificationToSlack
(
0
,
$details
);
}
}
else
$this
->
sendNotificationToSlack
(
1
,
$template
[
"body"
]);
// ユーザ側へ送信
// ユーザ側へ送信
$this
->
sendMailByTmp
(
'send_mail_for_user.xml'
$this
->
sendMailByTmp
(
'send_mail_for_user.xml'
...
@@ -138,7 +132,7 @@ class LogicSupport extends SupportModelClass {
...
@@ -138,7 +132,7 @@ class LogicSupport extends SupportModelClass {
],
],
"requester"
=>
[
"requester"
=>
[
"locale_id"
=>
$this
->
getZendeskLocaleCode
(),
"locale_id"
=>
$this
->
getZendeskLocaleCode
(),
"name"
=>
isset
(
$template
[
"full_name"
])
?
$template
[
"full_name"
]
:
NO_STRING
,
"name"
=>
$template
[
"full_name"
]
,
"email"
=>
$this
->
getEmail
()
"email"
=>
$this
->
getEmail
()
]
]
]
]
...
@@ -177,19 +171,23 @@ class LogicSupport extends SupportModelClass {
...
@@ -177,19 +171,23 @@ class LogicSupport extends SupportModelClass {
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* @function_name:
Slackへのエラー通知
* @function_name:
通知をSlackへ送信する機能
* @parameter : details
* @parameter : details
* @return : なし
* @return : なし
-------------------------------------------------------------------------*/
-------------------------------------------------------------------------*/
private
function
notifyErrorToSlack
(
$details
){
private
function
sendNotificationToSlack
(
$notificationType
,
$details
){
$slackChannels
=
$this
->
getSettingConfiguration
(
"slack_notif_channel"
);
$slackChannels
=
$this
->
getSettingConfiguration
(
"slack_notif_channel"
);
$handle
=
curl_init
();
$handle
=
curl_init
();
$message
=
[
"text"
=>
$details
];
$message
=
[
"text"
=>
$details
];
$channel
=
$notificationType
===
1
?
$slackChannels
->
successfully_submitted_tickets
:
$slackChannels
->
user_details_channel
;
curl_setopt_array
(
$handle
,
[
curl_setopt_array
(
$handle
,
[
CURLOPT_URL
=>
$
slackChannels
->
user_details_
channel
,
CURLOPT_URL
=>
$channel
,
CURLOPT_RETURNTRANSFER
=>
true
,
CURLOPT_RETURNTRANSFER
=>
true
,
CURLOPT_FOLLOWLOCATION
=>
true
,
CURLOPT_FOLLOWLOCATION
=>
true
,
CURLOPT_ENCODING
=>
"utf8"
,
CURLOPT_ENCODING
=>
"utf8"
,
...
@@ -206,7 +204,7 @@ class LogicSupport extends SupportModelClass {
...
@@ -206,7 +204,7 @@ class LogicSupport extends SupportModelClass {
if
(
$err
=
curl_error
(
$handle
))
if
(
$err
=
curl_error
(
$handle
))
echo
$err
;
echo
$err
;
curl_close
(
$handle
);
curl_close
(
$handle
);
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
...
logic/support/model.php
View file @
d669c370
...
@@ -561,5 +561,14 @@ class SupportModelClass extends ModelClassEx {
...
@@ -561,5 +561,14 @@ class SupportModelClass extends ModelClassEx {
return
1
;
return
1
;
}
}
}
}
/*-------------------------------------------------------------------------
* @function_name: 相談者の名前
* @parameter : なし
* @return : string
-------------------------------------------------------------------------*/
function
getInquirerName
()
{
return
$this
->
name
;
}
}
}
?>
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment