Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: Refactor the 'dataentry' admin controller in the LimeSurvey Yii …
…port (GCI2011 by Ivan Penchev) git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11690 b72ed6b6-b9f8-46b5-92b4-906544132732
- Loading branch information
Pieter Jan Speelmans
committed
Dec 19, 2011
1 parent
8924e8a
commit 475c605
Showing
14 changed files
with
1,066 additions
and
1,550 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class='header ui-widget-header'><?php echo $clang->gT("Data entry"); ?></div> | ||
<div class='messagebox ui-corner-all'> | ||
<div class='successheader'><?php echo $clang->gT("Record Deleted"); ?> (ID: <?php echo $id; ?>)</div> | ||
<br /><br /> | ||
<input type='submit' value='<?php echo $clang->gT("Browse responses"); ?>' onclick="window.open('<?php echo $this->createUrl('/').'/admin/browse/surveyid/'.$surveyid.'/all'; ?>, '_top')" /> | ||
<br /><br /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php include('includes/editdata/'.$part.'.php'); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class='header ui-widget-header'> | ||
<?php echo $clang->gT("Import responses from a deactivated survey table"); ?> | ||
</div> | ||
<form id='importresponses' class='form30' method='post'> | ||
<ul> | ||
<li> | ||
<label for='spansurveyid'><?php echo $clang->gT("Target survey ID:"); ?></label> | ||
<span id='spansurveyid'><?php echo $surveyid; ?><input type='hidden' value='$surveyid' name='sid'></span> | ||
</li> | ||
<li> | ||
<label for='oldtable'> | ||
<?php echo $clang->gT("Source table:"); ?> | ||
</label> | ||
<select name='oldtable'> | ||
<?php echo $optionElements; ?> | ||
</select> | ||
</li> | ||
<li> | ||
<label for='importtimings'> | ||
<?php echo $clang->gT("Import also timings (if exist):"); ?> | ||
</label> | ||
<select name='importtimings' > | ||
<option value='Y' selected='selected'><?php echo $clang->gT("Yes"); ?></option> | ||
<option value='N'><?php echo $clang->gT("No"); ?></option> | ||
</select> | ||
</li> | ||
</ul> | ||
<p> | ||
<input type='submit' value='<?php echo $clang->gT("Import Responses"); ?>' onclick='return confirm("<?php echo $clang->gT("Are you sure?","js"); ?>")'> | ||
<input type='hidden' name='subaction' value='import'><br /><br /> | ||
<div class='messagebox ui-corner-all'><div class='warningheader'><?php echo $clang->gT("Warning").'</div>'.$clang->gT("You can import all old responses with the same amount of columns as in your active survey. YOU have to make sure, that this responses corresponds to the questions in your active survey."); ?></div> | ||
</p> | ||
</form> | ||
<br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<input type='submit' value='<?php echo $clang->gT("Save"); ?>' /> | ||
<input type='hidden' name='id' value='<?php echo $id; ?>' /> | ||
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>' /> | ||
<input type='hidden' name='subaction' value='update' /> | ||
<input type='hidden' name='language' value='<?php echo $sDataEntryLanguage; ?>' /> |
62 changes: 62 additions & 0 deletions
62
application/views/admin/dataentry/includes/editdata/editdata.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<script type='text/javascript'> | ||
<!-- | ||
function saveshow(value) | ||
{ | ||
if (document.getElementById(value).checked == true) | ||
{ | ||
document.getElementById("closerecord").checked=false; | ||
document.getElementById("closerecord").disabled=true; | ||
document.getElementById("saveoptions").style.display=""; | ||
} | ||
else | ||
{ | ||
document.getElementById("saveoptions").style.display="none"; | ||
document.getElementById("closerecord").disabled=false; | ||
} | ||
} | ||
//--> | ||
</script> | ||
|
||
<table> | ||
<tr> | ||
<td align='left'> | ||
<input type='checkbox' class='checkboxbtn' name='closerecord' id='closerecord' /> | ||
<label for='closerecord'>".$clang->gT("Finalize response submission")."</label> | ||
</td> | ||
</tr> | ||
<input type='hidden' name='closedate' value='<?php echo date_shift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", Yii::app()->getConfig('timeadjust')); ?>' /> | ||
<tr> | ||
<td align='left'> | ||
<input type='checkbox' class='checkboxbtn' name='save' id='save' onclick='saveshow(this.id)' /> | ||
<label for='save'><?php echo $clang->gT("Save for further completion by survey user"); ?></label> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<div name='saveoptions' id='saveoptions' style='display: none'> | ||
<table align='center' class='outlinetable' cellspacing='0'> | ||
<tr><td align='right'><?php echo $clang->gT("Identifier:"); ?></td> | ||
<td> | ||
<input type='text' name='save_identifier'" | ||
<?php if (returnglobal('identifier')) { ?> | ||
value="<?php echo stripslashes(stripslashes(returnglobal('identifier'))); ?>" | ||
<?php } ?> /> | ||
</td> | ||
</tr> | ||
</table> | ||
<input type='hidden' name='save_password' value='<?php echo returnglobal('accesscode'); ?>' /> | ||
<input type='hidden' name='save_confirmpassword' value='<?php echo returnglobal('accesscode'); ?>' />\n" | ||
<input type='hidden' name='save_email' value='<?php echo $saver['email']; ?>' />\n" | ||
<input type='hidden' name='save_scid' value='<?php echo $saver['scid']; ?>' />\n" | ||
<input type='hidden' name='redo' value='yes' />\n"; | ||
</td> | ||
</tr> | ||
</div> | ||
<tr> | ||
<td align='center'> | ||
<input type='submit' value='<?php echo $clang->gT("Submit"); ?>' /> | ||
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>' /> | ||
<input type='hidden' name='subaction' value='insert' /> | ||
<input type='hidden' name='language' value='<?php echo $sDataEntryLanguage; ?>' /> | ||
</td> | ||
</tr> |
13 changes: 13 additions & 0 deletions
13
application/views/admin/dataentry/includes/editdata/header.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class='header ui-widget-header'><?php echo $clang->gT("Data entry"); ?></div> | ||
<div class='header ui-widget-header'> | ||
<?php | ||
if ($subaction == "edit") { | ||
echo sprintf($clang->gT("Editing response (ID %s)"), $id); | ||
} else { | ||
echo sprintf($clang->gT("Viewing response (ID %s)"), $id); | ||
} | ||
?> | ||
</div> | ||
|
||
<form method='post' action='<?php echo $this->createUrl('/admin/dataentry/sa/update'); ?>' name='editresponse' id='editresponse'> | ||
<table id='responsedetail' width='99%' align='center' cellpadding='0' cellspacing='0'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<div class='header ui-widget-header'><?php echo $clang->gT("Data entry"); ?></div> | ||
<div class='messagebox ui-corner-all'> | ||
<br /> | ||
<?php if(isset($save) && $errormsg): ?> | ||
<?php echo $clang->gT("Try again"); ?>: | ||
<form method='post'> | ||
<table class='outlinetable' cellspacing='0' align='center'> | ||
<tr> | ||
<td align='right'><?php echo $clang->gT("Identifier:"); ?></td> | ||
<td> | ||
<input type='text' name='save_identifier' value='<?php echo $_POST['save_identifier']; ?>' />' | ||
</td> | ||
</tr> | ||
<tr> | ||
<td align='right'><?php echo $clang->gT("Password:"); ?></td> | ||
<td> | ||
<input type='password' name='save_password' value='<?php echo $_POST['save_password']; ?>' /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td align='right'><?php echo $clang->gT("Confirm Password:"); ?></td> | ||
<td> | ||
<input type='password' name='save_confirmpassword' value='<?php echo $_POST['save_confirmpassword']; ?>' /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td align='right'><?php echo $clang->gT("Email:"); ?></td> | ||
<td> | ||
<input type='text' name='save_email' value='<?php echo $_POST['save_email']; ?>' /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td align='right'><?php echo $clang->gT("Start Language:"); ?></td> | ||
<td> | ||
<input type='text' name='save_language' value='<?php echo $_POST['save_language']; ?>' /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<td> | ||
<input type='submit' value='<?php echo $clang->gT("Submit"); ?>' /> | ||
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>' /> | ||
<input type='hidden' name='subaction' value='<?php echo $_POST['subaction']; ?>' /> | ||
<input type='hidden' name='language' value='<?php echo $lang; ?>' /> | ||
<input type='hidden' name='save' value='on' /> | ||
</td> | ||
<?php | ||
echo $hiddenfields; | ||
|
||
if (isset($_POST['datestamp'])) { | ||
echo CHtml::hiddenField('datestamp', $_POST['datestamp']); | ||
} | ||
|
||
if (isset($_POST['ipaddr'])) | ||
{ | ||
echo CHtml::hiddenField('ipaddr', $_POST['ipaddr']); | ||
} | ||
?> | ||
</tr> | ||
</table> | ||
</form> | ||
<?php endif; ?> | ||
|
||
<?php | ||
|
||
foreach($dataentrymsgs as $msg) { | ||
echo $msg . "<br />\n"; | ||
} | ||
|
||
?> | ||
|
||
<?php if(isset($thisid)): ?> | ||
<div class='successheader'><?php echo $clang->gT("Success"); ?></div> | ||
<?php echo $clang->gT("The entry was assigned the following record id: ")."{$thisid}"; ?> <br /><br /> | ||
<?php endif; ?> | ||
|
||
<?php echo $errormsg; ?> | ||
|
||
<input type='submit' value='<?php echo $clang->gT("Add Another Record"); ?>' onclick="window.open('<?php echo Yii::app()->homeUrl.('/admin/dataentry/sa/view/surveyid/'.$surveyid.'/lang/'.$lang); ?>', '_top')" /> | ||
<br /><br /> | ||
<input type='submit' value='<?php echo $clang->gT("Return to survey administration"); ?>' onclick="window.open('<?php echo Yii::app()->homeUrl.('/admin/survey/view/'.$surveyid); ?>', '_top')" /> | ||
<br /><br /> | ||
|
||
<?php if(isset($thisid)): ?> | ||
<input type='submit' value='<?php echo $clang->gT("View This Record"); ?>' onclick="window.open('<?php echo Yii::app()->homeUrl.('/admin/browse/sa/action/surveyid/'.$surveyid.'/id/'.$thisid); ?>', '_top')" /> | ||
<br /><br /> | ||
<?php endif; ?> | ||
|
||
<?php if(isset($save)): ?> | ||
<input type='submit' value='<?php echo $clang->gT("Browse Saved Responses"); ?>' onclick="window.open('<?php echo Yii::app()->homeUrl.('/admin/saved/sa/view/surveyid/'.$surveyid.'/all'); ?>', '_top')" /> | ||
<br /><br /> | ||
<?php endif; ?> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
if ($tableExists) { | ||
?> | ||
<div class='header ui-widget-header'><?php echo $clang->gT("Import a VV survey file"); ?></div> | ||
<form id='vvexport' enctype='multipart/form-data' method='post' action="<?php echo $this->createURL('admin/dataentry/sa/vvimport/surveyid/'.$surveyid); ?>"> | ||
<ul> | ||
<li> | ||
<label for='the_file'><?php echo $clang->gT("File:"); ?></label> | ||
<input type='file' size=50 id='the_file' name='the_file' /> | ||
</li> | ||
<li> | ||
<label for='sid'><?php echo $clang->gT("Survey ID:"); ?></label> | ||
<input type='text' size=10 id='sid' name='sid' value='<?php echo $surveyid; ?>' readonly='readonly' /> | ||
</li> | ||
<li> | ||
<label for='noid'><?php echo $clang->gT("Exclude record IDs?"); ?></label> | ||
<input type='checkbox' id='noid' name='noid' value='noid' checked=checked onchange='form.insertmethod.disabled=this.checked;' /> | ||
</li> | ||
<li> | ||
<label for='insertmethod'><?php echo $clang->gT("When an imported record matches an existing record ID:"); ?></label> | ||
<select id='insertmethod' name='insert' disabled='disabled'> | ||
<option value='ignore' selected='selected'><?php echo $clang->gT("Report and skip the new record."); ?></option> | ||
<option value='renumber'><?php echo $clang->gT("Renumber the new record."); ?></option> | ||
<option value='replace'><?php echo $clang->gT("Replace the existing record."); ?></option> | ||
</select> | ||
</li> | ||
<li> | ||
<label for='finalized'><?php echo $clang->gT("Import as not finalized answers?"); ?></label> | ||
<input type='checkbox' id='finalized' name='finalized' value='notfinalized' /> | ||
</li> | ||
<li> | ||
<label for='vvcharset'><?php echo $clang->gT("Character set of the file:"); ?></label> | ||
<select id='vvcharset' name='vvcharset'> | ||
<?php echo $charsetsout; ?> | ||
</select> | ||
</li> | ||
</ul> | ||
<p> | ||
<input type='submit' value='<?php echo $clang->gT("Import"); ?>' /> | ||
<input type='hidden' name='action' value='vvimport' /> | ||
<input type='hidden' name='subaction' value='upload' /> | ||
</p> | ||
</form> | ||
<br /> | ||
|
||
<?php } else { ?> | ||
<br /> | ||
<div class='messagebox'> | ||
<div class='header'><?php echo $clang->gT("Import a VV response data file"); ?></div> | ||
<div class='warningheader'><?php echo $clang->gT("Cannot import the VVExport file."); ?></div> | ||
<?php echo $clang->gT("This survey is not active. You must activate the survey before attempting to import a VVexport file."); ?> | ||
<br /> <br /> | ||
[<a href='<?php echo $this->createUrl('/admin/survey/view/'.$surveyid); ?>'><?php echo $clang->gT("Return to survey administration"); ?></a>] | ||
</div> | ||
<?php } ?> |
Oops, something went wrong.