当前位置: 首页>>代码示例>>PHP>>正文


PHP Survey::setDefaultSurvey方法代码示例

本文整理汇总了PHP中Survey::setDefaultSurvey方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::setDefaultSurvey方法的具体用法?PHP Survey::setDefaultSurvey怎么用?PHP Survey::setDefaultSurvey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Survey的用法示例。


在下文中一共展示了Survey::setDefaultSurvey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: convertSurveys

         }
     }
     /* convert */
     $this->convertSurveys();
     // return result
     return "";
 }
 function convertSurveys()
 {
     $query = "select * from " . $this->sourcetable . "_surveys order by syid";
     if (!($res = $this->importdb->selectQuery($query))) {
         $query = "select * from " . $this->sourcetable . "_survey order by syid";
         $res = $this->importdb->selectQuery($query);
     }
     if ($res) {
         if ($this->importdb->getNumberOfRows($res) > 0) {
             $user = new User($_SESSION['URID']);
             while ($row = $this->importdb->getRow($res)) {
                 $this->suid = $row["syid"] + $this->addtosuid;
                 $this->syid = $row["syid"];
                 $this->convertSurveySettings($row);
                 // get languages
                 $survey = new Survey($this->suid);
                 $this->languages = explode("~", $survey->getAllowedLanguages(MODE_CASI));
                 $this->convertSections();
                 $this->convertVariables();
                 $this->convertTemplates();
                 $this->convertTypes();
                 $this->convertRouting();
                 // if first survey in project, then set as default survey
                 $surveys = new Surveys();
                 $surveys = $surveys->getSurveys();
                 if (sizeof($surveys) == 1) {
                     $survey->setDefaultSurvey(DEFAULT_SURVEY_YES);
                 }
                 // update allowed modes
                 $survey->setAllowedModes(MODE_CASI);
                 // update allowed languages
                 $survey->setAllowedLanguages(implode("~", $this->languages));
                 // update access of user doing the import
                 $mods = explode("~", $survey->getAllowedModes());
                 foreach ($mods as $m) {
开发者ID:nubissurveying,项目名称:nubis,代码行数:42,代码来源:importer.php

示例2: showEditSurveyRes


//.........这里部分代码省略.........
             $var->setShowBackButton(BUTTON_NO);
             $var->setShowNextButton(BUTTON_YES);
             $var->setShowRFButton(BUTTON_NO);
             $var->setShowDKButton(BUTTON_NO);
             $var->setShowNAButton(BUTTON_NO);
             $var->setShowUpdateButton(BUTTON_NO);
             $var->setShowRemarkButton(BUTTON_NO);
             $var->setShowProgressBar(PROGRESSBAR_NO);
             $var->setHidden(HIDDEN_YES);
             $var->setTyd(-1);
             $var->setPosition(15);
             $var->save();
             $var = new VariableDescriptive();
             $var->setVsid(16);
             $var->setName(VARIABLE_CLOSED);
             $var->setAnswerType(ANSWER_TYPE_NONE);
             $var->setSeid(1);
             $var->setSuid($newsuid);
             $var->setDescription('CLOSED SCREEN');
             $var->setQuestion(Language::messageSurveyClosed());
             $var->setShowBackButton(BUTTON_NO);
             $var->setShowNextButton(BUTTON_NO);
             $var->setShowRFButton(BUTTON_NO);
             $var->setShowDKButton(BUTTON_NO);
             $var->setShowNAButton(BUTTON_NO);
             $var->setShowUpdateButton(BUTTON_NO);
             $var->setShowRemarkButton(BUTTON_NO);
             $var->setShowProgressBar(PROGRESSBAR_NO);
             $var->setHidden(HIDDEN_YES);
             $var->setTyd(-1);
             $var->setPosition(16);
             $var->save();
             $var = new VariableDescriptive();
             $var->setVsid(17);
             $var->setName(VARIABLE_EXECUTION_MODE);
             $var->setAnswerType(ANSWER_TYPE_ENUMERATED);
             $var->setSeid(1);
             $var->setSuid($newsuid);
             $var->setDescription('EXECUTION MODE');
             $var->setQuestion("execution mode");
             $var->setOptionsText("0 (NORMAL) Normal mode\r\n1 (TEST) Test mode");
             $var->setShowBackButton(BUTTON_NO);
             $var->setShowNextButton(BUTTON_NO);
             $var->setShowRFButton(BUTTON_NO);
             $var->setShowDKButton(BUTTON_NO);
             $var->setShowNAButton(BUTTON_NO);
             $var->setShowUpdateButton(BUTTON_NO);
             $var->setShowProgressBar(PROGRESSBAR_NO);
             $var->setHidden(HIDDEN_YES);
             $var->setTyd(-1);
             $var->setPosition(17);
             $var->save();
             /* update current user for access */
             $surv = new Survey($newsuid);
             $user = new User($_SESSION['URID']);
             $mods = explode("~", $surv->getAllowedModes());
             foreach ($mods as $m) {
                 $user->setLanguages($newsuid, $m, $surv->getAllowedLanguages($m));
             }
             $user->saveChanges();
             $content = $displaySysAdmin->displaySuccess(Language::messageSurveyAdded(loadvar('name')));
         }
     }
     //ADD ALL SORTS OF CHECKS!!
     if ($suid != '' || loadvar('name') != "") {
         $survey->setName(loadvar('name'));
         $survey->setDescription(loadvar(SETTING_DESCRIPTION));
         $survey->setTitle(loadvar(SETTING_TITLE));
         $survey->setDefaultSurvey(loadvar(SETTING_DEFAULT_SURVEY));
         $survey->save();
         // default, then update setting and set all others to no
         $surveys = new Surveys();
         $surveys = $surveys->getSurveys();
         if (loadvar(SETTING_DEFAULT_SURVEY) == DEFAULT_SURVEY_YES) {
             if (sizeof($surveys) == 1) {
                 $survey->setDefaultSurvey(DEFAULT_SURVEY_YES);
             } else {
                 foreach ($surveys as $s) {
                     if ($s->getSuid() != $survey->getSuid()) {
                         $s->setDefaultSurvey(DEFAULT_SURVEY_NO);
                     } else {
                         $s->setDefaultSurvey(DEFAULT_SURVEY_YES);
                     }
                 }
             }
         } else {
             // if only one survey, make sure we set this one to default
             if (sizeof($surveys) == 1) {
                 $survey->setDefaultSurvey(DEFAULT_SURVEY_YES);
             }
         }
     }
     /* update last page */
     $_SESSION['LASTPAGE'] = substr($_SESSION['LASTPAGE'], 0, strripos($_SESSION['LASTPAGE'], "res"));
     if ($suid != '') {
         return $displaySysAdmin->showEditSurvey($_SESSION['SUID'], $content);
     } else {
         return $displaySysAdmin->showSurveys($content);
     }
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:101,代码来源:sysadmin.php


注:本文中的Survey::setDefaultSurvey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。