Skip to content

Commit

Permalink
Dev Merging changes from stable branch up to rev 9585
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@9586 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Dec 6, 2010
1 parent 52ae575 commit 9eff9ca
Show file tree
Hide file tree
Showing 190 changed files with 119,313 additions and 133,499 deletions.
2 changes: 1 addition & 1 deletion admin/browse.php
Expand Up @@ -676,7 +676,7 @@
else {$gbc = "odd";}
}
$tableheader .= "<th class='$gbc'><strong>"
. strip_javascript("$fn[1]")
. FlattenText("$fn[1]")
. "</strong></th>\n";
}
$tableheader .= "\t</tr></thead>\n\n";
Expand Down
27 changes: 23 additions & 4 deletions admin/classes/tcpdf/mypdf.php
Expand Up @@ -177,8 +177,8 @@ function headTable($head, $table, $modulo=1 )
for($a=0;$a<sizeof($array);$a++)
{
if($modulo){
if($a%2 === 0){$fill=0;}
else{$fill=1;}
if($a%2 === 0){$fill=1;}
else{$fill=0;}
}
else{$fill=0;}
for($b=0;$b<sizeof($array[$a]);$b++)
Expand All @@ -187,13 +187,31 @@ function headTable($head, $table, $modulo=1 )
{
$oldStyle = $this->FontStyle;
$this->SetFont($this->FontFamily, 'B', $this->FontSizePt);
$this->Cell($maxwidth[$b],4,$this->delete_html($array[$a][$b]),0,0,'L',0);

if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
if ($maxwidth[$b] < 20) $maxwidth[$b]=20;
$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',1,0);

$this->SetFont($this->FontFamily, $oldStyle, $this->FontSizePt);
}
else
{
if ($a==1)
{
$this->SetFillColor(250, 250, 250);
}
//echo $maxwidth[$b]." max $b.Spalte<br/>";
$this->Cell($maxwidth[$b],4,$this->delete_html($array[$a][$b]),0,0,'L',$fill);

if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
if ($b==0)
{
$iLines=$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',$fill,0);
}
else
{
$this->MultiCell($maxwidth[$b],$iLines,$this->delete_html($array[$a][$b]),0,'L',$fill,0);
}

}
}
$this->ln();
Expand Down Expand Up @@ -309,5 +327,6 @@ function delete_html($text)
$text = html_entity_decode($text);
return strip_tags($text);
}

}
?>
46 changes: 23 additions & 23 deletions admin/classes/tcpdf/tcpdf.php
Expand Up @@ -73,7 +73,7 @@
// dullus for text Justification.
// Bob Vincent (pillarsdotnet@users.sourceforge.net) for <li> value attribute.
// Patrick Benny for text stretch suggestion on Cell().
// Johannes G�ntert for JavaScript support.
// Johannes Güntert for JavaScript support.
// Denis Van Nuffelen for Dynamic Form.
// Jacek Czekaj for multibyte justification
// Anthony Ferrara for the reintroduction of legacy image methods.
Expand All @@ -84,7 +84,7 @@
// Mohamad Ali Golkar, Saleh AlMatrafe, Charles Abbott for Arabic and Persian support.
// Moritz Wagner and Andreas Wurmser for graphic functions.
// Andrew Whitehead for core fonts support.
// Esteban Jo�l Mar�n for OpenType font conversion.
// Esteban Joël Marín for OpenType font conversion.
// Teus Hagen for several suggestions and fixes.
// Yukihiro Nakadaira for CID-0 CJK fonts fixes.
// Kosmas Papachristos for some CSS improvements.
Expand Down Expand Up @@ -6234,10 +6234,10 @@ public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=
$this->y = $y;
$this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']);
}
$this->setContentMark();
$this->cell_padding = $prev_cell_padding;
$this->cell_margin = $prev_cell_margin;
return $nl;
$this->setContentMark();
$this->cell_padding = $prev_cell_padding;
$this->cell_margin = $prev_cell_margin;
return $currentY-$this->y;
}

