Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA: {ANSWERTABLE}

{ANSWERTABLE} 2 Jahre 8 Monate her #73856

  • pcrilly
  • pcrillys Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
Does anyone know how this can be adjusted ? i've looked through some forum posts but i can't see if anyone found a correct answer to this...
Using {ANSWERTABLE} in the e-mail template i get something like this as a print output bound to an email....


Response ID 10
Date submitted 2012-02-07 17:51:15
Last page 2
Start language en
Token
Date last action 2012-02-07 17:51:15
Date started 2012-02-07 17:51:15

Any way of removing the above? I don't really need to see this


Business Unit Close Premium Finance [A4]
Category General Ledger [A1]
Sub Category SAP/Infrastructure [A1]
Modules SAP ABAP [A10]
Component Citrix [A3]

I've worked out that the [A4], [A1], [A10], [A3] are the question tags
I can't see where ( not really good with code ) in the printanswers.pstpl and printanswers.php how i can get rid of the [ ] tags from the generated email.

Does anyone know... im about to really swear at the server and it's not the poor things fault.

Thanks :)
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73859

  • Ben_V
  • Ben_Vs Avatar
  • OFFLINE
  • Platinum Lime
  • Beiträge: 1125
  • Dank erhalten: 259
  • Karma: 79
Hi Pcrilly,

Here the few I can say to help you:
1) For the [answercode] look here

2) For the headings:

Try this:
- Open your printanswers.php file (after backup)
- Look for something like:
unset ($aFullResponseTable);
unset ($aFullResponseTable);
unset ($aFullResponseTable);
unset ($aFullResponseTable);
unset ($aFullResponseTable);
unset ($aFullResponseTable);


and add to the list:
unset ($aFullResponseTable);
unset ($aFullResponseTable);
unset ($aFullResponseTable);


/!\ Don't remove anything but wrap as comment if you want to change or test something
// unset ($aFullResponseTable);



CHECK !
Good luck
Ben
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Letzte Änderung: 2 Jahre 8 Monate her von Ben_V. Begründung: invalid link
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73860

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5351
  • Dank erhalten: 299
  • Karma: 250
The only solution to get rid of single entries is by editing the source code as described above.

Keep in mind that you will have to re-implement all the changes when updating and that such changes affect all surveys.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73887

  • pcrilly
  • pcrillys Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
They were cool ideas, but they don't seem to work on my version Version 1.91+ Build 11343

Tried all three, not even so much as a flicker of a change.


Response ID 21
Date submitted 2012-02-08 09:56:33
Last page 2
Start language en
Token

Details <--- this is the group name
End User Telephone Number 45745745
End User Email Address 57457457
End User Name 457457
Call Reference 5745745

ALL<--- this is the group name
Site Name 7457457
Impact High [A2]
Urgency High [A2]
Modules SAP Controlling (CO) [2]
Component Internet [8]
Any Additional Information 457457
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73891

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5351
  • Dank erhalten: 299
  • Karma: 250
It might depend on the place where you add the unset() calls. Data might get filled later on.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73892

  • pcrilly
  • pcrillys Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
i've just downloaded the latest ver and ill test with that :D
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73895

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5351
  • Dank erhalten: 299
  • Karma: 250
Good luck.

If you are interested in a fully customized printanswers.php script, feel free to ping me at Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73906

  • pcrilly
  • pcrillys Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
ok.. still dosn't work
everything in red i have added to the stock file
my printanswers.php file :


<?php
/*
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: printanswers.php 12171 2012-01-23 20:27:28Z tpartner $
*
*/

//Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
require_once(dirname(__FILE__).'/classes/core/startup.php');
require_once(dirname(__FILE__).'/config-defaults.php');
require_once(dirname(__FILE__).'/common.php');
if(isset($usepdfexport) && $usepdfexport == 1)
{
require_once($pdfexportdir."/extensiontcpdf.php");
}

if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
else {
//This next line ensures that the $surveyid value is never anything but a number.
$surveyid=sanitize_int($surveyid);
}

