- Posts: 4
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
// $iBaseSurvey is id of the original survey // $oBaseSurveyLanguage is SurveyLanguageSettings for this survey and default language /* Copy the survey */ $aExcludes = array(); $sNewSurveyName = str_replace("[BASE] ","",$oBaseSurveyLanguage->surveyls_title)." - ".date("c"); $aExcludes['dates'] = true; $btranslinksfields=true; Yii::app()->loadHelper('export'); $copysurveydata = surveyGetXMLData($iBaseSurvey, $aExcludes); if($copysurveydata) { Yii::app()->loadHelper('admin/import'); $aImportResults = XMLImportSurvey('', $copysurveydata, $sNewSurveyName,NULL,$btranslinksfields); } if(!empty($aImportResults['newsid'])) { // And here i update SurveyLanguageSettings and some question too }
public function afterPluginLoad() { $oController = Yii::app()->getController(); if ($oController && $oController->getId() == "admin") { $requestUrl = $this->api->createUrl('plugins/direct', array('plugin' => get_class($this), 'function' => 'createSurvey', 'arg1' => 'value1')); // https://localhost/limesurvey/index.php/plugins/direct?plugin=TLAuth&function=createSurvey&arg1=value1 } }