/**
Expand Down Expand Up @@ -6322,7 +6322,7 @@ protected function getBorderMode($brd, $position='start') {
* @param float $cellpadding Internal cell padding, if empty uses default cell padding.
* @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @return float Return the minimal height needed for multicell method for printing the $txt param.
* @author Alexander Escalona Fern�ndez, Nicola Asuni
* @author Alexander Escalona Fernández, Nicola Asuni
* @access public
* @since 4.5.011
*/
Expand Down Expand Up @@ -6426,7 +6426,7 @@ public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellp
* @param float $cellpadding Internal cell padding, if empty uses default cell padding.
* @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @return float Return the minimal height needed for multicell method for printing the $txt param.
* @author Nicola Asuni, Alexander Escalona Fern�ndez
* @author Nicola Asuni, Alexander Escalona Fernández
* @access public
*/
public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding='', $border=0) {
Expand Down Expand Up @@ -12597,7 +12597,7 @@ protected function _outRect($x, $y, $w, $h, $op) {
}

/**
* Append a cubic B�zier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the B�zier control points.
* Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bézier control points.
* The new current point shall be (x3, y3).
* @param float $x1 Abscissa of control point 1.
* @param float $y1 Ordinate of control point 1.
Expand All @@ -12613,7 +12613,7 @@ protected function _outCurve($x1, $y1, $x2, $y2, $x3, $y3) {
}

/**
* Append a cubic B�zier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the B�zier control points.
* Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bézier control points.
* The new current point shall be (x3, y3).
* @param float $x2 Abscissa of control point 2.
* @param float $y2 Ordinate of control point 2.
Expand All @@ -12627,7 +12627,7 @@ protected function _outCurveV($x2, $y2, $x3, $y3) {
}

/**
* Append a cubic B�zier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the B�zier control points.
* Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bézier control points.
* The new current point shall be (x3, y3).
* @param float $x1 Abscissa of control point 1.
* @param float $y1 Ordinate of control point 1.
Expand Down Expand Up @@ -14021,7 +14021,7 @@ protected function _putbookmarks() {
* Adds a javascript
* @param string $script Javascript code
* @access public
* @author Johannes G�ntert, Nicola Asuni
* @author Johannes Güntert, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
public function IncludeJS($script) {
Expand All @@ -14046,7 +14046,7 @@ public function addJavascriptObject($script, $onload=false) {
/**
* Create a javascript PDF string.
* @access protected
* @author Johannes G�ntert, Nicola Asuni
* @author Johannes Güntert, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
protected function _putjavascript() {
Expand Down Expand Up @@ -15784,7 +15784,7 @@ public function registrationMark($x, $y, $r, $double=false, $cola=array(0,0,0),
* @param array $col1 first color (Grayscale, RGB or CMYK components).
* @param array $col2 second color (Grayscale, RGB or CMYK components).
* @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0).
* @author Andreas W�rmser, Nicola Asuni
* @author Andreas Würmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @access public
*/
Expand All @@ -15802,7 +15802,7 @@ public function LinearGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $co
* @param array $col1 first color (Grayscale, RGB or CMYK components).
* @param array $col2 second color (Grayscale, RGB or CMYK components).
* @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined.
* @author Andreas W�rmser, Nicola Asuni
* @author Andreas Würmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @access public
*/
Expand All @@ -15825,7 +15825,7 @@ public function RadialGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $co
* @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0
* @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1
* @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts.
* @author Andreas W�rmser, Nicola Asuni
* @author Andreas Würmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @access public
*/
Expand Down Expand Up @@ -15910,7 +15910,7 @@ public function CoonsPatchMesh($x, $y, $w, $h, $col1=array(), $col2=array(), $co
* @param float $y ordinate of the top left corner of the rectangle.
* @param float $w width of the rectangle.
* @param float $h height of the rectangle.
* @author Andreas W�rmser, Nicola Asuni
* @author Andreas Würmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @access protected
*/
Expand Down Expand Up @@ -17279,19 +17279,19 @@ protected function extractCSSproperties($cssdata) {
// remove empty blocks
$cssdata = preg_replace('/([^\}\{]+)\{\}/', '', $cssdata);
// replace media type parenthesis
$cssdata = preg_replace('/@media[\s]+([^\{]*)\{/i', '@media \\1', $cssdata);
$cssdata = preg_replace('/\}\}/si', '}', $cssdata);
$cssdata = preg_replace('/@media[\s]+([^\{]*)\{/i', '@media \\1§', $cssdata);
$cssdata = preg_replace('/\}\}/si', '}§', $cssdata);
// trim string
$cssdata = trim($cssdata);
// find media blocks (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv)
$cssblocks = array();
$matches = array();
if (preg_match_all('/@media[\s]+([^\]*)([^]*)/i', $cssdata, $matches) > 0) {
if (preg_match_all('/@media[\s]+([^\§]*)§([^§]*)§/i', $cssdata, $matches) > 0) {
foreach ($matches[1] as $key => $type) {
$cssblocks[$type] = $matches[2][$key];
}
// remove media blocks
$cssdata = preg_replace('/@media[\s]+([^\]*)([^]*)/i', '', $cssdata);
$cssdata = preg_replace('/@media[\s]+([^\§]*)§([^§]*)§/i', '', $cssdata);
}
// keep 'all' and 'print' media, other media types are discarded
if (isset($cssblocks['all']) AND !empty($cssblocks['all'])) {
Expand Down Expand Up @@ -24952,7 +24952,7 @@ protected function SVGPath($d, $style='') {
}
break;
}
case 'Q': { // quadratic B�zier curveto
case 'Q': { // quadratic Bézier curveto
foreach ($params as $ck => $cp) {
$params[$ck] = $cp;
if ((($ck + 1) % 4) == 0) {
Expand All @@ -24978,7 +24978,7 @@ protected function SVGPath($d, $style='') {
}
break;
}
case 'T': { // shorthand/smooth quadratic B�zier curveto
case 'T': { // shorthand/smooth quadratic Bézier curveto
foreach ($params as $ck => $cp) {
$params[$ck] = $cp;
if (($ck % 2) != 0) {
Expand Down
33 changes: 11 additions & 22 deletions admin/database.php
Expand Up @@ -456,8 +456,8 @@ function get_max_question_order($gid)

$qtypes=getqtypelist('','array');
// These are the questions types that have no answers and therefore we delete the answer in that case
$keepansweroptions = ($qtypes[$_POST['type']]['answerscales']>0);
$keepsubquestions = ($qtypes[$_POST['type']]['subquestions']>0);
$iAnswerScales = $qtypes[$_POST['type']]['answerscales'];
$iSubquestionScales = $qtypes[$_POST['type']]['subquestions'];

// These are the questions types that have the other option therefore we set everything else to 'No Other'
if (($_POST['type']!= "L") && ($_POST['type']!= "!") && ($_POST['type']!= "P") && ($_POST['type']!="M"))
Expand Down Expand Up @@ -583,24 +583,13 @@ function get_max_question_order($gid)
// then change the cfieldname accordingly
fixmovedquestionConditions($postqid, $oldgid, $postgid);
}
if (!$keepansweroptions)
{
$query = "DELETE FROM ".db_table_name('answers')." WHERE qid=".$postqid;

$query = "DELETE FROM ".db_table_name('answers')." WHERE qid= {$postqid} and scale_id>={$iAnswerScales}";
$result = $connect->Execute($query) or safe_die("Error: ".$connect->ErrorMsg()); // Checked
if (!$result)
{
$databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Answers can't be deleted","js")."\n".htmlspecialchars($connect->ErrorMsg())."\")\n //-->\n</script>\n";
}
}
if (!$keepsubquestions)
{
$query = "DELETE FROM ".db_table_name('questions')." WHERE parent_qid=".$postqid;

// Remove old subquestion scales
$query = "DELETE FROM ".db_table_name('questions')." WHERE parent_qid={$postqid} and scale_id>={$iSubquestionScales}";
$result = $connect->Execute($query) or safe_die("Error: ".$connect->ErrorMsg()); // Checked
if (!$result)
{
$databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Answers can't be deleted","js")."\n".htmlspecialchars($connect->ErrorMsg())."\")\n //-->\n</script>\n";
}
}
$_SESSION['flashmessage'] = $clang->gT("Question was successfully saved.");


Expand Down Expand Up @@ -733,7 +722,7 @@ function get_max_question_order($gid)
if (isset($aSQIDMappings[$qr1['qid']]))
{
$qr1['qid']=$aSQIDMappings[$qr1['qid']];
db_switchIDInsert($tablename,true);
db_switchIDInsert('questions',true);
}
else
{
Expand All @@ -744,7 +733,7 @@ function get_max_question_order($gid)
$ir1 = $connect->Execute($sInsertSQL); // Checked
if (isset($qr1['qid']))
{
db_switchIDInsert($tablename,false);
db_switchIDInsert('questions',false);
}
else
{
Expand All @@ -763,10 +752,10 @@ function get_max_question_order($gid)
while ($qr1 = $r1->FetchRow())
{
$qr1 = array_map('db_quote', $qr1);
$i1 = "INSERT INTO {$dbprefix}answers (qid, code, answer, sortorder, language) "
$i1 = "INSERT INTO {$dbprefix}answers (qid, code, answer, sortorder, language, scale_id) "
. "VALUES ('$newqid', '{$qr1['code']}', "
. "'{$qr1['answer']}', "
. "'{$qr1['sortorder']}', '{$qr1['language']}')";
. "'{$qr1['sortorder']}', '{$qr1['language']}', '{$qr1['scale_id']}')";
$ir1 = $connect->Execute($i1); // Checked

}
Expand Down
19 changes: 11 additions & 8 deletions admin/dataentry.php
Expand Up @@ -271,17 +271,20 @@
}
else
{
if ($irow['type'] == 'D')
{
$datetimeobj = new Date_Time_Converter($_POST[$fieldname],$dateformatdetails['phpdate']);
$columns[] .= db_quote_id($fieldname);
$values[] .= db_quoteall(count($phparray), true);
$values[] .= db_quoteall($datetimeobj->convert("Y-m-d H:i:s"),true);
}
}
else
{
$columns[] .= db_quote_id($fieldname);
else
{
$columns[] .= db_quote_id($fieldname);
$values[] .= db_quoteall($_POST[$fieldname],true);
}
}
}
}

$SQL = "INSERT INTO $surveytable
(".implode(',',$columns).")
Expand Down Expand Up @@ -563,7 +566,7 @@
{
case "completed":
// First compute the submitdate
if ($private == "Y" && $datestamp == "N")
if ($private == "Y")
{
// In case of anonymized responses survey with no datestamp
// then the the answer submutdate gets a conventional timestamp
Expand All @@ -578,11 +581,11 @@

$dataentryoutput .= " <select name='submitdate'>\n";
$dataentryoutput .= " <option value=";
if(empty($idrow[$fname['fieldname']])) { $dataentryoutput .= "'' selected"; }
if(empty($idrow['submitdate'])) { $dataentryoutput .= "'' selected"; }
else { $dataentryoutput .= "'N'"; }
$dataentryoutput .= ">".$clang->gT("No")."</option>\n";
$dataentryoutput .= " <option value=";
if(!empty($idrow[$fname['fieldname']])) { $dataentryoutput .= "'' selected"; }
if(!empty($idrow['submitdate'])) { $dataentryoutput .= "'' selected"; }
else { $dataentryoutput .= "'$completedate'"; }
$dataentryoutput .= ">".$clang->gT("Yes")."</option>\n";
$dataentryoutput .= " </select>\n";
Expand Down

0 comments on commit 9eff9ca

Please sign in to comment.