Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit fbb51d1

Browse files
authored
Merge pull request #139 from blopa/develop
Develop
2 parents dcb41ed + 03d04d1 commit fbb51d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2338
-75
lines changed

Magento2/app/code/Werules/Chatbot/Api/Data/ChatbotAPIInterface.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424
interface ChatbotAPIInterface
2525
{
2626

27-
const CHATBOTUSER_ID = 'chatbotuser_id';
27+
const UPDATED_AT = 'updated_at';
28+
const CHAT_ID = 'chat_id';
2829
const LAST_COMMAND_DETAILS = 'last_command_details';
29-
const FALLBACK_QTY = 'fallback_qty';
30-
const CHATBOTAPI_ID = 'chatbotapi_id';
3130
const CREATED_AT = 'created_at';
32-
const LOGGED = 'logged';
33-
const CONVERSATION_STATE = 'conversation_state';
3431
const HASH_KEY = 'hash_key';
32+
const CHATBOTAPI_ID = 'chatbotapi_id';
33+
const LOGGED = 'logged';
3534
const CHATBOT_TYPE = 'chatbot_type';
36-
const UPDATED_AT = 'updated_at';
35+
const CONVERSATION_STATE = 'conversation_state';
36+
const CHATBOTUSER_ID = 'chatbotuser_id';
3737
const ENABLED = 'enabled';
38-
const CHAT_ID = 'chat_id';
38+
const FALLBACK_QTY = 'fallback_qty';
3939

4040

4141
/**

Magento2/app/code/Werules/Chatbot/Api/Data/ChatbotUserInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
interface ChatbotUserInterface
2525
{
2626

27-
const CHATBOTUSER_ID = 'chatbotuser_id';
27+
const UPDATED_AT = 'updated_at';
2828
const CUSTOMER_ID = 'customer_id';
29-
const CREATED_AT = 'created_at';
30-
const SESSION_ID = 'session_id';
31-
const ENABLE_SUPPORT = 'enable_support';
3229
const QUOTE_ID = 'quote_id';
3330
const ADMIN = 'admin';
34-
const UPDATED_AT = 'updated_at';
31+
const ENABLE_SUPPORT = 'enable_support';
32+
const CREATED_AT = 'created_at';
3533
const ENABLE_PROMOTIONAL_MESSAGES = 'enable_promotional_messages';
34+
const SESSION_ID = 'session_id';
35+
const CHATBOTUSER_ID = 'chatbotuser_id';
3636

3737

3838
/**

Magento2/app/code/Werules/Chatbot/Api/Data/MessageInterface.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@
2424
interface MessageInterface
2525
{
2626

27-
const CONTENT = 'content';
27+
const DIRECTION = 'direction';
28+
const UPDATED_AT = 'updated_at';
29+
const CHAT_MESSAGE_ID = 'chat_message_id';
2830
const CONTENT_TYPE = 'content_type';
29-
const SENT_AT = 'sent_at';
30-
const STATUS = 'status';
31-
const MESSAGE_ID = 'message_id';
3231
const CREATED_AT = 'created_at';
33-
const SENDER_ID = 'sender_id';
34-
const DIRECTION = 'direction';
32+
const SENT_AT = 'sent_at';
3533
const CHATBOT_TYPE = 'chatbot_type';
36-
const UPDATED_AT = 'updated_at';
34+
const MESSAGE_ID = 'message_id';
3735
const MESSAGE_PAYLOAD = 'message_payload';
38-
const CHAT_MESSAGE_ID = 'chat_message_id';
36+
const SENDER_ID = 'sender_id';
37+
const CONTENT = 'content';
3938
const CURRENT_COMMAND_DETAILS = 'current_command_details';
39+
const STATUS = 'status';
4040

4141

4242
/**
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
namespace Werules\Chatbot\Api\Data;
23+
24+
interface PromotionalMessagesInterface
25+
{
26+
27+
const UPDATED_AT = 'updated_at';
28+
const CONTENT = 'content';
29+
const CREATED_AT = 'created_at';
30+
const STATUS = 'status';
31+
const PROMOTIONALMESSAGES_ID = 'promotionalmessages_id';
32+
33+
34+
/**
35+
* Get promotionalmessages_id
36+
* @return string|null
37+
*/
38+
public function getPromotionalmessagesId();
39+
40+
/**
41+
* Set promotionalmessages_id
42+
* @param string $promotionalmessages_id
43+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface
44+
*/
45+
public function setPromotionalmessagesId($promotionalmessagesId);
46+
47+
/**
48+
* Get content
49+
* @return string|null
50+
*/
51+
public function getContent();
52+
53+
/**
54+
* Set content
55+
* @param string $content
56+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface
57+
*/
58+
public function setContent($content);
59+
60+
/**
61+
* Get created_at
62+
* @return string|null
63+
*/
64+
public function getCreatedAt();
65+
66+
/**
67+
* Set created_at
68+
* @param string $created_at
69+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface
70+
*/
71+
public function setCreatedAt($created_at);
72+
73+
/**
74+
* Get updated_at
75+
* @return string|null
76+
*/
77+
public function getUpdatedAt();
78+
79+
/**
80+
* Set updated_at
81+
* @param string $updated_at
82+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface
83+
*/
84+
public function setUpdatedAt($updated_at);
85+
86+
/**
87+
* Get status
88+
* @return string|null
89+
*/
90+
public function getStatus();
91+
92+
/**
93+
* Set status
94+
* @param string $status
95+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface
96+
*/
97+
public function setStatus($status);
98+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
namespace Werules\Chatbot\Api\Data;
23+
24+
interface PromotionalMessagesSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
25+
{
26+
27+
28+
/**
29+
* Get PromotionalMessages list.
30+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface[]
31+
*/
32+
public function getItems();
33+
34+
/**
35+
* Set content list.
36+
* @param \Werules\Chatbot\Api\Data\PromotionalMessagesInterface[] $items
37+
* @return $this
38+
*/
39+
public function setItems(array $items);
40+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
namespace Werules\Chatbot\Api;
23+
24+
use Magento\Framework\Api\SearchCriteriaInterface;
25+
26+
interface PromotionalMessagesRepositoryInterface
27+
{
28+
29+
30+
/**
31+
* Save PromotionalMessages
32+
* @param \Werules\Chatbot\Api\Data\PromotionalMessagesInterface $promotionalMessages
33+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface
34+
* @throws \Magento\Framework\Exception\LocalizedException
35+
*/
36+
public function save(
37+
\Werules\Chatbot\Api\Data\PromotionalMessagesInterface $promotionalMessages
38+
);
39+
40+
/**
41+
* Retrieve PromotionalMessages
42+
* @param string $promotionalmessagesId
43+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesInterface
44+
* @throws \Magento\Framework\Exception\LocalizedException
45+
*/
46+
public function getById($promotionalmessagesId);
47+
48+
/**
49+
* Retrieve PromotionalMessages matching the specified criteria.
50+
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
51+
* @return \Werules\Chatbot\Api\Data\PromotionalMessagesSearchResultsInterface
52+
* @throws \Magento\Framework\Exception\LocalizedException
53+
*/
54+
public function getList(
55+
\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
56+
);
57+
58+
/**
59+
* Delete PromotionalMessages
60+
* @param \Werules\Chatbot\Api\Data\PromotionalMessagesInterface $promotionalMessages
61+
* @return bool true on success
62+
* @throws \Magento\Framework\Exception\LocalizedException
63+
*/
64+
public function delete(
65+
\Werules\Chatbot\Api\Data\PromotionalMessagesInterface $promotionalMessages
66+
);
67+
68+
/**
69+
* Delete PromotionalMessages by ID
70+
* @param string $promotionalmessagesId
71+
* @return bool true on success
72+
* @throws \Magento\Framework\Exception\NoSuchEntityException
73+
* @throws \Magento\Framework\Exception\LocalizedException
74+
*/
75+
public function deleteById($promotionalmessagesId);
76+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Magento Chatbot Integration
4+
* Copyright (C) 2017
5+
*
6+
* This file is part of Werules/Chatbot.
7+
*
8+
* Werules/Chatbot is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
namespace Werules\Chatbot\Block\Adminhtml\PromotionalMessages\Edit;
23+
24+
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
25+
26+
class BackButton extends GenericButton implements ButtonProviderInterface
27+
{
28+
29+
/**
30+
* @return array
31+
*/
32+
public function getButtonData()
33+
{
34+
return [
35+
'label' => __('Back'),
36+
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()),
37+
'class' => 'back',
38+
'sort_order' => 10
39+
];
40+
}
41+
42+
/**
43+
* Get URL for back (reset) button
44+
*
45+
* @return string
46+
*/
47+
public function getBackUrl()
48+
{
49+
return $this->getUrl('*/*/');
50+
}
51+
}

0 commit comments

Comments
 (0)