modules/project/models/Project.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Package
Default  

\Project_Model_Project

Package: Project\Models
Project_Model_Project
Author
Evgeniy  

Properties

>VPropertyprivate$_db
Details
Type
n/a
>VPropertyprivate$_projId = 0
Default value0Details
Type
n/a
>VPropertyprivate$_schema
Details
Type
n/a
>VPropertyprivate$sqlPool = array()
Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( $projId = "") : void

Parameters
NameTypeDescription
$projId
methodpubliccalculateAbonentStatuses(integer $userId, boolean $meAndOffline = false) : array

Calculate statuses for all _sf.id. Retun only nathced =, that not be ant action and is OFFLINE

Parameters
NameTypeDescription
$userIdinteger
$meAndOfflineboolean
Returns
TypeDescription
array
methodpubliccheckIfStatusUsed(integer $statusId) : integer

Check if project status in use

Parameters
NameTypeDescription
$statusIdinteger

[description]

Returns
TypeDescription
integer
methodpubliccreateTable_tmpALLSTATUSES( $userId, boolean $viaPool = false) : string

Create table with statuses each phone that was not uesed. For used phones atatuses already exists

Parameters
NameTypeDescription
$userId
$viaPoolboolean
Returns
TypeDescription
string
methodpubliccreateTable_tmpAbonentCustomStatuses( $userId) : string

Cerate table where for each abonent set satus for stopping. We get all phones where last status is custom Then fot each abobnet look wich get by hierarhy and set as abonent status. Abonent without any call - skipped aboentns with owerquota set OWERQUOTA, if finished SUCCESFULL. with auto status not counted

Parameters
NameTypeDescription
$userId
Returns
TypeDescription
string
methodpubliccreateTable_tmpAbonentHierarhy( $userId, boolean $viaPool = false) : string

Сreate table with status for each abonent by hierarhy

Parameters
NameTypeDescription
$userId
$viaPoolboolean
Returns
TypeDescription
string
methodpubliccreateTable_tmpAbonentStatusesWithC( $userId) : string

Cerate table where for each abonent set satus for stopping. We get all phones where last status is custom Then fot each abobnet look wich get by hierarhy and set as abonent status. Abonent without any call - skipped aboentns with owerquota set OWERQUOTA, if finished SUCCESFULL. with auto status not counted

Parameters
NameTypeDescription
$userId
Returns
TypeDescription
string
methodpubliccreateTable_tmpMAXX( $userId, boolean $viaPool = false) : string

Create table id, l_id stat store each row st status for each phone. If no phone then NULL

Parameters
NameTypeDescription
$userId
$viaPoolboolean
Returns
TypeDescription
stringdatabase.tablename
methodpubliccreateTable_tmpStatusesIDs( $userId) : string

Create table from all statuses and replce types by ids from log.

we get all statuses for brijects custm and auto. custom > 100

Parameters
NameTypeDescription
$userId
Returns
TypeDescription
string
methodpublicdecrease_data(array $params) : void

Decrease projects data

Parameters
NameTypeDescription
$paramsarray
methodpublicencrease_data(array $params) : void

Increase projects data

Parameters
NameTypeDescription
$paramsarray
methodpublicexport_respondents( $proj_id,  $filename,  $lang) : void

Export erespondents fom sample file

Parameters
NameTypeDescription
$proj_id
$filename
$lang
Throws
ExceptionDescription
\Exception
methodpublicgetCVarsWithValues(integer $projId) : array

Get all c variables and values for project

Parameters
NameTypeDescription
$projIdinteger
Returns
TypeDescription
array
methodpublicgetNAAnswered() : array

Returned array with 2 child arrays 'user' and 'question'. List of all questions/users set NA for questions in survey

Returns
TypeDescription
array
methodpublicgetPhoneIdByNumber(string $normalizedPhoneNumber) : integer

Get phone id of respondent by phone number

Parameters
NameTypeDescription
$normalizedPhoneNumberstring
Returns
TypeDescription
integer
methodpublicgetQuestionnaireID() : object

Get current project questionnnaire id

Returns
TypeDescription
object
methodpublicgetRespondentAnswersByIds(integer $proj_id, array $respondent_ids = array()) : \array[respondent_id][quest_num]=row

Get aswers from respondents by ids

Parameters
NameTypeDescription
$proj_idinteger
$respondent_idsarray
Returns
TypeDescription
\array[respondent_id][quest_num]=row
methodpublicgetRespondentInfo(integer $sf_id, boolean $showAll = false) : \srray

Get info about project repondent

Parameters
NameTypeDescription
$sf_idinteger
$showAllboolean
Returns
TypeDescription
\srray
methodpublicgetRespondentNames() : \array_pairs

Return pairs sf_id => name for project_XXX_sf and field types

Returns
TypeDescription
\array_pairs
methodpublicgetRespondentsCount(string $projId = "") : integer | string

Return count of started surveys

Parameters
NameTypeDescription
$projIdstring
Returns
TypeDescription
integer | string
methodpublicgetRespondentsCountByQuestions(string $freqType = "all") : array

Return pairs array[question_id]=count of users who answered this question

Parameters
NameTypeDescription
$freqTypestring

[all|success]

Returns
TypeDescription
array
methodpublicgetRespondentsEmails() : \array_pairs

Return pairs sf_id => email for project_XXX_sf and field types

Returns
TypeDescription
\array_pairs
methodpublicgetRespondentsListForExportStatuses(string $projectId = "", integer $exportType = 1, integer $projectType = \Project::PROJECT_TYPE_CATI) : array

Returned array of Respondents with all information (phones/email depends on project type, name, address, C, F, S)

Parameters
NameTypeDescription
$projectIdstring
$exportTypeinteger
$projectTypeinteger
Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Exception
methodpublicgetShowSurveyVars(array $showUI, array $sf_row) : array

Get c variables values for durvey

Parameters
NameTypeDescription
$showUIarray
$sf_rowarray
Returns
TypeDescription
array
methodpublicgetSimplFileCount(string $projId = "") : integer

Get count rows in simple file

Parameters
NameTypeDescription
$projIdstring
Returns
TypeDescription
integer
methodpublicgetSuccessSurveyCount() : integer | string

Return count of success completed survey in project

Returns
TypeDescription
integer | string
methodpublicprepareEdit() : array

Prepare project date before show edit page

Returns
TypeDescription
array
methodpublicsaveQuotaNews( $senderId,  $quotaType,  $quotaCode,  $quotaStatus) : integer | string

Save table quata actions (proj_XXX_news) changing quotas for project

Parameters
NameTypeDescription
$senderId
$quotaType
$quotaCode
$quotaStatus
Returns
TypeDescription
integer | string
Documentation was generated by phpDocumentor 2.8.5.