// Compute the Session name
// Session name is based:
// * on this specific limesurvey installation (Value SessionName in DB)
// * on the surveyid (from Get or Post param). If no surveyid is given we are on the public surveys portal
$usquery = "SELECT stg_value FROM ".db_table_name("settings_global")." where stg_name='SessionName'";
$usresult = db_execute_assoc($usquery,'',true); //Checked
if ($usresult)
{
$usrow = $usresult->FetchRow();
$stg_SessionName=$usrow;
if ($surveyid)
{
@session_name($stg_SessionName.'-runtime-'.$surveyid);
}
else
{
@session_name($stg_SessionName.'-runtime-publicportal');
}
}
else
{
session_name("LimeSurveyRuntime-$surveyid");
}
session_set_cookie_params(0,$relativeurl.'/');
@session_start();

if (isset($_SESSION)) {$surveyid=$_SESSION;} else die('Invalid survey/session');

//Debut session time out
if (!isset($_SESSION) || !isset($_SESSION))
// Argh ... a session time out! RUN!
//display "sorry but your session has expired"
{
require_once($rootdir.'/classes/core/language.php');
$baselang = GetBaseLanguageFromSurveyID($surveyid);
$clang = new limesurvey_lang($baselang);
//A nice exit

sendcacheheaders();
doHeader();

echo templatereplace(file_get_contents(sGetTemplatePath(validate_templatedir("default"))."/startpage.pstpl"));
echo "<center><br />\n"
."\t<font color='RED'><strong>".$clang->gT("ERROR")."</strong></font><br />\n"
."\t".$clang->gT("We are sorry but your session has expired.")."<br />".$clang->gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.")."<br />\n"
."\t".sprintf($clang->gT("Please contact %s ( %s ) for further assistance."),$siteadminname,$siteadminemail)."\n"
."</center><br />\n";

echo templatereplace(file_get_contents(sGetTemplatePath(validate_templatedir("default"))."/endpage.pstpl"));
doFooter();
exit;
};
//Fin session time out

$id=$_SESSION; //I want to see the answers with this id
$clang = $_SESSION;

//A little bit of debug to see in the noodles plate
/*if ($debug==2)
{
echo "MonSurveyID $surveyid et ma langue ". $_SESSION. " et SRID = ". $_SESSION ."<br />";
echo "session id".session_id()." \n"."<br />";

echo //"secanswer ". $_SESSION
"oldsid ". $_SESSION."<br />"
."step ". $_SESSION."<br />"
."scid ". $_SESSION
."srid ". $_SESSION."<br />"
."datestamp ". $_SESSION."<br />"
."insertarray ". $_SESSION."<br />"
."fieldarray ". $_SESSION."<br />";
."holdname". $_SESSION;

print " limit ". $limit."<br />"; //afficher les 50 derniéres réponses par ex. (pas nécessaire)
print " surveyid ".$surveyid."<br />"; //sid
print " id ".$id."<br />"; //identifiant de la réponses
print " order ". $order ."<br />"; //ordre de tri (pas nécessaire)
print " this survey ". $thissurvey;
}; */

//Ensure script is not run directly, avoid path disclosure
if (!isset($rootdir) || isset($_REQUEST)) {die("browse - Cannot run this script directly");}

// Set the language for dispay
require_once($rootdir.'/classes/core/language.php'); // has been secured
if (isset($_SESSION))
{
$clang = SetSurveyLanguage( $surveyid, $_SESSION);
$language = $_SESSION;
} else {
$language = GetBaseLanguageFromSurveyID($surveyid);
$clang = SetSurveyLanguage( $surveyid, $language);
}

// Get the survey inforamtion
$thissurvey = getSurveyInfo($surveyid,$language);

//SET THE TEMPLATE DIRECTORY
if (!isset($thissurvey) || !$thissurvey)
{
$thistpl=validate_templatedir("default");
}
else
{
$thistpl=validate_templatedir($thissurvey);
}

if ($thissurvey=='N') die(); //Die quietly if print answers is not permitted






//CHECK IF SURVEY IS ACTIVATED AND EXISTS
$actquery = "SELECT * FROM ".db_table_name('surveys')." as a inner join ".db_table_name('surveys_languagesettings')." as b on (b.surveyls_survey_id=a.sid and b.surveyls_language=a.language) WHERE a.sid=$surveyid";

$actresult = db_execute_assoc($actquery); //Checked
$actcount = $actresult->RecordCount();
if ($actcount > 0)
{
while ($actrow = $actresult->FetchRow())
{
$surveytable = db_table_name("survey_".$actrow);
$surveyname = "{$actrow}";
$anonymized = $actrow;
}
}


