Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
t3o
my.typo3.org
Commits
a67ef8c9
Commit
a67ef8c9
authored
Nov 05, 2018
by
mabolek
Browse files
[TASK] Implemented karma extension shell
parent
67a45137
Pipeline
#5529
failed with stages
in 13 seconds
Changes
21
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
html/typo3conf/ext/karma/Classes/Domain/Model/Campaign.php
0 → 100644
View file @
a67ef8c9
<?php
namespace
T3o\Karma\Domain\Model
;
/***************************************************************
* Copyright notice
*
* (c) 2018
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class
Campaign
extends
\
TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* The title of the campaign
*
* @var string
*/
protected
$title
;
/**
* The percentage with which to change the entry value (no change = 100)
*
* @var int
*/
protected
$percent
;
/**
* The value to add or subtract from the entry value
*
* @var int
*/
protected
$value
;
/**
* Returns the title of the campaign
*
* @return string
*/
public
function
getTitle
()
{
return
$this
->
title
;
}
/**
* Set the title of the campaign
*
* @param string $title
*/
public
function
setTitle
(
string
$title
)
{
$this
->
title
=
$title
;
}
/**
* Return the percentage amount to change the entry value
*
* No change = 100
*
* @return int
*/
public
function
getPercent
()
{
return
$this
->
percent
;
}
/**
* Set the percentage value with which to change an entry
*
* No change = 100
*
* @param int $percent
*/
public
function
setPercent
(
int
$percent
)
{
$this
->
percent
=
$percent
;
}
/**
* Returns the value to add or subtract from the entry value
*
* @return int
*/
public
function
getValue
()
{
return
$this
->
value
;
}
/**
* Set the value to add or subtract from the entry value
*
* @param int $value
*/
public
function
setValue
(
int
$value
)
{
$this
->
value
=
$value
;
}
}
\ No newline at end of file
html/typo3conf/ext/karma/Classes/Domain/Model/KarmaSource.php
0 → 100644
View file @
a67ef8c9
<?php
namespace
T3o\Karma\Domain\Model
;
/***************************************************************
* Copyright notice
*
* (c) 2018
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class
KarmaSource
extends
\
TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* The title of the karma source
*
* @var string
*/
protected
$title
;
/**
* The alphanumeric code of the karma source
*
* Used for API calls etc.
*
* @var string
*/
protected
$code
;
/**
* Get the title of the karma source
*
* @return string
*/
public
function
getTitle
()
{
return
$this
->
title
;
}
/**
* Set the title of the karma source
*
* @param string $title
*/
public
function
setTitle
(
string
$title
)
{
$this
->
title
=
$title
;
}
/**
* Get the karma source code
*
* Alphanumeric code for use in APIs etc.
*
* @return string
*/
public
function
getCode
()
{
return
$this
->
code
;
}
/**
* Set the karma code
*
* Set the alphanumeric code for use in APIs etc.
*
* @param string $code
*/
public
function
setCode
(
string
$code
)
{
$this
->
code
=
$code
;
}
}
\ No newline at end of file
html/typo3conf/ext/karma/Classes/Domain/Model/LedgerEntry.php
0 → 100644
View file @
a67ef8c9
<?php
namespace
T3o\Karma\Domain\Model
;
use
In2code\Userprofile\Domain\Model\FrontendUser
;
/***************************************************************
* Copyright notice
*
* (c) 2018
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class
LedgerEntry
extends
\
TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* The date when the entry expired, if set.
*
* Set when the entry expires.
*
* @var int
*/
protected
$expired
;
/**
* The unchangeable ledgerentry entry value
*
* @var int
*/
protected
$immutableValue
;
/**
* The changeable ledgerentry entry value.
*
* Can be depreciated over time or set to zero.
*
* @var int
*/
protected
$mutableValue
;
/**
* The entry karmaSource
*
* @var KarmaSource
*/
protected
$karmaSource
;
/**
* Set to the related campaign if the entry is generated through a campaign
*
* @var Campaign
*/
protected
$campaign
;
/**
* The user the entry is valid for
*
* @var FrontendUser
*/
protected
$user
;
/**
* Return the expired timestamp or zero if not yet expired
*
* @return int
*/
public
function
getExpired
()
{
return
$this
->
expired
;
}
/**
* Returns true if the entry has expired
*
* @return bool
*/
public
function
isExpired
()
{
return
(
bool
)
$this
->
getExpired
();
}
/**
* Set the timestamp for the entry's expiry, or zero if the entry has not expired
*
* @param int $expired
*/
public
function
setExpired
(
int
$expired
)
{
$this
->
expired
=
$expired
;
}
/**
* Returns the unchangeable entry value
*
* @return int
*/
public
function
getImmutableValue
()
{
return
$this
->
immutableValue
;
}
/**
* Set the unchangeable entry value.
*
* Should only be done once.
*
* @param int $immutableValue
*/
public
function
setImmutableValue
(
int
$immutableValue
)
{
$this
->
immutableValue
=
$immutableValue
;
}
/**
* Returns the changeable entry value
*
* @return int
*/
public
function
getMutableValue
()
{
return
$this
->
mutableValue
;
}
/**
* Set the changeable entry value
*
* @param int $mutableValue
*/
public
function
setMutableValue
(
int
$mutableValue
)
{
$this
->
mutableValue
=
$mutableValue
;
}
/**
* Get the entry karma source
*
* @return KarmaSource
*/
public
function
getKarmaSource
()
{
return
$this
->
karmaSource
;
}
/**
* Set the entry karma source
*
* @param KarmaSource $karmaSource
*/
public
function
setKarmaSource
(
KarmaSource
$karmaSource
)
{
$this
->
karmaSource
=
$karmaSource
;
}
/**
* Get the entry campaign that generated this entry, or null if no campaign
*
* @return Campaign
*/
public
function
getCampaign
()
{
return
$this
->
campaign
;
}
/**
* Set the campaign that generated this entry
*
* @param Campaign $campaign
*/
public
function
setCampaign
(
Campaign
$campaign
)
{
$this
->
campaign
=
$campaign
;
}
/**
* Get the user this entry is for
*
* @return FrontendUser
*/
public
function
getUser
()
{
return
$this
->
user
;
}
/**
* Set the user the entry is for
*
* @param FrontendUser $user
*/
public
function
setUser
(
FrontendUser
$user
)
{
$this
->
user
=
$user
;
}
}
html/typo3conf/ext/karma/Classes/Domain/Repository/CampaignRepository.php
0 → 100644
View file @
a67ef8c9
<?php
namespace
T3o\Karma\Domain\Repository
;
/***************************************************************
* Copyright notice
*
* (c) 2018
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class
CampaignRepository
extends
\
TYPO3\CMS\Extbase\Persistence\Repository
{
}
html/typo3conf/ext/karma/Classes/Domain/Repository/KarmaSourceRepository.php
0 → 100644
View file @
a67ef8c9
<?php
namespace
T3o\Karma\Domain\Repository
;
/***************************************************************
* Copyright notice
*
* (c) 2018
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class
KarmaSourceRepository
extends
\
TYPO3\CMS\Extbase\Persistence\Repository
{
}
html/typo3conf/ext/karma/Classes/Domain/Repository/LedgerEntryRepository.php
0 → 100644
View file @
a67ef8c9
<?php
namespace
T3o\Karma\Domain\Repository
;
/***************************************************************
* Copyright notice
*
* (c) 2018
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class
LedgerEntryRepository
extends
\
TYPO3\CMS\Extbase\Persistence\Repository
{
}
html/typo3conf/ext/karma/Configuration/TCA/Overrides/fe_users.php
0 → 100644
View file @
a67ef8c9
<?php
declare
(
strict_types
=
1
);
/*
* Table configuration fe_users
*/
$feUsersColumns
=
[
'tx_karma_immutable_value_cache'
=>
[
'exclude'
=>
0
,
'config'
=>
[
'type'
=>
'passthrough'
,
],
],
'tx_karma_mutable_value_cache'
=>
[
'exclude'
=>
0
,
'config'
=>
[
'type'
=>
'passthrough'
,
],
],
'tx_karma_cache_timestamp'
=>
[
'exclude'
=>
0
,
'config'
=>
[
'type'
=>
'passthrough'
,
],
],
];
$fields
=
'tx_karma_immutable_value_cache,tx_karma_mutable_value_cache,tx_karma_cache_timestamp,'
;
\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
addToAllTCAtypes
(
'fe_users'
,
'tx_karma_immutable_value_cache,tx_karma_mutable_value_cache,tx_karma_cache_timestamp,'
,
''
,
''
);
\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
addTCAcolumns
(
'fe_users'
,
$feUsersColumns
);
html/typo3conf/ext/karma/Configuration/TCA/tx_karma_domain_model_campaign.php
0 → 100644
View file @
a67ef8c9
<?php
defined
(
'TYPO3_MODE'
)
or
die
();
$ll
=
'LLL:EXT:karma/Resources/Private/Language/locallang_db.xlf:'
;
$tx_karma_domain_model_campaign
=
[
'ctrl'
=>
[
'title'
=>
$ll
.
'tx_karma_domain_model_campaign'
,
'label'
=>
'title'
,
'hideAtCopy'
=>
true
,
'tstamp'
=>
'tstamp'
,
'crdate'
=>
'crdate'
,
'default_sortby'
=>
'ORDER BY title'
,
'delete'
=>
'deleted'
,
'enablecolumns'
=>
[
'disabled'
=>
'hidden'
,
'starttime'
=>
'starttime'
,
'endtime'
=>
'endtime'
,
],
'iconfile'
=>
'EXT:karma/Resources/Public/Icons/tx_karma_domain_model_campaign.svg'
,
],
'interface'
=>
[
'showRecordFieldList'
=>
'pid,hidden,title,code'
],
'columns'
=>
[
'hidden'
=>
[
'exclude'
=>
true
,
'label'
=>
'LLL:EXT:lang/locallang_general.xlf:LGL.hidden'
,
'config'
=>
[
'type'
=>
'check'
,
'default'
=>
0
],
],
'pid'
=>
[
'label'
=>
'pid'
,
'config'
=>
[
'type'
=>
'passthrough'
]
],
'crdate'
=>
[
'label'
=>
'crdate'
,
'config'
=>
[
'type'
=>
'passthrough'
,
]
],
'tstamp'
=>
[
'label'
=>
'tstamp'
,
'config'
=>
[
'type'
=>
'passthrough'
,
]
],
'starttime'
=>
[