6 Commits

Author SHA1 Message Date
petermarynczak
7d1cc5384e Merge pull request #7 from wiosna-dev/feature/WZUW-1498-Lime_misinterpretation_of_time
[WZUW-1498] [prod] Using 24-hour format to set validfrom date_time
2025-09-12 12:57:49 +02:00
petermarynczak
e74f2e1a51 Merge pull request #8 from wiosna-dev/feature/WZUW-1267-Lime_surveys
[WZUW-1267] [master] Update version of wiosna-dev/common-library
2025-09-12 12:54:26 +02:00
Piotr Marynczak
4f7a72dc0b [WZUW-1498] feat: Using 24-hour format to set validfrom date_time 2025-09-11 13:42:26 +02:00
Piotr Marynczak
13886da84d [WZUW-1267] package: Update version of wiosna-dev/common-library 2025-05-20 16:33:06 +02:00
petermarynczak
7c1ee7dfb8 Merge pull request #6 from wiosna-dev/feature/WZUW-781-from-tag-0.1.3
[WZUW-781] chore: added validfrom key upon creating a participant
2024-07-03 14:44:10 +02:00
Piotr Marynczak
59ebe2d236 [WZUW-781] chore: added validfrom key upon creating a participant 2024-07-03 12:59:09 +02:00
4 changed files with 4 additions and 57 deletions

View File

@@ -12,7 +12,7 @@
"require": { "require": {
"php": ">=5.6", "php": ">=5.6",
"fguillot/json-rpc": "^1.2", "fguillot/json-rpc": "^1.2",
"wiosna-dev/common-library": "^0.1.9" "wiosna-dev/common-library": "^0.2.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2.6", "friendsofphp/php-cs-fixer": "^2.6",

View File

@@ -57,14 +57,9 @@ class Result
* class constants. * class constants.
* @param array $rawData Raw data returned by the LimeSurvey's API * @param array $rawData Raw data returned by the LimeSurvey's API
*/ */
public function __construct($method, $rawData) public function __construct($method, array $rawData)
{ {
$this->method = MethodType::getValidatedMethod($method); $this->method = MethodType::getValidatedMethod($method);
if (true === is_string($rawData)) {
$rawData = base64_decode($rawData);
$rawData = json_decode($rawData, true);
}
$this->setRawDataAndStatus($rawData); $this->setRawDataAndStatus($rawData);
} }

View File

@@ -23,6 +23,7 @@ use Meritoo\LimeSurvey\ApiClient\Result\Item\Survey;
use Meritoo\LimeSurvey\ApiClient\Result\Item\SurveySummary; use Meritoo\LimeSurvey\ApiClient\Result\Item\SurveySummary;
use Meritoo\LimeSurvey\ApiClient\Type\MethodType; use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
use Meritoo\LimeSurvey\ApiClient\Type\ReasonType; use Meritoo\LimeSurvey\ApiClient\Type\ReasonType;
use Meritoo\Common\Utilities\Date;
/** /**
* Service that serves surveys and participants of surveys * Service that serves surveys and participants of surveys
@@ -301,6 +302,7 @@ class SurveyService
'firstname' => $firstName, 'firstname' => $firstName,
'lastname' => $lastName, 'lastname' => $lastName,
'email' => $email, 'email' => $email,
'validfrom' => date('Y-m-d H:i:s'),
], ],
]; ];
@@ -458,45 +460,4 @@ class SurveyService
return false; return false;
} }
public function getResponseIds($surveyId, $token)
{
$arguments = [
$surveyId,
$token,
];
return $this
->client
->run('get_response_ids', $arguments)
->getData(true);
}
public function exportResponsesByToken($surveyId, $token)
{
$arguments = [
$surveyId,
'json',
$token,
];
return $this
->client
->run('export_responses_by_token', $arguments)
->getData(true);
}
public function exportUploadedFilesByToken($surveyId, $token)
{
$arguments = [
$surveyId,
'json',
$token,
];
return $this
->client
->run('get_uploaded_files', $arguments)
->getData(true);
}
} }

View File

@@ -93,12 +93,6 @@ class MethodType extends BaseType
*/ */
const LIST_USERS = 'list_users'; const LIST_USERS = 'list_users';
const EXPORT_RESPONSES_BY_TOKEN = 'export_responses_by_token';
const GET_RESPONSE_IDS = 'get_response_ids';
const EXPORT_UPLOADED_FILES_BY_TOKEN = 'get_uploaded_files';
/** /**
* Returns validated name of method to call or throws an exception (if method is incorrect) * Returns validated name of method to call or throws an exception (if method is incorrect)
* *
@@ -132,9 +126,6 @@ class MethodType extends BaseType
static::LIST_QUESTIONS, static::LIST_QUESTIONS,
static::LIST_SURVEYS, static::LIST_SURVEYS,
static::LIST_USERS, static::LIST_USERS,
static::EXPORT_RESPONSES_BY_TOKEN,
static::GET_RESPONSE_IDS,
static::EXPORT_UPLOADED_FILES_BY_TOKEN
]); ]);
} }
} }