//OK. IF WE GOT THIS FAR, THEN THE SURVEY EXISTS AND IT IS ACTIVE, SO LETS GET TO WORK.
//SHOW HEADER
$printoutput = '';
if(isset($usepdfexport) && $usepdfexport == 1)
{
$printoutput .= "<form action='printanswers.php?printableexport=pdf&sid=$surveyid' method='post'>\n<center><input type='submit' value='".$clang->gT("PDF Export")."'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";
}
if(isset($_POST))
{
$pdf = new PDF($pdforientation);
$pdf->SetFont($pdfdefaultfont,'',$pdffontsize);
$pdf->AddPage();
$pdf->titleintopdf($clang->gT("Survey name (ID)",'unescaped').": {$surveyname} ({$surveyid})");
}
$printoutput .= "\t<div class='printouttitle'><strong>".$clang->gT("Survey name (ID):")."</strong> $surveyname ($surveyid)</div><p> \n";

$bHonorConditions=($printanswershonorsconditions==1);
$aFullResponseTable=aGetFullResponseTable($surveyid,$id,$language,$bHonorConditions);

//Get the fieldmap @TODO: do we need to filter out some fields?
//unset ($aFullResponseTable);
//unset ($aFullResponseTable);
//unset ($aFullResponseTable);
//unset ($aFullResponseTable);
//unset ($aFullResponseTable);
//unset ($aFullResponseTable);

$printoutput .= "<table class='printouttable' >\n";
if(isset($_POST))
{
$pdf->intopdf($clang->gT("Question",'unescaped').": ".$clang->gT("Your answer",'unescaped'));
}

$oldgid = 0;
$oldqid = 0;
foreach ($aFullResponseTable as $sFieldname=>$fname)
{
if (substr($sFieldname,0,4)=='gid_')
{

if(isset($_POST))
{
$pdf->intopdf(FlattenText($fname[0],true));
$pdf->ln(2);
}
else
{
$printoutput .= "\t<tr class='printanswersgroup'><td colspan='2'>{$fname[0]}</td></tr>\n";
}
}
elseif (substr($sFieldname,0,4)=='qid_')
{
if(isset($_POST))
{
$pdf->intopdf(FlattenText($fname[0].$fname[1],true).": ".$fname[2]);
$pdf->ln(2);
}
else
{
$printoutput .= "\t<tr class='printanswersquestionhead'><td colspan='2'>{$fname[0]}</td></tr>\n";
}
}
elseif ($sFieldname=='submitdate')
{
if($anonymized != 'Y')
{
if(isset($_POST))
{
$pdf->intopdf(FlattenText($fname[0].$fname[1],true).": ".$fname[2]);
$pdf->ln(2);
}
else
{
$printoutput .= "\t<tr class='printanswersquestion'><td>{$fname[0]} {$fname[1]} {$sFieldname}</td><td class='printanswersanswertext'>{$fname[2]}</td></tr>";
}
}
}
else
{
if(isset($_POST))
{
$pdf->intopdf(FlattenText($fname[0].$fname[1],true).": ".$fname[2]);
$pdf->ln(2);
}
else
{
$printoutput .= "\t<tr class='printanswersquestion'><td>{$fname[0]} {$fname[1]}</td><td class='printanswersanswertext'>{$fname[2]}</td></tr>";
}
}
}

$printoutput .= "</table>\n";
if(isset($_POST))
{

header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

$sExportFileName=sanitize_filename($surveyname);
$pdf->Output($sExportFileName."-".$surveyid.".pdf","D");
}


//Display the page with user answers
if(!isset($_POST))
{
sendcacheheaders();
doHeader();

echo templatereplace(file_get_contents(sGetTemplatePath($thistpl).'/startpage.pstpl'));
echo templatereplace(file_get_contents(sGetTemplatePath($thistpl).'/printanswers.pstpl'),array('ANSWERTABLE'=>$printoutput));
echo templatereplace(file_get_contents(sGetTemplatePath($thistpl).'/endpage.pstpl'));
echo "</body></html>";
}


?>
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73908

  • pcrilly
  • pcrillys Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
my printanswers.pstpl file :

<style type="text/css" media="all">
<!--
.nocode{display:none}
-->
</style>
{ANSWERTABLE}
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: {ANSWERTABLE} 2 Jahre 8 Monate her #73909

  • pcrilly
  • pcrillys Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.230 Sekunden
Donation Image