Tokens
extends SurveyCommonAction
in package
Tokens Controller
This controller performs token actions
Tags
Table of Contents
Methods
- __construct() : mixed
- addDummies() : void
- Add dummy tokens form
- addnew() : void
- Add new token form, also adding new participant.
- bounceprocessing() : void
- tokens::bounceprocessing()
- bouncesettings() : void
- Bounce Settings Action.
- browse() : void
- Browse Tokens
- delete() : void
- Delete tokens
- deleteMultiple() : bool
- deleteToken() : bool
- Deletes a participant from survey.
- deletetokenattributes() : void
- Delete token attributes
- edit() : false|null
- Edit Tokens
- editMultiple() : mixed
- The fields with a value "lskeep" will not be updated
- email() : void
- Handle email action
- exportdialog() : void
- Export Dialog
- handletokenform() : void
- Handle token form for addnew/edit actions
- import() : void
- import from csv
- importldap() : void
- Performs a ldap import
- index() : void
- index() : void
- Show token index page, handle token database
- kill() : void
- Remove Token Database
- managetokenattributes() : void
- Handle managetokenattributes action
- prepExportToCPDB() : mixed
- questionbar() : mixed
- Shows admin menu for question
- renderInternal() : mixed
- run() : mixed
- Action classes require them to have a run method. We reroute it to index if called.
- runWithParams() : bool
- Override runWithParams() implementation in CAction to help us parse requests with subactions.
- surveybar() : mixed
- Shows admin menu for surveys
- tokenify() : void
- Generate tokens
- updateEncryption() : mixed
- Updates Token encryption settings based on $iSurveyId and configuration $aEncryptionSettings
- updatetokenattributedescriptions() : void
- updatetokenattributedescriptions action
- updatetokenattributes() : void
- Update token attributes
- beforeSideMenuRender() : string
- Returns content from event beforeSideMenuRender
- clearEmailSessionCache() : void
- Reminders that are send are stored in session, so that they are not send twice by accident in case of an unpredicted page reload.
- dispatchBeforeTokenImport() : array<string|int, mixed>
- Dispatches the beforeTokenImport event
- fetchExtraMenus() : array<string|int, ExtraMenu>
- Get extra menus from plugins that are using event beforeAdminMenuRender
- filterImportedResources() : array<string|int, mixed>
- getEmailCacheName() : string
- getSQLemailstatuscondition() : string
- getSQLremindercountcondition() : string
- getSQLreminderdelaycondition() : string
- getSubAction() : string
- getTokenIds() : array<string|int, mixed>
- listquestiongroups() : mixed
- REFACTORED in LayoutHelper
- listquestions() : mixed
- REFACTORED in LayoutHelper
- notifications() : mixed
- Display notifications
- nsurveysummary() : mixed
- REFACTORED in LayoutHelper
- organizequestionbar() : mixed
- Render the save/cancel bar for Organize question groups/questions
- renderCentralContents() : string
- Rendering the subviews and views of renderWrappedTemplate
- renderJSON() : void
- Method to render an array as a json document
- renderQuickmenu() : string
- Render the quick-menu that is shown when side-menu is hidden.
- renderWrappedTemplate() : void
- Renders template(s) wrapped in header and footer
- requirePostRequest() : mixed
- Validates that the request method is POST.
- route() : mixed
- Routes the action into correct subaction
- showadminmenu() : string
- showadminmenu() function returns html text for the administration button bar
- showHeaders() : mixed
- Header
- showInviteOrReminderEmailForm() : void
- This method echos HTML and ends.
- surveysidemenu() : mixed
- Show side menu for survey view
- titlebar() : mixed
- REFACTORED in LayoutHelper.php
- tokenIsSetInEmailCache() : mixed
- Returns true if this $token is set in cache for $iSurveyId.
- updatenotification() : mixed
- Display the update notification
- addPseudoParams() : array<string|int, mixed>
- Some functions have different parameters, which are just an alias of the usual parameters we're getting in the url. This function just populates those variables so that we don't end up in an error.
- newtokentable() : void
- Show dialogs and create a new tokens table
Methods
__construct()
public
__construct([mixed $controller = null ][, mixed $id = null ]) : mixed
Parameters
- $controller : mixed = null
- $id : mixed = null
addDummies()
Add dummy tokens form
public
addDummies(int $iSurveyId[, string $subaction = '' ]) : void
Parameters
- $iSurveyId : int
- $subaction : string = ''
Tags
addnew()
Add new token form, also adding new participant.
public
addnew(int $iSurveyId) : void
Parameters
- $iSurveyId : int
Tags
bounceprocessing()
tokens::bounceprocessing()
public
bounceprocessing(int $iSurveyId) : void
Parameters
- $iSurveyId : int
bouncesettings()
Bounce Settings Action.
public
bouncesettings(int $iSurveyId) : void
Parameters
- $iSurveyId : int
browse()
Browse Tokens
public
browse(int $iSurveyId[, int $limit = 50 ][, int $start = 0 ]) : void
Parameters
- $iSurveyId : int
- $limit : int = 50
- $start : int = 0
delete()
Delete tokens
public
delete(int $iSurveyID) : void
Parameters
- $iSurveyID : int
deleteMultiple()
public
deleteMultiple() : bool
Return values
booldeleteToken()
Deletes a participant from survey.
public
deleteToken() : bool
The parameter 'sItem' can either be an array of ids or just a single id (int)
Tags
Return values
booldeletetokenattributes()
Delete token attributes
public
deletetokenattributes(int $iSurveyId) : void
Parameters
- $iSurveyId : int
edit()
Edit Tokens
public
edit(int $iSurveyId, int $iTokenId[, null $deprecated = null ]) : false|null
Parameters
- $iSurveyId : int
- $iTokenId : int
- $deprecated : null = null
-
in 6.5.5, used before to show partial view, move to Yii::app()->request->getIsAjaxRequest()
Return values
false|nulleditMultiple()
The fields with a value "lskeep" will not be updated
public
editMultiple() : mixed
email()
Handle email action
public
email(int $iSurveyId) : void
Parameters
- $iSurveyId : int
exportdialog()
Export Dialog
public
exportdialog(int $iSurveyId) : void
Parameters
- $iSurveyId : int
handletokenform()
Handle token form for addnew/edit actions
public
handletokenform(int $iSurveyId, string $subaction[, int $iTokenId = "" ][, null $deprecated = null ]) : void
Parameters
- $iSurveyId : int
- $subaction : string
- $iTokenId : int = ""
- $deprecated : null = null
-
in 6.5.5, used before to show partial view, move to Yii::app()->request->getIsAjaxRequest()
import()
import from csv
public
import(int $iSurveyId) : void
Parameters
- $iSurveyId : int
importldap()
Performs a ldap import
public
importldap(int $iSurveyId) : void
Parameters
- $iSurveyId : int
index()
public
index() : void
index()
Show token index page, handle token database
public
index(int $surveyid[, mixed $limit = 50 ][, mixed $start = 0 ]) : void
Parameters
- $surveyid : int
-
The survey ID
- $limit : mixed = 50
- $start : mixed = 0
kill()
Remove Token Database
public
kill(int $iSurveyId) : void
Parameters
- $iSurveyId : int
managetokenattributes()
Handle managetokenattributes action
public
managetokenattributes(int $iSurveyId) : void
Parameters
- $iSurveyId : int
prepExportToCPDB()
public
prepExportToCPDB() : mixed
questionbar()
Shows admin menu for question
public
questionbar(array<string|int, mixed> $aData) : mixed
Parameters
- $aData : array<string|int, mixed>
Tags
renderInternal()
public
renderInternal(string $_viewFile_[, mixed $_data_ = null ][, mixed $_return_ = false ]) : mixed
Parameters
- $_viewFile_ : string
- $_data_ : mixed = null
- $_return_ : mixed = false
Tags
run()
Action classes require them to have a run method. We reroute it to index if called.
public
run() : mixed
runWithParams()
Override runWithParams() implementation in CAction to help us parse requests with subactions.
public
runWithParams(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
-
URL Parameters
Return values
boolsurveybar()
Shows admin menu for surveys
public
surveybar(array<string|int, mixed> $aData) : mixed
Parameters
- $aData : array<string|int, mixed>
Tags
tokenify()
Generate tokens
public
tokenify(int $iSurveyId) : void
Parameters
- $iSurveyId : int
updateEncryption()
Updates Token encryption settings based on $iSurveyId and configuration $aEncryptionSettings
public
updateEncryption(string|int $iSurveyId, array<string|int, mixed> $aEncryptionSettings) : mixed
Parameters
- $iSurveyId : string|int
- $aEncryptionSettings : array<string|int, mixed>
-
The new attribute encryption status
updatetokenattributedescriptions()
updatetokenattributedescriptions action
public
updatetokenattributedescriptions(int $iSurveyId) : void
Parameters
- $iSurveyId : int
updatetokenattributes()
Update token attributes
public
updatetokenattributes(int $iSurveyId) : void
Parameters
- $iSurveyId : int
beforeSideMenuRender()
Returns content from event beforeSideMenuRender
protected
beforeSideMenuRender(array<string|int, mixed> $aData) : string
REFACTORED in LayoutHelper
Parameters
- $aData : array<string|int, mixed>
Return values
stringclearEmailSessionCache()
Reminders that are send are stored in session, so that they are not send twice by accident in case of an unpredicted page reload.
protected
clearEmailSessionCache(int $iSurveyId) : void
Parameters
- $iSurveyId : int
dispatchBeforeTokenImport()
Dispatches the beforeTokenImport event
protected
dispatchBeforeTokenImport(mixed $iSurveyId, mixed $aToken, mixed $iRecordCount, mixed $aOptions) : array<string|int, mixed>
Parameters
- $iSurveyId : mixed
- $aToken : mixed
- $iRecordCount : mixed
- $aOptions : mixed
Return values
array<string|int, mixed>fetchExtraMenus()
Get extra menus from plugins that are using event beforeAdminMenuRender
protected
fetchExtraMenus(array<string|int, mixed> $aData) : array<string|int, ExtraMenu>
Parameters
- $aData : array<string|int, mixed>
Return values
array<string|int, ExtraMenu>filterImportedResources()
protected
filterImportedResources(string $extractdir, string $destdir) : array<string|int, mixed>
Parameters
- $extractdir : string
- $destdir : string
Tags
Return values
array<string|int, mixed>getEmailCacheName()
protected
getEmailCacheName(int $iSurveyId) : string
Parameters
- $iSurveyId : int
Return values
string —Cache name, like survey_1234_email_cache
getSQLemailstatuscondition()
protected
getSQLemailstatuscondition() : string
Return values
string —SQL condition
getSQLremindercountcondition()
protected
getSQLremindercountcondition() : string
Return values
string —SQL condition
getSQLreminderdelaycondition()
protected
getSQLreminderdelaycondition(bool $bEmail) : string
Parameters
- $bEmail : bool
Return values
string —SQL condition
getSubAction()
protected
getSubAction() : string
Return values
stringgetTokenIds()
protected
getTokenIds() : array<string|int, mixed>
Return values
array<string|int, mixed>listquestiongroups()
REFACTORED in LayoutHelper
protected
listquestiongroups(array<string|int, mixed> $aData) : mixed
listquestion groups
Parameters
- $aData : array<string|int, mixed>
listquestions()
REFACTORED in LayoutHelper
protected
listquestions( $aData) : mixed
Parameters
Tags
notifications()
Display notifications
protected
notifications() : mixed
- REFACTORED (in LayoutHelper.php)
nsurveysummary()
REFACTORED in LayoutHelper
protected
nsurveysummary(array<string|int, mixed> $aData) : mixed
Survey summary
Parameters
- $aData : array<string|int, mixed>
organizequestionbar()
Render the save/cancel bar for Organize question groups/questions
protected
organizequestionbar(array<string|int, mixed> $aData) : mixed
REFACTORED in LayoutHelper
Parameters
- $aData : array<string|int, mixed>
Tags
renderCentralContents()
Rendering the subviews and views of renderWrappedTemplate
protected
renderCentralContents(string $sAction, array<string|int, mixed>|string $aViewUrls[, array<string|int, mixed> $aData = [] ]) : string
Parameters
- $sAction : string
- $aViewUrls : array<string|int, mixed>|string
- $aData : array<string|int, mixed> = []
Return values
stringrenderJSON()
Method to render an array as a json document
protected
renderJSON(array<string|int, mixed> $aData[, mixed $success = true ]) : void
REFACTORED in LSBaseController (this one called by a lot of actions in different controllers)
Parameters
- $aData : array<string|int, mixed>
- $success : mixed = true
renderQuickmenu()
Render the quick-menu that is shown when side-menu is hidden.
protected
renderQuickmenu(array<string|int, mixed> $aData) : string
REFACTORED in LayoutHelper
Only show home-icon for now.
Add support for plugin to attach icon elements using event afterQuickMenuLoad
Parameters
- $aData : array<string|int, mixed>
Tags
Return values
stringrenderWrappedTemplate()
Renders template(s) wrapped in header and footer
protected
renderWrappedTemplate([string $sAction = 'token' ][, string|array<string|int, mixed> $aViewUrls = array() ][, array<string|int, mixed> $aData = array() ][, bool $sRenderFile = false ]) : void
Parameters
- $sAction : string = 'token'
-
Current action, the folder to fetch views from
- $aViewUrls : string|array<string|int, mixed> = array()
-
View url(s)
- $aData : array<string|int, mixed> = array()
-
Data to be passed on. Optional.
- $sRenderFile : bool = false
Tags
requirePostRequest()
Validates that the request method is POST.
protected
requirePostRequest() : mixed
This is intended to be used on subactions. When possible (eg. when refactoring a SurveyCommonAction into an actual controller), use 'postOnly' filter instead.
Tags
route()
Routes the action into correct subaction
protected
route(string $sa, array<string|int, string> $get_vars) : mixed
Parameters
- $sa : string
- $get_vars : array<string|int, string>
Tags
showadminmenu()
showadminmenu() function returns html text for the administration button bar
protected
showadminmenu( $aData) : string
REFACTORED (in LayoutHelper.php)
Parameters
Tags
Return values
stringshowHeaders()
Header
protected
showHeaders(array<string|int, mixed> $aData[, mixed $sendHTTPHeader = true ]) : mixed
- REFACTORED (in LayoutHelper.php)
Parameters
- $aData : array<string|int, mixed>
- $sendHTTPHeader : mixed = true
showInviteOrReminderEmailForm()
This method echos HTML and ends.
protected
showInviteOrReminderEmailForm(int $iSurveyId, array<string|int, mixed> $aSurveyLangs, array<string|int, mixed> $aData) : void
Parameters
- $iSurveyId : int
- $aSurveyLangs : array<string|int, mixed>
- $aData : array<string|int, mixed>
surveysidemenu()
Show side menu for survey view
protected
surveysidemenu(array<string|int, mixed> $aData) : mixed
REFACTORED in LayoutHelper.php
Parameters
- $aData : array<string|int, mixed>
-
all the needed data
titlebar()
REFACTORED in LayoutHelper.php
protected
titlebar( $aData) : mixed
Parameters
Tags
tokenIsSetInEmailCache()
Returns true if this $token is set in cache for $iSurveyId.
protected
tokenIsSetInEmailCache(int $iSurveyId, mixed $tid, bool $bIsInvitation) : mixed
Being set means the email has already been send.
Parameters
- $iSurveyId : int
- $tid : mixed
- $bIsInvitation : bool
-
$return boolean
updatenotification()
Display the update notification
protected
updatenotification() : mixed
REFACTORED (in LayoutHelper.php)
Tags
addPseudoParams()
Some functions have different parameters, which are just an alias of the usual parameters we're getting in the url. This function just populates those variables so that we don't end up in an error.
private
addPseudoParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Parameters to parse and populate
Tags
Return values
array<string|int, mixed> —Populated parameters
newtokentable()
Show dialogs and create a new tokens table
private
newtokentable(int $iSurveyId) : void
Parameters
- $iSurveyId : int