コード例 #1
0
ファイル: sysadmin.php プロジェクト: nubissurveying/nubis
 function showCopyTypeRes()
 {
     /* update last page */
     $_SESSION['LASTPAGE'] = 'sysadmin.survey.type';
     $tyd = getFromSessionParams('tyd');
     $displaySysAdmin = new DisplaySysAdmin();
     $survey = new Survey($_SESSION['SUID']);
     $type = $survey->getType($tyd);
     if ($tyd != '') {
         $suid = "";
         if (loadvar("suid") != "") {
             $suid = loadvar("suid");
         }
         $type->copy($suid, loadvar("includesuffix"));
         $_SESSION['TYD'] = $type->getTyd();
         /* same survey */
         if ($suid == "" || $suid == $_SESSION['SUID']) {
             $compiler = new Compiler($_SESSION['SUID'], getSurveyVersion($survey));
             $mess = $compiler->generateTypes(array($type));
         } else {
             $_SESSION['SUID'] = $suid;
             $survey = new Survey($_SESSION['SUID']);
             $compiler = new Compiler($_SESSION['SUID'], getSurveyVersion($survey));
             $vars = $survey->getVariableDescriptivesOfType($tyd);
             $mess = $compiler->generateVariableDescriptives($vars);
             $mess = $compiler->generateGetFills($vars);
             $mess = $compiler->generateInlineFields($vars);
         }
         $content = $displaySysAdmin->displaySuccess(Language::messageTypeCopied($type->getName()));
         return $displaySysAdmin->showEditType($type->getTyd(), $content);
     } else {
         $content = $displaySysAdmin->displayError(Language::messageTypeNotCopied($type->getName()));
         return $displaySysAdmin->showSurvey($content);
     }
 }