Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
my.typo3.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
t3o
my.typo3.org
Commits
0e1a97e0
Commit
0e1a97e0
authored
Feb 11, 2019
by
mabolek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TASK] Completed karma source referencing
parent
ab37000d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
11 deletions
+88
-11
extensions/karma/Classes/Domain/Model/LedgerEntry.php
extensions/karma/Classes/Domain/Model/LedgerEntry.php
+52
-1
extensions/karma/Classes/Service/KarmaService.php
extensions/karma/Classes/Service/KarmaService.php
+5
-5
extensions/karma/Classes/Utility/UserProfileChangeKarmaIssuerUtility.php
...a/Classes/Utility/UserProfileChangeKarmaIssuerUtility.php
+6
-2
extensions/karma/Configuration/TCA/tx_karma_domain_model_ledgerentry.php
...a/Configuration/TCA/tx_karma_domain_model_ledgerentry.php
+21
-2
extensions/karma/Resources/Private/Templates/UserDisplay/List.html
...s/karma/Resources/Private/Templates/UserDisplay/List.html
+1
-1
extensions/karma/ext_tables.sql
extensions/karma/ext_tables.sql
+3
-0
No files found.
extensions/karma/Classes/Domain/Model/LedgerEntry.php
View file @
0e1a97e0
...
...
@@ -62,12 +62,22 @@ class LedgerEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
protected
$mutableValue
;
/**
* The entry karma source
* The entry karma source
code
*
* @var string
*/
protected
$karmaSource
;
/**
* @var string
*/
protected
$issuer
;
/**
* @var string
*/
protected
$issuerAction
;
/**
* Set to the related campaign if the entry is generated through a campaign
*
...
...
@@ -214,6 +224,47 @@ class LedgerEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
$this
->
karmaSource
=
$karmaSource
;
}
/**
* Get the issuer code
*
* @return string
*/
public
function
getIssuer
()
{
return
$this
->
issuer
;
}
/**
* Set the issuer code
*
* @param string $issuer
*/
public
function
setIssuer
(
string
$issuer
)
{
$this
->
issuer
=
$issuer
;
}
/**
* Get the issuer action code
*
* @return string
*/
public
function
getIssuerAction
()
{
return
$this
->
issuerAction
;
}
/**
* Set the issuer action code
*
* @param string $issuerAction
*/
public
function
setIssuerAction
(
string
$issuerAction
)
{
$this
->
issuerAction
=
$issuerAction
;
}
/**
* Get the entry campaign that generated this entry, or null if no campaign
*
...
...
extensions/karma/Classes/Service/KarmaService.php
View file @
0e1a97e0
...
...
@@ -129,9 +129,10 @@ class KarmaService implements \TYPO3\CMS\Core\SingletonInterface
* @param int $karmaValue to add to the user
* @param ExtbaseFrontendUser $frontendUser to add the value to
* @param string $karmaSource for the karma value
* @param Campaign $campaign for the value (optional)
* @param string $karmaIssuer code
* @param string $karmaIssuerAction code
*/
public
function
addKarmaToUser
(
int
$karmaValue
,
ExtbaseFrontendUser
$frontendUser
,
string
$karmaSource
,
Campaign
$campaign
=
null
)
public
function
addKarmaToUser
(
int
$karmaValue
,
ExtbaseFrontendUser
$frontendUser
,
string
$karmaSource
,
string
$karmaIssuer
,
string
$karmaIssuerAction
)
{
$frontendUser
=
$this
->
ensureCorrectFrontendUserSubclass
(
$frontendUser
);
...
...
@@ -141,9 +142,8 @@ class KarmaService implements \TYPO3\CMS\Core\SingletonInterface
$ledgerEntry
->
setMutableValue
(
$karmaValue
);
$ledgerEntry
->
setUser
(
$frontendUser
);
$ledgerEntry
->
setKarmaSource
(
$karmaSource
);
if
(
$campaign
!==
null
)
{
$ledgerEntry
->
setCampaign
(
$campaign
);
}
$ledgerEntry
->
setIssuer
(
$karmaIssuer
);
$ledgerEntry
->
setIssuerAction
(
$karmaIssuerAction
);
$this
->
ledgerEntryRepository
->
add
(
$ledgerEntry
);
...
...
extensions/karma/Classes/Utility/UserProfileChangeKarmaIssuerUtility.php
View file @
0e1a97e0
...
...
@@ -35,6 +35,8 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
class
UserProfileChangeKarmaIssuerUtility
{
public
const
ISSUER_CODE
=
'userProfileChange'
;
/**
* @var \T3o\Karma\Service\KarmaService
*/
...
...
@@ -100,7 +102,7 @@ class UserProfileChangeKarmaIssuerUtility
*/
public
function
newUserWasCreated
(
ExtbaseFrontendUser
$frontendUser
)
{
$issuerActionSettings
=
$this
->
settings
[
'issuers'
][
'userProfileChange'
][
'newUserWasCreated'
];
$issuerActionSettings
=
$this
->
settings
[
'issuers'
][
self
::
ISSUER_CODE
][
__FUNCTION__
];
$karmaSourceCode
=
$issuerActionSettings
[
'sourceCode'
];
if
(
$karmaSourceCode
===
''
)
{
...
...
@@ -110,7 +112,9 @@ class UserProfileChangeKarmaIssuerUtility
$this
->
karmaService
->
addKarmaToUser
(
$issuerActionSettings
[
'valueEarned'
],
$frontendUser
,
$issuerActionSettings
[
'sourceCode'
]
$issuerActionSettings
[
'sourceCode'
],
self
::
ISSUER_CODE
,
__FUNCTION__
);
}
}
extensions/karma/Configuration/TCA/tx_karma_domain_model_ledgerentry.php
View file @
0e1a97e0
...
...
@@ -84,8 +84,27 @@ $tx_karma_domain_model_ledgerentry = [
'type'
=>
'input'
,
'size'
=>
16
,
'max'
=>
16
,
'eval'
=>
'trim'
,
'default'
=>
0
,
'eval'
=>
'trim'
]
],
'issuer'
=>
[
'exclude'
=>
true
,
'label'
=>
$ll
.
'tx_karma_domain_model_ledgerentry.issuer'
,
'config'
=>
[
'type'
=>
'input'
,
'size'
=>
32
,
'max'
=>
32
,
'eval'
=>
'trim'
]
],
'issuer_action'
=>
[
'exclude'
=>
true
,
'label'
=>
$ll
.
'tx_karma_domain_model_ledgerentry.issuer_action'
,
'config'
=>
[
'type'
=>
'input'
,
'size'
=>
32
,
'max'
=>
32
,
'eval'
=>
'trim'
]
],
'campaign'
=>
[
...
...
extensions/karma/Resources/Private/Templates/UserDisplay/List.html
View file @
0e1a97e0
...
...
@@ -12,7 +12,7 @@
<f:for
each=
"{entries}"
as=
"entry"
>
<tr
id=
"entry-{entry.uid}"
>
<td>
{entry.crdate -> f:format.date(format:'j F, Y')}
</td>
<td>
{entry.karmaSource
.title
}
</td>
<td>
{entry.karmaSource
} {entry.issuer} {entry.issuerAction
}
</td>
<td>
{entry.immutableValue}
</td>
<td>
{entry.mutableValue}
</td>
</tr>
...
...
extensions/karma/ext_tables.sql
View file @
0e1a97e0
...
...
@@ -14,6 +14,9 @@ CREATE TABLE tx_karma_domain_model_ledgerentry (
mutable_value
int
(
11
)
DEFAULT
'0'
,
karma_source
varchar
(
16
)
DEFAULT
''
,
issuer
varchar
(
32
)
DEFAULT
''
,
issuer_action
varchar
(
32
)
DEFAULT
''
,
campaign
int
(
11
)
unsigned
DEFAULT
'0'
,
user
int
(
11
)
unsigned
DEFAULT
'0'
,
...
...
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