diff --git a/application/config/third_party.php b/application/config/third_party.php index 7f147eb7015..b245245e71f 100755 --- a/application/config/third_party.php +++ b/application/config/third_party.php @@ -7,8 +7,8 @@ /* Tag if debug is set : debug is set in user config file and this file is directly required in internal.php where $userConfig var arry is set */ /* This allow us to use minified version according to debug */ $debug = isset($userConfig['config']['debug']) ? $userConfig['config']['debug'] : 0; -/* To add more easily min version */ -$minVersion = ($debug<2) ? ".min": ""; +/* To add more easily min version : config > 2 , seems really an core dev issue to fix bootstrap.js ;) */ +$minVersion = ($debug>2) ? "":".min"; /* Please : comment the reason, mantis bug link: ajax don't need any package if i don't make error */ /* Ajax must renderPartial (better : always return json) and never render and don't registerScript (IMHO) / Shnoulle on 2016-11-16 */ if(isset($_GET['isAjax'])){ diff --git a/application/controllers/admin/templates.php b/application/controllers/admin/templates.php index 69dbba63ee7..fe29f9ae176 100644 --- a/application/controllers/admin/templates.php +++ b/application/controllers/admin/templates.php @@ -887,7 +887,8 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma $screens['printanswers'] = gT('Print answers page','unescaped'); $screens['printablesurvey'] = gT('Printable survey page','unescaped'); - // Page display blocks + /* pstpl file list */ + /* used for call AND for pstl editable files list */ $SurveyList = array('startpage.pstpl', 'surveylist.pstpl', 'endpage.pstpl' @@ -1099,16 +1100,18 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma switch ($screenname) { case 'surveylist': - $aSurveyListTexts = array( - "nosid" => gT("You have not provided a survey identification number"), - "contact" => sprintf(gT("Please contact %s ( %s ) for further assistance."), Yii::app()->getConfig("siteadminname"), Yii::app()->getConfig("siteadminemail")), - "listheading" => gT("The following surveys are available:"), - "list" => $this->getController()->renderPartial('/admin/templates/templateeditor_surveylist_view', array(), true), + $aSurveyList = array( + 'publicSurveys' => Survey::model()->active()->open()->public()->with('languagesettings')->findAll(), + 'futureSurveys' => Survey::model()->active()->registration()->public()->with('languagesettings')->findAll(), ); - $aData['surveylist'] = $aSurveyListTexts; - $aData['aReplacements'] = $aGlobalReplacements; + $aReplacementSurveyList = array( + "SURVEYCONTACT" => sprintf(gT("Please contact %s ( %s ) for further assistance."), Yii::app()->getConfig("siteadminname"), Yii::app()->getConfig("siteadminemail")), + "SURVEYLISTHEADING" => gT("The following surveys are available:"), + "SURVEYLIST" => $this->getController()->renderPartial('/admin/templates/templateeditor_surveylist_view', $aSurveyList, true), + ); + //$aData['surveylist'] = $aSurveyListTexts; + $aData['aReplacements'] = array_merge($aGlobalReplacements,$aReplacementSurveyList); $myoutput[] = ""; - //$myoutput[] = templatereplace(file_get_contents("$templatedir/startpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate); $files=$SurveyList; foreach ($files as $qs) { @@ -1221,7 +1224,15 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma $files=$Save; $aData['aReplacements'] = $aGlobalReplacements; $myoutput[] = templatereplace(file_get_contents("$templatedir/startpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate); - $myoutput[] = templatereplace(file_get_contents("$templatedir/save.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate); + $aData['aReplacements']['SAVEHEADING'] = App()->getController()->renderPartial("/survey/frontpage/saveForm/heading",array(),true); + $aData['aReplacements']['SAVEMESSAGE'] = App()->getController()->renderPartial("/survey/frontpage/saveForm/message",array(),true); + $aData['aReplacements']['SAVEALERT'] = App()->getController()->renderPartial("/survey/frontpage/saveForm/anonymized",array(),true); + $aData['aReplacements']['SAVEERROR'] = ""; + $saveForm = CHtml::beginForm(array("/survey/index","sid"=>$surveyid), 'post',array('id'=>'form-save')); + $saveForm .= App()->getController()->renderPartial("/survey/frontpage/saveForm/form",array('captcha'=>false),true); + $saveForm .= CHtml::endForm(); + $aData['aReplacements']['SAVEFORM'] = $saveForm; + $myoutput = array_merge($myoutput, doreplacement($oEditedTemplate->pstplPath . "/save.pstpl", $aData, $oEditedTemplate)); $myoutput[] = templatereplace(file_get_contents("$templatedir/endpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate); $myoutput[] = "\n"; break; @@ -1229,9 +1240,17 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma case 'load': $files=$Load; $aData['aReplacements'] = $aGlobalReplacements; - $myoutput[] = templatereplace(file_get_contents("$templatedir/startpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate); - $myoutput[] = templatereplace(file_get_contents("$templatedir/load.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate); - $myoutput[] = templatereplace(file_get_contents("$templatedir/endpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate); + $myoutput[] = templatereplace(file_get_contents("$templatedir/startpage.pstpl"), array(),$aData['aReplacements'], 'Unspecified', false, NULL, array(), false, $oEditedTemplate); + $aData['aReplacements']['LOADHEADING'] = App()->getController()->renderPartial("/survey/frontpage/loadForm/heading",array(),true); + $aData['aReplacements']['LOADMESSAGE'] = App()->getController()->renderPartial("/survey/frontpage/loadForm/message",array(),true); + $aData['aReplacements']['LOADERROR'] = ""; + $loadForm = CHtml::beginForm(array("/survey/index","sid"=>$surveyid), 'post',array('id'=>'form-load')); + $loadForm .= App()->getController()->renderPartial("/survey/frontpage/loadForm/form",array('captcha'=>false),true); + $loadForm .= CHtml::endForm(); + $aData['aReplacements']['LOADFORM'] = $loadForm; + $myoutput = array_merge($myoutput, doreplacement($oEditedTemplate->pstplPath . "/load.pstpl", $aData, $oEditedTemplate)); + $myoutput[] = templatereplace(file_get_contents("$templatedir/endpage.pstpl"), $aData['aReplacements'], $aData['aReplacements'], 'Unspecified', false, NULL, array(), false, $oEditedTemplate); + $myoutput[] = "\n"; break; diff --git a/application/views/admin/templates/templateeditor_question_answertext_view.php b/application/views/admin/templates/templateeditor_question_answertext_view.php index 7d00feab88f..3f2cd69d377 100644 --- a/application/views/admin/templates/templateeditor_question_answertext_view.php +++ b/application/views/admin/templates/templateeditor_question_answertext_view.php @@ -1,14 +1,15 @@ getController()->renderPartial('/survey/questions/longfreetext/answer', array( +App()->getController()->renderPartial('/survey/questions/answer/longfreetext/answer', array( 'extraclass' => 'col-sm-12', 'coreClass' =>"ls-answers answer-item text-item", 'withColumn' =>true, 'kpclass' => '', 'name' => '1234X56X78', + 'basename' => '1234X56X78', 'drows' => 5, 'dispVal' => gT('Some text in this answer'), 'tiwidth' => 40, 'maxlength' => '', - 'checkconditionFunction' => '', + 'inputsize' => null )); ?> diff --git a/application/views/admin/templates/templateeditor_surveylist_view.php b/application/views/admin/templates/templateeditor_surveylist_view.php index 19821ddcb14..fa43a45f002 100644 --- a/application/views/admin/templates/templateeditor_surveylist_view.php +++ b/application/views/admin/templates/templateeditor_surveylist_view.php @@ -1,65 +1,95 @@ - + $listheading="
+ ".gT("The following surveys are available:")." +
"; + if( $outputSurveys==0) + { + $list=CHtml::openTag('div',array('class'=>'col-xs-12')).gT("No available surveys").CHtml::closeTag('div'); + } + echo $list;