mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Merging the updated Limesurvey 1.92+ branch of queXS to trunk
This commit is contained in:
+13
-8
@@ -274,14 +274,19 @@ if ($questionnaire_id != false)
|
|||||||
print "<h1>" . T_("Enter the details for creating the row quota:") . "</h1>";
|
print "<h1>" . T_("Enter the details for creating the row quota:") . "</h1>";
|
||||||
print "<h2>" . T_("Pre defined values for this question:") . "</h2>";
|
print "<h2>" . T_("Pre defined values for this question:") . "</h2>";
|
||||||
|
|
||||||
$qid = explode("X", $sgqa);
|
$rs = "";
|
||||||
$qid = $qid[2];
|
|
||||||
|
if ($sgqa != -2 && $sgqa != -1 && !empty($sgqa))
|
||||||
$sql = "SELECT l.code,l.answer as title
|
{
|
||||||
FROM `" . LIME_PREFIX . "answers` as l
|
$qid = explode("X", $sgqa);
|
||||||
WHERE l.qid = '$qid'";
|
$qid = $qid[2];
|
||||||
|
|
||||||
$rs = $db->GetAll($sql);
|
$sql = "SELECT l.code,l.answer as title
|
||||||
|
FROM `" . LIME_PREFIX . "answers` as l
|
||||||
|
WHERE l.qid = '$qid'";
|
||||||
|
|
||||||
|
$rs = $db->GetAll($sql);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($rs) || empty($rs))
|
if (!isset($rs) || empty($rs))
|
||||||
print "<p>" . T_("No labels defined for this question") ."</p>";
|
print "<p>" . T_("No labels defined for this question") ."</p>";
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ $js = false;
|
|||||||
if (AUTO_LOGOUT_MINUTES !== false)
|
if (AUTO_LOGOUT_MINUTES !== false)
|
||||||
$js = array("include/jquery-ui/js/jquery-1.4.2.min.js","js/childnap.js");
|
$js = array("include/jquery-ui/js/jquery-1.4.2.min.js","js/childnap.js");
|
||||||
|
|
||||||
xhtml_head(T_("Appointment List"),true,array("css/table.css"),$js,false,15);
|
xhtml_head(T_("Appointment List"),true,array("css/table.css"),$js,false,60);
|
||||||
|
|
||||||
//List the case appointment
|
//List the case appointment
|
||||||
// display in respondent time so that the operator will be able to
|
// display in respondent time so that the operator will be able to
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ $js = false;
|
|||||||
if (AUTO_LOGOUT_MINUTES !== false)
|
if (AUTO_LOGOUT_MINUTES !== false)
|
||||||
$js = array("include/jquery-ui/js/jquery-1.4.2.min.js","js/childnap.js");
|
$js = array("include/jquery-ui/js/jquery-1.4.2.min.js","js/childnap.js");
|
||||||
|
|
||||||
xhtml_head(T_("Case History List"),true,array("css/table.css"),$js,false,15);
|
xhtml_head(T_("Case History List"),true,array("css/table.css"),$js,false,60);
|
||||||
|
|
||||||
//List the case call history
|
//List the case call history
|
||||||
// display in respondent time so that the operator will be able to
|
// display in respondent time so that the operator will be able to
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ $js = false;
|
|||||||
if (AUTO_LOGOUT_MINUTES !== false)
|
if (AUTO_LOGOUT_MINUTES !== false)
|
||||||
$js = array("include/jquery-ui/js/jquery-1.4.2.min.js","js/childnap.js");
|
$js = array("include/jquery-ui/js/jquery-1.4.2.min.js","js/childnap.js");
|
||||||
|
|
||||||
xhtml_head(T_("Call List"),true,array("css/table.css"),$js,false,15);
|
xhtml_head(T_("Call List"),true,array("css/table.css"),$js,false,60);
|
||||||
|
|
||||||
//List the case call history
|
//List the case call history
|
||||||
// display in respondent time so that the operator will be able to
|
// display in respondent time so that the operator will be able to
|
||||||
|
|||||||
+1
-1
@@ -161,7 +161,7 @@ if (!defined('PHP_EXEC')) define('PHP_EXEC', "php");
|
|||||||
/**
|
/**
|
||||||
* Path to ADODB
|
* Path to ADODB
|
||||||
*/
|
*/
|
||||||
if (!defined('ADODB_PATH')) define('ADODB_PATH',dirname(__FILE__).'/../adodb/');
|
if (!defined('ADODB_PATH')) define('ADODB_PATH',dirname(__FILE__).'/include/limesurvey/classes/adodb/');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to the HTPASSWD file read/writable by the web server user for htpasswd integration
|
* Path to the HTPASSWD file read/writable by the web server user for htpasswd integration
|
||||||
|
|||||||
@@ -63,11 +63,6 @@ define('AUTO_POPUP',false);
|
|||||||
*/
|
*/
|
||||||
define('QUEXS_PATH', '/quexs/');
|
define('QUEXS_PATH', '/quexs/');
|
||||||
|
|
||||||
/**
|
|
||||||
* Path to ADODB
|
|
||||||
*/
|
|
||||||
define('ADODB_PATH',dirname(__FILE__).'/../adodb/');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database configuration for queXS
|
* Database configuration for queXS
|
||||||
*/
|
*/
|
||||||
|
|||||||
+186
-24
@@ -3,9 +3,9 @@
|
|||||||
-- http://www.phpmyadmin.net
|
-- http://www.phpmyadmin.net
|
||||||
--
|
--
|
||||||
-- Host: localhost
|
-- Host: localhost
|
||||||
-- Generation Time: Sep 07, 2011 at 02:42 PM
|
-- Generation Time: Nov 16, 2012 at 12:35 PM
|
||||||
-- Server version: 5.0.51
|
-- Server version: 5.0.51
|
||||||
-- PHP Version: 5.2.6-1+lenny13
|
-- PHP Version: 5.2.6-1+lenny16
|
||||||
|
|
||||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
|
||||||
@@ -18,7 +18,6 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
|||||||
--
|
--
|
||||||
-- Database: `quexs`
|
-- Database: `quexs`
|
||||||
--
|
--
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -472,6 +471,31 @@ CREATE TABLE `lime_defaultvalues` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_expression_errors`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_expression_errors` (
|
||||||
|
`id` int(9) NOT NULL auto_increment,
|
||||||
|
`errortime` varchar(50) collate utf8_unicode_ci default NULL,
|
||||||
|
`sid` int(11) default NULL,
|
||||||
|
`gid` int(11) default NULL,
|
||||||
|
`qid` int(11) default NULL,
|
||||||
|
`gseq` int(11) default NULL,
|
||||||
|
`qseq` int(11) default NULL,
|
||||||
|
`type` varchar(50) collate utf8_unicode_ci default NULL,
|
||||||
|
`eqn` text collate utf8_unicode_ci,
|
||||||
|
`prettyprint` text collate utf8_unicode_ci,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_expression_errors`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -504,6 +528,8 @@ CREATE TABLE `lime_groups` (
|
|||||||
`group_order` int(11) NOT NULL default '0',
|
`group_order` int(11) NOT NULL default '0',
|
||||||
`description` text collate utf8_unicode_ci,
|
`description` text collate utf8_unicode_ci,
|
||||||
`language` varchar(20) collate utf8_unicode_ci NOT NULL default 'en',
|
`language` varchar(20) collate utf8_unicode_ci NOT NULL default 'en',
|
||||||
|
`randomization_group` varchar(20) collate utf8_unicode_ci NOT NULL default '',
|
||||||
|
`grelevance` text collate utf8_unicode_ci,
|
||||||
PRIMARY KEY (`gid`,`language`),
|
PRIMARY KEY (`gid`,`language`),
|
||||||
KEY `groups_idx2` (`sid`)
|
KEY `groups_idx2` (`sid`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
@@ -553,6 +579,119 @@ CREATE TABLE `lime_labelsets` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_participants`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_participants` (
|
||||||
|
`participant_id` varchar(50) collate utf8_unicode_ci NOT NULL,
|
||||||
|
`firstname` varchar(40) collate utf8_unicode_ci default NULL,
|
||||||
|
`lastname` varchar(40) collate utf8_unicode_ci default NULL,
|
||||||
|
`email` varchar(80) collate utf8_unicode_ci default NULL,
|
||||||
|
`language` varchar(40) collate utf8_unicode_ci default NULL,
|
||||||
|
`blacklisted` varchar(1) collate utf8_unicode_ci NOT NULL,
|
||||||
|
`owner_uid` int(20) NOT NULL,
|
||||||
|
PRIMARY KEY (`participant_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_participants`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_participant_attribute`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_participant_attribute` (
|
||||||
|
`participant_id` varchar(50) collate utf8_unicode_ci NOT NULL,
|
||||||
|
`attribute_id` int(11) NOT NULL,
|
||||||
|
`value` varchar(50) collate utf8_unicode_ci NOT NULL,
|
||||||
|
PRIMARY KEY (`participant_id`,`attribute_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_participant_attribute`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_participant_attribute_names`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_participant_attribute_names` (
|
||||||
|
`attribute_id` int(11) NOT NULL auto_increment,
|
||||||
|
`attribute_type` varchar(4) collate utf8_unicode_ci NOT NULL,
|
||||||
|
`visible` char(5) collate utf8_unicode_ci NOT NULL,
|
||||||
|
PRIMARY KEY (`attribute_id`,`attribute_type`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_participant_attribute_names`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_participant_attribute_names_lang`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_participant_attribute_names_lang` (
|
||||||
|
`attribute_id` int(11) NOT NULL,
|
||||||
|
`attribute_name` varchar(30) collate utf8_unicode_ci NOT NULL,
|
||||||
|
`lang` varchar(20) collate utf8_unicode_ci NOT NULL,
|
||||||
|
PRIMARY KEY (`attribute_id`,`lang`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_participant_attribute_names_lang`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_participant_attribute_values`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_participant_attribute_values` (
|
||||||
|
`value_id` int(11) NOT NULL auto_increment,
|
||||||
|
`attribute_id` int(11) NOT NULL,
|
||||||
|
`value` varchar(20) collate utf8_unicode_ci NOT NULL,
|
||||||
|
PRIMARY KEY (`value_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_participant_attribute_values`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_participant_shares`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_participant_shares` (
|
||||||
|
`participant_id` varchar(50) collate utf8_unicode_ci NOT NULL,
|
||||||
|
`share_uid` int(11) NOT NULL,
|
||||||
|
`date_added` datetime NOT NULL,
|
||||||
|
`can_edit` varchar(5) collate utf8_unicode_ci NOT NULL,
|
||||||
|
PRIMARY KEY (`participant_id`,`share_uid`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_participant_shares`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -575,6 +714,7 @@ CREATE TABLE `lime_questions` (
|
|||||||
`language` varchar(20) collate utf8_unicode_ci NOT NULL default 'en',
|
`language` varchar(20) collate utf8_unicode_ci NOT NULL default 'en',
|
||||||
`scale_id` tinyint(4) NOT NULL default '0',
|
`scale_id` tinyint(4) NOT NULL default '0',
|
||||||
`same_default` tinyint(4) NOT NULL default '0' COMMENT 'Saves if user set to use the same default value across languages in default options dialog',
|
`same_default` tinyint(4) NOT NULL default '0' COMMENT 'Saves if user set to use the same default value across languages in default options dialog',
|
||||||
|
`relevance` text collate utf8_unicode_ci,
|
||||||
PRIMARY KEY (`qid`,`language`),
|
PRIMARY KEY (`qid`,`language`),
|
||||||
KEY `questions_idx2` (`sid`),
|
KEY `questions_idx2` (`sid`),
|
||||||
KEY `questions_idx3` (`gid`),
|
KEY `questions_idx3` (`gid`),
|
||||||
@@ -598,8 +738,10 @@ CREATE TABLE `lime_question_attributes` (
|
|||||||
`qid` int(11) NOT NULL default '0',
|
`qid` int(11) NOT NULL default '0',
|
||||||
`attribute` varchar(50) collate utf8_unicode_ci default NULL,
|
`attribute` varchar(50) collate utf8_unicode_ci default NULL,
|
||||||
`value` text collate utf8_unicode_ci,
|
`value` text collate utf8_unicode_ci,
|
||||||
|
`language` varchar(20) collate utf8_unicode_ci default NULL,
|
||||||
PRIMARY KEY (`qaid`),
|
PRIMARY KEY (`qaid`),
|
||||||
KEY `question_attributes_idx2` (`qid`)
|
KEY `question_attributes_idx2` (`qid`),
|
||||||
|
KEY `question_attributes_idx3` (`attribute`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -741,14 +883,9 @@ CREATE TABLE `lime_settings_global` (
|
|||||||
-- Dumping data for table `lime_settings_global`
|
-- Dumping data for table `lime_settings_global`
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('DBVersion', '146');
|
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('force_ssl', '');
|
('DBVersion', '155.6'),
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('SessionName', 'ls28629164789259281352');
|
('SessionName', 'ls28629164789259281352');
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('showgroupinfo', 'choose');
|
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('showqnumcode', 'choose');
|
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('showXquestions', 'choose');
|
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('updateavailable', '0');
|
|
||||||
INSERT INTO `lime_settings_global` (`stg_name`, `stg_value`) VALUES('updatelastcheck', '2011-09-07 14:38:57');
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
@@ -795,7 +932,7 @@ CREATE TABLE `lime_surveys` (
|
|||||||
`emailresponseto` text collate utf8_unicode_ci,
|
`emailresponseto` text collate utf8_unicode_ci,
|
||||||
`emailnotificationto` text collate utf8_unicode_ci,
|
`emailnotificationto` text collate utf8_unicode_ci,
|
||||||
`tokenlength` tinyint(2) default '15',
|
`tokenlength` tinyint(2) default '15',
|
||||||
`showXquestions` char(1) collate utf8_unicode_ci default 'Y',
|
`showxquestions` char(1) collate utf8_unicode_ci default 'Y',
|
||||||
`showgroupinfo` char(1) collate utf8_unicode_ci default 'B',
|
`showgroupinfo` char(1) collate utf8_unicode_ci default 'B',
|
||||||
`shownoanswer` char(1) collate utf8_unicode_ci default 'Y',
|
`shownoanswer` char(1) collate utf8_unicode_ci default 'Y',
|
||||||
`showqnumcode` char(1) collate utf8_unicode_ci default 'X',
|
`showqnumcode` char(1) collate utf8_unicode_ci default 'X',
|
||||||
@@ -812,6 +949,8 @@ CREATE TABLE `lime_surveys` (
|
|||||||
`navigationdelay` tinyint(2) default '0',
|
`navigationdelay` tinyint(2) default '0',
|
||||||
`nokeyboard` char(1) collate utf8_unicode_ci default 'N',
|
`nokeyboard` char(1) collate utf8_unicode_ci default 'N',
|
||||||
`alloweditaftercompletion` char(1) collate utf8_unicode_ci default 'N',
|
`alloweditaftercompletion` char(1) collate utf8_unicode_ci default 'N',
|
||||||
|
`googleanalyticsstyle` char(1) collate utf8_unicode_ci default NULL,
|
||||||
|
`googleanalyticsapikey` varchar(25) collate utf8_unicode_ci default NULL,
|
||||||
PRIMARY KEY (`sid`)
|
PRIMARY KEY (`sid`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
@@ -827,7 +966,7 @@ CREATE TABLE `lime_surveys` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE TABLE `lime_surveys_languagesettings` (
|
CREATE TABLE `lime_surveys_languagesettings` (
|
||||||
`surveyls_survey_id` int(10) unsigned NOT NULL default '0',
|
`surveyls_survey_id` int(11) NOT NULL default '0',
|
||||||
`surveyls_language` varchar(45) collate utf8_unicode_ci NOT NULL default 'en',
|
`surveyls_language` varchar(45) collate utf8_unicode_ci NOT NULL default 'en',
|
||||||
`surveyls_title` varchar(200) collate utf8_unicode_ci NOT NULL,
|
`surveyls_title` varchar(200) collate utf8_unicode_ci NOT NULL,
|
||||||
`surveyls_description` text collate utf8_unicode_ci,
|
`surveyls_description` text collate utf8_unicode_ci,
|
||||||
@@ -844,11 +983,11 @@ CREATE TABLE `lime_surveys_languagesettings` (
|
|||||||
`surveyls_email_confirm_subj` varchar(255) collate utf8_unicode_ci default NULL,
|
`surveyls_email_confirm_subj` varchar(255) collate utf8_unicode_ci default NULL,
|
||||||
`surveyls_email_confirm` text collate utf8_unicode_ci,
|
`surveyls_email_confirm` text collate utf8_unicode_ci,
|
||||||
`surveyls_dateformat` int(10) unsigned NOT NULL default '1',
|
`surveyls_dateformat` int(10) unsigned NOT NULL default '1',
|
||||||
`surveyls_numberformat` int(11) NOT NULL default '0',
|
|
||||||
`email_admin_notification_subj` varchar(255) collate utf8_unicode_ci default NULL,
|
`email_admin_notification_subj` varchar(255) collate utf8_unicode_ci default NULL,
|
||||||
`email_admin_notification` text collate utf8_unicode_ci,
|
`email_admin_notification` text collate utf8_unicode_ci,
|
||||||
`email_admin_responses_subj` varchar(255) collate utf8_unicode_ci default NULL,
|
`email_admin_responses_subj` varchar(255) collate utf8_unicode_ci default NULL,
|
||||||
`email_admin_responses` text collate utf8_unicode_ci,
|
`email_admin_responses` text collate utf8_unicode_ci,
|
||||||
|
`surveyls_numberformat` int(11) NOT NULL default '0',
|
||||||
PRIMARY KEY (`surveyls_survey_id`,`surveyls_language`)
|
PRIMARY KEY (`surveyls_survey_id`,`surveyls_language`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
@@ -857,6 +996,25 @@ CREATE TABLE `lime_surveys_languagesettings` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `lime_survey_links`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `lime_survey_links` (
|
||||||
|
`participant_id` varchar(50) collate utf8_unicode_ci NOT NULL,
|
||||||
|
`token_id` int(11) NOT NULL,
|
||||||
|
`survey_id` int(11) NOT NULL,
|
||||||
|
`date_created` datetime NOT NULL,
|
||||||
|
PRIMARY KEY (`participant_id`,`token_id`,`survey_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `lime_survey_links`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -864,8 +1022,8 @@ CREATE TABLE `lime_surveys_languagesettings` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE TABLE `lime_survey_permissions` (
|
CREATE TABLE `lime_survey_permissions` (
|
||||||
`sid` int(10) unsigned NOT NULL,
|
`sid` int(11) NOT NULL,
|
||||||
`uid` int(10) unsigned NOT NULL,
|
`uid` int(11) NOT NULL,
|
||||||
`permission` varchar(20) collate utf8_unicode_ci NOT NULL,
|
`permission` varchar(20) collate utf8_unicode_ci NOT NULL,
|
||||||
`create_p` tinyint(1) NOT NULL default '0',
|
`create_p` tinyint(1) NOT NULL default '0',
|
||||||
`read_p` tinyint(1) NOT NULL default '0',
|
`read_p` tinyint(1) NOT NULL default '0',
|
||||||
@@ -927,19 +1085,22 @@ CREATE TABLE `lime_users` (
|
|||||||
`users_name` varchar(64) collate utf8_unicode_ci NOT NULL default '',
|
`users_name` varchar(64) collate utf8_unicode_ci NOT NULL default '',
|
||||||
`password` blob NOT NULL,
|
`password` blob NOT NULL,
|
||||||
`full_name` varchar(50) collate utf8_unicode_ci NOT NULL,
|
`full_name` varchar(50) collate utf8_unicode_ci NOT NULL,
|
||||||
`parent_id` int(10) unsigned NOT NULL,
|
`parent_id` int(11) NOT NULL,
|
||||||
`lang` varchar(20) collate utf8_unicode_ci default NULL,
|
`lang` varchar(20) collate utf8_unicode_ci default NULL,
|
||||||
`email` varchar(320) collate utf8_unicode_ci default NULL,
|
`email` varchar(320) collate utf8_unicode_ci default NULL,
|
||||||
`create_survey` tinyint(1) NOT NULL default '0',
|
`create_survey` tinyint(1) NOT NULL default '0',
|
||||||
`create_user` tinyint(1) NOT NULL default '0',
|
`create_user` tinyint(1) NOT NULL default '0',
|
||||||
|
`participant_panel` tinyint(1) NOT NULL default '0',
|
||||||
`delete_user` tinyint(1) NOT NULL default '0',
|
`delete_user` tinyint(1) NOT NULL default '0',
|
||||||
`superadmin` tinyint(1) NOT NULL default '0',
|
`superadmin` tinyint(1) NOT NULL default '0',
|
||||||
`configurator` tinyint(1) NOT NULL default '0',
|
`configurator` tinyint(1) NOT NULL default '0',
|
||||||
`manage_template` tinyint(1) NOT NULL default '0',
|
`manage_template` tinyint(1) NOT NULL default '0',
|
||||||
`manage_label` tinyint(1) NOT NULL default '0',
|
`manage_label` tinyint(1) NOT NULL default '0',
|
||||||
`htmleditormode` varchar(7) collate utf8_unicode_ci default 'default',
|
`htmleditormode` varchar(7) collate utf8_unicode_ci default 'default',
|
||||||
|
`templateeditormode` varchar(7) collate utf8_unicode_ci default 'default',
|
||||||
|
`questionselectormode` varchar(7) collate utf8_unicode_ci default 'default',
|
||||||
`one_time_pw` blob,
|
`one_time_pw` blob,
|
||||||
`dateformat` int(10) unsigned NOT NULL default '1',
|
`dateformat` int(11) NOT NULL default '1',
|
||||||
PRIMARY KEY (`uid`),
|
PRIMARY KEY (`uid`),
|
||||||
UNIQUE KEY `users_name` (`users_name`)
|
UNIQUE KEY `users_name` (`users_name`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
@@ -948,7 +1109,8 @@ CREATE TABLE `lime_users` (
|
|||||||
-- Dumping data for table `lime_users`
|
-- Dumping data for table `lime_users`
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO `lime_users` (`uid`, `users_name`, `password`, `full_name`, `parent_id`, `lang`, `email`, `create_survey`, `create_user`, `delete_user`, `superadmin`, `configurator`, `manage_template`, `manage_label`, `htmleditormode`, `one_time_pw`, `dateformat`) VALUES(1, 'admin', 0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438, 'Your Name', 0, 'en', 'your@email.org', 1, 1, 1, 1, 1, 1, 1, 'default', NULL, 1);
|
INSERT INTO `lime_users` (`uid`, `users_name`, `password`, `full_name`, `parent_id`, `lang`, `email`, `create_survey`, `create_user`, `participant_panel`, `delete_user`, `superadmin`, `configurator`, `manage_template`, `manage_label`, `htmleditormode`, `templateeditormode`, `questionselectormode`, `one_time_pw`, `dateformat`) VALUES
|
||||||
|
(1, 'admin', 0x35653838343839386461323830343731353164306535366638646336323932373733363033643064366161626264643632613131656637323164313534326438, 'Your Name', 0, 'en', 'your-email@example.net', 1, 1, 0, 1, 1, 1, 1, 1, 'default', 'default', 'default', NULL, 1);
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
@@ -957,10 +1119,10 @@ INSERT INTO `lime_users` (`uid`, `users_name`, `password`, `full_name`, `parent_
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE TABLE `lime_user_groups` (
|
CREATE TABLE `lime_user_groups` (
|
||||||
`ugid` int(10) unsigned NOT NULL auto_increment,
|
`ugid` int(11) NOT NULL auto_increment,
|
||||||
`name` varchar(20) collate utf8_unicode_ci NOT NULL,
|
`name` varchar(20) collate utf8_unicode_ci NOT NULL,
|
||||||
`description` text collate utf8_unicode_ci NOT NULL,
|
`description` text collate utf8_unicode_ci NOT NULL,
|
||||||
`owner_id` int(10) unsigned NOT NULL,
|
`owner_id` int(11) NOT NULL,
|
||||||
PRIMARY KEY (`ugid`),
|
PRIMARY KEY (`ugid`),
|
||||||
UNIQUE KEY `name` (`name`)
|
UNIQUE KEY `name` (`name`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
@@ -977,8 +1139,8 @@ CREATE TABLE `lime_user_groups` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
CREATE TABLE `lime_user_in_groups` (
|
CREATE TABLE `lime_user_in_groups` (
|
||||||
`ugid` int(10) unsigned NOT NULL,
|
`ugid` int(11) NOT NULL,
|
||||||
`uid` int(10) unsigned NOT NULL,
|
`uid` int(11) NOT NULL,
|
||||||
PRIMARY KEY (`ugid`,`uid`)
|
PRIMARY KEY (`ugid`,`uid`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
/upload/surveys/*
|
||||||
@@ -10,15 +10,15 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: access_denied.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: access_denied.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if (!isset($dbprefix) || isset($_REQUEST['dbprefix'])) {die("Cannot run this script directly (access_denied)");}
|
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
||||||
|
|
||||||
if (isset($_SESSION['loginID']))
|
if (isset($_SESSION['loginID']))
|
||||||
{
|
{
|
||||||
|
include('html.php'); // For showadminmenu
|
||||||
$accesssummary = "<p><strong>".$clang->gT("Access denied!")."</strong><br />\n";
|
$accesssummary = "<p><strong>".$clang->gT("Access denied!")."</strong><br />\n";
|
||||||
|
|
||||||
$action=returnglobal('action');
|
$action=returnglobal('action');
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: activate.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: activate.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -88,3 +88,4 @@ else
|
|||||||
include('tokens.php');
|
include('tokens.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,31 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* LimeSurvey
|
* LimeSurvey
|
||||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||||
* LimeSurvey is free software. This version may have been modified pursuant
|
* LimeSurvey is free software. This version may have been modified pursuant
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* to the GNU General Public License, and as distributed it includes or
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
* is derivative of works licensed under the GNU General Public License or
|
||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: admin.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: admin.php 12082 2012-01-17 04:55:39Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
|
// Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
|
||||||
|
|
||||||
require_once(dirname(__FILE__).'/../classes/core/startup.php');
|
require_once(dirname(__FILE__).'/../classes/core/startup.php');
|
||||||
|
|
||||||
// XML code for LS1.70 is based on the experimental PHP4 domxml
|
|
||||||
// extension. PHP5 uses the PHP5/dom extension unless the old domxml is activated
|
|
||||||
// the following file is a wrapper to use PHP4/domxml scripts
|
|
||||||
// with PHP5/dom or PHP6/dom
|
|
||||||
// see http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html#licence
|
|
||||||
if (version_compare(PHP_VERSION,'5','>=')&& !(function_exists('domxml_new_doc')))
|
|
||||||
{
|
|
||||||
require_once(dirname(__FILE__).'/classes/core/domxml-php4-to-php5.php');
|
|
||||||
}
|
|
||||||
require_once(dirname(__FILE__).'/../config-defaults.php');
|
require_once(dirname(__FILE__).'/../config-defaults.php');
|
||||||
require_once(dirname(__FILE__).'/../common.php');
|
require_once(dirname(__FILE__).'/../common.php');
|
||||||
|
|
||||||
@@ -45,6 +36,19 @@ if (!isset($action)) {$action=returnglobal('action');} //Desired action
|
|||||||
if (!isset($subaction)) {$subaction=returnglobal('subaction');} //Desired subaction
|
if (!isset($subaction)) {$subaction=returnglobal('subaction');} //Desired subaction
|
||||||
if (!isset($editedaction)) {$editedaction=returnglobal('editedaction');} // for html editor integration
|
if (!isset($editedaction)) {$editedaction=returnglobal('editedaction');} // for html editor integration
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_REFERER']))
|
||||||
|
{
|
||||||
|
$refurl = $_SERVER['HTTP_REFERER']; //store referer. Can be used for other screens and not just GlobalSettings
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$refurl = "";
|
||||||
|
}
|
||||||
|
LimeExpressionManager::SetSurveyId($surveyid); // must be called early - it clears internal cache if a new survey is being used
|
||||||
|
if (!is_null($surveyid)) {
|
||||||
|
$sinfo = getSurveyInfo($surveyid);
|
||||||
|
LimeExpressionManager::SetEMLanguage($sinfo['surveyls_language']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($action != 'showprintablesurvey' && substr($action,0,4)!= 'ajax')
|
if ($action != 'showprintablesurvey' && substr($action,0,4)!= 'ajax')
|
||||||
{
|
{
|
||||||
@@ -85,15 +89,15 @@ if(isset($_SESSION['loginID']))
|
|||||||
sendcacheheaders();
|
sendcacheheaders();
|
||||||
|
|
||||||
/* Check user right actions for validity
|
/* Check user right actions for validity
|
||||||
Currently existing user rights:
|
Currently existing user rights:
|
||||||
`configurator`
|
`configurator`
|
||||||
`create_survey`
|
`create_survey`
|
||||||
`create_user`
|
`create_user`
|
||||||
`delete_user`
|
`delete_user`
|
||||||
`manage_label`
|
`manage_label`
|
||||||
`manage_template`
|
`manage_template`
|
||||||
`superadmin`
|
`superadmin`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'importsurvey' || $action == 'copysurvey')
|
if ($action == 'importsurvey' || $action == 'copysurvey')
|
||||||
{
|
{
|
||||||
@@ -102,7 +106,7 @@ if(isset($_SESSION['loginID']))
|
|||||||
}
|
}
|
||||||
elseif ($action == 'dumpdb')
|
elseif ($action == 'dumpdb')
|
||||||
{
|
{
|
||||||
if ($_SESSION['USER_RIGHT_CONFIGURATOR']==1) {include('dumpdb.php');}
|
if ($_SESSION['USER_RIGHT_SUPERADMIN']==1) {include('dumpdb.php');}
|
||||||
else { include('access_denied.php');}
|
else { include('access_denied.php');}
|
||||||
}
|
}
|
||||||
elseif ($action == 'dumplabel')
|
elseif ($action == 'dumplabel')
|
||||||
@@ -149,14 +153,14 @@ if(isset($_SESSION['loginID']))
|
|||||||
|
|
||||||
|
|
||||||
/* Check survey right actions for validity
|
/* Check survey right actions for validity
|
||||||
Currently existing survey rights:
|
Currently existing survey rights:
|
||||||
`edit_survey_property`
|
`edit_survey_property`
|
||||||
`define_questions`
|
`define_questions`
|
||||||
`browse_response`
|
`browse_response`
|
||||||
`export`
|
`export`
|
||||||
`delete_survey`
|
`delete_survey`
|
||||||
`activate_survey`
|
`activate_survey`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'activate')
|
if ($action == 'activate')
|
||||||
{
|
{
|
||||||
@@ -255,6 +259,25 @@ if(isset($_SESSION['loginID']))
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
elseif ($action == 'showlogicfile')
|
||||||
|
{
|
||||||
|
if(bHasSurveyPermission($surveyid,'translations','read'))
|
||||||
|
{
|
||||||
|
$surveyid = sanitize_int($surveyid);
|
||||||
|
$thissurvey = getSurveyInfo($surveyid);
|
||||||
|
$_POST['sid'] = $surveyid . '|N';
|
||||||
|
$_POST['LEM_PRETTY_PRINT_ALL_SYNTAX'] = 'Y';
|
||||||
|
$_POST['surveyMode'] = 'survey';
|
||||||
|
$_POST['LEMcalledFromAdmin'] = 'Y';
|
||||||
|
$_POST['assessments'] = $thissurvey['assessments'];
|
||||||
|
LimeExpressionManager::SetDirtyFlag();
|
||||||
|
if (isset($_GET['gid'])) { $_POST['gid'] = $_GET['gid']; }
|
||||||
|
if (isset($_GET['qid'])) { $_POST['qid'] = $_GET['qid']; }
|
||||||
|
include($rootdir . '/classes/expressions/test/survey_logic_file.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else { include('access_denied.php');}
|
||||||
|
}
|
||||||
elseif ($action=='addgroup' || $action=='editgroup' || $action=='ordergroups')
|
elseif ($action=='addgroup' || $action=='editgroup' || $action=='ordergroups')
|
||||||
{
|
{
|
||||||
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {$_SESSION['FileManagerContext']="edit:group:$surveyid"; include('questiongrouphandling.php');}
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {$_SESSION['FileManagerContext']="edit:group:$surveyid"; include('questiongrouphandling.php');}
|
||||||
@@ -265,13 +288,13 @@ if(isset($_SESSION['loginID']))
|
|||||||
if(bHasSurveyPermission($surveyid,'responses','read')) {include('saved.php');}
|
if(bHasSurveyPermission($surveyid,'responses','read')) {include('saved.php');}
|
||||||
else { include('access_denied.php');}
|
else { include('access_denied.php');}
|
||||||
}
|
}
|
||||||
//<AdV>
|
//<AdV>
|
||||||
elseif ($action == 'translate')
|
elseif ($action == 'translate')
|
||||||
{
|
{
|
||||||
if(bHasSurveyPermission($surveyid,'translations','read')) {$_SESSION['FileManagerContext']="edit:translate:$surveyid"; include('translate.php');}
|
if(bHasSurveyPermission($surveyid,'translations','read')) {$_SESSION['FileManagerContext']="edit:translate:$surveyid"; include('translate.php');}
|
||||||
else { include('access_denied.php'); }
|
else { include('access_denied.php'); }
|
||||||
}
|
}
|
||||||
//</AdV>
|
//</AdV>
|
||||||
elseif ($action == 'tokens')
|
elseif ($action == 'tokens')
|
||||||
{
|
{
|
||||||
if(bHasSurveyPermission($surveyid,'tokens','read'))
|
if(bHasSurveyPermission($surveyid,'tokens','read'))
|
||||||
@@ -437,11 +460,11 @@ if(isset($_SESSION['loginID']))
|
|||||||
include('surveylist.php');
|
include('surveylist.php');
|
||||||
}
|
}
|
||||||
if (!isset($assessmentsoutput) && !isset($statisticsoutput) && !isset($browseoutput) &&
|
if (!isset($assessmentsoutput) && !isset($statisticsoutput) && !isset($browseoutput) &&
|
||||||
!isset($savedsurveyoutput) && !isset($listcolumnoutput) && !isset($conditionsoutput) &&
|
!isset($savedsurveyoutput) && !isset($listcolumnoutput) && !isset($conditionsoutput) &&
|
||||||
!isset($importoldresponsesoutput) && !isset($exportroutput) && !isset($vvoutput) &&
|
!isset($importoldresponsesoutput) && !isset($exportroutput) && !isset($vvoutput) &&
|
||||||
!isset($tokenoutput) && !isset($exportoutput) && !isset($templatesoutput) && !isset($translateoutput) && //<AdV>
|
!isset($tokenoutput) && !isset($exportoutput) && !isset($templatesoutput) && !isset($translateoutput) && //<AdV>
|
||||||
!isset($iteratesurveyoutput) && (substr($action,0,4)!= 'ajax') && ($action!='update') &&
|
!isset($iteratesurveyoutput) && (substr($action,0,4)!= 'ajax') && ($action!='update') &&
|
||||||
(isset($surveyid) || $action == "" || preg_match('/^(personalsettings|statistics|copysurvey|importsurvey|editsurveysettings|editsurveylocalesettings|updatesurveysettings|updatesurveysettingsandeditlocalesettings|updatedefaultvalues|ordergroups|dataentry|newsurvey|globalsettings|editusergroups|editusergroup|exportspss|surveyrights|quotas|editusers|login|browse|vvimport|vvexport|setuserrights|modifyuser|setusertemplates|deluser|adduser|userrights|usertemplates|moduser|addusertogroup|deleteuserfromgroup|globalsettingssave|savepersonalsettings|addusergroup|editusergroupindb|usergroupindb|finaldeluser|delusergroup|mailusergroup|mailsendusergroup)$/',$action)))
|
(isset($surveyid) || $action == "" || preg_match('/^(personalsettings|statistics|copysurvey|importsurvey|editsurveysettings|editsurveylocalesettings|updatesurveysettings|updatesurveysettingsandeditlocalesettings|updatedefaultvalues|ordergroups|dataentry|newsurvey|globalsettings|editusergroups|editusergroup|exportspss|surveyrights|quotas|editusers|login|browse|vvimport|vvexport|setuserrights|modifyuser|setusertemplates|deluser|adduser|userrights|usertemplates|moduser|addusertogroup|deleteuserfromgroup|globalsettingssave|savepersonalsettings|addusergroup|editusergroupindb|usergroupindb|finaldeluser|delusergroup|mailusergroup|mailsendusergroup)$/',$action)))
|
||||||
{
|
{
|
||||||
if ($action=='editsurveysettings' || $action=='editsurveylocalesettings')
|
if ($action=='editsurveysettings' || $action=='editsurveylocalesettings')
|
||||||
{
|
{
|
||||||
@@ -520,8 +543,103 @@ if(isset($_SESSION['loginID']))
|
|||||||
if(bHasSurveyPermission($surveyid,'responses','create')) {include('vvimport.php');}
|
if(bHasSurveyPermission($surveyid,'responses','create')) {include('vvimport.php');}
|
||||||
else { include('access_denied.php');}
|
else { include('access_denied.php');}
|
||||||
}
|
}
|
||||||
|
elseif ($action == 'EMtest') {
|
||||||
|
switch ($subaction) {
|
||||||
|
case 'functions':
|
||||||
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {
|
||||||
|
include('../classes/expressions/test/functions.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'stringsplit':
|
||||||
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {
|
||||||
|
include('../classes/expressions/test/stringsplit.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'tokenizer':
|
||||||
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {
|
||||||
|
include('../classes/expressions/test/tokenizer.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'unit':
|
||||||
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {
|
||||||
|
include('../classes/expressions/test/unit.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'strings_with_expressions':
|
||||||
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {
|
||||||
|
include('../classes/expressions/test/strings_with_expressions.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'relevance':
|
||||||
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {
|
||||||
|
include('../classes/expressions/test/relevance.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'conditions2relevance':
|
||||||
|
if (bHasSurveyPermission($surveyid, 'surveycontent', 'read'))
|
||||||
|
{
|
||||||
|
include('../classes/expressions/test/conditions2relevance.php');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'navigation_test':
|
||||||
|
if($_SESSION['USER_RIGHT_CONFIGURATOR']==1) {
|
||||||
|
include('../classes/expressions/test/navigation_test.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'survey_logic_file':
|
||||||
|
if($_SESSION['USER_RIGHT_CONFIGURATOR']==1) {
|
||||||
|
include('../classes/expressions/test/survey_logic_file.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'upgrade_conditions2relevance':
|
||||||
|
if($_SESSION['USER_RIGHT_CONFIGURATOR']==1) {
|
||||||
|
include('../classes/expressions/test/upgrade_conditions2relevance.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {
|
||||||
|
include('../classes/expressions/test/test.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
include('access_denied.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
if ($action=='addquestion' || $action=='copyquestion' || $action=='editquestion' || $action=='editdefaultvalues' ||
|
if ($action=='addquestion' || $action=='copyquestion' || $action=='editquestion' || $action=='editdefaultvalues' ||
|
||||||
$action=='orderquestions' || $action=='ajaxquestionattributes' || $action=='ajaxlabelsetpicker' || $action=='ajaxlabelsetdetails')
|
$action=='orderquestions' || $action=='ajaxquestionattributes' || $action=='ajaxlabelsetpicker' || $action=='ajaxlabelsetdetails')
|
||||||
{
|
{
|
||||||
if(bHasSurveyPermission($surveyid,'surveycontent','read'))
|
if(bHasSurveyPermission($surveyid,'surveycontent','read'))
|
||||||
{
|
{
|
||||||
@@ -674,11 +792,11 @@ if(isset($_SESSION['loginID']))
|
|||||||
else
|
else
|
||||||
{ //not logged in
|
{ //not logged in
|
||||||
|
|
||||||
sendcacheheaders();
|
sendcacheheaders();
|
||||||
if (!isset($_SESSION['metaHeader'])) {$_SESSION['metaHeader']='';}
|
if (!isset($_SESSION['metaHeader'])) {$_SESSION['metaHeader']='';}
|
||||||
$adminoutput = getAdminHeader($_SESSION['metaHeader']).$adminoutput.$loginsummary; // All future output is written into this and then outputted at the end of file
|
$adminoutput = getAdminHeader($_SESSION['metaHeader']).$adminoutput.$loginsummary; // All future output is written into this and then outputted at the end of file
|
||||||
unset($_SESSION['metaHeader']);
|
unset($_SESSION['metaHeader']);
|
||||||
$adminoutput.= "</div>\n".getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
|
$adminoutput.= "</div>\n".getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
|
||||||
}
|
}
|
||||||
if (($action=='showphpinfo') && ($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1))
|
if (($action=='showphpinfo') && ($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: admin_functions.php 9586 2010-12-06 03:08:07Z c_schmitz $
|
* $Id: admin_functions.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
* Files Purpose:
|
* Files Purpose:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -339,6 +339,7 @@ function getAdminHeader($meta=false)
|
|||||||
$strAdminHeader.= "<script type=\"text/javascript\" src=\"{$homeurl}/scripts/tabpane/js/tabpane.js\"></script>\n"
|
$strAdminHeader.= "<script type=\"text/javascript\" src=\"{$homeurl}/scripts/tabpane/js/tabpane.js\"></script>\n"
|
||||||
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.js\"></script>\n"
|
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.js\"></script>\n"
|
||||||
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery-ui.js\"></script>\n"
|
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery-ui.js\"></script>\n"
|
||||||
|
. "<script type=\"text/javascript\" src=\"".$rooturl."/scripts/jquery/jquery.ui.touch-punch.min.js\"></script>\n"
|
||||||
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.qtip.js\"></script>\n"
|
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.qtip.js\"></script>\n"
|
||||||
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.notify.js\"></script>\n"
|
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.notify.js\"></script>\n"
|
||||||
. "<script type=\"text/javascript\" src=\"{$homeurl}/scripts/admin_core.js\"></script>\n";
|
. "<script type=\"text/javascript\" src=\"{$homeurl}/scripts/admin_core.js\"></script>\n";
|
||||||
@@ -404,4 +405,4 @@ function getAdminHeader($meta=false)
|
|||||||
// Standard header
|
// Standard header
|
||||||
$strAdminHeader .="<div class='maintitle'>{$sitename}</div>\n";
|
$strAdminHeader .="<div class='maintitle'>{$sitename}</div>\n";
|
||||||
return $strAdminHeader;
|
return $strAdminHeader;
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: assessments.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: assessments.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ if (bHasSurveyPermission($surveyid, 'assessments','read'))
|
|||||||
$assessmentsoutput.= "\t</div>\n"
|
$assessmentsoutput.= "\t</div>\n"
|
||||||
. "\t<div class='menubar-main'>\n"
|
. "\t<div class='menubar-main'>\n"
|
||||||
. "<div class='menubar-left'>\n"
|
. "<div class='menubar-left'>\n"
|
||||||
. "\t<a href=\"#\" onclick=\"window.open('$scriptname?sid=$surveyid', '_self')\" title='".$clang->gTview("Return to survey administration")."'>"
|
. "\t<a href=\"#\" onclick=\"window.open('$scriptname?sid=$surveyid', '_self')\" title='".$clang->gTview("Return to survey administration")."'>"
|
||||||
. "<img name='Administration' src='$imageurl/home.png' alt='".$clang->gT("Return to survey administration")."' /></a>\n"
|
. "<img name='Administration' src='$imageurl/home.png' alt='".$clang->gT("Return to survey administration")."' /></a>\n"
|
||||||
. "\t<img src='$imageurl/blank.gif' alt='' width='11' />\n"
|
. "\t<img src='$imageurl/blank.gif' alt='' width='11' />\n"
|
||||||
. "\t<img src='$imageurl/seperator.gif' alt='' />\n";
|
. "\t<img src='$imageurl/seperator.gif' alt='' />\n";
|
||||||
@@ -171,10 +171,11 @@ if (bHasSurveyPermission($surveyid, 'assessments','read'))
|
|||||||
$assessmentsoutput.= "<th>$head</th>\n";
|
$assessmentsoutput.= "<th>$head</th>\n";
|
||||||
}
|
}
|
||||||
$assessmentsoutput.= "<th>".$clang->gT("Title")."</th><th>".$clang->gT("Message")."</th>";
|
$assessmentsoutput.= "<th>".$clang->gT("Title")."</th><th>".$clang->gT("Message")."</th>";
|
||||||
$assessmentsoutput.= "</tr></thead>\n<tbody>\n";
|
$assessmentsoutput.= "</tr></thead>\n";
|
||||||
$flipflop=true;
|
$flipflop=true;
|
||||||
foreach($assessments as $assess) {
|
foreach($assessments as $assess) {
|
||||||
$flipflop=!$flipflop;
|
$flipflop=!$flipflop;
|
||||||
|
$assessmentsoutput.= "<tbody>\n";
|
||||||
if ($flipflop==true){$assessmentsoutput.= "<tr class='oddrow'>\n";}
|
if ($flipflop==true){$assessmentsoutput.= "<tr class='oddrow'>\n";}
|
||||||
else {$assessmentsoutput.= "<tr class='evenrow'>\n";}
|
else {$assessmentsoutput.= "<tr class='evenrow'>\n";}
|
||||||
$assessmentsoutput.= "<td>".$assess['id']."</td>\n";
|
$assessmentsoutput.= "<td>".$assess['id']."</td>\n";
|
||||||
@@ -226,32 +227,33 @@ if (bHasSurveyPermission($surveyid, 'assessments','read'))
|
|||||||
$assessmentsoutput.= "<br /><form method='post' class='form30' id='assessmentsform' name='assessmentsform' action='$scriptname?sid=$surveyid'><div class='header ui-widget-header'>\n";
|
$assessmentsoutput.= "<br /><form method='post' class='form30' id='assessmentsform' name='assessmentsform' action='$scriptname?sid=$surveyid'><div class='header ui-widget-header'>\n";
|
||||||
$assessmentsoutput.= "$actiontitle</div>\n";
|
$assessmentsoutput.= "$actiontitle</div>\n";
|
||||||
|
|
||||||
$assessmentsoutput.="<ul><li><label>".$clang->gT("Scope")."</label><input type='radio' id='radiototal' name='scope' value='T' ";
|
$assessmentsoutput.="<ul>\n"
|
||||||
|
."<li><label>".$clang->gT("Scope")."</label><input type='radio' id='radiototal' name='scope' value='T' ";
|
||||||
if (!isset($editdata) || $editdata['scope'] == "T") {$assessmentsoutput .= " checked='checked' ";}
|
if (!isset($editdata) || $editdata['scope'] == "T") {$assessmentsoutput .= " checked='checked' ";}
|
||||||
$assessmentsoutput.=" /><label for='radiototal'>".$clang->gT("Total")."</label>
|
$assessmentsoutput.=" /><label for='radiototal'>".$clang->gT("Total")."</label>
|
||||||
<input type='radio' id='radiogroup' name='scope' value='G'";
|
<input type='radio' id='radiogroup' name='scope' value='G'";
|
||||||
if (isset($editdata) && $editdata['scope'] == "G") {$assessmentsoutput .= " checked='checked' ";}
|
if (isset($editdata) && $editdata['scope'] == "G") {$assessmentsoutput .= " checked='checked' ";}
|
||||||
$assessmentsoutput.="/><label for='radiogroup'>".$clang->gT("Group")."</label></li>";
|
$assessmentsoutput.="/><label for='radiogroup'>".$clang->gT("Group")."</label></li>\n";
|
||||||
$assessmentsoutput.="<li><label for='gid'>".$clang->gT("Question group")."</label>$groupselect</li>"
|
$assessmentsoutput.="<li><label for='gid'>".$clang->gT("Question group")."</label>$groupselect</li>\n"
|
||||||
."<li><label for='minimum'>".$clang->gT("Minimum")."</label><input type='text' id='minimum' name='minimum' class='numbersonly'";
|
."<li><label for='minimum'>".$clang->gT("Minimum")."</label><input type='text' id='minimum' name='minimum' class='numbersonly'";
|
||||||
if (isset($editdata)) {$assessmentsoutput .= " value='{$editdata['minimum']}' ";}
|
if (isset($editdata)) {$assessmentsoutput .= " value='{$editdata['minimum']}' ";}
|
||||||
$assessmentsoutput.="/></li>"
|
$assessmentsoutput.="/></li>\n"
|
||||||
."<li><label for='maximum'>".$clang->gT("Maximum")."</label><input type='text' id='maximum' name='maximum' class='numbersonly'";
|
."<li><label for='maximum'>".$clang->gT("Maximum")."</label><input type='text' id='maximum' name='maximum' class='numbersonly'";
|
||||||
if (isset($editdata)) {$assessmentsoutput .= " value='{$editdata['maximum']}' ";}
|
if (isset($editdata)) {$assessmentsoutput .= " value='{$editdata['maximum']}' ";}
|
||||||
$assessmentsoutput.="/></li>";
|
$assessmentsoutput.="/></li>\n"
|
||||||
|
."</ul>";
|
||||||
|
|
||||||
// start tabs
|
// start tabs
|
||||||
$assessmentsoutput.= "<tr><td> </td><td> </td></tr>\n";
|
$assessmentsoutput.= "<div id=\"languagetabs\">"
|
||||||
$assessmentsoutput.='</table><div id="languagetabs">'
|
."<ul>\n";
|
||||||
.'<ul>';
|
|
||||||
foreach ($assessmentlangs as $assessmentlang)
|
foreach ($assessmentlangs as $assessmentlang)
|
||||||
{
|
{
|
||||||
$position=0;
|
$position=0;
|
||||||
$assessmentsoutput .= '<li><a href="#tablang'.$assessmentlang.'"><span>'.getLanguageNameFromCode($assessmentlang, false);
|
$assessmentsoutput .= '<li><a href="#tablang'.$assessmentlang.'"><span>'.getLanguageNameFromCode($assessmentlang, false);
|
||||||
if ($assessmentlang==$baselang) {$assessmentsoutput .= ' ('.$clang->gT("Base language").')';}
|
if ($assessmentlang==$baselang) {$assessmentsoutput .= ' ('.$clang->gT("Base language").')';}
|
||||||
$assessmentsoutput .='</span></a></li>';
|
$assessmentsoutput .="</span></a></li>\n";
|
||||||
}
|
}
|
||||||
$assessmentsoutput.= '</ul>';
|
$assessmentsoutput.= "</ul>\n";
|
||||||
foreach ($assessmentlangs as $assessmentlang)
|
foreach ($assessmentlangs as $assessmentlang)
|
||||||
{
|
{
|
||||||
$heading=''; $message='';
|
$heading=''; $message='';
|
||||||
@@ -265,28 +267,29 @@ if (bHasSurveyPermission($surveyid, 'assessments','read'))
|
|||||||
$heading=htmlspecialchars($editdata['name'],ENT_QUOTES);
|
$heading=htmlspecialchars($editdata['name'],ENT_QUOTES);
|
||||||
$message=htmlspecialchars($editdata['message']);
|
$message=htmlspecialchars($editdata['message']);
|
||||||
}
|
}
|
||||||
$assessmentsoutput .= '<div id="tablang'.$assessmentlang.'">';
|
$assessmentsoutput .= "<div id=\"tablang".$assessmentlang."\">\n"
|
||||||
$assessmentsoutput .= $clang->gT("Heading")."<br/>"
|
."\t<div class='settingrow'>\n"
|
||||||
."<input type='text' name='name_$assessmentlang' size='80' value='$heading'/><br /><br />"
|
."\t\t<span class=\"settingcaption\">".$clang->gT("Heading")."</span>\n"
|
||||||
.$clang->gT("Message")
|
."\t\t<span class=\"settingentry\"><input type='text' name='name_$assessmentlang' size='80' value='$heading'/></span>\n"
|
||||||
."<textarea name='assessmentmessage_$assessmentlang' id='assessmentmessage_$assessmentlang' rows='10' cols='80'>$message</textarea >";
|
."\t</div>\n"
|
||||||
|
."\t<div class='settingrow'>\n"
|
||||||
$assessmentsoutput .='</div>';
|
."\t\t<span class=\"settingcaption\">".$clang->gT("Message")."</span>\n"
|
||||||
|
."\t\t<span class=\"settingentry\">\n\t\t\t<textarea name='assessmentmessage_$assessmentlang' id='assessmentmessage_$assessmentlang' rows='10' cols='80'>$message</textarea >\n";
|
||||||
|
$assessmentsoutput.=getEditor("assessment-text","assessmentmessage_$assessmentlang", "[".$clang->gT("Message:", "js")."]",$surveyid,$gid,$qid,$action);
|
||||||
|
$assessmentsoutput .="</span>\n\t</div>\n"
|
||||||
|
."\t<div style='clear:both'></div>\n"
|
||||||
|
."</div>";
|
||||||
}
|
}
|
||||||
$assessmentsoutput .='</div>';
|
$assessmentsoutput .='</div>';
|
||||||
|
|
||||||
|
$assessmentsoutput.= "<p>\n"
|
||||||
$assessmentsoutput.= "<p><input type='submit' value='".$clang->gT("Save")."' />\n";
|
."<input type='submit' value='".$clang->gT("Save")."' />\n";
|
||||||
if ($action == "assessmentedit") $assessmentsoutput.= " <input type='submit' value='".$clang->gT("Cancel")."' onclick=\"document.assessmentsform.action.value='assessments'\" />\n";
|
if ($action == "assessmentedit") $assessmentsoutput.= " <input type='submit' value='".$clang->gT("Cancel")."' onclick=\"document.assessmentsform.action.value='assessments'\" />\n";
|
||||||
$assessmentsoutput.= "<input type='hidden' name='sid' value='$surveyid' />\n"
|
$assessmentsoutput.= "<input type='hidden' name='sid' value='$surveyid' />\n"
|
||||||
."<input type='hidden' name='action' value='$actionvalue' />\n"
|
."<input type='hidden' name='action' value='$actionvalue' />\n"
|
||||||
."<input type='hidden' name='id' value='$thisid' />\n"
|
."<input type='hidden' name='id' value='$thisid' />\n"
|
||||||
."</div>\n"
|
."</p>\n"
|
||||||
."</form>\n";
|
."</form>\n";
|
||||||
foreach ($assessmentlangs as $assessmentlang)
|
|
||||||
{
|
|
||||||
$assessmentsoutput.=getEditor("assessment-text","assessmentmessage_$assessmentlang", "[".$clang->gT("Message:", "js")."]",$surveyid,$gid,$qid,$action);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,13 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: browse.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
||||||
|
|
||||||
if (!isset($limit)) {$limit=returnglobal('limit');}
|
if (!isset($limit)) {$limit=(int)returnglobal('limit');}
|
||||||
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
||||||
if (!isset($id)) {$id=returnglobal('id');}
|
if (!isset($id)) {$id=(int)returnglobal('id');}
|
||||||
if (!isset($order)) {$order=returnglobal('order');}
|
if (!isset($order)) {$order=returnglobal('order');}
|
||||||
if (!isset($browselang)) {$browselang=returnglobal('browselang');}
|
if (!isset($browselang)) {$browselang=returnglobal('browselang');}
|
||||||
|
|
||||||
@@ -121,7 +120,7 @@ if ($subaction == "id")
|
|||||||
$dateformatdetails=getDateFormatData($_SESSION['dateformat']);
|
$dateformatdetails=getDateFormatData($_SESSION['dateformat']);
|
||||||
|
|
||||||
//SHOW HEADER
|
//SHOW HEADER
|
||||||
if (!isset($_POST['sql']) || !$_POST['sql']) {$browseoutput .= $surveyoptions;} // Don't show options if coming from tokens/statistics script
|
if (!isset($_SESSION['sql']) || !$_SESSION['sql']) {$browseoutput .= $surveyoptions;} // Don't show options if coming from tokens/statistics script
|
||||||
//FIRST LETS GET THE NAMES OF THE QUESTIONS AND MATCH THEM TO THE FIELD NAMES FOR THE DATABASE
|
//FIRST LETS GET THE NAMES OF THE QUESTIONS AND MATCH THEM TO THE FIELD NAMES FOR THE DATABASE
|
||||||
|
|
||||||
$fncount = 0;
|
$fncount = 0;
|
||||||
@@ -188,20 +187,22 @@ if ($subaction == "id")
|
|||||||
|
|
||||||
$nfncount = count($fnames)-1;
|
$nfncount = count($fnames)-1;
|
||||||
//SHOW INDIVIDUAL RECORD
|
//SHOW INDIVIDUAL RECORD
|
||||||
$idquery = "SELECT * FROM $surveytable ";
|
$idquery = "SELECT * FROM {$surveytable} s";
|
||||||
if ($surveyinfo['anonymized'] == "N" && db_tables_exist($tokentable))
|
if ($surveyinfo['anonymized'] == "N" && db_tables_exist($tokentable))
|
||||||
$idquery .= "LEFT JOIN $tokentable ON $surveytable.token = $tokentable.token ";
|
$idquery .= " LEFT JOIN {$tokentable} t ON s.token = t.token ";
|
||||||
|
|
||||||
|
|
||||||
//queXS Addition
|
//queXS Addition
|
||||||
$qfs = questionnaireSampleFilterstate();
|
$qfs = questionnaireSampleFilterstate();
|
||||||
if ($qfs != false)
|
if ($qfs != false)
|
||||||
{
|
{
|
||||||
//Limit responses by questionnaire and/or sample
|
//Limit responses by questionnaire and/or sample
|
||||||
$query .= " JOIN `case` AS c ON ($surveytable.token = c.case_id AND c.questionnaire_id = '{$qfs[0]}') ";
|
$query .= " JOIN `case` AS c ON (s.token = c.case_id AND c.questionnaire_id = '{$qfs[0]}') ";
|
||||||
if ($qfs[1] != 0) //if a sample is selected
|
if ($qfs[1] != 0) //if a sample is selected
|
||||||
$query .= " JOIN `sample` AS s ON (s.sample_id = c.sample_id AND s.import_id = '{$qfs[1]}') ";
|
$query .= " JOIN `sample` AS ss ON (ss.sample_id = c.sample_id AND ss.import_id = '{$qfs[1]}') ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (incompleteAnsFilterstate() == "inc")
|
if (incompleteAnsFilterstate() == "inc")
|
||||||
$idquery .= " WHERE (submitdate = ".$connect->DBDate('1980-01-01'). " OR submitdate IS NULL) AND ";
|
$idquery .= " WHERE (submitdate = ".$connect->DBDate('1980-01-01'). " OR submitdate IS NULL) AND ";
|
||||||
elseif (incompleteAnsFilterstate() == "filter")
|
elseif (incompleteAnsFilterstate() == "filter")
|
||||||
@@ -209,12 +210,7 @@ if ($subaction == "id")
|
|||||||
else
|
else
|
||||||
$idquery .= " WHERE ";
|
$idquery .= " WHERE ";
|
||||||
if ($id < 1) { $id = 1; }
|
if ($id < 1) { $id = 1; }
|
||||||
if (isset($_POST['sql']) && $_POST['sql'])
|
$idquery .= " s.id = $id";
|
||||||
{
|
|
||||||
if (get_magic_quotes_gpc()) {$idquery .= stripslashes($_POST['sql']);}
|
|
||||||
else {$idquery .= "{$_POST['sql']}";}
|
|
||||||
}
|
|
||||||
else {$idquery .= "$surveytable.id = $id";}
|
|
||||||
$idresult = db_execute_assoc($idquery) or safe_die ("Couldn't get entry<br />\n$idquery<br />\n".$connect->ErrorMsg());
|
$idresult = db_execute_assoc($idquery) or safe_die ("Couldn't get entry<br />\n$idquery<br />\n".$connect->ErrorMsg());
|
||||||
while ($idrow = $idresult->FetchRow())
|
while ($idrow = $idresult->FetchRow())
|
||||||
{
|
{
|
||||||
@@ -273,6 +269,10 @@ if ($subaction == "id")
|
|||||||
$highlight=false;
|
$highlight=false;
|
||||||
for ($i = 0; $i < $nfncount+1; $i++)
|
for ($i = 0; $i < $nfncount+1; $i++)
|
||||||
{
|
{
|
||||||
|
if ($fnames[$i][0] != 'completed' && is_null($idrow[$fnames[$i][0]]))
|
||||||
|
{
|
||||||
|
continue; // irrelevant, so don't show
|
||||||
|
}
|
||||||
$inserthighlight='';
|
$inserthighlight='';
|
||||||
if ($highlight)
|
if ($highlight)
|
||||||
$inserthighlight="class='highlight'";
|
$inserthighlight="class='highlight'";
|
||||||
@@ -329,20 +329,21 @@ elseif ($subaction == "all")
|
|||||||
var noFilesSelectedForDeletion = '".$clang->gT('Please select at least one file for deletion','js')."';
|
var noFilesSelectedForDeletion = '".$clang->gT('Please select at least one file for deletion','js')."';
|
||||||
var noFilesSelectedForDnld = '".$clang->gT('Please select at least one file for download','js')."';
|
var noFilesSelectedForDnld = '".$clang->gT('Please select at least one file for download','js')."';
|
||||||
</script>\n";
|
</script>\n";
|
||||||
if (!isset($_POST['sql']))
|
$browseoutput .= $surveyoptions;
|
||||||
{$browseoutput .= $surveyoptions;} //don't show options when called from another script with a filter on
|
$bClearFilter=returnglobal('clearfilter');
|
||||||
else
|
if ($bClearFilter)
|
||||||
{
|
{
|
||||||
$browseoutput .= "\t<tr><td colspan='2' height='4'><strong>".$clang->gT("Browse Responses").":</strong> $surveyname</td></tr>\n"
|
unset($_SESSION['sql']);
|
||||||
."\n<tr><td><table width='100%' align='center' border='0' bgcolor='#EFEFEF'>\n"
|
}
|
||||||
."\t<tr>\n"
|
if (isset($_SESSION['sql']))
|
||||||
."<td align='center'>\n"
|
{
|
||||||
."".$clang->gT("Showing Filtered Results")."<br />\n"
|
$browseoutput .= "<form action='$scriptname?clearfilter=1' method='post'>
|
||||||
." [<a href=\"javascript:window.close()\">".$clang->gT("Close")."</a>]"
|
<p>".$clang->gT("Note:").' '.$clang->gT("Showing Filtered Results")." "
|
||||||
."</font></td>\n"
|
." <input type='submit' value='".$clang->gT("Remove filter")."'>
|
||||||
."\t</tr>\n"
|
<input type='hidden' name='sid' value='$surveyid' />
|
||||||
."</table></td></tr>\n";
|
<input type='hidden' name='action' value='browse' />
|
||||||
|
<input type='hidden' name='subaction' value='all' />
|
||||||
|
</p></form>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Delete Individual answer using inrow delete buttons/links - checked
|
//Delete Individual answer using inrow delete buttons/links - checked
|
||||||
@@ -597,6 +598,7 @@ elseif ($subaction == "all")
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$selectedgroup = returnglobal('selectgroup'); // group token id
|
$selectedgroup = returnglobal('selectgroup'); // group token id
|
||||||
|
|
||||||
$sql_where = "";
|
$sql_where = "";
|
||||||
@@ -624,9 +626,9 @@ elseif ($subaction == "all")
|
|||||||
if ($limit > $dtcount) {$limit=$dtcount;}
|
if ($limit > $dtcount) {$limit=$dtcount;}
|
||||||
|
|
||||||
//NOW LETS SHOW THE DATA
|
//NOW LETS SHOW THE DATA
|
||||||
if (isset($_POST['sql']))
|
if (isset($_SESSION['sql']))
|
||||||
{
|
{
|
||||||
if ($_POST['sql'] == "NULL" )
|
if ($_SESSION['sql'] == "NULL" )
|
||||||
{
|
{
|
||||||
if ($surveyinfo['anonymized'] == "N" && db_tables_exist($tokentable))
|
if ($surveyinfo['anonymized'] == "N" && db_tables_exist($tokentable))
|
||||||
$dtquery = "SELECT * FROM $surveytable LEFT JOIN $tokentable ON $surveytable.token = $tokentable.token ";
|
$dtquery = "SELECT * FROM $surveytable LEFT JOIN $tokentable ON $surveytable.token = $tokentable.token ";
|
||||||
@@ -657,6 +659,7 @@ elseif ($subaction == "all")
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($surveytable['anonymized'] == "N" && db_tables_exist($tokentable))
|
if ($surveytable['anonymized'] == "N" && db_tables_exist($tokentable))
|
||||||
$dtquery = "SELECT * FROM $surveytable LEFT JOIN $tokentable ON $surveytable.token = $tokentable.token WHERE 1=1 ";
|
$dtquery = "SELECT * FROM $surveytable LEFT JOIN $tokentable ON $surveytable.token = $tokentable.token WHERE 1=1 ";
|
||||||
else
|
else
|
||||||
@@ -681,9 +684,9 @@ elseif ($subaction == "all")
|
|||||||
{
|
{
|
||||||
$dtquery .= " AND submitdate IS NOT NULL ";
|
$dtquery .= " AND submitdate IS NOT NULL ";
|
||||||
}
|
}
|
||||||
if (stripcslashes($_POST['sql']) !== "")
|
if ($_SESSION['sql'] !== "")
|
||||||
{
|
{
|
||||||
$dtquery .= ' AND '.stripcslashes($_POST['sql'])." ";
|
$dtquery .= ' AND '.$_SESSION['sql']." ";
|
||||||
}
|
}
|
||||||
$dtquery .= " ORDER BY {$surveytable}.id";
|
$dtquery .= " ORDER BY {$surveytable}.id";
|
||||||
}
|
}
|
||||||
@@ -704,6 +707,7 @@ elseif ($subaction == "all")
|
|||||||
$dtquery .= " JOIN `sample` AS s ON (s.sample_id = c.sample_id AND s.import_id = '{$qfs[1]}') ";
|
$dtquery .= " JOIN `sample` AS s ON (s.sample_id = c.sample_id AND s.import_id = '{$qfs[1]}') ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (incompleteAnsFilterstate() == "inc")
|
if (incompleteAnsFilterstate() == "inc")
|
||||||
{
|
{
|
||||||
$dtquery .= " WHERE submitdate IS NULL ";
|
$dtquery .= " WHERE submitdate IS NULL ";
|
||||||
@@ -772,13 +776,14 @@ elseif ($subaction == "all")
|
|||||||
|
|
||||||
$browseoutput .="<form action='$scriptname?action=browse' id='browseresults' method='post'><font size='1' face='verdana'>\n"
|
$browseoutput .="<form action='$scriptname?action=browse' id='browseresults' method='post'><font size='1' face='verdana'>\n"
|
||||||
."<img src='$imageurl/blank.gif' width='31' height='20' border='0' hspace='0' align='right' alt='' />\n"
|
."<img src='$imageurl/blank.gif' width='31' height='20' border='0' hspace='0' align='right' alt='' />\n"
|
||||||
." ".$clang->gT("Display:")."<select name='filterinc' onchange='javascript:document.getElementById(\"limit\").value=\"\";submit();'>\n"
|
." ".$clang->gT("Display:")."<select name='filterinc' onchange='javascript:document.getElementById(\"limit\").value=\"\";submit();'>\n"
|
||||||
."\t<option value='show' $selectshow>".$clang->gT("All responses")."</option>\n"
|
."\t<option value='show' $selectshow>".$clang->gT("All responses")."</option>\n"
|
||||||
."\t<option value='filter' $selecthide>".$clang->gT("Completed responses only")."</option>\n"
|
."\t<option value='filter' $selecthide>".$clang->gT("Completed responses only")."</option>\n"
|
||||||
."\t<option value='incomplete' $selectinc>".$clang->gT("Incomplete responses only")."</option>\n"
|
."\t<option value='incomplete' $selectinc>".$clang->gT("Incomplete responses only")."</option>\n"
|
||||||
."</select>\n";
|
."</select>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$quexsfilterstate = questionnaireSampleFilterstate();
|
$quexsfilterstate = questionnaireSampleFilterstate();
|
||||||
|
|
||||||
//queXS Addition
|
//queXS Addition
|
||||||
@@ -793,6 +798,7 @@ $quexsfilterstate = questionnaireSampleFilterstate();
|
|||||||
." <input type='submit' value='".$clang->gT("Show")."' />\n";
|
." <input type='submit' value='".$clang->gT("Show")."' />\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$browseoutput .= "</font>\n"
|
$browseoutput .= "</font>\n"
|
||||||
."<input type='hidden' name='sid' value='$surveyid' />\n"
|
."<input type='hidden' name='sid' value='$surveyid' />\n"
|
||||||
."<input type='hidden' name='action' value='browse' />\n"
|
."<input type='hidden' name='action' value='browse' />\n"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,54 +1,54 @@
|
|||||||
<?php
|
<?php
|
||||||
final class SettingsStorage extends ArrayObject
|
final class SettingsStorage extends ArrayObject
|
||||||
{
|
{
|
||||||
protected static $_instance = null;
|
protected static $_instance = null;
|
||||||
|
|
||||||
public function __construct($array = array(), $flags = parent::ARRAY_AS_PROPS)
|
public function __construct($array = array(), $flags = parent::ARRAY_AS_PROPS)
|
||||||
{
|
{
|
||||||
parent::__construct($array, $flags);
|
parent::__construct($array, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getInstance()
|
public static function getInstance()
|
||||||
{
|
{
|
||||||
if( self::$_instance === NULL ) {
|
if( self::$_instance === NULL ) {
|
||||||
self::$_instance = new self();
|
self::$_instance = new self();
|
||||||
}
|
}
|
||||||
return self::$_instance;
|
return self::$_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get($index)
|
public static function get($index)
|
||||||
{
|
{
|
||||||
$instance = self::getInstance();
|
$instance = self::getInstance();
|
||||||
|
|
||||||
if (!$instance->offsetExists($index)) {
|
if (!$instance->offsetExists($index)) {
|
||||||
throw new Exception("No entry is registered for key '$index'");
|
throw new Exception("No entry is registered for key '$index'");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $instance->offsetGet($index);
|
return $instance->offsetGet($index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function set($index, $value)
|
public static function set($index, $value)
|
||||||
{
|
{
|
||||||
$instance = self::getInstance();
|
$instance = self::getInstance();
|
||||||
$instance->offsetSet($index, $value);
|
$instance->offsetSet($index, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isRegistered($index)
|
public static function isRegistered($index)
|
||||||
{
|
{
|
||||||
if (self::$_instance === null) {
|
if (self::$_instance === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return self::$_instance->offsetExists($index);
|
return self::$_instance->offsetExists($index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).
|
* Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).
|
||||||
*/
|
*/
|
||||||
public function offsetExists($index)
|
public function offsetExists($index)
|
||||||
{
|
{
|
||||||
return array_key_exists($index, $this);
|
return array_key_exists($index, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,325 +1,320 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GTranslate - A class to comunicate with Google Translate(TM) Service
|
* GTranslate - A class to comunicate with Google Translate(TM) Service
|
||||||
* Google Translate(TM) API Wrapper
|
* Google Translate(TM) API Wrapper
|
||||||
* More info about Google(TM) service can be found on http://code.google.com/apis/ajaxlanguage/documentation/reference.html
|
* More info about Google(TM) service can be found on http://code.google.com/apis/ajaxlanguage/documentation/reference.html
|
||||||
* This code has o affiliation with Google (TM) , its a PHP Library that allows to comunicate with public a API
|
* This code has o affiliation with Google (TM) , its a PHP Library that allows to comunicate with public a API
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
* @author Jose da Silva <jose@josedasilva.net>
|
* @author Jose da Silva <jose@josedasilva.net>
|
||||||
* @since 2009/11/18
|
* @since 2009/11/18
|
||||||
* @version 0.7.4
|
* @version 0.7.4
|
||||||
* @licence LGPL v3
|
* @licence LGPL v3
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* <?
|
* <?
|
||||||
* require_once("GTranslate.php");
|
* require_once("GTranslate.php");
|
||||||
* try{
|
* try{
|
||||||
* $gt = new Gtranslate;
|
* $gt = new Gtranslate;
|
||||||
* echo $gt->english_to_german("hello world");
|
* echo $gt->english_to_german("hello world");
|
||||||
* } catch (GTranslateException $ge)
|
* } catch (GTranslateException $ge)
|
||||||
* {
|
* {
|
||||||
* echo $ge->getMessage();
|
* echo $ge->getMessage();
|
||||||
* }
|
* }
|
||||||
* ?>
|
* ?>
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception class for GTranslated Exceptions
|
* Exception class for GTranslated Exceptions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class GTranslateException extends Exception
|
class GTranslateException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($string) {
|
public function __construct($string) {
|
||||||
parent::__construct($string, 0);
|
parent::__construct($string, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GTranslate
|
class GTranslate
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Google Translate(TM) Api endpoint
|
* Google Translate(TM) Api endpoint
|
||||||
* @access private
|
* @access private
|
||||||
* @var String
|
* @var String
|
||||||
*/
|
*/
|
||||||
private $url = "http://ajax.googleapis.com/ajax/services/language/translate";
|
private $url = "https://www.googleapis.com/language/translate/v2";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google Translate (TM) Api Version
|
* Google Translate (TM) Api Version
|
||||||
* @access private
|
* @access private
|
||||||
* @var String
|
* @var String
|
||||||
*/
|
*/
|
||||||
private $api_version = "1.0";
|
private $api_version = "2";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comunication Transport Method
|
* Comunication Transport Method
|
||||||
* Available: http / curl
|
* Available: http / curl
|
||||||
* @access private
|
* @access private
|
||||||
* @var String
|
* @var String
|
||||||
*/
|
*/
|
||||||
private $request_type = "http";
|
private $request_type = "http";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to available languages file
|
* Path to available languages file
|
||||||
* @access private
|
* @access private
|
||||||
* @var String
|
* @var String
|
||||||
*/
|
*/
|
||||||
private $available_languages_file = "languages.ini";
|
private $available_languages_file = "languages.ini";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holder to the parse of the ini file
|
* Holder to the parse of the ini file
|
||||||
* @access private
|
* @access private
|
||||||
* @var Array
|
* @var Array
|
||||||
*/
|
*/
|
||||||
private $available_languages = array();
|
private $available_languages = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google Translate api key
|
* Google Translate api key
|
||||||
* @access private
|
* @access private
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $api_key = null;
|
private $api_key = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google request User IP
|
* Google request User IP
|
||||||
* @access private
|
* @access private
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $user_ip = null;
|
private $user_ip = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor sets up {@link $available_languages}
|
* Constructor sets up {@link $available_languages}
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->available_languages = parse_ini_file("languages.ini");
|
$this->available_languages = parse_ini_file("languages.ini");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL Formater to use on request
|
* URL Formater to use on request
|
||||||
* @access private
|
* @access private
|
||||||
* @param array $lang_pair
|
* @param array $lang_pair
|
||||||
* @param array $string
|
* @param array $string
|
||||||
* "returns String $url
|
* "returns String $url
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private function urlFormat($lang_pair,$string)
|
private function urlFormat($lang_pair,$string)
|
||||||
{
|
{
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
"v" => $this->api_version,
|
"q" => $string,
|
||||||
"q" => $string,
|
"source" => $lang_pair[0],
|
||||||
"langpair"=> implode("|",$lang_pair)
|
"target" => $lang_pair[1],
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!empty($this->api_key))
|
if(!empty($this->api_key))
|
||||||
{
|
{
|
||||||
$parameters["key"] = $this->api_key;
|
$parameters["key"] = $this->api_key;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if( empty($this->user_ip) )
|
{
|
||||||
{
|
$parameters["key"] = getGlobalSetting('googletranslateapikey');
|
||||||
if( !empty($_SERVER["REMOTE_ADDR"]) )
|
}
|
||||||
{
|
|
||||||
$parameters["userip"] = $_SERVER["REMOTE_ADDR"];
|
$url = "";
|
||||||
}
|
|
||||||
} else
|
foreach($parameters as $k=>$p)
|
||||||
{
|
{
|
||||||
$parameters["userip"] = $this->user_ip;
|
$url .= $k."=".urlencode($p)."&";
|
||||||
}
|
}
|
||||||
|
return $url;
|
||||||
$url = "";
|
}
|
||||||
|
|
||||||
foreach($parameters as $k=>$p)
|
/**
|
||||||
{
|
* Define the request type
|
||||||
$url .= $k."=".urlencode($p)."&";
|
* @access public
|
||||||
}
|
* @param string $request_type
|
||||||
return $url;
|
* return boolean
|
||||||
}
|
*/
|
||||||
|
public function setRequestType($request_type = 'http') {
|
||||||
/**
|
if (!empty($request_type)) {
|
||||||
* Define the request type
|
$this->request_type = $request_type;
|
||||||
* @access public
|
return true;
|
||||||
* @param string $request_type
|
}
|
||||||
* return boolean
|
return false;
|
||||||
*/
|
}
|
||||||
public function setRequestType($request_type = 'http') {
|
|
||||||
if (!empty($request_type)) {
|
/**
|
||||||
$this->request_type = $request_type;
|
* Define the Google Translate Api Key
|
||||||
return true;
|
* @access public
|
||||||
}
|
* @param string $api_key
|
||||||
return false;
|
* return boolean
|
||||||
}
|
*/
|
||||||
|
public function setApiKey($api_key) {
|
||||||
/**
|
if (!empty($api_key)) {
|
||||||
* Define the Google Translate Api Key
|
$this->api_key = $api_key;
|
||||||
* @access public
|
return true;
|
||||||
* @param string $api_key
|
}
|
||||||
* return boolean
|
return false;
|
||||||
*/
|
}
|
||||||
public function setApiKey($api_key) {
|
|
||||||
if (!empty($api_key)) {
|
/**
|
||||||
$this->api_key = $api_key;
|
* Define the User Ip for the query
|
||||||
return true;
|
* @access public
|
||||||
}
|
* @param string $ip
|
||||||
return false;
|
* return boolean
|
||||||
}
|
*/
|
||||||
|
public function setUserIp($ip) {
|
||||||
/**
|
if (!empty($ip)) {
|
||||||
* Define the User Ip for the query
|
$this->user_ip = $ip;
|
||||||
* @access public
|
return true;
|
||||||
* @param string $ip
|
}
|
||||||
* return boolean
|
return false;
|
||||||
*/
|
}
|
||||||
public function setUserIp($ip) {
|
|
||||||
if (!empty($ip)) {
|
/**
|
||||||
$this->user_ip = $ip;
|
* Query the Google(TM) endpoint
|
||||||
return true;
|
* @access private
|
||||||
}
|
* @param array $lang_pair
|
||||||
return false;
|
* @param array $string
|
||||||
}
|
* returns String $response
|
||||||
|
*/
|
||||||
/**
|
|
||||||
* Query the Google(TM) endpoint
|
public function query($lang_pair,$string)
|
||||||
* @access private
|
{
|
||||||
* @param array $lang_pair
|
$query_url = $this->urlFormat($lang_pair,$string);
|
||||||
* @param array $string
|
$response = $this->{"request".ucwords($this->request_type)}($query_url);
|
||||||
* returns String $response
|
return $response;
|
||||||
*/
|
}
|
||||||
|
|
||||||
public function query($lang_pair,$string)
|
/**
|
||||||
{
|
* Query Wrapper for Http Transport
|
||||||
$query_url = $this->urlFormat($lang_pair,$string);
|
* @access private
|
||||||
$response = $this->{"request".ucwords($this->request_type)}($query_url);
|
* @param String $url
|
||||||
return $response;
|
* returns String $response
|
||||||
}
|
*/
|
||||||
|
|
||||||
/**
|
private function requestHttp($url)
|
||||||
* Query Wrapper for Http Transport
|
{
|
||||||
* @access private
|
$fullurl = $this->url."?".$url;
|
||||||
* @param String $url
|
$return = file_get_contents($fullurl);
|
||||||
* returns String $response
|
$json = json_decode($return);
|
||||||
*/
|
return GTranslate::evalResponse($json);
|
||||||
|
}
|
||||||
private function requestHttp($url)
|
|
||||||
{
|
/**
|
||||||
return GTranslate::evalResponse(json_decode(file_get_contents($this->url."?".$url)));
|
* Query Wrapper for Curl Transport
|
||||||
}
|
* @access private
|
||||||
|
* @param String $url
|
||||||
/**
|
* returns String $response
|
||||||
* Query Wrapper for Curl Transport
|
*/
|
||||||
* @access private
|
|
||||||
* @param String $url
|
private function requestCurl($url)
|
||||||
* returns String $response
|
{
|
||||||
*/
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $this->url);
|
||||||
private function requestCurl($url)
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
{
|
curl_setopt($ch, CURLOPT_REFERER, !empty($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "");
|
||||||
$ch = curl_init();
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
curl_setopt($ch, CURLOPT_URL, $this->url);
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $url);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
$body = curl_exec($ch);
|
||||||
curl_setopt($ch, CURLOPT_REFERER, !empty($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "");
|
curl_close($ch);
|
||||||
curl_setopt($ch, CURLOPT_POST, 1);
|
return GTranslate::evalResponse(json_decode($body));
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $url);
|
}
|
||||||
$body = curl_exec($ch);
|
|
||||||
curl_close($ch);
|
/**
|
||||||
return GTranslate::evalResponse(json_decode($body));
|
* Response Evaluator, validates the response
|
||||||
}
|
* Throws an exception on error
|
||||||
|
* @access private
|
||||||
/**
|
* @param String $json_response
|
||||||
* Response Evaluator, validates the response
|
* returns String $response
|
||||||
* Throws an exception on error
|
*/
|
||||||
* @access private
|
|
||||||
* @param String $json_response
|
private function evalResponse($json_response)
|
||||||
* returns String $response
|
{
|
||||||
*/
|
if (isset($json_response->data->translations))
|
||||||
|
{
|
||||||
private function evalResponse($json_response)
|
return $json_response->data->translations[0]->translatedText;
|
||||||
{
|
}
|
||||||
switch($json_response->responseStatus)
|
else
|
||||||
{
|
{
|
||||||
case 200:
|
throw new GTranslateException("Unable to perform Translation:".$json_response->data);
|
||||||
return $json_response->responseData->translatedText;
|
}
|
||||||
break;
|
}
|
||||||
default:
|
|
||||||
throw new GTranslateException("Unable to perform Translation:".$json_response->responseDetails);
|
|
||||||
break;
|
/**
|
||||||
}
|
* Validates if the language pair is valid
|
||||||
}
|
* Throws an exception on error
|
||||||
|
* @access private
|
||||||
|
* @param Array $languages
|
||||||
/**
|
* returns Array $response Array with formated languages pair
|
||||||
* Validates if the language pair is valid
|
*/
|
||||||
* Throws an exception on error
|
|
||||||
* @access private
|
private function isValidLanguage($languages)
|
||||||
* @param Array $languages
|
{
|
||||||
* returns Array $response Array with formated languages pair
|
$language_list = $this->available_languages;
|
||||||
*/
|
|
||||||
|
$languages = array_map( "strtolower", $languages );
|
||||||
private function isValidLanguage($languages)
|
$language_list_v = array_map( "strtolower", array_values($language_list) );
|
||||||
{
|
$language_list_k = array_map( "strtolower", array_keys($language_list) );
|
||||||
$language_list = $this->available_languages;
|
$valid_languages = false;
|
||||||
|
if( TRUE == in_array($languages[0],$language_list_v) AND TRUE == in_array($languages[1],$language_list_v) )
|
||||||
$languages = array_map( "strtolower", $languages );
|
{
|
||||||
$language_list_v = array_map( "strtolower", array_values($language_list) );
|
$valid_languages = true;
|
||||||
$language_list_k = array_map( "strtolower", array_keys($language_list) );
|
}
|
||||||
$valid_languages = false;
|
|
||||||
if( TRUE == in_array($languages[0],$language_list_v) AND TRUE == in_array($languages[1],$language_list_v) )
|
if( FALSE === $valid_languages AND TRUE == in_array($languages[0],$language_list_k) AND TRUE == in_array($languages[1],$language_list_k) )
|
||||||
{
|
{
|
||||||
$valid_languages = true;
|
$languages = array($language_list[strtoupper($languages[0])],$language_list[strtoupper($languages[1])]);
|
||||||
}
|
$valid_languages = true;
|
||||||
|
}
|
||||||
if( FALSE === $valid_languages AND TRUE == in_array($languages[0],$language_list_k) AND TRUE == in_array($languages[1],$language_list_k) )
|
|
||||||
{
|
if( FALSE === $valid_languages )
|
||||||
$languages = array($language_list[strtoupper($languages[0])],$language_list[strtoupper($languages[1])]);
|
{
|
||||||
$valid_languages = true;
|
throw new GTranslateException("Unsupported languages");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( FALSE === $valid_languages )
|
return $languages;
|
||||||
{
|
}
|
||||||
throw new GTranslateException("Unsupported languages");
|
|
||||||
}
|
/**
|
||||||
|
* Magic method to understande translation comman
|
||||||
return $languages;
|
* Evaluates methods like language_to_language
|
||||||
}
|
* @access public
|
||||||
|
* @param String $name
|
||||||
/**
|
* @param Array $args
|
||||||
* Magic method to understande translation comman
|
* returns String $response Translated Text
|
||||||
* Evaluates methods like language_to_language
|
*/
|
||||||
* @access public
|
|
||||||
* @param String $name
|
|
||||||
* @param Array $args
|
public function __call($name,$args)
|
||||||
* returns String $response Translated Text
|
{
|
||||||
*/
|
$languages_list = explode("_to_",strtolower($name));
|
||||||
|
$languages = $this->isValidLanguage($languages_list);
|
||||||
|
|
||||||
public function __call($name,$args)
|
$string = $args[0];
|
||||||
{
|
|
||||||
$languages_list = explode("_to_",strtolower($name));
|
return $this->query($languages,$string);
|
||||||
$languages = $this->isValidLanguage($languages_list);
|
}
|
||||||
|
}
|
||||||
$string = $args[0];
|
|
||||||
|
?>
|
||||||
return $this->query($languages,$string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -1,110 +1,110 @@
|
|||||||
AFRIKAANS = af
|
AFRIKAANS = af
|
||||||
ALBANIAN = sq
|
ALBANIAN = sq
|
||||||
AMHARIC = am
|
AMHARIC = am
|
||||||
ARABIC = ar
|
ARABIC = ar
|
||||||
ARMENIAN = hy
|
ARMENIAN = hy
|
||||||
AZERBAIJANI = az
|
AZERBAIJANI = az
|
||||||
BASQUE = eu
|
BASQUE = eu
|
||||||
BELARUSIAN = be
|
BELARUSIAN = be
|
||||||
BENGALI = bn
|
BENGALI = bn
|
||||||
BIHARI = bh
|
BIHARI = bh
|
||||||
BRETON = br
|
BRETON = br
|
||||||
BULGARIAN = bg
|
BULGARIAN = bg
|
||||||
BURMESE = my
|
BURMESE = my
|
||||||
CATALAN = ca
|
CATALAN = ca
|
||||||
CHEROKEE = chr
|
CHEROKEE = chr
|
||||||
CHINESE = zh
|
CHINESE = zh
|
||||||
CHINESE_SIMPLIFIED = zh-Hans
|
CHINESE_SIMPLIFIED = zh-Hans
|
||||||
CHINESE_TRADITIONAL = zh-Hant
|
CHINESE_TRADITIONAL = zh-Hant
|
||||||
CORSICAN = co
|
CORSICAN = co
|
||||||
CROATIAN = hr
|
CROATIAN = hr
|
||||||
CZECH = cs
|
CZECH = cs
|
||||||
DANISH = da
|
DANISH = da
|
||||||
DHIVEHI = dv
|
DHIVEHI = dv
|
||||||
DUTCH = nl
|
DUTCH = nl
|
||||||
ENGLISH = en
|
ENGLISH = en
|
||||||
ESPERANTO = eo
|
ESPERANTO = eo
|
||||||
ESTONIAN = et
|
ESTONIAN = et
|
||||||
FAROESE = fo
|
FAROESE = fo
|
||||||
FILIPINO = tl
|
FILIPINO = tl
|
||||||
FINNISH = fi
|
FINNISH = fi
|
||||||
FRENCH = fr
|
FRENCH = fr
|
||||||
FRISIAN = fy
|
FRISIAN = fy
|
||||||
GALICIAN = gl
|
GALICIAN = gl
|
||||||
GEORGIAN = ka
|
GEORGIAN = ka
|
||||||
GERMAN = de
|
GERMAN = de
|
||||||
GERMAN INFORMAL= de-informal
|
GERMAN INFORMAL= de-informal
|
||||||
GREEK = el
|
GREEK = el
|
||||||
GUJARATI = gu
|
GUJARATI = gu
|
||||||
HAITIAN_CREOLE = ht
|
HAITIAN_CREOLE = ht
|
||||||
HEBREW = iw
|
HEBREW = iw
|
||||||
HINDI = hi
|
HINDI = hi
|
||||||
HUNGARIAN = hu
|
HUNGARIAN = hu
|
||||||
ICELANDIC = is
|
ICELANDIC = is
|
||||||
INDONESIAN = id
|
INDONESIAN = id
|
||||||
INUKTITUT = iu
|
INUKTITUT = iu
|
||||||
IRISH = ga
|
IRISH = ga
|
||||||
ITALIAN = it
|
ITALIAN = it
|
||||||
JAPANESE = ja
|
JAPANESE = ja
|
||||||
JAVANESE = jw
|
JAVANESE = jw
|
||||||
KANNADA = kn
|
KANNADA = kn
|
||||||
KAZAKH = kk
|
KAZAKH = kk
|
||||||
KHMER = km
|
KHMER = km
|
||||||
KOREAN = ko
|
KOREAN = ko
|
||||||
KURDISH = ku
|
KURDISH = ku
|
||||||
KYRGYZ = ky
|
KYRGYZ = ky
|
||||||
LAO = lo
|
LAO = lo
|
||||||
LATIN = la
|
LATIN = la
|
||||||
LATVIAN = lv
|
LATVIAN = lv
|
||||||
LITHUANIAN = lt
|
LITHUANIAN = lt
|
||||||
LUXEMBOURGISH = lb
|
LUXEMBOURGISH = lb
|
||||||
MACEDONIAN = mk
|
MACEDONIAN = mk
|
||||||
MALAY = ms
|
MALAY = ms
|
||||||
MALAYALAM = ml
|
MALAYALAM = ml
|
||||||
MALTESE = mt
|
MALTESE = mt
|
||||||
MAORI = mi
|
MAORI = mi
|
||||||
MARATHI = mr
|
MARATHI = mr
|
||||||
MONGOLIAN = mn
|
MONGOLIAN = mn
|
||||||
NEPALI = ne
|
NEPALI = ne
|
||||||
NORWEGIAN = no
|
NORWEGIAN = no
|
||||||
NORWEGIAN NYNORSK = nn
|
NORWEGIAN NYNORSK = nn
|
||||||
NORWEGIAN BOKMAL = nb
|
NORWEGIAN BOKMAL = nb
|
||||||
OCCITAN = oc
|
OCCITAN = oc
|
||||||
ORIYA = or
|
ORIYA = or
|
||||||
PASHTO = ps
|
PASHTO = ps
|
||||||
PERSIAN = fa
|
PERSIAN = fa
|
||||||
POLISH = pl
|
POLISH = pl
|
||||||
PORTUGUESE = pt
|
PORTUGUESE = pt
|
||||||
PORTUGUESE_PORTUGAL = pt-PT
|
PORTUGUESE_PORTUGAL = pt-PT
|
||||||
PUNJABI = pa
|
PUNJABI = pa
|
||||||
QUECHUA = qu
|
QUECHUA = qu
|
||||||
ROMANIAN = ro
|
ROMANIAN = ro
|
||||||
RUSSIAN = ru
|
RUSSIAN = ru
|
||||||
SANSKRIT = sa
|
SANSKRIT = sa
|
||||||
SCOTS_GAELIC = gd
|
SCOTS_GAELIC = gd
|
||||||
SERBIAN = sr
|
SERBIAN = sr
|
||||||
SINDHI = sd
|
SINDHI = sd
|
||||||
SINHALESE = si
|
SINHALESE = si
|
||||||
SLOVAK = sk
|
SLOVAK = sk
|
||||||
SLOVENIAN = sl
|
SLOVENIAN = sl
|
||||||
SPANISH = es
|
SPANISH = es
|
||||||
SUNDANESE = su
|
SUNDANESE = su
|
||||||
SWAHILI = sw
|
SWAHILI = sw
|
||||||
SWEDISH = sv
|
SWEDISH = sv
|
||||||
SYRIAC = syr
|
SYRIAC = syr
|
||||||
TAJIK = tg
|
TAJIK = tg
|
||||||
TAMIL = ta
|
TAMIL = ta
|
||||||
TATAR = tt
|
TATAR = tt
|
||||||
TELUGU = te
|
TELUGU = te
|
||||||
THAI = th
|
THAI = th
|
||||||
TIBETAN = bo
|
TIBETAN = bo
|
||||||
TONGA = to
|
TONGA = to
|
||||||
TURKISH = tr
|
TURKISH = tr
|
||||||
UKRAINIAN = uk
|
UKRAINIAN = uk
|
||||||
URDU = ur
|
URDU = ur
|
||||||
UZBEK = uz
|
UZBEK = uz
|
||||||
UIGHUR = ug
|
UIGHUR = ug
|
||||||
VIETNAMESE = vi
|
VIETNAMESE = vi
|
||||||
WELSH = cy
|
WELSH = cy
|
||||||
YIDDISH = yi
|
YIDDISH = yi
|
||||||
YORUBA = yo
|
YORUBA = yo
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,132 +1,132 @@
|
|||||||
<?
|
<?
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// PhpConcept Library (PCL) Error 1.0
|
// PhpConcept Library (PCL) Error 1.0
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// License GNU/GPL - Vincent Blavet - Mars 2001
|
// License GNU/GPL - Vincent Blavet - Mars 2001
|
||||||
// http://www.phpconcept.net & http://phpconcept.free.fr
|
// http://www.phpconcept.net & http://phpconcept.free.fr
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// Fran�ais :
|
// Fran�ais :
|
||||||
// La description de l'usage de la librairie PCL Error 1.0 n'est pas encore
|
// La description de l'usage de la librairie PCL Error 1.0 n'est pas encore
|
||||||
// disponible. Celle-ci n'est pour le moment distribu�e qu'avec les
|
// disponible. Celle-ci n'est pour le moment distribu�e qu'avec les
|
||||||
// d�veloppements applicatifs de PhpConcept.
|
// d�veloppements applicatifs de PhpConcept.
|
||||||
// Une version ind�pendante sera bientot disponible sur http://www.phpconcept.net
|
// Une version ind�pendante sera bientot disponible sur http://www.phpconcept.net
|
||||||
//
|
//
|
||||||
// English :
|
// English :
|
||||||
// The PCL Error 1.0 library description is not available yet. This library is
|
// The PCL Error 1.0 library description is not available yet. This library is
|
||||||
// released only with PhpConcept application and libraries.
|
// released only with PhpConcept application and libraries.
|
||||||
// An independant release will be soon available on http://www.phpconcept.net
|
// An independant release will be soon available on http://www.phpconcept.net
|
||||||
//
|
//
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// * Avertissement :
|
// * Avertissement :
|
||||||
//
|
//
|
||||||
// Cette librairie a �t� cr��e de fa�on non professionnelle.
|
// Cette librairie a �t� cr��e de fa�on non professionnelle.
|
||||||
// Son usage est au risque et p�ril de celui qui l'utilise, en aucun cas l'auteur
|
// Son usage est au risque et p�ril de celui qui l'utilise, en aucun cas l'auteur
|
||||||
// de ce code ne pourra �tre tenu pour responsable des �ventuels d�gats qu'il pourrait
|
// de ce code ne pourra �tre tenu pour responsable des �ventuels d�gats qu'il pourrait
|
||||||
// engendrer.
|
// engendrer.
|
||||||
// Il est entendu cependant que l'auteur a r�alis� ce code par plaisir et n'y a
|
// Il est entendu cependant que l'auteur a r�alis� ce code par plaisir et n'y a
|
||||||
// cach� aucun virus, ni malveillance.
|
// cach� aucun virus, ni malveillance.
|
||||||
// Cette libairie est distribu�e sous la license GNU/GPL (http://www.gnu.org)
|
// Cette libairie est distribu�e sous la license GNU/GPL (http://www.gnu.org)
|
||||||
//
|
//
|
||||||
// * Auteur :
|
// * Auteur :
|
||||||
//
|
//
|
||||||
// Ce code a �t� �crit par Vincent Blavet (vincent@blavet.net) sur son temps
|
// Ce code a �t� �crit par Vincent Blavet (vincent@blavet.net) sur son temps
|
||||||
// de loisir.
|
// de loisir.
|
||||||
//
|
//
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
// ----- Look for double include
|
// ----- Look for double include
|
||||||
if (!defined("PCLERROR_LIB"))
|
if (!defined("PCLERROR_LIB"))
|
||||||
{
|
{
|
||||||
define( "PCLERROR_LIB", 1 );
|
define( "PCLERROR_LIB", 1 );
|
||||||
|
|
||||||
// ----- Version
|
// ----- Version
|
||||||
$g_pcl_error_version = "1.0";
|
$g_pcl_error_version = "1.0";
|
||||||
|
|
||||||
// ----- Internal variables
|
// ----- Internal variables
|
||||||
// These values must only be change by PclError library functions
|
// These values must only be change by PclError library functions
|
||||||
$g_pcl_error_string = "";
|
$g_pcl_error_string = "";
|
||||||
$g_pcl_error_code = 1;
|
$g_pcl_error_code = 1;
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// Function : PclErrorLog()
|
// Function : PclErrorLog()
|
||||||
// Description :
|
// Description :
|
||||||
// Parameters :
|
// Parameters :
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
function PclErrorLog($p_error_code=0, $p_error_string="")
|
function PclErrorLog($p_error_code=0, $p_error_string="")
|
||||||
{
|
{
|
||||||
global $g_pcl_error_string;
|
global $g_pcl_error_string;
|
||||||
global $g_pcl_error_code;
|
global $g_pcl_error_code;
|
||||||
|
|
||||||
$g_pcl_error_code = $p_error_code;
|
$g_pcl_error_code = $p_error_code;
|
||||||
$g_pcl_error_string = $p_error_string;
|
$g_pcl_error_string = $p_error_string;
|
||||||
|
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// Function : PclErrorFatal()
|
// Function : PclErrorFatal()
|
||||||
// Description :
|
// Description :
|
||||||
// Parameters :
|
// Parameters :
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
function PclErrorFatal($p_file, $p_line, $p_error_string="")
|
function PclErrorFatal($p_file, $p_line, $p_error_string="")
|
||||||
{
|
{
|
||||||
global $g_pcl_error_string;
|
global $g_pcl_error_string;
|
||||||
global $g_pcl_error_code;
|
global $g_pcl_error_code;
|
||||||
|
|
||||||
$v_message = "<html><body>";
|
$v_message = "<html><body>";
|
||||||
$v_message .= "<p align=center><font color=red bgcolor=white><b>PclError Library has detected a fatal error on file '$p_file', line $p_line</b></font></p>";
|
$v_message .= "<p align=center><font color=red bgcolor=white><b>PclError Library has detected a fatal error on file '$p_file', line $p_line</b></font></p>";
|
||||||
$v_message .= "<p align=center><font color=red bgcolor=white><b>$p_error_string</b></font></p>";
|
$v_message .= "<p align=center><font color=red bgcolor=white><b>$p_error_string</b></font></p>";
|
||||||
$v_message .= "</body></html>";
|
$v_message .= "</body></html>";
|
||||||
die($v_message);
|
die($v_message);
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// Function : PclErrorReset()
|
// Function : PclErrorReset()
|
||||||
// Description :
|
// Description :
|
||||||
// Parameters :
|
// Parameters :
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
function PclErrorReset()
|
function PclErrorReset()
|
||||||
{
|
{
|
||||||
global $g_pcl_error_string;
|
global $g_pcl_error_string;
|
||||||
global $g_pcl_error_code;
|
global $g_pcl_error_code;
|
||||||
|
|
||||||
$g_pcl_error_code = 1;
|
$g_pcl_error_code = 1;
|
||||||
$g_pcl_error_string = "";
|
$g_pcl_error_string = "";
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// Function : PclErrorCode()
|
// Function : PclErrorCode()
|
||||||
// Description :
|
// Description :
|
||||||
// Parameters :
|
// Parameters :
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
function PclErrorCode()
|
function PclErrorCode()
|
||||||
{
|
{
|
||||||
global $g_pcl_error_string;
|
global $g_pcl_error_string;
|
||||||
global $g_pcl_error_code;
|
global $g_pcl_error_code;
|
||||||
|
|
||||||
return($g_pcl_error_code);
|
return($g_pcl_error_code);
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// Function : PclErrorString()
|
// Function : PclErrorString()
|
||||||
// Description :
|
// Description :
|
||||||
// Parameters :
|
// Parameters :
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
function PclErrorString()
|
function PclErrorString()
|
||||||
{
|
{
|
||||||
global $g_pcl_error_string;
|
global $g_pcl_error_string;
|
||||||
global $g_pcl_error_code;
|
global $g_pcl_error_code;
|
||||||
|
|
||||||
return($g_pcl_error_string." [code $g_pcl_error_code]");
|
return($g_pcl_error_string." [code $g_pcl_error_code]");
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// ----- End of double include look
|
// ----- End of double include look
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,412 +1,412 @@
|
|||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// PclZip 2.8.1 - readme.txt
|
// PclZip 2.8.1 - readme.txt
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// License GNU/LGPL - August 2009
|
// License GNU/LGPL - August 2009
|
||||||
// Vincent Blavet - vincent@phpconcept.net
|
// Vincent Blavet - vincent@phpconcept.net
|
||||||
// http://www.phpconcept.net
|
// http://www.phpconcept.net
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
// $Id: readme.txt,v 1.58 2009/08/11 14:58:12 vblavet Exp $
|
// $Id: readme.txt,v 1.58 2009/08/11 14:58:12 vblavet Exp $
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
0 - Sommaire
|
0 - Sommaire
|
||||||
============
|
============
|
||||||
1 - Introduction
|
1 - Introduction
|
||||||
2 - What's new
|
2 - What's new
|
||||||
3 - Corrected bugs
|
3 - Corrected bugs
|
||||||
4 - Known bugs or limitations
|
4 - Known bugs or limitations
|
||||||
5 - License
|
5 - License
|
||||||
6 - Warning
|
6 - Warning
|
||||||
7 - Documentation
|
7 - Documentation
|
||||||
8 - Author
|
8 - Author
|
||||||
9 - Contribute
|
9 - Contribute
|
||||||
|
|
||||||
1 - Introduction
|
1 - Introduction
|
||||||
================
|
================
|
||||||
|
|
||||||
PclZip is a library that allow you to manage a Zip archive.
|
PclZip is a library that allow you to manage a Zip archive.
|
||||||
|
|
||||||
Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip
|
Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip
|
||||||
|
|
||||||
2 - What's new
|
2 - What's new
|
||||||
==============
|
==============
|
||||||
|
|
||||||
Version 2.8.1 :
|
Version 2.8.1 :
|
||||||
- Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is
|
- Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is
|
||||||
deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will
|
deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will
|
||||||
automatically replace it by PCLZIP_OPT_BY_PREG.
|
automatically replace it by PCLZIP_OPT_BY_PREG.
|
||||||
|
|
||||||
Version 2.8 :
|
Version 2.8 :
|
||||||
- Improve extraction of zip archive for large files by using temporary files
|
- Improve extraction of zip archive for large files by using temporary files
|
||||||
This feature is working like the one defined in r2.7.
|
This feature is working like the one defined in r2.7.
|
||||||
Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF,
|
Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF,
|
||||||
PCLZIP_OPT_TEMP_FILE_THRESHOLD
|
PCLZIP_OPT_TEMP_FILE_THRESHOLD
|
||||||
- Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto
|
- Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto
|
||||||
sense of temporary file use.
|
sense of temporary file use.
|
||||||
- Bug correction : Reduce filepath in returned file list to remove ennoying
|
- Bug correction : Reduce filepath in returned file list to remove ennoying
|
||||||
'.//' preambule in file path.
|
'.//' preambule in file path.
|
||||||
|
|
||||||
Version 2.7 :
|
Version 2.7 :
|
||||||
- Improve creation of zip archive for large files :
|
- Improve creation of zip archive for large files :
|
||||||
PclZip will now autosense the configured memory and use temporary files
|
PclZip will now autosense the configured memory and use temporary files
|
||||||
when large file is suspected.
|
when large file is suspected.
|
||||||
This feature can also ne triggered by manual options in create() and add()
|
This feature can also ne triggered by manual options in create() and add()
|
||||||
methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files,
|
methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files,
|
||||||
'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic,
|
'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic,
|
||||||
'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size
|
'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size
|
||||||
threshold to use temporary files.
|
threshold to use temporary files.
|
||||||
Using "temporary files" rather than "memory" might take more time, but
|
Using "temporary files" rather than "memory" might take more time, but
|
||||||
might give the ability to zip very large files :
|
might give the ability to zip very large files :
|
||||||
Tested on my win laptop with a 88Mo file :
|
Tested on my win laptop with a 88Mo file :
|
||||||
Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo)
|
Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo)
|
||||||
Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo)
|
Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo)
|
||||||
- Replace use of mktime() by time() to limit the E_STRICT error messages.
|
- Replace use of mktime() by time() to limit the E_STRICT error messages.
|
||||||
- Bug correction : When adding files with full windows path (drive letter)
|
- Bug correction : When adding files with full windows path (drive letter)
|
||||||
PclZip is now working. Before, if the drive letter is not the default
|
PclZip is now working. Before, if the drive letter is not the default
|
||||||
path, PclZip was not able to add the file.
|
path, PclZip was not able to add the file.
|
||||||
|
|
||||||
Version 2.6 :
|
Version 2.6 :
|
||||||
- Code optimisation
|
- Code optimisation
|
||||||
- New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to
|
- New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to
|
||||||
add a comment for a specific file. (Don't really know if this is usefull)
|
add a comment for a specific file. (Don't really know if this is usefull)
|
||||||
- New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string
|
- New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string
|
||||||
as a file.
|
as a file.
|
||||||
- New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with
|
- New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with
|
||||||
a file.
|
a file.
|
||||||
- Correct a bug. Files archived with a timestamp with 0h0m0s were extracted
|
- Correct a bug. Files archived with a timestamp with 0h0m0s were extracted
|
||||||
with current time
|
with current time
|
||||||
- Add CRC value in the informations returned back for each file after an
|
- Add CRC value in the informations returned back for each file after an
|
||||||
action.
|
action.
|
||||||
- Add missing closedir() statement.
|
- Add missing closedir() statement.
|
||||||
- When adding a folder, and removing the path of this folder, files were
|
- When adding a folder, and removing the path of this folder, files were
|
||||||
incorrectly added with a '/' at the beginning. Which means files are
|
incorrectly added with a '/' at the beginning. Which means files are
|
||||||
related to root in unix systems. Corrected.
|
related to root in unix systems. Corrected.
|
||||||
- Add conditional if before constant definition. This will allow users
|
- Add conditional if before constant definition. This will allow users
|
||||||
to redefine constants without changing the file, and then improve
|
to redefine constants without changing the file, and then improve
|
||||||
upgrade of pclzip code for new versions.
|
upgrade of pclzip code for new versions.
|
||||||
|
|
||||||
Version 2.5 :
|
Version 2.5 :
|
||||||
- Introduce the ability to add file/folder with individual properties (file descriptor).
|
- Introduce the ability to add file/folder with individual properties (file descriptor).
|
||||||
This gives for example the ability to change the filename of a zipped file.
|
This gives for example the ability to change the filename of a zipped file.
|
||||||
. Able to add files individually
|
. Able to add files individually
|
||||||
. Able to change full name
|
. Able to change full name
|
||||||
. Able to change short name
|
. Able to change short name
|
||||||
. Compatible with global options
|
. Compatible with global options
|
||||||
- New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME
|
- New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME
|
||||||
- New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE
|
- New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE
|
||||||
- Add a security control feature. PclZip can extract any file in any folder
|
- Add a security control feature. PclZip can extract any file in any folder
|
||||||
of a system. People may use this to upload a zip file and try to override
|
of a system. People may use this to upload a zip file and try to override
|
||||||
a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the
|
a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the
|
||||||
ability to forgive any directory transversal behavior.
|
ability to forgive any directory transversal behavior.
|
||||||
- New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path
|
- New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path
|
||||||
- New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION
|
- New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION
|
||||||
- Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend
|
- Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend
|
||||||
by current path (getcwd())
|
by current path (getcwd())
|
||||||
|
|
||||||
Version 2.4 :
|
Version 2.4 :
|
||||||
- Code improvment : try to speed up the code by removing unusefull call to pack()
|
- Code improvment : try to speed up the code by removing unusefull call to pack()
|
||||||
- Correct bug in delete() : delete() should be called with no argument. This was not
|
- Correct bug in delete() : delete() should be called with no argument. This was not
|
||||||
the case in 2.3. This is corrected in 2.4.
|
the case in 2.3. This is corrected in 2.4.
|
||||||
- Correct a bug in path_inclusion function. When the path has several '../../', the
|
- Correct a bug in path_inclusion function. When the path has several '../../', the
|
||||||
result was bad.
|
result was bad.
|
||||||
- Add a check for magic_quotes_runtime configuration. If enabled, PclZip will
|
- Add a check for magic_quotes_runtime configuration. If enabled, PclZip will
|
||||||
disable it while working and det it back to its original value.
|
disable it while working and det it back to its original value.
|
||||||
This resolve a lots of bad formated archive errors.
|
This resolve a lots of bad formated archive errors.
|
||||||
- Bug correction : PclZip now correctly unzip file in some specific situation,
|
- Bug correction : PclZip now correctly unzip file in some specific situation,
|
||||||
when compressed content has same size as uncompressed content.
|
when compressed content has same size as uncompressed content.
|
||||||
- Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH',
|
- Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH',
|
||||||
directories are not any more created.
|
directories are not any more created.
|
||||||
- Code improvment : correct unclosed opendir(), better handling of . and .. in
|
- Code improvment : correct unclosed opendir(), better handling of . and .. in
|
||||||
loops.
|
loops.
|
||||||
|
|
||||||
|
|
||||||
Version 2.3 :
|
Version 2.3 :
|
||||||
- Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not
|
- Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not
|
||||||
give the same result in PHP4 and PHP5 ....
|
give the same result in PHP4 and PHP5 ....
|
||||||
|
|
||||||
Version 2.2 :
|
Version 2.2 :
|
||||||
- Try development of PCLZIP_OPT_CRYPT .....
|
- Try development of PCLZIP_OPT_CRYPT .....
|
||||||
However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers,
|
However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers,
|
||||||
the result (greater than a long) is not supported by PHP. Even the use of bcmath
|
the result (greater than a long) is not supported by PHP. Even the use of bcmath
|
||||||
functions does not help. I did not find yet a solution ...;
|
functions does not help. I did not find yet a solution ...;
|
||||||
- Add missing '/' at end of directory entries
|
- Add missing '/' at end of directory entries
|
||||||
- Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or
|
- Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or
|
||||||
error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION.
|
error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION.
|
||||||
- Corrected : Bad "version need to extract" field in local file header
|
- Corrected : Bad "version need to extract" field in local file header
|
||||||
- Add private method privCheckFileHeaders() in order to check local and central
|
- Add private method privCheckFileHeaders() in order to check local and central
|
||||||
file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives
|
file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives
|
||||||
the ability to have a local file header without size, compressed size and crc filled.
|
the ability to have a local file header without size, compressed size and crc filled.
|
||||||
- Add a generic status 'error' for file status
|
- Add a generic status 'error' for file status
|
||||||
- Add control of compression type. PclZip only support deflate compression method.
|
- Add control of compression type. PclZip only support deflate compression method.
|
||||||
Before v2.2, PclZip does not check the compression method used in an archive while
|
Before v2.2, PclZip does not check the compression method used in an archive while
|
||||||
extracting. With v2.2 PclZip returns a new error status for a file using an unsupported
|
extracting. With v2.2 PclZip returns a new error status for a file using an unsupported
|
||||||
compression method. New status is "unsupported_compression". New error code is
|
compression method. New status is "unsupported_compression". New error code is
|
||||||
PCLZIP_ERR_UNSUPPORTED_COMPRESSION.
|
PCLZIP_ERR_UNSUPPORTED_COMPRESSION.
|
||||||
- Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files
|
- Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files
|
||||||
when errors like 'a folder with same name exists' or 'a newer file exists' or
|
when errors like 'a folder with same name exists' or 'a newer file exists' or
|
||||||
'a write protected file' exists, rather than set a status for the concerning file
|
'a write protected file' exists, rather than set a status for the concerning file
|
||||||
and resume the extract of the zip.
|
and resume the extract of the zip.
|
||||||
- Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the
|
- Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the
|
||||||
replacement of the file, even if a newer version of the file exists.
|
replacement of the file, even if a newer version of the file exists.
|
||||||
Note that today if a file with the same name already exists but is older it will be
|
Note that today if a file with the same name already exists but is older it will be
|
||||||
replaced by the extracted one.
|
replaced by the extracted one.
|
||||||
- Improve PclZipUtilOption()
|
- Improve PclZipUtilOption()
|
||||||
- Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central
|
- Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central
|
||||||
directory structure is the last data in the archive. Crypt encryption/decryption of
|
directory structure is the last data in the archive. Crypt encryption/decryption of
|
||||||
zip archive put trailing 0 bytes after decryption. PclZip is now supporting this.
|
zip archive put trailing 0 bytes after decryption. PclZip is now supporting this.
|
||||||
|
|
||||||
Version 2.1 :
|
Version 2.1 :
|
||||||
- Add the ability to abort the extraction by using a user callback function.
|
- Add the ability to abort the extraction by using a user callback function.
|
||||||
The user can now return the value '2' in its callback which indicates to stop the
|
The user can now return the value '2' in its callback which indicates to stop the
|
||||||
extraction. For a pre call-back extract is stopped before the extration of the current
|
extraction. For a pre call-back extract is stopped before the extration of the current
|
||||||
file. For a post call back, the extraction is stopped after.
|
file. For a post call back, the extraction is stopped after.
|
||||||
- Add the ability to extract a file (or several files) directly in the standard output.
|
- Add the ability to extract a file (or several files) directly in the standard output.
|
||||||
This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract().
|
This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract().
|
||||||
- Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT,
|
- Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT,
|
||||||
PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments
|
PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments
|
||||||
in the zip archive.
|
in the zip archive.
|
||||||
- When merging two archives, the comments are not any more lost, but merged, with a
|
- When merging two archives, the comments are not any more lost, but merged, with a
|
||||||
blank space separator.
|
blank space separator.
|
||||||
- Corrected bug : Files are not deleted when all files are asked to be deleted.
|
- Corrected bug : Files are not deleted when all files are asked to be deleted.
|
||||||
- Corrected bug : Folders with name '0' made PclZip to abort the create or add feature.
|
- Corrected bug : Folders with name '0' made PclZip to abort the create or add feature.
|
||||||
|
|
||||||
|
|
||||||
Version 2.0 :
|
Version 2.0 :
|
||||||
***** Warning : Some new features may break the backward compatibility for your scripts.
|
***** Warning : Some new features may break the backward compatibility for your scripts.
|
||||||
Please carefully read the readme file.
|
Please carefully read the readme file.
|
||||||
- Add the ability to delete by Index, name and regular expression. This feature is
|
- Add the ability to delete by Index, name and regular expression. This feature is
|
||||||
performed by the method delete(), which uses the optional parameters
|
performed by the method delete(), which uses the optional parameters
|
||||||
PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG.
|
PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG.
|
||||||
- Add the ability to extract by regular expression. To extract by regexp you must use the method
|
- Add the ability to extract by regular expression. To extract by regexp you must use the method
|
||||||
extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG
|
extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG
|
||||||
(depending if you want to use ereg() or preg_match() syntax) followed by the
|
(depending if you want to use ereg() or preg_match() syntax) followed by the
|
||||||
regular expression pattern.
|
regular expression pattern.
|
||||||
- Add the ability to extract by index, directly with the extract() method. This is a
|
- Add the ability to extract by index, directly with the extract() method. This is a
|
||||||
code improvment of the extractByIndex() method.
|
code improvment of the extractByIndex() method.
|
||||||
- Add the ability to extract by name. To extract by name you must use the method
|
- Add the ability to extract by name. To extract by name you must use the method
|
||||||
extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to
|
extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to
|
||||||
extract or an array of filenames to extract. To extract all a folder, use the folder
|
extract or an array of filenames to extract. To extract all a folder, use the folder
|
||||||
name rather than the filename with a '/' at the end.
|
name rather than the filename with a '/' at the end.
|
||||||
- Add the ability to add files without compression. This is done with a new attribute
|
- Add the ability to add files without compression. This is done with a new attribute
|
||||||
which is PCLZIP_OPT_NO_COMPRESSION.
|
which is PCLZIP_OPT_NO_COMPRESSION.
|
||||||
- Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly
|
- Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly
|
||||||
in a string without using any file (or temporary file).
|
in a string without using any file (or temporary file).
|
||||||
- Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string.
|
- Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string.
|
||||||
The default separator is now a comma (,) and not any more a blank space.
|
The default separator is now a comma (,) and not any more a blank space.
|
||||||
THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with
|
THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with
|
||||||
your script.
|
your script.
|
||||||
- Improve algorythm performance by removing the use of temporary files when adding or
|
- Improve algorythm performance by removing the use of temporary files when adding or
|
||||||
extracting files in an archive.
|
extracting files in an archive.
|
||||||
- Add (correct) detection of empty filename zipping. This can occurs when the removed
|
- Add (correct) detection of empty filename zipping. This can occurs when the removed
|
||||||
path is the same
|
path is the same
|
||||||
as a zipped dir. The dir is not zipped (['status'] = filtered), only its content.
|
as a zipped dir. The dir is not zipped (['status'] = filtered), only its content.
|
||||||
- Add better support for windows paths (thanks for help from manus@manusfreedom.com).
|
- Add better support for windows paths (thanks for help from manus@manusfreedom.com).
|
||||||
- Corrected bug : When the archive file already exists with size=0, the add() method
|
- Corrected bug : When the archive file already exists with size=0, the add() method
|
||||||
fails. Corrected in 2.0.
|
fails. Corrected in 2.0.
|
||||||
- Remove the use of OS_WINDOWS constant. Use php_uname() function rather.
|
- Remove the use of OS_WINDOWS constant. Use php_uname() function rather.
|
||||||
- Control the order of index ranges in extract by index feature.
|
- Control the order of index ranges in extract by index feature.
|
||||||
- Change the internal management of folders (better handling of internal flag).
|
- Change the internal management of folders (better handling of internal flag).
|
||||||
|
|
||||||
|
|
||||||
Version 1.3 :
|
Version 1.3 :
|
||||||
- Removing the double include check. This is now done by include_once() and require_once()
|
- Removing the double include check. This is now done by include_once() and require_once()
|
||||||
PHP directives.
|
PHP directives.
|
||||||
- Changing the error handling mecanism : Remove the use of an external error library.
|
- Changing the error handling mecanism : Remove the use of an external error library.
|
||||||
The former PclError...() functions are replaced by internal equivalent methods.
|
The former PclError...() functions are replaced by internal equivalent methods.
|
||||||
By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library.
|
By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library.
|
||||||
Introducing the use of constants for error codes rather than integer values. This will help
|
Introducing the use of constants for error codes rather than integer values. This will help
|
||||||
in futur improvment.
|
in futur improvment.
|
||||||
Introduction of error handling functions like errorCode(), errorName() and errorInfo().
|
Introduction of error handling functions like errorCode(), errorName() and errorInfo().
|
||||||
- Remove the deprecated use of calling function with arguments passed by reference.
|
- Remove the deprecated use of calling function with arguments passed by reference.
|
||||||
- Add the calling of extract(), extractByIndex(), create() and add() functions
|
- Add the calling of extract(), extractByIndex(), create() and add() functions
|
||||||
with variable options rather than fixed arguments.
|
with variable options rather than fixed arguments.
|
||||||
- Add the ability to remove all the file path while extracting or adding,
|
- Add the ability to remove all the file path while extracting or adding,
|
||||||
without any need to specify the path to remove.
|
without any need to specify the path to remove.
|
||||||
This is available for extract(), extractByIndex(), create() and add() functionS by using
|
This is available for extract(), extractByIndex(), create() and add() functionS by using
|
||||||
the new variable options parameters :
|
the new variable options parameters :
|
||||||
- PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct.
|
- PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct.
|
||||||
- Ability to change the mode of a file after the extraction (chmod()).
|
- Ability to change the mode of a file after the extraction (chmod()).
|
||||||
This is available for extract() and extractByIndex() functionS by using
|
This is available for extract() and extractByIndex() functionS by using
|
||||||
the new variable options parameters.
|
the new variable options parameters.
|
||||||
- PCLZIP_OPT_SET_CHMOD : by setting the value of this option.
|
- PCLZIP_OPT_SET_CHMOD : by setting the value of this option.
|
||||||
- Ability to definition call-back options. These call-back will be called during the adding,
|
- Ability to definition call-back options. These call-back will be called during the adding,
|
||||||
or the extracting of file (extract(), extractByIndex(), create() and add() functions) :
|
or the extracting of file (extract(), extractByIndex(), create() and add() functions) :
|
||||||
- PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user
|
- PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user
|
||||||
can trigerred the change the filename of the extracted file. The user can triggered the
|
can trigerred the change the filename of the extracted file. The user can triggered the
|
||||||
skip of the extraction. This is adding a 'skipped' status in the file list result value.
|
skip of the extraction. This is adding a 'skipped' status in the file list result value.
|
||||||
- PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file.
|
- PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file.
|
||||||
Nothing can be triggered from that point.
|
Nothing can be triggered from that point.
|
||||||
- PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user
|
- PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user
|
||||||
can trigerred the change the stored filename of the added file. The user can triggered the
|
can trigerred the change the stored filename of the added file. The user can triggered the
|
||||||
skip of the add. This is adding a 'skipped' status in the file list result value.
|
skip of the add. This is adding a 'skipped' status in the file list result value.
|
||||||
- PCLZIP_CB_POST_ADD : will be called after each add of a file.
|
- PCLZIP_CB_POST_ADD : will be called after each add of a file.
|
||||||
Nothing can be triggered from that point.
|
Nothing can be triggered from that point.
|
||||||
- Two status are added in the file list returned as function result : skipped & filename_too_long
|
- Two status are added in the file list returned as function result : skipped & filename_too_long
|
||||||
'skipped' is used when a call-back function ask for skipping the file.
|
'skipped' is used when a call-back function ask for skipping the file.
|
||||||
'filename_too_long' is used while adding a file with a too long filename to archive (the file is
|
'filename_too_long' is used while adding a file with a too long filename to archive (the file is
|
||||||
not added)
|
not added)
|
||||||
- Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into
|
- Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into
|
||||||
a directory.
|
a directory.
|
||||||
- Add a check of the presence of the archive file before some actions (like list, ...)
|
- Add a check of the presence of the archive file before some actions (like list, ...)
|
||||||
- Add the initialisation of field "index" in header array. This means that by
|
- Add the initialisation of field "index" in header array. This means that by
|
||||||
default index will be -1 when not explicitly set by the methods.
|
default index will be -1 when not explicitly set by the methods.
|
||||||
|
|
||||||
Version 1.2 :
|
Version 1.2 :
|
||||||
- Adding a duplicate function.
|
- Adding a duplicate function.
|
||||||
- Adding a merge function. The merge function is a "quick merge" function,
|
- Adding a merge function. The merge function is a "quick merge" function,
|
||||||
it just append the content of an archive at the end of the first one. There
|
it just append the content of an archive at the end of the first one. There
|
||||||
is no check for duplicate files or more recent files.
|
is no check for duplicate files or more recent files.
|
||||||
- Improve the search of the central directory end.
|
- Improve the search of the central directory end.
|
||||||
|
|
||||||
Version 1.1.2 :
|
Version 1.1.2 :
|
||||||
|
|
||||||
- Changing the license of PclZip. PclZip is now released under the GNU / LGPL license
|
- Changing the license of PclZip. PclZip is now released under the GNU / LGPL license
|
||||||
(see License section).
|
(see License section).
|
||||||
- Adding the optional support of a static temporary directory. You will need to configure
|
- Adding the optional support of a static temporary directory. You will need to configure
|
||||||
the constant PCLZIP_TEMPORARY_DIR if you want to use this feature.
|
the constant PCLZIP_TEMPORARY_DIR if you want to use this feature.
|
||||||
- Improving the rename() function. In some cases rename() does not work (different
|
- Improving the rename() function. In some cases rename() does not work (different
|
||||||
Filesystems), so it will be replaced by a copy() + unlink() functions.
|
Filesystems), so it will be replaced by a copy() + unlink() functions.
|
||||||
|
|
||||||
Version 1.1.1 :
|
Version 1.1.1 :
|
||||||
|
|
||||||
- Maintenance release, no new feature.
|
- Maintenance release, no new feature.
|
||||||
|
|
||||||
Version 1.1 :
|
Version 1.1 :
|
||||||
|
|
||||||
- New method Add() : adding files in the archive
|
- New method Add() : adding files in the archive
|
||||||
- New method ExtractByIndex() : partial extract of the archive, files are identified by
|
- New method ExtractByIndex() : partial extract of the archive, files are identified by
|
||||||
their index in the archive
|
their index in the archive
|
||||||
- New method DeleteByIndex() : delete some files/folder entries from the archive,
|
- New method DeleteByIndex() : delete some files/folder entries from the archive,
|
||||||
files are identified by their index in the archive.
|
files are identified by their index in the archive.
|
||||||
- Adding a test of the zlib extension presence. If not present abort the script.
|
- Adding a test of the zlib extension presence. If not present abort the script.
|
||||||
|
|
||||||
Version 1.0.1 :
|
Version 1.0.1 :
|
||||||
|
|
||||||
- No new feature
|
- No new feature
|
||||||
|
|
||||||
|
|
||||||
3 - Corrected bugs
|
3 - Corrected bugs
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Corrected in Version 2.0 :
|
Corrected in Version 2.0 :
|
||||||
- Corrected : During an extraction, if a call-back fucntion is used and try to skip
|
- Corrected : During an extraction, if a call-back fucntion is used and try to skip
|
||||||
a file, all the extraction process is stopped.
|
a file, all the extraction process is stopped.
|
||||||
|
|
||||||
Corrected in Version 1.3 :
|
Corrected in Version 1.3 :
|
||||||
- Corrected : Support of static synopsis for method extract() is broken.
|
- Corrected : Support of static synopsis for method extract() is broken.
|
||||||
- Corrected : invalid size of archive content field (0xFF) should be (0xFFFF).
|
- Corrected : invalid size of archive content field (0xFF) should be (0xFFFF).
|
||||||
- Corrected : When an extract is done with a remove_path parameter, the entry for
|
- Corrected : When an extract is done with a remove_path parameter, the entry for
|
||||||
the directory with exactly the same path is not skipped/filtered.
|
the directory with exactly the same path is not skipped/filtered.
|
||||||
- Corrected : extractByIndex() and deleteByIndex() were not managing index in the
|
- Corrected : extractByIndex() and deleteByIndex() were not managing index in the
|
||||||
right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This
|
right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This
|
||||||
is due to a sort of the index resulting table that puts 11 before 3-5 (sort on
|
is due to a sort of the index resulting table that puts 11 before 3-5 (sort on
|
||||||
string and not interger). The sort is temporarilly removed, this means that
|
string and not interger). The sort is temporarilly removed, this means that
|
||||||
you must provide a sorted list of index ranges.
|
you must provide a sorted list of index ranges.
|
||||||
|
|
||||||
Corrected in Version 1.2 :
|
Corrected in Version 1.2 :
|
||||||
|
|
||||||
- Nothing.
|
- Nothing.
|
||||||
|
|
||||||
Corrected in Version 1.1.2 :
|
Corrected in Version 1.1.2 :
|
||||||
|
|
||||||
- Corrected : Winzip is unable to delete or add new files in a PclZip created archives.
|
- Corrected : Winzip is unable to delete or add new files in a PclZip created archives.
|
||||||
|
|
||||||
Corrected in Version 1.1.1 :
|
Corrected in Version 1.1.1 :
|
||||||
|
|
||||||
- Corrected : When archived file is not compressed (0% compression), the
|
- Corrected : When archived file is not compressed (0% compression), the
|
||||||
extract method fails.
|
extract method fails.
|
||||||
|
|
||||||
Corrected in Version 1.1 :
|
Corrected in Version 1.1 :
|
||||||
|
|
||||||
- Corrected : Adding a complete tree of folder may result in a bad archive
|
- Corrected : Adding a complete tree of folder may result in a bad archive
|
||||||
creation.
|
creation.
|
||||||
|
|
||||||
Corrected in Version 1.0.1 :
|
Corrected in Version 1.0.1 :
|
||||||
|
|
||||||
- Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
|
- Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
|
||||||
|
|
||||||
|
|
||||||
4 - Known bugs or limitations
|
4 - Known bugs or limitations
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
Please publish bugs reports in SourceForge :
|
Please publish bugs reports in SourceForge :
|
||||||
http://sourceforge.net/tracker/?group_id=40254&atid=427564
|
http://sourceforge.net/tracker/?group_id=40254&atid=427564
|
||||||
|
|
||||||
In Version 2.x :
|
In Version 2.x :
|
||||||
- PclZip does only support file uncompressed or compressed with deflate (compression method 8)
|
- PclZip does only support file uncompressed or compressed with deflate (compression method 8)
|
||||||
- PclZip does not support password protected zip archive
|
- PclZip does not support password protected zip archive
|
||||||
- Some concern were seen when changing mtime of a file while archiving.
|
- Some concern were seen when changing mtime of a file while archiving.
|
||||||
Seems to be linked to Daylight Saving Time (PclTest_changing_mtime).
|
Seems to be linked to Daylight Saving Time (PclTest_changing_mtime).
|
||||||
|
|
||||||
In Version 1.2 :
|
In Version 1.2 :
|
||||||
|
|
||||||
- merge() methods does not check for duplicate files or last date of modifications.
|
- merge() methods does not check for duplicate files or last date of modifications.
|
||||||
|
|
||||||
In Version 1.1 :
|
In Version 1.1 :
|
||||||
|
|
||||||
- Limitation : Using 'extract' fields in the file header in the zip archive is not supported.
|
- Limitation : Using 'extract' fields in the file header in the zip archive is not supported.
|
||||||
- WinZip is unable to delete a single file in a PclZip created archive. It is also unable to
|
- WinZip is unable to delete a single file in a PclZip created archive. It is also unable to
|
||||||
add a file in a PclZip created archive. (Corrected in v.1.2)
|
add a file in a PclZip created archive. (Corrected in v.1.2)
|
||||||
|
|
||||||
In Version 1.0.1 :
|
In Version 1.0.1 :
|
||||||
|
|
||||||
- Adding a complete tree of folder may result in a bad archive
|
- Adding a complete tree of folder may result in a bad archive
|
||||||
creation. (Corrected in V.1.1).
|
creation. (Corrected in V.1.1).
|
||||||
- Path given to methods must be in the unix format (/) and not the Windows format (\).
|
- Path given to methods must be in the unix format (/) and not the Windows format (\).
|
||||||
Workaround : Use only / directory separators.
|
Workaround : Use only / directory separators.
|
||||||
- PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz
|
- PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz
|
||||||
added suffix. Files with these names may already exist and may be overwritten.
|
added suffix. Files with these names may already exist and may be overwritten.
|
||||||
Workaround : none.
|
Workaround : none.
|
||||||
- PclZip does not check if the zlib extension is present. If it is absent, the zip
|
- PclZip does not check if the zlib extension is present. If it is absent, the zip
|
||||||
file is not created and the lib abort without warning.
|
file is not created and the lib abort without warning.
|
||||||
Workaround : enable the zlib extension on the php install
|
Workaround : enable the zlib extension on the php install
|
||||||
|
|
||||||
In Version 1.0 :
|
In Version 1.0 :
|
||||||
|
|
||||||
- Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
|
- Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
|
||||||
(Corrected in v.1.0.1)
|
(Corrected in v.1.0.1)
|
||||||
- Limitation : Multi-disk zip archive are not supported.
|
- Limitation : Multi-disk zip archive are not supported.
|
||||||
|
|
||||||
|
|
||||||
5 - License
|
5 - License
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Since version 1.1.2, PclZip Library is released under GNU/LGPL license.
|
Since version 1.1.2, PclZip Library is released under GNU/LGPL license.
|
||||||
This library is free, so you can use it at no cost.
|
This library is free, so you can use it at no cost.
|
||||||
|
|
||||||
HOWEVER, if you release a script, an application, a library or any kind of
|
HOWEVER, if you release a script, an application, a library or any kind of
|
||||||
code using PclZip library (or a part of it), YOU MUST :
|
code using PclZip library (or a part of it), YOU MUST :
|
||||||
- Indicate in the documentation (or a readme file), that your work
|
- Indicate in the documentation (or a readme file), that your work
|
||||||
uses PclZip Library, and make a reference to the author and the web site
|
uses PclZip Library, and make a reference to the author and the web site
|
||||||
http://www.phpconcept.net
|
http://www.phpconcept.net
|
||||||
- Gives the ability to the final user to update the PclZip libary.
|
- Gives the ability to the final user to update the PclZip libary.
|
||||||
|
|
||||||
I will also appreciate that you send me a mail (vincent@phpconcept.net), just to
|
I will also appreciate that you send me a mail (vincent@phpconcept.net), just to
|
||||||
be aware that someone is using PclZip.
|
be aware that someone is using PclZip.
|
||||||
|
|
||||||
For more information about GNU/LGPL license : http://www.gnu.org
|
For more information about GNU/LGPL license : http://www.gnu.org
|
||||||
|
|
||||||
6 - Warning
|
6 - Warning
|
||||||
=================
|
=================
|
||||||
|
|
||||||
This library and the associated files are non commercial, non professional work.
|
This library and the associated files are non commercial, non professional work.
|
||||||
It should not have unexpected results. However if any damage is caused by this software
|
It should not have unexpected results. However if any damage is caused by this software
|
||||||
the author can not be responsible.
|
the author can not be responsible.
|
||||||
The use of this software is at the risk of the user.
|
The use of this software is at the risk of the user.
|
||||||
|
|
||||||
7 - Documentation
|
7 - Documentation
|
||||||
=================
|
=================
|
||||||
PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php
|
PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php
|
||||||
A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/
|
A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/
|
||||||
|
|
||||||
8 - Author
|
8 - Author
|
||||||
==========
|
==========
|
||||||
|
|
||||||
This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time.
|
This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time.
|
||||||
|
|
||||||
9 - Contribute
|
9 - Contribute
|
||||||
==============
|
==============
|
||||||
If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net.
|
If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net.
|
||||||
If you can help in financing PhpConcept hosting service, please go to
|
If you can help in financing PhpConcept hosting service, please go to
|
||||||
http://www.phpconcept.net/soutien.php
|
http://www.phpconcept.net/soutien.php
|
||||||
|
|||||||
@@ -1,412 +1,412 @@
|
|||||||
<?php
|
<?php
|
||||||
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | PHP Version 4 |
|
// | PHP Version 4 |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | Copyright (c) 1997-2002 The PHP Group |
|
// | Copyright (c) 1997-2002 The PHP Group |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | This source file is subject to version 2.02 of the PHP license, |
|
// | This source file is subject to version 2.02 of the PHP license, |
|
||||||
// | that is bundled with this package in the file LICENSE, and is |
|
// | that is bundled with this package in the file LICENSE, and is |
|
||||||
// | available at through the world-wide-web at |
|
// | available at through the world-wide-web at |
|
||||||
// | http://www.php.net/license/2_02.txt. |
|
// | http://www.php.net/license/2_02.txt. |
|
||||||
// | If you did not receive a copy of the PHP license and are unable to |
|
// | If you did not receive a copy of the PHP license and are unable to |
|
||||||
// | obtain it through the world-wide-web, please send a note to |
|
// | obtain it through the world-wide-web, please send a note to |
|
||||||
// | license@php.net so we can mail you a copy immediately. |
|
// | license@php.net so we can mail you a copy immediately. |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | Author: Xavier Noguer <xnoguer@php.net> |
|
// | Author: Xavier Noguer <xnoguer@php.net> |
|
||||||
// | Based on OLE::Storage_Lite by Kawai, Takanori |
|
// | Based on OLE::Storage_Lite by Kawai, Takanori |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
//
|
//
|
||||||
// $Id: OLE.php,v 1.7 2003/08/21 15:15:40 xnoguer Exp $
|
// $Id: OLE.php,v 1.7 2003/08/21 15:15:40 xnoguer Exp $
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants for OLE package
|
* Constants for OLE package
|
||||||
*/
|
*/
|
||||||
define('OLE_PPS_TYPE_ROOT', 5);
|
define('OLE_PPS_TYPE_ROOT', 5);
|
||||||
define('OLE_PPS_TYPE_DIR', 1);
|
define('OLE_PPS_TYPE_DIR', 1);
|
||||||
define('OLE_PPS_TYPE_FILE', 2);
|
define('OLE_PPS_TYPE_FILE', 2);
|
||||||
define('OLE_DATA_SIZE_SMALL', 0x1000);
|
define('OLE_DATA_SIZE_SMALL', 0x1000);
|
||||||
define('OLE_LONG_INT_SIZE', 4);
|
define('OLE_LONG_INT_SIZE', 4);
|
||||||
define('OLE_PPS_SIZE', 0x80);
|
define('OLE_PPS_SIZE', 0x80);
|
||||||
|
|
||||||
if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}
|
if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}
|
||||||
if (!isset($homedir)) die();
|
if (!isset($homedir)) die();
|
||||||
require_once($homedir.'/classes/pear/PEAR.php');
|
require_once($homedir.'/classes/pear/PEAR.php');
|
||||||
require_once $homedir.'/classes/pear/OLE/PPS.php';
|
require_once $homedir.'/classes/pear/OLE/PPS.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OLE package base class.
|
* OLE package base class.
|
||||||
*
|
*
|
||||||
* @author Xavier Noguer <xnoguer@php.net>
|
* @author Xavier Noguer <xnoguer@php.net>
|
||||||
* @category Structures
|
* @category Structures
|
||||||
* @package OLE
|
* @package OLE
|
||||||
*/
|
*/
|
||||||
class OLE extends PEAR
|
class OLE extends PEAR
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The file handle for reading an OLE container
|
* The file handle for reading an OLE container
|
||||||
* @var resource
|
* @var resource
|
||||||
*/
|
*/
|
||||||
var $_file_handle;
|
var $_file_handle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of PPS's found on the OLE container
|
* Array of PPS's found on the OLE container
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_list;
|
var $_list;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new OLE object
|
* Creates a new OLE object
|
||||||
* Remember to use ampersand when creating an OLE object ($my_ole =& new OLE();)
|
* Remember to use ampersand when creating an OLE object ($my_ole =& new OLE();)
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function OLE()
|
function OLE()
|
||||||
{
|
{
|
||||||
$this->_list = array();
|
$this->_list = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads an OLE container from the contents of the file given.
|
* Reads an OLE container from the contents of the file given.
|
||||||
*
|
*
|
||||||
* @acces public
|
* @acces public
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @return mixed true on success, PEAR_Error on failure
|
* @return mixed true on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function read($file)
|
function read($file)
|
||||||
{
|
{
|
||||||
/* consider storing offsets as constants */
|
/* consider storing offsets as constants */
|
||||||
$big_block_size_offset = 30;
|
$big_block_size_offset = 30;
|
||||||
$iBdbCnt_offset = 44;
|
$iBdbCnt_offset = 44;
|
||||||
$bd_start_offset = 68;
|
$bd_start_offset = 68;
|
||||||
|
|
||||||
$fh = @fopen($file, "r");
|
$fh = @fopen($file, "r");
|
||||||
if ($fh == false) {
|
if ($fh == false) {
|
||||||
return $this->raiseError("Can't open file $file");
|
return $this->raiseError("Can't open file $file");
|
||||||
}
|
}
|
||||||
$this->_file_handle = $fh;
|
$this->_file_handle = $fh;
|
||||||
|
|
||||||
/* begin reading OLE attributes */
|
/* begin reading OLE attributes */
|
||||||
fseek($fh, 0);
|
fseek($fh, 0);
|
||||||
$signature = fread($fh, 8);
|
$signature = fread($fh, 8);
|
||||||
if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) {
|
if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) {
|
||||||
return $this->raiseError("File doesn't seem to be an OLE container.");
|
return $this->raiseError("File doesn't seem to be an OLE container.");
|
||||||
}
|
}
|
||||||
fseek($fh, $big_block_size_offset);
|
fseek($fh, $big_block_size_offset);
|
||||||
$packed_array = unpack("v", fread($fh, 2));
|
$packed_array = unpack("v", fread($fh, 2));
|
||||||
$big_block_size = pow(2, $packed_array['']);
|
$big_block_size = pow(2, $packed_array['']);
|
||||||
|
|
||||||
$packed_array = unpack("v", fread($fh, 2));
|
$packed_array = unpack("v", fread($fh, 2));
|
||||||
$small_block_size = pow(2, $packed_array['']);
|
$small_block_size = pow(2, $packed_array['']);
|
||||||
$i1stBdL = ($big_block_size - 0x4C) / OLE_LONG_INT_SIZE;
|
$i1stBdL = ($big_block_size - 0x4C) / OLE_LONG_INT_SIZE;
|
||||||
|
|
||||||
fseek($fh, $iBdbCnt_offset);
|
fseek($fh, $iBdbCnt_offset);
|
||||||
$packed_array = unpack("V", fread($fh, 4));
|
$packed_array = unpack("V", fread($fh, 4));
|
||||||
$iBdbCnt = $packed_array[''];
|
$iBdbCnt = $packed_array[''];
|
||||||
|
|
||||||
$packed_array = unpack("V", fread($fh, 4));
|
$packed_array = unpack("V", fread($fh, 4));
|
||||||
$pps_wk_start = $packed_array[''];
|
$pps_wk_start = $packed_array[''];
|
||||||
|
|
||||||
fseek($fh, $bd_start_offset);
|
fseek($fh, $bd_start_offset);
|
||||||
$packed_array = unpack("V", fread($fh, 4));
|
$packed_array = unpack("V", fread($fh, 4));
|
||||||
$bd_start = $packed_array[''];
|
$bd_start = $packed_array[''];
|
||||||
$packed_array = unpack("V", fread($fh, 4));
|
$packed_array = unpack("V", fread($fh, 4));
|
||||||
$bd_count = $packed_array[''];
|
$bd_count = $packed_array[''];
|
||||||
$packed_array = unpack("V", fread($fh, 4));
|
$packed_array = unpack("V", fread($fh, 4));
|
||||||
$iAll = $packed_array['']; // this may be wrong
|
$iAll = $packed_array['']; // this may be wrong
|
||||||
/* create OLE_PPS objects from */
|
/* create OLE_PPS objects from */
|
||||||
$ret = $this->_readPpsWks($pps_wk_start, $big_block_size);
|
$ret = $this->_readPpsWks($pps_wk_start, $big_block_size);
|
||||||
if (PEAR::isError($ret)) {
|
if (PEAR::isError($ret)) {
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor (using PEAR)
|
* Destructor (using PEAR)
|
||||||
* Just closes the file handle on the OLE file.
|
* Just closes the file handle on the OLE file.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _OLE()
|
function _OLE()
|
||||||
{
|
{
|
||||||
fclose($this->_file_handle);
|
fclose($this->_file_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets information about all PPS's on the OLE container from the PPS WK's
|
* Gets information about all PPS's on the OLE container from the PPS WK's
|
||||||
* creates an OLE_PPS object for each one.
|
* creates an OLE_PPS object for each one.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @param integer $pps_wk_start Position inside the OLE file where PPS WK's start
|
* @param integer $pps_wk_start Position inside the OLE file where PPS WK's start
|
||||||
* @param integer $big_block_size Size of big blobks in the OLE file
|
* @param integer $big_block_size Size of big blobks in the OLE file
|
||||||
* @return mixed true on success, PEAR_Error on failure
|
* @return mixed true on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _readPpsWks($pps_wk_start, $big_block_size)
|
function _readPpsWks($pps_wk_start, $big_block_size)
|
||||||
{
|
{
|
||||||
$pointer = ($pps_wk_start + 1) * $big_block_size;
|
$pointer = ($pps_wk_start + 1) * $big_block_size;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
fseek($this->_file_handle, $pointer);
|
fseek($this->_file_handle, $pointer);
|
||||||
$pps_wk = fread($this->_file_handle, OLE_PPS_SIZE);
|
$pps_wk = fread($this->_file_handle, OLE_PPS_SIZE);
|
||||||
if (strlen($pps_wk) != OLE_PPS_SIZE) {
|
if (strlen($pps_wk) != OLE_PPS_SIZE) {
|
||||||
break; // Excel likes to add a trailing byte sometimes
|
break; // Excel likes to add a trailing byte sometimes
|
||||||
//return $this->raiseError("PPS at $pointer seems too short: ".strlen($pps_wk));
|
//return $this->raiseError("PPS at $pointer seems too short: ".strlen($pps_wk));
|
||||||
}
|
}
|
||||||
$name_length = unpack("c", substr($pps_wk, 64, 2)); // FIXME (2 bytes??)
|
$name_length = unpack("c", substr($pps_wk, 64, 2)); // FIXME (2 bytes??)
|
||||||
$name_length = $name_length[''] - 2;
|
$name_length = $name_length[''] - 2;
|
||||||
$name = substr($pps_wk, 0, $name_length);
|
$name = substr($pps_wk, 0, $name_length);
|
||||||
$type = unpack("c", substr($pps_wk, 66, 1));
|
$type = unpack("c", substr($pps_wk, 66, 1));
|
||||||
if (($type[''] != OLE_PPS_TYPE_ROOT) and
|
if (($type[''] != OLE_PPS_TYPE_ROOT) and
|
||||||
($type[''] != OLE_PPS_TYPE_DIR) and
|
($type[''] != OLE_PPS_TYPE_DIR) and
|
||||||
($type[''] != OLE_PPS_TYPE_FILE))
|
($type[''] != OLE_PPS_TYPE_FILE))
|
||||||
{
|
{
|
||||||
return $this->raiseError("PPS at $pointer has unknown type: {$type['']}");
|
return $this->raiseError("PPS at $pointer has unknown type: {$type['']}");
|
||||||
}
|
}
|
||||||
$prev = unpack("V", substr($pps_wk, 68, 4));
|
$prev = unpack("V", substr($pps_wk, 68, 4));
|
||||||
$next = unpack("V", substr($pps_wk, 72, 4));
|
$next = unpack("V", substr($pps_wk, 72, 4));
|
||||||
$dir = unpack("V", substr($pps_wk, 76, 4));
|
$dir = unpack("V", substr($pps_wk, 76, 4));
|
||||||
// there is no magic number, it can take different values.
|
// there is no magic number, it can take different values.
|
||||||
//$magic = unpack("V", strrev(substr($pps_wk, 92, 4)));
|
//$magic = unpack("V", strrev(substr($pps_wk, 92, 4)));
|
||||||
$time_1st = substr($pps_wk, 100, 8);
|
$time_1st = substr($pps_wk, 100, 8);
|
||||||
$time_2nd = substr($pps_wk, 108, 8);
|
$time_2nd = substr($pps_wk, 108, 8);
|
||||||
$start_block = unpack("V", substr($pps_wk, 116, 4));
|
$start_block = unpack("V", substr($pps_wk, 116, 4));
|
||||||
$size = unpack("V", substr($pps_wk, 120, 4));
|
$size = unpack("V", substr($pps_wk, 120, 4));
|
||||||
// _data member will point to position in file!!
|
// _data member will point to position in file!!
|
||||||
// OLE_PPS object is created with an empty children array!!
|
// OLE_PPS object is created with an empty children array!!
|
||||||
$this->_list[] = new OLE_PPS(null, '', $type[''], $prev[''], $next[''],
|
$this->_list[] = new OLE_PPS(null, '', $type[''], $prev[''], $next[''],
|
||||||
$dir[''], OLE::OLE2LocalDate($time_1st),
|
$dir[''], OLE::OLE2LocalDate($time_1st),
|
||||||
OLE::OLE2LocalDate($time_2nd),
|
OLE::OLE2LocalDate($time_2nd),
|
||||||
($start_block[''] + 1) * $big_block_size, array());
|
($start_block[''] + 1) * $big_block_size, array());
|
||||||
// give it a size
|
// give it a size
|
||||||
$this->_list[count($this->_list) - 1]->Size = $size[''];
|
$this->_list[count($this->_list) - 1]->Size = $size[''];
|
||||||
// check if the PPS tree (starting from root) is complete
|
// check if the PPS tree (starting from root) is complete
|
||||||
if ($this->_ppsTreeComplete(0)) {
|
if ($this->_ppsTreeComplete(0)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$pointer += OLE_PPS_SIZE;
|
$pointer += OLE_PPS_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It checks whether the PPS tree is complete (all PPS's read)
|
* It checks whether the PPS tree is complete (all PPS's read)
|
||||||
* starting with the given PPS (not necessarily root)
|
* starting with the given PPS (not necessarily root)
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @param integer $index The index of the PPS from which we are checking
|
* @param integer $index The index of the PPS from which we are checking
|
||||||
* @return boolean Whether the PPS tree for the given PPS is complete
|
* @return boolean Whether the PPS tree for the given PPS is complete
|
||||||
*/
|
*/
|
||||||
function _ppsTreeComplete($index)
|
function _ppsTreeComplete($index)
|
||||||
{
|
{
|
||||||
if ($this->_list[$index]->NextPps != -1) {
|
if ($this->_list[$index]->NextPps != -1) {
|
||||||
if (!isset($this->_list[$this->_list[$index]->NextPps])) {
|
if (!isset($this->_list[$this->_list[$index]->NextPps])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $this->_ppsTreeComplete($this->_list[$index]->NextPps);
|
return $this->_ppsTreeComplete($this->_list[$index]->NextPps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->_list[$index]->DirPps != -1) {
|
if ($this->_list[$index]->DirPps != -1) {
|
||||||
if (!isset($this->_list[$this->_list[$index]->DirPps])) {
|
if (!isset($this->_list[$this->_list[$index]->DirPps])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $this->_ppsTreeComplete($this->_list[$index]->DirPps);
|
return $this->_ppsTreeComplete($this->_list[$index]->DirPps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether a PPS is a File PPS or not.
|
* Checks whether a PPS is a File PPS or not.
|
||||||
* If there is no PPS for the index given, it will return false.
|
* If there is no PPS for the index given, it will return false.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $index The index for the PPS
|
* @param integer $index The index for the PPS
|
||||||
* @return bool true if it's a File PPS, false otherwise
|
* @return bool true if it's a File PPS, false otherwise
|
||||||
*/
|
*/
|
||||||
function isFile($index)
|
function isFile($index)
|
||||||
{
|
{
|
||||||
if (isset($this->_list[$index])) {
|
if (isset($this->_list[$index])) {
|
||||||
return ($this->_list[$index]->Type == OLE_PPS_TYPE_FILE);
|
return ($this->_list[$index]->Type == OLE_PPS_TYPE_FILE);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether a PPS is a Root PPS or not.
|
* Checks whether a PPS is a Root PPS or not.
|
||||||
* If there is no PPS for the index given, it will return false.
|
* If there is no PPS for the index given, it will return false.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $index The index for the PPS.
|
* @param integer $index The index for the PPS.
|
||||||
* @return bool true if it's a Root PPS, false otherwise
|
* @return bool true if it's a Root PPS, false otherwise
|
||||||
*/
|
*/
|
||||||
function isRoot($index)
|
function isRoot($index)
|
||||||
{
|
{
|
||||||
if (isset($this->_list[$index])) {
|
if (isset($this->_list[$index])) {
|
||||||
return ($this->_list[$index]->Type == OLE_PPS_TYPE_ROOT);
|
return ($this->_list[$index]->Type == OLE_PPS_TYPE_ROOT);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gives the total number of PPS's found in the OLE container.
|
* Gives the total number of PPS's found in the OLE container.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return integer The total number of PPS's found in the OLE container
|
* @return integer The total number of PPS's found in the OLE container
|
||||||
*/
|
*/
|
||||||
function ppsTotal()
|
function ppsTotal()
|
||||||
{
|
{
|
||||||
return count($this->_list);
|
return count($this->_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets data from a PPS
|
* Gets data from a PPS
|
||||||
* If there is no PPS for the index given, it will return an empty string.
|
* If there is no PPS for the index given, it will return an empty string.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $index The index for the PPS
|
* @param integer $index The index for the PPS
|
||||||
* @param integer $position The position from which to start reading
|
* @param integer $position The position from which to start reading
|
||||||
* (relative to the PPS)
|
* (relative to the PPS)
|
||||||
* @param integer $length The amount of bytes to read (at most)
|
* @param integer $length The amount of bytes to read (at most)
|
||||||
* @return string The binary string containing the data requested
|
* @return string The binary string containing the data requested
|
||||||
*/
|
*/
|
||||||
function getData($index, $position, $length)
|
function getData($index, $position, $length)
|
||||||
{
|
{
|
||||||
// if position is not valid return empty string
|
// if position is not valid return empty string
|
||||||
if (!isset($this->_list[$index]) or ($position >= $this->_list[$index]->Size) or ($position < 0)) {
|
if (!isset($this->_list[$index]) or ($position >= $this->_list[$index]->Size) or ($position < 0)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
// Beware!!! _data member is actually a position
|
// Beware!!! _data member is actually a position
|
||||||
fseek($this->_file_handle, $this->_list[$index]->_data + $position);
|
fseek($this->_file_handle, $this->_list[$index]->_data + $position);
|
||||||
return fread($this->_file_handle, $length);
|
return fread($this->_file_handle, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the data length from a PPS
|
* Gets the data length from a PPS
|
||||||
* If there is no PPS for the index given, it will return 0.
|
* If there is no PPS for the index given, it will return 0.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $index The index for the PPS
|
* @param integer $index The index for the PPS
|
||||||
* @return integer The amount of bytes in data the PPS has
|
* @return integer The amount of bytes in data the PPS has
|
||||||
*/
|
*/
|
||||||
function getDataLength($index)
|
function getDataLength($index)
|
||||||
{
|
{
|
||||||
if (isset($this->_list[$index])) {
|
if (isset($this->_list[$index])) {
|
||||||
return $this->_list[$index]->Size;
|
return $this->_list[$index]->Size;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility function to transform ASCII text to Unicode
|
* Utility function to transform ASCII text to Unicode
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
* @param string $ascii The ASCII string to transform
|
* @param string $ascii The ASCII string to transform
|
||||||
* @return string The string in Unicode
|
* @return string The string in Unicode
|
||||||
*/
|
*/
|
||||||
static function Asc2Ucs($ascii)
|
static function Asc2Ucs($ascii)
|
||||||
{
|
{
|
||||||
$rawname = '';
|
$rawname = '';
|
||||||
for ($i = 0; $i < strlen($ascii); $i++) {
|
for ($i = 0; $i < strlen($ascii); $i++) {
|
||||||
$rawname .= $ascii{$i}."\x00";
|
$rawname .= $ascii{$i}."\x00";
|
||||||
}
|
}
|
||||||
return $rawname;
|
return $rawname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility function
|
* Utility function
|
||||||
* Returns a string for the OLE container with the date given
|
* Returns a string for the OLE container with the date given
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
* @param integer $date A timestamp
|
* @param integer $date A timestamp
|
||||||
* @return string The string for the OLE container
|
* @return string The string for the OLE container
|
||||||
*/
|
*/
|
||||||
static function LocalDate2OLE($date = null)
|
static function LocalDate2OLE($date = null)
|
||||||
{
|
{
|
||||||
if (!isset($date)) {
|
if (!isset($date)) {
|
||||||
return "\x00\x00\x00\x00\x00\x00\x00\x00";
|
return "\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||||
}
|
}
|
||||||
|
|
||||||
// factor used for separating numbers into 4 bytes parts
|
// factor used for separating numbers into 4 bytes parts
|
||||||
$factor = pow(2,32);
|
$factor = pow(2,32);
|
||||||
|
|
||||||
// days from 1-1-1601 until the beggining of UNIX era
|
// days from 1-1-1601 until the beggining of UNIX era
|
||||||
$days = 134774;
|
$days = 134774;
|
||||||
// calculate seconds
|
// calculate seconds
|
||||||
$big_date = $days*24*3600 + gmmktime(date("H",$date),date("i",$date),date("s",$date),
|
$big_date = $days*24*3600 + gmmktime(date("H",$date),date("i",$date),date("s",$date),
|
||||||
date("m",$date),date("d",$date),date("Y",$date));
|
date("m",$date),date("d",$date),date("Y",$date));
|
||||||
// multiply just to make MS happy
|
// multiply just to make MS happy
|
||||||
$big_date *= 10000000;
|
$big_date *= 10000000;
|
||||||
|
|
||||||
$high_part = floor($big_date/$factor);
|
$high_part = floor($big_date/$factor);
|
||||||
// lower 4 bytes
|
// lower 4 bytes
|
||||||
$low_part = floor((($big_date/$factor) - $high_part)*$factor);
|
$low_part = floor((($big_date/$factor) - $high_part)*$factor);
|
||||||
|
|
||||||
// Make HEX string
|
// Make HEX string
|
||||||
$res = '';
|
$res = '';
|
||||||
|
|
||||||
for ($i=0; $i<4; $i++)
|
for ($i=0; $i<4; $i++)
|
||||||
{
|
{
|
||||||
$hex = $low_part % 0x100;
|
$hex = $low_part % 0x100;
|
||||||
$res .= pack('c', $hex);
|
$res .= pack('c', $hex);
|
||||||
$low_part /= 0x100;
|
$low_part /= 0x100;
|
||||||
}
|
}
|
||||||
for ($i=0; $i<4; $i++)
|
for ($i=0; $i<4; $i++)
|
||||||
{
|
{
|
||||||
$hex = $high_part % 0x100;
|
$hex = $high_part % 0x100;
|
||||||
$res .= pack('c', $hex);
|
$res .= pack('c', $hex);
|
||||||
$high_part /= 0x100;
|
$high_part /= 0x100;
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a timestamp from an OLE container's date
|
* Returns a timestamp from an OLE container's date
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
* @param integer $string A binary string with the encoded date
|
* @param integer $string A binary string with the encoded date
|
||||||
* @return string The timestamp corresponding to the string
|
* @return string The timestamp corresponding to the string
|
||||||
*/
|
*/
|
||||||
static function OLE2LocalDate($string)
|
static function OLE2LocalDate($string)
|
||||||
{
|
{
|
||||||
if (strlen($string) != 8) {
|
if (strlen($string) != 8) {
|
||||||
return new PEAR_Error("Expecting 8 byte string");
|
return new PEAR_Error("Expecting 8 byte string");
|
||||||
}
|
}
|
||||||
|
|
||||||
// factor used for separating numbers into 4 bytes parts
|
// factor used for separating numbers into 4 bytes parts
|
||||||
$factor = pow(2,32);
|
$factor = pow(2,32);
|
||||||
$high_part = 0;
|
$high_part = 0;
|
||||||
for ($i=0; $i<4; $i++)
|
for ($i=0; $i<4; $i++)
|
||||||
{
|
{
|
||||||
$al = unpack('C', $string{(7 - $i)});
|
$al = unpack('C', $string{(7 - $i)});
|
||||||
$high_part += $al[''];
|
$high_part += $al[''];
|
||||||
if ($i < 3) {
|
if ($i < 3) {
|
||||||
$high_part *= 0x100;
|
$high_part *= 0x100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$low_part = 0;
|
$low_part = 0;
|
||||||
for ($i=4; $i<8; $i++)
|
for ($i=4; $i<8; $i++)
|
||||||
{
|
{
|
||||||
$al = unpack('C', $string{(7 - $i)});
|
$al = unpack('C', $string{(7 - $i)});
|
||||||
$low_part += $al[''];
|
$low_part += $al[''];
|
||||||
if ($i < 7) {
|
if ($i < 7) {
|
||||||
$low_part *= 0x100;
|
$low_part *= 0x100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$big_date = ($high_part*$factor) + $low_part;
|
$big_date = ($high_part*$factor) + $low_part;
|
||||||
// translate to seconds
|
// translate to seconds
|
||||||
$big_date /= 10000000;
|
$big_date /= 10000000;
|
||||||
|
|
||||||
// days from 1-1-1601 until the beggining of UNIX era
|
// days from 1-1-1601 until the beggining of UNIX era
|
||||||
$days = 134774;
|
$days = 134774;
|
||||||
|
|
||||||
// translate to seconds from beggining of UNIX era
|
// translate to seconds from beggining of UNIX era
|
||||||
$big_date -= $days*24*3600;
|
$big_date -= $days*24*3600;
|
||||||
return floor($big_date);
|
return floor($big_date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,220 +1,220 @@
|
|||||||
<?php
|
<?php
|
||||||
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | PHP Version 4 |
|
// | PHP Version 4 |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | Copyright (c) 1997-2002 The PHP Group |
|
// | Copyright (c) 1997-2002 The PHP Group |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | This source file is subject to version 2.02 of the PHP license, |
|
// | This source file is subject to version 2.02 of the PHP license, |
|
||||||
// | that is bundled with this package in the file LICENSE, and is |
|
// | that is bundled with this package in the file LICENSE, and is |
|
||||||
// | available at through the world-wide-web at |
|
// | available at through the world-wide-web at |
|
||||||
// | http://www.php.net/license/2_02.txt. |
|
// | http://www.php.net/license/2_02.txt. |
|
||||||
// | If you did not receive a copy of the PHP license and are unable to |
|
// | If you did not receive a copy of the PHP license and are unable to |
|
||||||
// | obtain it through the world-wide-web, please send a note to |
|
// | obtain it through the world-wide-web, please send a note to |
|
||||||
// | license@php.net so we can mail you a copy immediately. |
|
// | license@php.net so we can mail you a copy immediately. |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | Author: Xavier Noguer <xnoguer@php.net> |
|
// | Author: Xavier Noguer <xnoguer@php.net> |
|
||||||
// | Based on OLE::Storage_Lite by Kawai, Takanori |
|
// | Based on OLE::Storage_Lite by Kawai, Takanori |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
//
|
//
|
||||||
// $Id: PPS.php,v 1.5 2003/12/14 18:12:28 xnoguer Exp $
|
// $Id: PPS.php,v 1.5 2003/12/14 18:12:28 xnoguer Exp $
|
||||||
|
|
||||||
if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}
|
if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}
|
||||||
if (!isset($homedir)) die();
|
if (!isset($homedir)) die();
|
||||||
require_once($homedir.'/classes/pear/PEAR.php');
|
require_once($homedir.'/classes/pear/PEAR.php');
|
||||||
require_once($homedir.'/classes/pear/OLE/OLE.php');
|
require_once($homedir.'/classes/pear/OLE/OLE.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for creating PPS's for OLE containers
|
* Class for creating PPS's for OLE containers
|
||||||
*
|
*
|
||||||
* @author Xavier Noguer <xnoguer@php.net>
|
* @author Xavier Noguer <xnoguer@php.net>
|
||||||
* @category Structures
|
* @category Structures
|
||||||
* @package OLE
|
* @package OLE
|
||||||
*/
|
*/
|
||||||
class OLE_PPS extends PEAR
|
class OLE_PPS extends PEAR
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The PPS index
|
* The PPS index
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $No;
|
var $No;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PPS name (in Unicode)
|
* The PPS name (in Unicode)
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $Name;
|
var $Name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PPS type. Dir, Root or File
|
* The PPS type. Dir, Root or File
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $Type;
|
var $Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The index of the previous PPS
|
* The index of the previous PPS
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $PrevPps;
|
var $PrevPps;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The index of the next PPS
|
* The index of the next PPS
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $NextPps;
|
var $NextPps;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The index of it's first child if this is a Dir or Root PPS
|
* The index of it's first child if this is a Dir or Root PPS
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $DirPps;
|
var $DirPps;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A timestamp
|
* A timestamp
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $Time1st;
|
var $Time1st;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A timestamp
|
* A timestamp
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $Time2nd;
|
var $Time2nd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starting block (small or big) for this PPS's data inside the container
|
* Starting block (small or big) for this PPS's data inside the container
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_StartBlock;
|
var $_StartBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The size of the PPS's data (in bytes)
|
* The size of the PPS's data (in bytes)
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $Size;
|
var $Size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PPS's data (only used if it's not using a temporary file)
|
* The PPS's data (only used if it's not using a temporary file)
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_data;
|
var $_data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of child PPS's (only used by Root and Dir PPS's)
|
* Array of child PPS's (only used by Root and Dir PPS's)
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $children = array();
|
var $children = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constructor
|
* The constructor
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $No The PPS index
|
* @param integer $No The PPS index
|
||||||
* @param string $name The PPS name (in Unicode)
|
* @param string $name The PPS name (in Unicode)
|
||||||
* @param integer $type The PPS type. Dir, Root or File
|
* @param integer $type The PPS type. Dir, Root or File
|
||||||
* @param integer $prev The index of the previous PPS
|
* @param integer $prev The index of the previous PPS
|
||||||
* @param integer $next The index of the next PPS
|
* @param integer $next The index of the next PPS
|
||||||
* @param integer $dir The index of it's first child if this is a Dir or Root PPS
|
* @param integer $dir The index of it's first child if this is a Dir or Root PPS
|
||||||
* @param integer $time_1st A timestamp
|
* @param integer $time_1st A timestamp
|
||||||
* @param integer $time_2nd A timestamp
|
* @param integer $time_2nd A timestamp
|
||||||
* @param array $children Array containing children PPS for this PPS
|
* @param array $children Array containing children PPS for this PPS
|
||||||
*/
|
*/
|
||||||
function OLE_PPS($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
|
function OLE_PPS($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
|
||||||
{
|
{
|
||||||
$this->No = $No;
|
$this->No = $No;
|
||||||
$this->Name = $name;
|
$this->Name = $name;
|
||||||
$this->Type = $type;
|
$this->Type = $type;
|
||||||
$this->PrevPps = $prev;
|
$this->PrevPps = $prev;
|
||||||
$this->NextPps = $next;
|
$this->NextPps = $next;
|
||||||
$this->DirPps = $dir;
|
$this->DirPps = $dir;
|
||||||
$this->Time1st = $time_1st;
|
$this->Time1st = $time_1st;
|
||||||
$this->Time2nd = $time_2nd;
|
$this->Time2nd = $time_2nd;
|
||||||
$this->_data = $data;
|
$this->_data = $data;
|
||||||
$this->children = $children;
|
$this->children = $children;
|
||||||
if ($data != '') {
|
if ($data != '') {
|
||||||
$this->Size = strlen($data);
|
$this->Size = strlen($data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->Size = 0;
|
$this->Size = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the amount of data saved for this PPS
|
* Returns the amount of data saved for this PPS
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @return integer The amount of data (in bytes)
|
* @return integer The amount of data (in bytes)
|
||||||
*/
|
*/
|
||||||
function _DataLen()
|
function _DataLen()
|
||||||
{
|
{
|
||||||
if (!isset($this->_data)) {
|
if (!isset($this->_data)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (isset($this->_PPS_FILE))
|
if (isset($this->_PPS_FILE))
|
||||||
{
|
{
|
||||||
fseek($this->_PPS_FILE, 0);
|
fseek($this->_PPS_FILE, 0);
|
||||||
$stats = fstat($this->_PPS_FILE);
|
$stats = fstat($this->_PPS_FILE);
|
||||||
return $stats[7];
|
return $stats[7];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return strlen($this->_data);
|
return strlen($this->_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string with the PPS's WK (What is a WK?)
|
* Returns a string with the PPS's WK (What is a WK?)
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @return string The binary string
|
* @return string The binary string
|
||||||
*/
|
*/
|
||||||
function _getPpsWk()
|
function _getPpsWk()
|
||||||
{
|
{
|
||||||
$ret = $this->Name;
|
$ret = $this->Name;
|
||||||
for ($i = 0; $i < (64 - strlen($this->Name)); $i++) {
|
for ($i = 0; $i < (64 - strlen($this->Name)); $i++) {
|
||||||
$ret .= "\x00";
|
$ret .= "\x00";
|
||||||
}
|
}
|
||||||
$ret .= pack("v", strlen($this->Name) + 2) // 66
|
$ret .= pack("v", strlen($this->Name) + 2) // 66
|
||||||
. pack("c", $this->Type) // 67
|
. pack("c", $this->Type) // 67
|
||||||
. pack("c", 0x00) //UK // 68
|
. pack("c", 0x00) //UK // 68
|
||||||
. pack("V", $this->PrevPps) //Prev // 72
|
. pack("V", $this->PrevPps) //Prev // 72
|
||||||
. pack("V", $this->NextPps) //Next // 76
|
. pack("V", $this->NextPps) //Next // 76
|
||||||
. pack("V", $this->DirPps) //Dir // 80
|
. pack("V", $this->DirPps) //Dir // 80
|
||||||
. "\x00\x09\x02\x00" // 84
|
. "\x00\x09\x02\x00" // 84
|
||||||
. "\x00\x00\x00\x00" // 88
|
. "\x00\x00\x00\x00" // 88
|
||||||
. "\xc0\x00\x00\x00" // 92
|
. "\xc0\x00\x00\x00" // 92
|
||||||
. "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root
|
. "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root
|
||||||
. "\x00\x00\x00\x00" // 100
|
. "\x00\x00\x00\x00" // 100
|
||||||
. OLE::LocalDate2OLE($this->Time1st) // 108
|
. OLE::LocalDate2OLE($this->Time1st) // 108
|
||||||
. OLE::LocalDate2OLE($this->Time2nd) // 116
|
. OLE::LocalDate2OLE($this->Time2nd) // 116
|
||||||
. pack("V", isset($this->_StartBlock)?
|
. pack("V", isset($this->_StartBlock)?
|
||||||
$this->_StartBlock:0) // 120
|
$this->_StartBlock:0) // 120
|
||||||
. pack("V", $this->Size) // 124
|
. pack("V", $this->Size) // 124
|
||||||
. pack("V", 0); // 128
|
. pack("V", 0); // 128
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates index and pointers to previous, next and children PPS's for this
|
* Updates index and pointers to previous, next and children PPS's for this
|
||||||
* PPS. I don't think it'll work with Dir PPS's.
|
* PPS. I don't think it'll work with Dir PPS's.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @param array &$pps_array Reference to the array of PPS's for the whole OLE
|
* @param array &$pps_array Reference to the array of PPS's for the whole OLE
|
||||||
* container
|
* container
|
||||||
* @return integer The index for this PPS
|
* @return integer The index for this PPS
|
||||||
*/
|
*/
|
||||||
function _savePpsSetPnt(&$pps_array)
|
function _savePpsSetPnt(&$pps_array)
|
||||||
{
|
{
|
||||||
$pps_array[count($pps_array)] = &$this;
|
$pps_array[count($pps_array)] = &$this;
|
||||||
$this->No = count($pps_array) - 1;
|
$this->No = count($pps_array) - 1;
|
||||||
$this->PrevPps = 0xFFFFFFFF;
|
$this->PrevPps = 0xFFFFFFFF;
|
||||||
$this->NextPps = 0xFFFFFFFF;
|
$this->NextPps = 0xFFFFFFFF;
|
||||||
if (count($this->children) > 0) {
|
if (count($this->children) > 0) {
|
||||||
$this->DirPps = $this->children[0]->_savePpsSetPnt($pps_array);
|
$this->DirPps = $this->children[0]->_savePpsSetPnt($pps_array);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->DirPps = 0xFFFFFFFF;
|
$this->DirPps = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
return $this->No;
|
return $this->No;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,115 +1,115 @@
|
|||||||
<?php
|
<?php
|
||||||
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | PHP Version 4 |
|
// | PHP Version 4 |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | Copyright (c) 1997-2002 The PHP Group |
|
// | Copyright (c) 1997-2002 The PHP Group |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | This source file is subject to version 2.02 of the PHP license, |
|
// | This source file is subject to version 2.02 of the PHP license, |
|
||||||
// | that is bundled with this package in the file LICENSE, and is |
|
// | that is bundled with this package in the file LICENSE, and is |
|
||||||
// | available at through the world-wide-web at |
|
// | available at through the world-wide-web at |
|
||||||
// | http://www.php.net/license/2_02.txt. |
|
// | http://www.php.net/license/2_02.txt. |
|
||||||
// | If you did not receive a copy of the PHP license and are unable to |
|
// | If you did not receive a copy of the PHP license and are unable to |
|
||||||
// | obtain it through the world-wide-web, please send a note to |
|
// | obtain it through the world-wide-web, please send a note to |
|
||||||
// | license@php.net so we can mail you a copy immediately. |
|
// | license@php.net so we can mail you a copy immediately. |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
// | Author: Xavier Noguer <xnoguer@php.net> |
|
// | Author: Xavier Noguer <xnoguer@php.net> |
|
||||||
// | Based on OLE::Storage_Lite by Kawai, Takanori |
|
// | Based on OLE::Storage_Lite by Kawai, Takanori |
|
||||||
// +----------------------------------------------------------------------+
|
// +----------------------------------------------------------------------+
|
||||||
//
|
//
|
||||||
// $Id: File.php,v 1.8 2003/12/12 21:10:10 xnoguer Exp $
|
// $Id: File.php,v 1.8 2003/12/12 21:10:10 xnoguer Exp $
|
||||||
|
|
||||||
if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}
|
if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}
|
||||||
if (!isset($homedir)) die();
|
if (!isset($homedir)) die();
|
||||||
require_once ($homedir.'/classes/pear/OLE/PPS.php');
|
require_once ($homedir.'/classes/pear/OLE/PPS.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for creating File PPS's for OLE containers
|
* Class for creating File PPS's for OLE containers
|
||||||
*
|
*
|
||||||
* @author Xavier Noguer <xnoguer@php.net>
|
* @author Xavier Noguer <xnoguer@php.net>
|
||||||
* @category Structures
|
* @category Structures
|
||||||
* @package OLE
|
* @package OLE
|
||||||
*/
|
*/
|
||||||
class OLE_PPS_File extends OLE_PPS
|
class OLE_PPS_File extends OLE_PPS
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The temporary dir for storing the OLE file
|
* The temporary dir for storing the OLE file
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_tmp_dir;
|
var $_tmp_dir;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constructor
|
* The constructor
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $name The name of the file (in Unicode)
|
* @param string $name The name of the file (in Unicode)
|
||||||
* @see OLE::Asc2Ucs()
|
* @see OLE::Asc2Ucs()
|
||||||
*/
|
*/
|
||||||
function OLE_PPS_File($name)
|
function OLE_PPS_File($name)
|
||||||
{
|
{
|
||||||
$this->_tmp_dir = '';
|
$this->_tmp_dir = '';
|
||||||
$this->OLE_PPS(
|
$this->OLE_PPS(
|
||||||
null,
|
null,
|
||||||
$name,
|
$name,
|
||||||
OLE_PPS_TYPE_FILE,
|
OLE_PPS_TYPE_FILE,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
'',
|
'',
|
||||||
array());
|
array());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the temp dir used for storing the OLE file
|
* Sets the temp dir used for storing the OLE file
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $dir The dir to be used as temp dir
|
* @param string $dir The dir to be used as temp dir
|
||||||
* @return true if given dir is valid, false otherwise
|
* @return true if given dir is valid, false otherwise
|
||||||
*/
|
*/
|
||||||
function setTempDir($dir)
|
function setTempDir($dir)
|
||||||
{
|
{
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
$this->_tmp_dir = $dir;
|
$this->_tmp_dir = $dir;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization method. Has to be called right after OLE_PPS_File().
|
* Initialization method. Has to be called right after OLE_PPS_File().
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return mixed true on success. PEAR_Error on failure
|
* @return mixed true on success. PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_File");
|
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_File");
|
||||||
$fh = @fopen($this->_tmp_filename, "w+b");
|
$fh = @fopen($this->_tmp_filename, "w+b");
|
||||||
if ($fh == false) {
|
if ($fh == false) {
|
||||||
return $this->raiseError("Can't create temporary file");
|
return $this->raiseError("Can't create temporary file");
|
||||||
}
|
}
|
||||||
$this->_PPS_FILE = $fh;
|
$this->_PPS_FILE = $fh;
|
||||||
if ($this->_PPS_FILE) {
|
if ($this->_PPS_FILE) {
|
||||||
fseek($this->_PPS_FILE, 0);
|
fseek($this->_PPS_FILE, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append data to PPS
|
* Append data to PPS
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $data The data to append
|
* @param string $data The data to append
|
||||||
*/
|
*/
|
||||||
function append($data)
|
function append($data)
|
||||||
{
|
{
|
||||||
if ($this->_PPS_FILE) {
|
if ($this->_PPS_FILE) {
|
||||||
fwrite($this->_PPS_FILE, $data);
|
fwrite($this->_PPS_FILE, $data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->_data .= $data;
|
$this->_data .= $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,191 +1,191 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file CAS/PGTStorage/pgt-db.php
|
* @file CAS/PGTStorage/pgt-db.php
|
||||||
* Basic class for PGT database storage
|
* Basic class for PGT database storage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class PGTStorageDB
|
* @class PGTStorageDB
|
||||||
* The PGTStorageDB class is a class for PGT database storage. An instance of
|
* The PGTStorageDB class is a class for PGT database storage. An instance of
|
||||||
* this class is returned by CASClient::SetPGTStorageDB().
|
* this class is returned by CASClient::SetPGTStorageDB().
|
||||||
*
|
*
|
||||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
||||||
*
|
*
|
||||||
* @ingroup internalPGTStorageDB
|
* @ingroup internalPGTStorageDB
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class PGTStorageDB extends PGTStorage
|
class PGTStorageDB extends PGTStorage
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @addtogroup internalPGTStorageDB
|
* @addtogroup internalPGTStorageDB
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a string representing a PEAR DB URL to connect to the database. Written by
|
* a string representing a PEAR DB URL to connect to the database. Written by
|
||||||
* PGTStorageDB::PGTStorageDB(), read by getURL().
|
* PGTStorageDB::PGTStorageDB(), read by getURL().
|
||||||
*
|
*
|
||||||
* @hideinitializer
|
* @hideinitializer
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var $_url='';
|
var $_url='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the PEAR DB URL to use to connect to the database.
|
* This method returns the PEAR DB URL to use to connect to the database.
|
||||||
*
|
*
|
||||||
* @return a PEAR DB URL
|
* @return a PEAR DB URL
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function getURL()
|
function getURL()
|
||||||
{
|
{
|
||||||
return $this->_url;
|
return $this->_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The handle of the connection to the database where PGT's are stored. Written by
|
* The handle of the connection to the database where PGT's are stored. Written by
|
||||||
* PGTStorageDB::init(), read by getLink().
|
* PGTStorageDB::init(), read by getLink().
|
||||||
*
|
*
|
||||||
* @hideinitializer
|
* @hideinitializer
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var $_link = null;
|
var $_link = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the handle of the connection to the database where PGT's are
|
* This method returns the handle of the connection to the database where PGT's are
|
||||||
* stored.
|
* stored.
|
||||||
*
|
*
|
||||||
* @return a handle of connection.
|
* @return a handle of connection.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function getLink()
|
function getLink()
|
||||||
{
|
{
|
||||||
return $this->_link;
|
return $this->_link;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the table where PGT's are stored. Written by
|
* The name of the table where PGT's are stored. Written by
|
||||||
* PGTStorageDB::PGTStorageDB(), read by getTable().
|
* PGTStorageDB::PGTStorageDB(), read by getTable().
|
||||||
*
|
*
|
||||||
* @hideinitializer
|
* @hideinitializer
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var $_table = '';
|
var $_table = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the name of the table where PGT's are stored.
|
* This method returns the name of the table where PGT's are stored.
|
||||||
*
|
*
|
||||||
* @return the name of a table.
|
* @return the name of a table.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function getTable()
|
function getTable()
|
||||||
{
|
{
|
||||||
return $this->_table;
|
return $this->_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// DEBUGGING
|
// DEBUGGING
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an informational string giving the type of storage
|
* This method returns an informational string giving the type of storage
|
||||||
* used by the object (used for debugging purposes).
|
* used by the object (used for debugging purposes).
|
||||||
*
|
*
|
||||||
* @return an informational string.
|
* @return an informational string.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function getStorageType()
|
function getStorageType()
|
||||||
{
|
{
|
||||||
return "database";
|
return "database";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an informational string giving informations on the
|
* This method returns an informational string giving informations on the
|
||||||
* parameters of the storage.(used for debugging purposes).
|
* parameters of the storage.(used for debugging purposes).
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function getStorageInfo()
|
function getStorageInfo()
|
||||||
{
|
{
|
||||||
return 'url=`'.$this->getURL().'\', table=`'.$this->getTable().'\'';
|
return 'url=`'.$this->getURL().'\', table=`'.$this->getTable().'\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// CONSTRUCTOR
|
// CONSTRUCTOR
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class constructor, called by CASClient::SetPGTStorageDB().
|
* The class constructor, called by CASClient::SetPGTStorageDB().
|
||||||
*
|
*
|
||||||
* @param $cas_parent the CASClient instance that creates the object.
|
* @param $cas_parent the CASClient instance that creates the object.
|
||||||
* @param $user the user to access the data with
|
* @param $user the user to access the data with
|
||||||
* @param $password the user's password
|
* @param $password the user's password
|
||||||
* @param $database_type the type of the database hosting the data
|
* @param $database_type the type of the database hosting the data
|
||||||
* @param $hostname the server hosting the database
|
* @param $hostname the server hosting the database
|
||||||
* @param $port the port the server is listening on
|
* @param $port the port the server is listening on
|
||||||
* @param $database the name of the database
|
* @param $database the name of the database
|
||||||
* @param $table the name of the table storing the data
|
* @param $table the name of the table storing the data
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function PGTStorageDB($cas_parent,$user,$password,$database_type,$hostname,$port,$database,$table)
|
function PGTStorageDB($cas_parent,$user,$password,$database_type,$hostname,$port,$database,$table)
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
|
|
||||||
// call the ancestor's constructor
|
// call the ancestor's constructor
|
||||||
$this->PGTStorage($cas_parent);
|
$this->PGTStorage($cas_parent);
|
||||||
|
|
||||||
if ( empty($database_type) ) $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE;
|
if ( empty($database_type) ) $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE;
|
||||||
if ( empty($hostname) ) $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME;
|
if ( empty($hostname) ) $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME;
|
||||||
if ( $port==0 ) $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT;
|
if ( $port==0 ) $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT;
|
||||||
if ( empty($database) ) $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE;
|
if ( empty($database) ) $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE;
|
||||||
if ( empty($table) ) $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE;
|
if ( empty($table) ) $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE;
|
||||||
|
|
||||||
// build and store the PEAR DB URL
|
// build and store the PEAR DB URL
|
||||||
$this->_url = $database_type.':'.'//'.$user.':'.$password.'@'.$hostname.':'.$port.'/'.$database;
|
$this->_url = $database_type.':'.'//'.$user.':'.$password.'@'.$hostname.':'.$port.'/'.$database;
|
||||||
|
|
||||||
// XXX should use setURL and setTable
|
// XXX should use setURL and setTable
|
||||||
phpCAS::traceEnd();
|
phpCAS::traceEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// INITIALIZATION
|
// INITIALIZATION
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to initialize the storage. Halts on error.
|
* This method is used to initialize the storage. Halts on error.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
// if the storage has already been initialized, return immediatly
|
// if the storage has already been initialized, return immediatly
|
||||||
if ( $this->isInitialized() )
|
if ( $this->isInitialized() )
|
||||||
return;
|
return;
|
||||||
// call the ancestor's method (mark as initialized)
|
// call the ancestor's method (mark as initialized)
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
//include phpDB library (the test was introduced in release 0.4.8 for
|
//include phpDB library (the test was introduced in release 0.4.8 for
|
||||||
//the integration into Tikiwiki).
|
//the integration into Tikiwiki).
|
||||||
if (!class_exists('DB')) {
|
if (!class_exists('DB')) {
|
||||||
include_once('DB.php');
|
include_once('DB.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to connect to the database
|
// try to connect to the database
|
||||||
$this->_link = DB::connect($this->getURL());
|
$this->_link = DB::connect($this->getURL());
|
||||||
if ( DB::isError($this->_link) ) {
|
if ( DB::isError($this->_link) ) {
|
||||||
phpCAS::error('could not connect to database ('.DB::errorMessage($this->_link).')');
|
phpCAS::error('could not connect to database ('.DB::errorMessage($this->_link).')');
|
||||||
}
|
}
|
||||||
var_dump($this->_link);
|
var_dump($this->_link);
|
||||||
phpCAS::traceBEnd();
|
phpCAS::traceBEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,250 +1,250 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file CAS/PGTStorage/pgt-file.php
|
* @file CAS/PGTStorage/pgt-file.php
|
||||||
* Basic class for PGT file storage
|
* Basic class for PGT file storage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class PGTStorageFile
|
* @class PGTStorageFile
|
||||||
* The PGTStorageFile class is a class for PGT file storage. An instance of
|
* The PGTStorageFile class is a class for PGT file storage. An instance of
|
||||||
* this class is returned by CASClient::SetPGTStorageFile().
|
* this class is returned by CASClient::SetPGTStorageFile().
|
||||||
*
|
*
|
||||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
||||||
*
|
*
|
||||||
* @ingroup internalPGTStorageFile
|
* @ingroup internalPGTStorageFile
|
||||||
*/
|
*/
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
class PGTStorageFile extends PGTStorage
|
class PGTStorageFile extends PGTStorage
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @addtogroup internalPGTStorageFile
|
* @addtogroup internalPGTStorageFile
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a string telling where PGT's should be stored on the filesystem. Written by
|
* a string telling where PGT's should be stored on the filesystem. Written by
|
||||||
* PGTStorageFile::PGTStorageFile(), read by getPath().
|
* PGTStorageFile::PGTStorageFile(), read by getPath().
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var $_path;
|
var $_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the name of the directory where PGT's should be stored
|
* This method returns the name of the directory where PGT's should be stored
|
||||||
* on the filesystem.
|
* on the filesystem.
|
||||||
*
|
*
|
||||||
* @return the name of a directory (with leading and trailing '/')
|
* @return the name of a directory (with leading and trailing '/')
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function getPath()
|
function getPath()
|
||||||
{
|
{
|
||||||
return $this->_path;
|
return $this->_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a string telling the format to use to store PGT's (plain or xml). Written by
|
* a string telling the format to use to store PGT's (plain or xml). Written by
|
||||||
* PGTStorageFile::PGTStorageFile(), read by getFormat().
|
* PGTStorageFile::PGTStorageFile(), read by getFormat().
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var $_format;
|
var $_format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the format to use when storing PGT's on the filesystem.
|
* This method returns the format to use when storing PGT's on the filesystem.
|
||||||
*
|
*
|
||||||
* @return a string corresponding to the format used (plain or xml).
|
* @return a string corresponding to the format used (plain or xml).
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function getFormat()
|
function getFormat()
|
||||||
{
|
{
|
||||||
return $this->_format;
|
return $this->_format;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// DEBUGGING
|
// DEBUGGING
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an informational string giving the type of storage
|
* This method returns an informational string giving the type of storage
|
||||||
* used by the object (used for debugging purposes).
|
* used by the object (used for debugging purposes).
|
||||||
*
|
*
|
||||||
* @return an informational string.
|
* @return an informational string.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function getStorageType()
|
function getStorageType()
|
||||||
{
|
{
|
||||||
return "file";
|
return "file";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an informational string giving informations on the
|
* This method returns an informational string giving informations on the
|
||||||
* parameters of the storage.(used for debugging purposes).
|
* parameters of the storage.(used for debugging purposes).
|
||||||
*
|
*
|
||||||
* @return an informational string.
|
* @return an informational string.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function getStorageInfo()
|
function getStorageInfo()
|
||||||
{
|
{
|
||||||
return 'path=`'.$this->getPath().'\', format=`'.$this->getFormat().'\'';
|
return 'path=`'.$this->getPath().'\', format=`'.$this->getFormat().'\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// CONSTRUCTOR
|
// CONSTRUCTOR
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class constructor, called by CASClient::SetPGTStorageFile().
|
* The class constructor, called by CASClient::SetPGTStorageFile().
|
||||||
*
|
*
|
||||||
* @param $cas_parent the CASClient instance that creates the object.
|
* @param $cas_parent the CASClient instance that creates the object.
|
||||||
* @param $format the format used to store the PGT's (`plain' and `xml' allowed).
|
* @param $format the format used to store the PGT's (`plain' and `xml' allowed).
|
||||||
* @param $path the path where the PGT's should be stored
|
* @param $path the path where the PGT's should be stored
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function PGTStorageFile($cas_parent,$format,$path)
|
function PGTStorageFile($cas_parent,$format,$path)
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
// call the ancestor's constructor
|
// call the ancestor's constructor
|
||||||
$this->PGTStorage($cas_parent);
|
$this->PGTStorage($cas_parent);
|
||||||
|
|
||||||
if (empty($format) ) $format = CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT;
|
if (empty($format) ) $format = CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT;
|
||||||
if (empty($path) ) $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH;
|
if (empty($path) ) $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH;
|
||||||
|
|
||||||
// check that the path is an absolute path
|
// check that the path is an absolute path
|
||||||
if (getenv("OS")=="Windows_NT"){
|
if (getenv("OS")=="Windows_NT"){
|
||||||
|
|
||||||
if (!preg_match('`^[a-zA-Z]:`', $path)) {
|
if (!preg_match('`^[a-zA-Z]:`', $path)) {
|
||||||
phpCAS::error('an absolute path is needed for PGT storage to file');
|
phpCAS::error('an absolute path is needed for PGT storage to file');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( $path[0] != '/' ) {
|
if ( $path[0] != '/' ) {
|
||||||
phpCAS::error('an absolute path is needed for PGT storage to file');
|
phpCAS::error('an absolute path is needed for PGT storage to file');
|
||||||
}
|
}
|
||||||
|
|
||||||
// store the path (with a leading and trailing '/')
|
// store the path (with a leading and trailing '/')
|
||||||
$path = preg_replace('|[/]*$|','/',$path);
|
$path = preg_replace('|[/]*$|','/',$path);
|
||||||
$path = preg_replace('|^[/]*|','/',$path);
|
$path = preg_replace('|^[/]*|','/',$path);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_path = $path;
|
$this->_path = $path;
|
||||||
// check the format and store it
|
// check the format and store it
|
||||||
switch ($format) {
|
switch ($format) {
|
||||||
case CAS_PGT_STORAGE_FILE_FORMAT_PLAIN:
|
case CAS_PGT_STORAGE_FILE_FORMAT_PLAIN:
|
||||||
case CAS_PGT_STORAGE_FILE_FORMAT_XML:
|
case CAS_PGT_STORAGE_FILE_FORMAT_XML:
|
||||||
$this->_format = $format;
|
$this->_format = $format;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
phpCAS::error('unknown PGT file storage format (`'.CAS_PGT_STORAGE_FILE_FORMAT_PLAIN.'\' and `'.CAS_PGT_STORAGE_FILE_FORMAT_XML.'\' allowed)');
|
phpCAS::error('unknown PGT file storage format (`'.CAS_PGT_STORAGE_FILE_FORMAT_PLAIN.'\' and `'.CAS_PGT_STORAGE_FILE_FORMAT_XML.'\' allowed)');
|
||||||
}
|
}
|
||||||
phpCAS::traceEnd();
|
phpCAS::traceEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// INITIALIZATION
|
// INITIALIZATION
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to initialize the storage. Halts on error.
|
* This method is used to initialize the storage. Halts on error.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
// if the storage has already been initialized, return immediatly
|
// if the storage has already been initialized, return immediatly
|
||||||
if ( $this->isInitialized() )
|
if ( $this->isInitialized() )
|
||||||
return;
|
return;
|
||||||
// call the ancestor's method (mark as initialized)
|
// call the ancestor's method (mark as initialized)
|
||||||
parent::init();
|
parent::init();
|
||||||
phpCAS::traceEnd();
|
phpCAS::traceEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// PGT I/O
|
// PGT I/O
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the filename corresponding to a PGT Iou.
|
* This method returns the filename corresponding to a PGT Iou.
|
||||||
*
|
*
|
||||||
* @param $pgt_iou the PGT iou.
|
* @param $pgt_iou the PGT iou.
|
||||||
*
|
*
|
||||||
* @return a filename
|
* @return a filename
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function getPGTIouFilename($pgt_iou)
|
function getPGTIouFilename($pgt_iou)
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
$filename = $this->getPath().$pgt_iou.'.'.$this->getFormat();
|
$filename = $this->getPath().$pgt_iou.'.'.$this->getFormat();
|
||||||
phpCAS::traceEnd($filename);
|
phpCAS::traceEnd($filename);
|
||||||
return $filename;
|
return $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method stores a PGT and its corresponding PGT Iou into a file. Echoes a
|
* This method stores a PGT and its corresponding PGT Iou into a file. Echoes a
|
||||||
* warning on error.
|
* warning on error.
|
||||||
*
|
*
|
||||||
* @param $pgt the PGT
|
* @param $pgt the PGT
|
||||||
* @param $pgt_iou the PGT iou
|
* @param $pgt_iou the PGT iou
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function write($pgt,$pgt_iou)
|
function write($pgt,$pgt_iou)
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
$fname = $this->getPGTIouFilename($pgt_iou);
|
$fname = $this->getPGTIouFilename($pgt_iou);
|
||||||
if ( $f=fopen($fname,"w") ) {
|
if ( $f=fopen($fname,"w") ) {
|
||||||
if ( fputs($f,$pgt) === FALSE ) {
|
if ( fputs($f,$pgt) === FALSE ) {
|
||||||
phpCAS::error('could not write PGT to `'.$fname.'\'');
|
phpCAS::error('could not write PGT to `'.$fname.'\'');
|
||||||
}
|
}
|
||||||
fclose($f);
|
fclose($f);
|
||||||
} else {
|
} else {
|
||||||
phpCAS::error('could not open `'.$fname.'\'');
|
phpCAS::error('could not open `'.$fname.'\'');
|
||||||
}
|
}
|
||||||
phpCAS::traceEnd();
|
phpCAS::traceEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method reads a PGT corresponding to a PGT Iou and deletes the
|
* This method reads a PGT corresponding to a PGT Iou and deletes the
|
||||||
* corresponding file.
|
* corresponding file.
|
||||||
*
|
*
|
||||||
* @param $pgt_iou the PGT iou
|
* @param $pgt_iou the PGT iou
|
||||||
*
|
*
|
||||||
* @return the corresponding PGT, or FALSE on error
|
* @return the corresponding PGT, or FALSE on error
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function read($pgt_iou)
|
function read($pgt_iou)
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
$pgt = FALSE;
|
$pgt = FALSE;
|
||||||
$fname = $this->getPGTIouFilename($pgt_iou);
|
$fname = $this->getPGTIouFilename($pgt_iou);
|
||||||
if ( !($f=fopen($fname,"r")) ) {
|
if ( !($f=fopen($fname,"r")) ) {
|
||||||
phpCAS::trace('could not open `'.$fname.'\'');
|
phpCAS::trace('could not open `'.$fname.'\'');
|
||||||
} else {
|
} else {
|
||||||
if ( ($pgt=fgets($f)) === FALSE ) {
|
if ( ($pgt=fgets($f)) === FALSE ) {
|
||||||
phpCAS::trace('could not read PGT from `'.$fname.'\'');
|
phpCAS::trace('could not read PGT from `'.$fname.'\'');
|
||||||
}
|
}
|
||||||
fclose($f);
|
fclose($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the PGT file
|
// delete the PGT file
|
||||||
@unlink($fname);
|
@unlink($fname);
|
||||||
|
|
||||||
phpCAS::traceEnd($pgt);
|
phpCAS::traceEnd($pgt);
|
||||||
return $pgt;
|
return $pgt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,188 +1,188 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file CAS/PGTStorage/pgt-main.php
|
* @file CAS/PGTStorage/pgt-main.php
|
||||||
* Basic class for PGT storage
|
* Basic class for PGT storage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class PGTStorage
|
* @class PGTStorage
|
||||||
* The PGTStorage class is a generic class for PGT storage. This class should
|
* The PGTStorage class is a generic class for PGT storage. This class should
|
||||||
* not be instanciated itself but inherited by specific PGT storage classes.
|
* not be instanciated itself but inherited by specific PGT storage classes.
|
||||||
*
|
*
|
||||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
||||||
*
|
*
|
||||||
* @ingroup internalPGTStorage
|
* @ingroup internalPGTStorage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class PGTStorage
|
class PGTStorage
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @addtogroup internalPGTStorage
|
* @addtogroup internalPGTStorage
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// CONSTRUCTOR
|
// CONSTRUCTOR
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constructor of the class, should be called only by inherited classes.
|
* The constructor of the class, should be called only by inherited classes.
|
||||||
*
|
*
|
||||||
* @param $cas_parent the CASclient instance that creates the current object.
|
* @param $cas_parent the CASclient instance that creates the current object.
|
||||||
*
|
*
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
function PGTStorage($cas_parent)
|
function PGTStorage($cas_parent)
|
||||||
{
|
{
|
||||||
phpCAS::traceBegin();
|
phpCAS::traceBegin();
|
||||||
if ( !$cas_parent->isProxy() ) {
|
if ( !$cas_parent->isProxy() ) {
|
||||||
phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
|
phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
|
||||||
}
|
}
|
||||||
phpCAS::traceEnd();
|
phpCAS::traceEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// DEBUGGING
|
// DEBUGGING
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This virtual method returns an informational string giving the type of storage
|
* This virtual method returns an informational string giving the type of storage
|
||||||
* used by the object (used for debugging purposes).
|
* used by the object (used for debugging purposes).
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function getStorageType()
|
function getStorageType()
|
||||||
{
|
{
|
||||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This virtual method returns an informational string giving informations on the
|
* This virtual method returns an informational string giving informations on the
|
||||||
* parameters of the storage.(used for debugging purposes).
|
* parameters of the storage.(used for debugging purposes).
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
function getStorageInfo()
|
function getStorageInfo()
|
||||||
{
|
{
|
||||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// ERROR HANDLING
|
// ERROR HANDLING
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* string used to store an error message. Written by PGTStorage::setErrorMessage(),
|
* string used to store an error message. Written by PGTStorage::setErrorMessage(),
|
||||||
* read by PGTStorage::getErrorMessage().
|
* read by PGTStorage::getErrorMessage().
|
||||||
*
|
*
|
||||||
* @hideinitializer
|
* @hideinitializer
|
||||||
* @private
|
* @private
|
||||||
* @deprecated not used.
|
* @deprecated not used.
|
||||||
*/
|
*/
|
||||||
var $_error_message=FALSE;
|
var $_error_message=FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method sets en error message, which can be read later by
|
* This method sets en error message, which can be read later by
|
||||||
* PGTStorage::getErrorMessage().
|
* PGTStorage::getErrorMessage().
|
||||||
*
|
*
|
||||||
* @param $error_message an error message
|
* @param $error_message an error message
|
||||||
*
|
*
|
||||||
* @protected
|
* @protected
|
||||||
* @deprecated not used.
|
* @deprecated not used.
|
||||||
*/
|
*/
|
||||||
function setErrorMessage($error_message)
|
function setErrorMessage($error_message)
|
||||||
{
|
{
|
||||||
$this->_error_message = $error_message;
|
$this->_error_message = $error_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an error message set by PGTStorage::setErrorMessage().
|
* This method returns an error message set by PGTStorage::setErrorMessage().
|
||||||
*
|
*
|
||||||
* @return an error message when set by PGTStorage::setErrorMessage(), FALSE
|
* @return an error message when set by PGTStorage::setErrorMessage(), FALSE
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @deprecated not used.
|
* @deprecated not used.
|
||||||
*/
|
*/
|
||||||
function getErrorMessage()
|
function getErrorMessage()
|
||||||
{
|
{
|
||||||
return $this->_error_message;
|
return $this->_error_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// INITIALIZATION
|
// INITIALIZATION
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a boolean telling if the storage has already been initialized. Written by
|
* a boolean telling if the storage has already been initialized. Written by
|
||||||
* PGTStorage::init(), read by PGTStorage::isInitialized().
|
* PGTStorage::init(), read by PGTStorage::isInitialized().
|
||||||
*
|
*
|
||||||
* @hideinitializer
|
* @hideinitializer
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var $_initialized = FALSE;
|
var $_initialized = FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method tells if the storage has already been intialized.
|
* This method tells if the storage has already been intialized.
|
||||||
*
|
*
|
||||||
* @return a boolean
|
* @return a boolean
|
||||||
*
|
*
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
function isInitialized()
|
function isInitialized()
|
||||||
{
|
{
|
||||||
return $this->_initialized;
|
return $this->_initialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This virtual method initializes the object.
|
* This virtual method initializes the object.
|
||||||
*
|
*
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
$this->_initialized = TRUE;
|
$this->_initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
// PGT I/O
|
// PGT I/O
|
||||||
// ########################################################################
|
// ########################################################################
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This virtual method stores a PGT and its corresponding PGT Iuo.
|
* This virtual method stores a PGT and its corresponding PGT Iuo.
|
||||||
* @note Should never be called.
|
* @note Should never be called.
|
||||||
*
|
*
|
||||||
* @param $pgt the PGT
|
* @param $pgt the PGT
|
||||||
* @param $pgt_iou the PGT iou
|
* @param $pgt_iou the PGT iou
|
||||||
*
|
*
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
function write($pgt,$pgt_iou)
|
function write($pgt,$pgt_iou)
|
||||||
{
|
{
|
||||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This virtual method reads a PGT corresponding to a PGT Iou and deletes
|
* This virtual method reads a PGT corresponding to a PGT Iou and deletes
|
||||||
* the corresponding storage entry.
|
* the corresponding storage entry.
|
||||||
* @note Should never be called.
|
* @note Should never be called.
|
||||||
*
|
*
|
||||||
* @param $pgt_iou the PGT iou
|
* @param $pgt_iou the PGT iou
|
||||||
*
|
*
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
function read($pgt_iou)
|
function read($pgt_iou)
|
||||||
{
|
{
|
||||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// include specific PGT storage classes
|
// include specific PGT storage classes
|
||||||
include_once(dirname(__FILE__).'/pgt-file.php');
|
include_once(dirname(__FILE__).'/pgt-file.php');
|
||||||
include_once(dirname(__FILE__).'/pgt-db.php');
|
include_once(dirname(__FILE__).'/pgt-db.php');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,277 +1,277 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @file domxml-php4-php5.php
|
* @file domxml-php4-php5.php
|
||||||
* Require PHP5, uses built-in DOM extension.
|
* Require PHP5, uses built-in DOM extension.
|
||||||
* To be used in PHP4 scripts using DOMXML extension.
|
* To be used in PHP4 scripts using DOMXML extension.
|
||||||
* Allows PHP4/DOMXML scripts to run on PHP5/DOM.
|
* Allows PHP4/DOMXML scripts to run on PHP5/DOM.
|
||||||
* (Requires PHP5/XSL extension for domxml_xslt functions)
|
* (Requires PHP5/XSL extension for domxml_xslt functions)
|
||||||
*
|
*
|
||||||
* Typical use:
|
* Typical use:
|
||||||
* <pre>
|
* <pre>
|
||||||
* {
|
* {
|
||||||
* if (version_compare(PHP_VERSION,'5','>='))
|
* if (version_compare(PHP_VERSION,'5','>='))
|
||||||
* require_once('domxml-php4-to-php5.php');
|
* require_once('domxml-php4-to-php5.php');
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* Version 1.5.5, 2005-01-18, http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
|
* Version 1.5.5, 2005-01-18, http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
|
||||||
*
|
*
|
||||||
* ------------------------------------------------------------------<br>
|
* ------------------------------------------------------------------<br>
|
||||||
* Written by Alexandre Alapetite, http://alexandre.alapetite.net/cv/
|
* Written by Alexandre Alapetite, http://alexandre.alapetite.net/cv/
|
||||||
*
|
*
|
||||||
* Copyright 2004, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR),
|
* Copyright 2004, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR),
|
||||||
* http://creativecommons.org/licenses/by-sa/2.0/fr/
|
* http://creativecommons.org/licenses/by-sa/2.0/fr/
|
||||||
* http://alexandre.alapetite.net/divers/apropos/#by-sa
|
* http://alexandre.alapetite.net/divers/apropos/#by-sa
|
||||||
* - Attribution. You must give the original author credit
|
* - Attribution. You must give the original author credit
|
||||||
* - Share Alike. If you alter, transform, or build upon this work,
|
* - Share Alike. If you alter, transform, or build upon this work,
|
||||||
* you may distribute the resulting work only under a license identical to this one
|
* you may distribute the resulting work only under a license identical to this one
|
||||||
* - The French law is authoritative
|
* - The French law is authoritative
|
||||||
* - Any of these conditions can be waived if you get permission from Alexandre Alapetite
|
* - Any of these conditions can be waived if you get permission from Alexandre Alapetite
|
||||||
* - Please send to Alexandre Alapetite the modifications you make,
|
* - Please send to Alexandre Alapetite the modifications you make,
|
||||||
* in order to improve this file for the benefit of everybody
|
* in order to improve this file for the benefit of everybody
|
||||||
*
|
*
|
||||||
* If you want to distribute this code, please do it as a link to:
|
* If you want to distribute this code, please do it as a link to:
|
||||||
* http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
|
* http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function domxml_new_doc($version) {return new php4DOMDocument('');}
|
function domxml_new_doc($version) {return new php4DOMDocument('');}
|
||||||
function domxml_open_file($filename) {return new php4DOMDocument($filename);}
|
function domxml_open_file($filename) {return new php4DOMDocument($filename);}
|
||||||
function domxml_open_mem($str)
|
function domxml_open_mem($str)
|
||||||
{
|
{
|
||||||
$dom=new php4DOMDocument('');
|
$dom=new php4DOMDocument('');
|
||||||
$dom->myDOMNode->loadXML($str);
|
$dom->myDOMNode->loadXML($str);
|
||||||
return $dom;
|
return $dom;
|
||||||
}
|
}
|
||||||
function xpath_eval($xpath_context,$eval_str,$contextnode=null) {return $xpath_context->query($eval_str,$contextnode);}
|
function xpath_eval($xpath_context,$eval_str,$contextnode=null) {return $xpath_context->query($eval_str,$contextnode);}
|
||||||
function xpath_new_context($dom_document) {return new php4DOMXPath($dom_document);}
|
function xpath_new_context($dom_document) {return new php4DOMXPath($dom_document);}
|
||||||
|
|
||||||
class php4DOMAttr extends php4DOMNode
|
class php4DOMAttr extends php4DOMNode
|
||||||
{
|
{
|
||||||
function php4DOMAttr($aDOMAttr) {$this->myDOMNode=$aDOMAttr;}
|
function php4DOMAttr($aDOMAttr) {$this->myDOMNode=$aDOMAttr;}
|
||||||
function Name() {return $this->myDOMNode->name;}
|
function Name() {return $this->myDOMNode->name;}
|
||||||
function Specified() {return $this->myDOMNode->specified;}
|
function Specified() {return $this->myDOMNode->specified;}
|
||||||
function Value() {return $this->myDOMNode->value;}
|
function Value() {return $this->myDOMNode->value;}
|
||||||
}
|
}
|
||||||
|
|
||||||
class php4DOMDocument extends php4DOMNode
|
class php4DOMDocument extends php4DOMNode
|
||||||
{
|
{
|
||||||
function php4DOMDocument($filename='')
|
function php4DOMDocument($filename='')
|
||||||
{
|
{
|
||||||
$this->myDOMNode=new DOMDocument();
|
$this->myDOMNode=new DOMDocument();
|
||||||
if ($filename!='') $this->myDOMNode->load($filename);
|
if ($filename!='') $this->myDOMNode->load($filename);
|
||||||
}
|
}
|
||||||
function create_attribute($name,$value)
|
function create_attribute($name,$value)
|
||||||
{
|
{
|
||||||
$myAttr=$this->myDOMNode->createAttribute($name);
|
$myAttr=$this->myDOMNode->createAttribute($name);
|
||||||
$myAttr->value=$value;
|
$myAttr->value=$value;
|
||||||
return new php4DOMAttr($myAttr,$this);
|
return new php4DOMAttr($myAttr,$this);
|
||||||
}
|
}
|
||||||
function create_cdata_section($content) {return new php4DOMNode($this->myDOMNode->createCDATASection($content),$this);}
|
function create_cdata_section($content) {return new php4DOMNode($this->myDOMNode->createCDATASection($content),$this);}
|
||||||
function create_comment($data) {return new php4DOMNode($this->myDOMNode->createComment($data),$this);}
|
function create_comment($data) {return new php4DOMNode($this->myDOMNode->createComment($data),$this);}
|
||||||
function create_element($name) {return new php4DOMElement($this->myDOMNode->createElement($name),$this);}
|
function create_element($name) {return new php4DOMElement($this->myDOMNode->createElement($name),$this);}
|
||||||
function create_text_node($content) {return new php4DOMNode($this->myDOMNode->createTextNode($content),$this);}
|
function create_text_node($content) {return new php4DOMNode($this->myDOMNode->createTextNode($content),$this);}
|
||||||
function document_element() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
|
function document_element() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
|
||||||
function dump_file($filename,$compressionmode=false,$format=false) {return $this->myDOMNode->save($filename);}
|
function dump_file($filename,$compressionmode=false,$format=false) {return $this->myDOMNode->save($filename);}
|
||||||
function dump_mem($format=false,$encoding=false) {return $this->myDOMNode->saveXML();}
|
function dump_mem($format=false,$encoding=false) {return $this->myDOMNode->saveXML();}
|
||||||
function get_element_by_id($id) {return new php4DOMElement($this->myDOMNode->getElementById($id),$this);}
|
function get_element_by_id($id) {return new php4DOMElement($this->myDOMNode->getElementById($id),$this);}
|
||||||
function get_elements_by_tagname($name)
|
function get_elements_by_tagname($name)
|
||||||
{
|
{
|
||||||
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
|
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
|
||||||
$nodeSet=array();
|
$nodeSet=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
if (isset($myDOMNodeList))
|
if (isset($myDOMNodeList))
|
||||||
while ($node=$myDOMNodeList->item($i))
|
while ($node=$myDOMNodeList->item($i))
|
||||||
{
|
{
|
||||||
$nodeSet[]=new php4DOMElement($node,$this);
|
$nodeSet[]=new php4DOMElement($node,$this);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
return $nodeSet;
|
return $nodeSet;
|
||||||
}
|
}
|
||||||
function html_dump_mem() {return $this->myDOMNode->saveHTML();}
|
function html_dump_mem() {return $this->myDOMNode->saveHTML();}
|
||||||
function root() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
|
function root() {return new php4DOMElement($this->myDOMNode->documentElement,$this);}
|
||||||
}
|
}
|
||||||
|
|
||||||
class php4DOMElement extends php4DOMNode
|
class php4DOMElement extends php4DOMNode
|
||||||
{
|
{
|
||||||
function get_attribute($name) {return $this->myDOMNode->getAttribute($name);}
|
function get_attribute($name) {return $this->myDOMNode->getAttribute($name);}
|
||||||
function get_elements_by_tagname($name)
|
function get_elements_by_tagname($name)
|
||||||
{
|
{
|
||||||
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
|
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
|
||||||
$nodeSet=array();
|
$nodeSet=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
if (isset($myDOMNodeList))
|
if (isset($myDOMNodeList))
|
||||||
while ($node=$myDOMNodeList->item($i))
|
while ($node=$myDOMNodeList->item($i))
|
||||||
{
|
{
|
||||||
$nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
|
$nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
return $nodeSet;
|
return $nodeSet;
|
||||||
}
|
}
|
||||||
function has_attribute($name) {return $this->myDOMNode->hasAttribute($name);}
|
function has_attribute($name) {return $this->myDOMNode->hasAttribute($name);}
|
||||||
function remove_attribute($name) {return $this->myDOMNode->removeAttribute($name);}
|
function remove_attribute($name) {return $this->myDOMNode->removeAttribute($name);}
|
||||||
function set_attribute($name,$value) {return $this->myDOMNode->setAttribute($name,$value);}
|
function set_attribute($name,$value) {return $this->myDOMNode->setAttribute($name,$value);}
|
||||||
function tagname() {return $this->myDOMNode->tagName;}
|
function tagname() {return $this->myDOMNode->tagName;}
|
||||||
}
|
}
|
||||||
|
|
||||||
class php4DOMNode
|
class php4DOMNode
|
||||||
{
|
{
|
||||||
var $myDOMNode;
|
var $myDOMNode;
|
||||||
var $myOwnerDocument;
|
var $myOwnerDocument;
|
||||||
function php4DOMNode($aDomNode,$aOwnerDocument)
|
function php4DOMNode($aDomNode,$aOwnerDocument)
|
||||||
{
|
{
|
||||||
$this->myDOMNode=$aDomNode;
|
$this->myDOMNode=$aDomNode;
|
||||||
$this->myOwnerDocument=$aOwnerDocument;
|
$this->myOwnerDocument=$aOwnerDocument;
|
||||||
}
|
}
|
||||||
function __get($name)
|
function __get($name)
|
||||||
{
|
{
|
||||||
if ($name=='type') return $this->myDOMNode->nodeType;
|
if ($name=='type') return $this->myDOMNode->nodeType;
|
||||||
elseif ($name=='tagname') return $this->myDOMNode->tagName;
|
elseif ($name=='tagname') return $this->myDOMNode->tagName;
|
||||||
elseif ($name=='content') return $this->myDOMNode->textContent;
|
elseif ($name=='content') return $this->myDOMNode->textContent;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$myErrors=debug_backtrace();
|
$myErrors=debug_backtrace();
|
||||||
trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE);
|
trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function append_child($newnode) {return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
|
function append_child($newnode) {return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
|
||||||
function append_sibling($newnode) {return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
|
function append_sibling($newnode) {return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);}
|
||||||
function attributes()
|
function attributes()
|
||||||
{
|
{
|
||||||
$myDOMNodeList=$this->myDOMNode->attributes;
|
$myDOMNodeList=$this->myDOMNode->attributes;
|
||||||
$nodeSet=array();
|
$nodeSet=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
if (isset($myDOMNodeList))
|
if (isset($myDOMNodeList))
|
||||||
while ($node=$myDOMNodeList->item($i))
|
while ($node=$myDOMNodeList->item($i))
|
||||||
{
|
{
|
||||||
$nodeSet[]=new php4DOMAttr($node,$this->myOwnerDocument);
|
$nodeSet[]=new php4DOMAttr($node,$this->myOwnerDocument);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
return $nodeSet;
|
return $nodeSet;
|
||||||
}
|
}
|
||||||
function child_nodes()
|
function child_nodes()
|
||||||
{
|
{
|
||||||
$myDOMNodeList=$this->myDOMNode->childNodes;
|
$myDOMNodeList=$this->myDOMNode->childNodes;
|
||||||
$nodeSet=array();
|
$nodeSet=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
if (isset($myDOMNodeList))
|
if (isset($myDOMNodeList))
|
||||||
while ($node=$myDOMNodeList->item($i))
|
while ($node=$myDOMNodeList->item($i))
|
||||||
{
|
{
|
||||||
$nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
|
$nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
return $nodeSet;
|
return $nodeSet;
|
||||||
}
|
}
|
||||||
function children() {return $this->child_nodes();}
|
function children() {return $this->child_nodes();}
|
||||||
function clone_node($deep=false) {return new php4DOMElement($this->myDOMNode->cloneNode($deep),$this->myOwnerDocument);}
|
function clone_node($deep=false) {return new php4DOMElement($this->myDOMNode->cloneNode($deep),$this->myOwnerDocument);}
|
||||||
function first_child() {return new php4DOMElement($this->myDOMNode->firstChild,$this->myOwnerDocument);}
|
function first_child() {return new php4DOMElement($this->myDOMNode->firstChild,$this->myOwnerDocument);}
|
||||||
function get_content() {return $this->myDOMNode->textContent;}
|
function get_content() {return $this->myDOMNode->textContent;}
|
||||||
function has_attributes() {return $this->myDOMNode->hasAttributes();}
|
function has_attributes() {return $this->myDOMNode->hasAttributes();}
|
||||||
function has_child_nodes() {return $this->myDOMNode->hasChildNodes();}
|
function has_child_nodes() {return $this->myDOMNode->hasChildNodes();}
|
||||||
function insert_before($newnode,$refnode) {return new php4DOMElement($this->myDOMNode->insertBefore($newnode->myDOMNode,$refnode->myDOMNode),$this->myOwnerDocument);}
|
function insert_before($newnode,$refnode) {return new php4DOMElement($this->myDOMNode->insertBefore($newnode->myDOMNode,$refnode->myDOMNode),$this->myOwnerDocument);}
|
||||||
function is_blank_node()
|
function is_blank_node()
|
||||||
{
|
{
|
||||||
$myDOMNodeList=$this->myDOMNode->childNodes;
|
$myDOMNodeList=$this->myDOMNode->childNodes;
|
||||||
$i=0;
|
$i=0;
|
||||||
if (isset($myDOMNodeList))
|
if (isset($myDOMNodeList))
|
||||||
while ($node=$myDOMNodeList->item($i))
|
while ($node=$myDOMNodeList->item($i))
|
||||||
{
|
{
|
||||||
if (($node->nodeType==XML_ELEMENT_NODE)||
|
if (($node->nodeType==XML_ELEMENT_NODE)||
|
||||||
(($node->nodeType==XML_TEXT_NODE)&&!preg_match('/^([[:cntrl:]]|[[:space:]])*$/',$node->nodeValue)))
|
(($node->nodeType==XML_TEXT_NODE)&&!preg_match('/^([[:cntrl:]]|[[:space:]])*$/',$node->nodeValue)))
|
||||||
return false;
|
return false;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function last_child() {return new php4DOMElement($this->myDOMNode->lastChild,$this->myOwnerDocument);}
|
function last_child() {return new php4DOMElement($this->myDOMNode->lastChild,$this->myOwnerDocument);}
|
||||||
function new_child($name,$content)
|
function new_child($name,$content)
|
||||||
{
|
{
|
||||||
$mySubNode=$this->myDOMNode->ownerDocument->createElement($name);
|
$mySubNode=$this->myDOMNode->ownerDocument->createElement($name);
|
||||||
$mySubNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($content));
|
$mySubNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($content));
|
||||||
$this->myDOMNode->appendChild($mySubNode);
|
$this->myDOMNode->appendChild($mySubNode);
|
||||||
return new php4DOMElement($mySubNode,$this->myOwnerDocument);
|
return new php4DOMElement($mySubNode,$this->myOwnerDocument);
|
||||||
}
|
}
|
||||||
function next_sibling() {return new php4DOMElement($this->myDOMNode->nextSibling,$this->myOwnerDocument);}
|
function next_sibling() {return new php4DOMElement($this->myDOMNode->nextSibling,$this->myOwnerDocument);}
|
||||||
function node_name() {return $this->myDOMNode->localName;}
|
function node_name() {return $this->myDOMNode->localName;}
|
||||||
function node_type() {return $this->myDOMNode->nodeType;}
|
function node_type() {return $this->myDOMNode->nodeType;}
|
||||||
function node_value() {return $this->myDOMNode->nodeValue;}
|
function node_value() {return $this->myDOMNode->nodeValue;}
|
||||||
function owner_document() {return $this->myOwnerDocument;}
|
function owner_document() {return $this->myOwnerDocument;}
|
||||||
function parent_node() {return new php4DOMElement($this->myDOMNode->parentNode,$this->myOwnerDocument);}
|
function parent_node() {return new php4DOMElement($this->myDOMNode->parentNode,$this->myOwnerDocument);}
|
||||||
function prefix() {return $this->myDOMNode->prefix;}
|
function prefix() {return $this->myDOMNode->prefix;}
|
||||||
function previous_sibling() {return new php4DOMElement($this->myDOMNode->previousSibling,$this->myOwnerDocument);}
|
function previous_sibling() {return new php4DOMElement($this->myDOMNode->previousSibling,$this->myOwnerDocument);}
|
||||||
function remove_child($oldchild) {return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode),$this->myOwnerDocument);}
|
function remove_child($oldchild) {return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode),$this->myOwnerDocument);}
|
||||||
function replace_child($oldnode,$newnode) {return new php4DOMElement($this->myDOMNode->replaceChild($oldnode->myDOMNode,$newnode->myDOMNode),$this->myOwnerDocument);}
|
function replace_child($oldnode,$newnode) {return new php4DOMElement($this->myDOMNode->replaceChild($oldnode->myDOMNode,$newnode->myDOMNode),$this->myOwnerDocument);}
|
||||||
function set_content($text)
|
function set_content($text)
|
||||||
{
|
{
|
||||||
if (($this->myDOMNode->hasChildNodes())&&($this->myDOMNode->firstChild->nodeType==XML_TEXT_NODE))
|
if (($this->myDOMNode->hasChildNodes())&&($this->myDOMNode->firstChild->nodeType==XML_TEXT_NODE))
|
||||||
$this->myDOMNode->removeChild($this->myDOMNode->firstChild);
|
$this->myDOMNode->removeChild($this->myDOMNode->firstChild);
|
||||||
return $this->myDOMNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($text));
|
return $this->myDOMNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($text));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class php4DOMNodelist
|
class php4DOMNodelist
|
||||||
{
|
{
|
||||||
var $myDOMNodelist;
|
var $myDOMNodelist;
|
||||||
var $nodeset;
|
var $nodeset;
|
||||||
function php4DOMNodelist($aDOMNodelist,$aOwnerDocument)
|
function php4DOMNodelist($aDOMNodelist,$aOwnerDocument)
|
||||||
{
|
{
|
||||||
$this->myDOMNodelist=$aDOMNodelist;
|
$this->myDOMNodelist=$aDOMNodelist;
|
||||||
$this->nodeset=array();
|
$this->nodeset=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
if (isset($this->myDOMNodelist))
|
if (isset($this->myDOMNodelist))
|
||||||
while ($node=$this->myDOMNodelist->item($i))
|
while ($node=$this->myDOMNodelist->item($i))
|
||||||
{
|
{
|
||||||
$this->nodeset[]=new php4DOMElement($node,$aOwnerDocument);
|
$this->nodeset[]=new php4DOMElement($node,$aOwnerDocument);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class php4DOMXPath
|
class php4DOMXPath
|
||||||
{
|
{
|
||||||
var $myDOMXPath;
|
var $myDOMXPath;
|
||||||
var $myOwnerDocument;
|
var $myOwnerDocument;
|
||||||
function php4DOMXPath($dom_document)
|
function php4DOMXPath($dom_document)
|
||||||
{
|
{
|
||||||
$this->myOwnerDocument=$dom_document;
|
$this->myOwnerDocument=$dom_document;
|
||||||
$this->myDOMXPath=new DOMXPath($dom_document->myDOMNode);
|
$this->myDOMXPath=new DOMXPath($dom_document->myDOMNode);
|
||||||
}
|
}
|
||||||
function query($eval_str,$contextnode)
|
function query($eval_str,$contextnode)
|
||||||
{
|
{
|
||||||
if (isset($contextnode)) return new php4DOMNodelist($this->myDOMXPath->query($eval_str,$contextnode->myDOMNode),$this->myOwnerDocument);
|
if (isset($contextnode)) return new php4DOMNodelist($this->myDOMXPath->query($eval_str,$contextnode->myDOMNode),$this->myOwnerDocument);
|
||||||
else return new php4DOMNodelist($this->myDOMXPath->query($eval_str),$this->myOwnerDocument);
|
else return new php4DOMNodelist($this->myDOMXPath->query($eval_str),$this->myOwnerDocument);
|
||||||
}
|
}
|
||||||
function xpath_register_ns($prefix,$namespaceURI) {return $this->myDOMXPath->registerNamespace($prefix,$namespaceURI);}
|
function xpath_register_ns($prefix,$namespaceURI) {return $this->myDOMXPath->registerNamespace($prefix,$namespaceURI);}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extension_loaded('xsl'))
|
if (extension_loaded('xsl'))
|
||||||
{//See also: http://alexandre.alapetite.net/doc-alex/xslt-php4-php5/
|
{//See also: http://alexandre.alapetite.net/doc-alex/xslt-php4-php5/
|
||||||
function domxml_xslt_stylesheet($xslstring) {return new php4DomXsltStylesheet(DOMDocument::loadXML($xslstring));}
|
function domxml_xslt_stylesheet($xslstring) {return new php4DomXsltStylesheet(DOMDocument::loadXML($xslstring));}
|
||||||
function domxml_xslt_stylesheet_doc($dom_document) {return new php4DomXsltStylesheet($dom_document);}
|
function domxml_xslt_stylesheet_doc($dom_document) {return new php4DomXsltStylesheet($dom_document);}
|
||||||
function domxml_xslt_stylesheet_file($xslfile) {return new php4DomXsltStylesheet(DOMDocument::load($xslfile));}
|
function domxml_xslt_stylesheet_file($xslfile) {return new php4DomXsltStylesheet(DOMDocument::load($xslfile));}
|
||||||
class php4DomXsltStylesheet
|
class php4DomXsltStylesheet
|
||||||
{
|
{
|
||||||
var $myxsltProcessor;
|
var $myxsltProcessor;
|
||||||
function php4DomXsltStylesheet($dom_document)
|
function php4DomXsltStylesheet($dom_document)
|
||||||
{
|
{
|
||||||
$this->myxsltProcessor=new xsltProcessor();
|
$this->myxsltProcessor=new xsltProcessor();
|
||||||
$this->myxsltProcessor->importStyleSheet($dom_document);
|
$this->myxsltProcessor->importStyleSheet($dom_document);
|
||||||
}
|
}
|
||||||
function process($dom_document,$xslt_parameters=array(),$param_is_xpath=false)
|
function process($dom_document,$xslt_parameters=array(),$param_is_xpath=false)
|
||||||
{
|
{
|
||||||
foreach ($xslt_parameters as $param=>$value)
|
foreach ($xslt_parameters as $param=>$value)
|
||||||
$this->myxsltProcessor->setParameter('',$param,$value);
|
$this->myxsltProcessor->setParameter('',$param,$value);
|
||||||
$myphp4DOMDocument=new php4DOMDocument();
|
$myphp4DOMDocument=new php4DOMDocument();
|
||||||
$myphp4DOMDocument->myDOMNode=$this->myxsltProcessor->transformToDoc($dom_document->myDOMNode);
|
$myphp4DOMDocument->myDOMNode=$this->myxsltProcessor->transformToDoc($dom_document->myDOMNode);
|
||||||
return $myphp4DOMDocument;
|
return $myphp4DOMDocument;
|
||||||
}
|
}
|
||||||
function result_dump_file($dom_document,$filename)
|
function result_dump_file($dom_document,$filename)
|
||||||
{
|
{
|
||||||
$html=$dom_document->myDOMNode->saveHTML();
|
$html=$dom_document->myDOMNode->saveHTML();
|
||||||
file_put_contents($filename,$html);
|
file_put_contents($filename,$html);
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
function result_dump_mem($dom_document) {return $dom_document->myDOMNode->saveHTML();}
|
function result_dump_mem($dom_document) {return $dom_document->myDOMNode->saveHTML();}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file languages/spanish.php
|
* @file languages/spanish.php
|
||||||
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com
|
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com
|
||||||
* @sa @link internalLang Internationalization @endlink
|
* @sa @link internalLang Internationalization @endlink
|
||||||
* @ingroup internalLang
|
* @ingroup internalLang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->_strings = array(
|
$this->_strings = array(
|
||||||
CAS_STR_USING_SERVER
|
CAS_STR_USING_SERVER
|
||||||
=> 'usant servidor',
|
=> 'usant servidor',
|
||||||
CAS_STR_AUTHENTICATION_WANTED
|
CAS_STR_AUTHENTICATION_WANTED
|
||||||
=> 'Autentificació CAS necessària!',
|
=> 'Autentificació CAS necessària!',
|
||||||
CAS_STR_LOGOUT
|
CAS_STR_LOGOUT
|
||||||
=> 'Sortida de CAS necessària!',
|
=> 'Sortida de CAS necessària!',
|
||||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
||||||
=> 'Ja hauria d\ haver estat redireccionat al servidor CAS. Feu click <a href="%s">aquí</a> per a continuar.',
|
=> 'Ja hauria d\ haver estat redireccionat al servidor CAS. Feu click <a href="%s">aquí</a> per a continuar.',
|
||||||
CAS_STR_AUTHENTICATION_FAILED
|
CAS_STR_AUTHENTICATION_FAILED
|
||||||
=> 'Autentificació CAS fallida!',
|
=> 'Autentificació CAS fallida!',
|
||||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
||||||
=> '<p>No estàs autentificat.</p><p>Pots tornar a intentar-ho fent click <a href="%s">aquí</a>.</p><p>Si el problema persisteix hauría de contactar amb l\'<a href="mailto:%s">administrador d\'aquest llocc</a>.</p>',
|
=> '<p>No estàs autentificat.</p><p>Pots tornar a intentar-ho fent click <a href="%s">aquí</a>.</p><p>Si el problema persisteix hauría de contactar amb l\'<a href="mailto:%s">administrador d\'aquest llocc</a>.</p>',
|
||||||
CAS_STR_SERVICE_UNAVAILABLE
|
CAS_STR_SERVICE_UNAVAILABLE
|
||||||
=> 'El servei `<b>%s</b>\' no està disponible (<b>%s</b>).'
|
=> 'El servei `<b>%s</b>\' no està disponible (<b>%s</b>).'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file languages/english.php
|
* @file languages/english.php
|
||||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
||||||
* @sa @link internalLang Internationalization @endlink
|
* @sa @link internalLang Internationalization @endlink
|
||||||
* @ingroup internalLang
|
* @ingroup internalLang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->_strings = array(
|
$this->_strings = array(
|
||||||
CAS_STR_USING_SERVER
|
CAS_STR_USING_SERVER
|
||||||
=> 'using server',
|
=> 'using server',
|
||||||
CAS_STR_AUTHENTICATION_WANTED
|
CAS_STR_AUTHENTICATION_WANTED
|
||||||
=> 'CAS Authentication wanted!',
|
=> 'CAS Authentication wanted!',
|
||||||
CAS_STR_LOGOUT
|
CAS_STR_LOGOUT
|
||||||
=> 'CAS logout wanted!',
|
=> 'CAS logout wanted!',
|
||||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
||||||
=> 'You should already have been redirected to the CAS server. Click <a href="%s">here</a> to continue.',
|
=> 'You should already have been redirected to the CAS server. Click <a href="%s">here</a> to continue.',
|
||||||
CAS_STR_AUTHENTICATION_FAILED
|
CAS_STR_AUTHENTICATION_FAILED
|
||||||
=> 'CAS Authentication failed!',
|
=> 'CAS Authentication failed!',
|
||||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
||||||
=> '<p>You were not authenticated.</p><p>You may submit your request again by clicking <a href="%s">here</a>.</p><p>If the problem persists, you may contact <a href="mailto:%s">the administrator of this site</a>.</p>',
|
=> '<p>You were not authenticated.</p><p>You may submit your request again by clicking <a href="%s">here</a>.</p><p>If the problem persists, you may contact <a href="mailto:%s">the administrator of this site</a>.</p>',
|
||||||
CAS_STR_SERVICE_UNAVAILABLE
|
CAS_STR_SERVICE_UNAVAILABLE
|
||||||
=> 'The service `<b>%s</b>\' is not available (<b>%s</b>).'
|
=> 'The service `<b>%s</b>\' is not available (<b>%s</b>).'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,29 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file languages/english.php
|
* @file languages/english.php
|
||||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
||||||
* @sa @link internalLang Internationalization @endlink
|
* @sa @link internalLang Internationalization @endlink
|
||||||
* @ingroup internalLang
|
* @ingroup internalLang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->_strings = array(
|
$this->_strings = array(
|
||||||
CAS_STR_USING_SERVER
|
CAS_STR_USING_SERVER
|
||||||
=> 'utilisant le serveur',
|
=> 'utilisant le serveur',
|
||||||
CAS_STR_AUTHENTICATION_WANTED
|
CAS_STR_AUTHENTICATION_WANTED
|
||||||
=> 'Authentication CAS n�cessaire !',
|
=> 'Authentication CAS n�cessaire !',
|
||||||
CAS_STR_LOGOUT
|
CAS_STR_LOGOUT
|
||||||
=> 'D�connexion demand�e !',
|
=> 'D�connexion demand�e !',
|
||||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
||||||
=> 'Vous auriez du etre redirig�(e) vers le serveur CAS. Cliquez <a href="%s">ici</a> pour continuer.',
|
=> 'Vous auriez du etre redirig�(e) vers le serveur CAS. Cliquez <a href="%s">ici</a> pour continuer.',
|
||||||
CAS_STR_AUTHENTICATION_FAILED
|
CAS_STR_AUTHENTICATION_FAILED
|
||||||
=> 'Authentification CAS infructueuse !',
|
=> 'Authentification CAS infructueuse !',
|
||||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
||||||
=> '<p>Vous n\'avez pas �t� authentifi�(e).</p><p>Vous pouvez soumettre votre requete � nouveau en cliquant <a href="%s">ici</a>.</p><p>Si le probl�me persiste, vous pouvez contacter <a href="mailto:%s">l\'administrateur de ce site</a>.</p>',
|
=> '<p>Vous n\'avez pas �t� authentifi�(e).</p><p>Vous pouvez soumettre votre requete � nouveau en cliquant <a href="%s">ici</a>.</p><p>Si le probl�me persiste, vous pouvez contacter <a href="mailto:%s">l\'administrateur de ce site</a>.</p>',
|
||||||
CAS_STR_SERVICE_UNAVAILABLE
|
CAS_STR_SERVICE_UNAVAILABLE
|
||||||
=> 'Le service `<b>%s</b>\' est indisponible (<b>%s</b>)'
|
=> 'Le service `<b>%s</b>\' est indisponible (<b>%s</b>)'
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file languages/german.php
|
* @file languages/german.php
|
||||||
* @author Henrik Genssen <hg at mediafactory.de>
|
* @author Henrik Genssen <hg at mediafactory.de>
|
||||||
* @sa @link internalLang Internationalization @endlink
|
* @sa @link internalLang Internationalization @endlink
|
||||||
* @ingroup internalLang
|
* @ingroup internalLang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->_strings = array(
|
$this->_strings = array(
|
||||||
CAS_STR_USING_SERVER
|
CAS_STR_USING_SERVER
|
||||||
=> 'via Server',
|
=> 'via Server',
|
||||||
CAS_STR_AUTHENTICATION_WANTED
|
CAS_STR_AUTHENTICATION_WANTED
|
||||||
=> 'CAS Authentifizierung erforderlich!',
|
=> 'CAS Authentifizierung erforderlich!',
|
||||||
CAS_STR_LOGOUT
|
CAS_STR_LOGOUT
|
||||||
=> 'CAS Abmeldung!',
|
=> 'CAS Abmeldung!',
|
||||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
||||||
=> 'eigentlich häten Sie zum CAS Server weitergeleitet werden sollen. Drücken Sie <a href="%s">hier</a> um fortzufahren.',
|
=> 'eigentlich häten Sie zum CAS Server weitergeleitet werden sollen. Drücken Sie <a href="%s">hier</a> um fortzufahren.',
|
||||||
CAS_STR_AUTHENTICATION_FAILED
|
CAS_STR_AUTHENTICATION_FAILED
|
||||||
=> 'CAS Anmeldung fehlgeschlagen!',
|
=> 'CAS Anmeldung fehlgeschlagen!',
|
||||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
||||||
=> '<p>Sie wurden nicht angemeldet.</p><p>Um es erneut zu versuchen klicken Sie <a href="%s">hier</a>.</p><p>Wenn das Problem bestehen bleibt, kontkatieren Sie den <a href="mailto:%s">Administrator</a> dieser Seite.</p>',
|
=> '<p>Sie wurden nicht angemeldet.</p><p>Um es erneut zu versuchen klicken Sie <a href="%s">hier</a>.</p><p>Wenn das Problem bestehen bleibt, kontkatieren Sie den <a href="mailto:%s">Administrator</a> dieser Seite.</p>',
|
||||||
CAS_STR_SERVICE_UNAVAILABLE
|
CAS_STR_SERVICE_UNAVAILABLE
|
||||||
=> 'Der Dienst `<b>%s</b>\' ist nicht verfügbar (<b>%s</b>).'
|
=> 'Der Dienst `<b>%s</b>\' ist nicht verfügbar (<b>%s</b>).'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file languages/greek.php
|
* @file languages/greek.php
|
||||||
* @author Vangelis Haniotakis <haniotak at ucnet.uoc.gr>
|
* @author Vangelis Haniotakis <haniotak at ucnet.uoc.gr>
|
||||||
* @sa @link internalLang Internationalization @endlink
|
* @sa @link internalLang Internationalization @endlink
|
||||||
* @ingroup internalLang
|
* @ingroup internalLang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->_strings = array(
|
$this->_strings = array(
|
||||||
CAS_STR_USING_SERVER
|
CAS_STR_USING_SERVER
|
||||||
=> '��������������� � ������������',
|
=> '��������������� � ������������',
|
||||||
CAS_STR_AUTHENTICATION_WANTED
|
CAS_STR_AUTHENTICATION_WANTED
|
||||||
=> '���������� � ����������� CAS!',
|
=> '���������� � ����������� CAS!',
|
||||||
CAS_STR_LOGOUT
|
CAS_STR_LOGOUT
|
||||||
=> '���������� � ���������� ��� CAS!',
|
=> '���������� � ���������� ��� CAS!',
|
||||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
||||||
=> '�� ������ �� ������ �������������� ���� ����������� CAS. ����� ���� <a href="%s">���</a> ��� �� ����������.',
|
=> '�� ������ �� ������ �������������� ���� ����������� CAS. ����� ���� <a href="%s">���</a> ��� �� ����������.',
|
||||||
CAS_STR_AUTHENTICATION_FAILED
|
CAS_STR_AUTHENTICATION_FAILED
|
||||||
=> '� ����������� CAS �������!',
|
=> '� ����������� CAS �������!',
|
||||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
||||||
=> '<p>��� ���������������.</p><p>�������� �� ����������������, �������� ���� <a href="%s">���</a>.</p><p>��� �� �������� ���������, ����� �� ����� �� ��� <a href="mailto:%s">�����������</a>.</p>',
|
=> '<p>��� ���������������.</p><p>�������� �� ����������������, �������� ���� <a href="%s">���</a>.</p><p>��� �� �������� ���������, ����� �� ����� �� ��� <a href="mailto:%s">�����������</a>.</p>',
|
||||||
CAS_STR_SERVICE_UNAVAILABLE
|
CAS_STR_SERVICE_UNAVAILABLE
|
||||||
=> '� �������� `<b>%s</b>\' ��� ����� ��������� (<b>%s</b>).'
|
=> '� �������� `<b>%s</b>\' ��� ����� ��������� (<b>%s</b>).'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file languages/languages.php
|
* @file languages/languages.php
|
||||||
* Internationalization constants
|
* Internationalization constants
|
||||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
|
||||||
* @sa @link internalLang Internationalization @endlink
|
* @sa @link internalLang Internationalization @endlink
|
||||||
* @ingroup internalLang
|
* @ingroup internalLang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
* a phpCAS string index
|
* a phpCAS string index
|
||||||
*/
|
*/
|
||||||
define("CAS_STR_USING_SERVER", 1);
|
define("CAS_STR_USING_SERVER", 1);
|
||||||
define("CAS_STR_AUTHENTICATION_WANTED", 2);
|
define("CAS_STR_AUTHENTICATION_WANTED", 2);
|
||||||
define("CAS_STR_LOGOUT", 3);
|
define("CAS_STR_LOGOUT", 3);
|
||||||
define("CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED", 4);
|
define("CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED", 4);
|
||||||
define("CAS_STR_AUTHENTICATION_FAILED", 5);
|
define("CAS_STR_AUTHENTICATION_FAILED", 5);
|
||||||
define("CAS_STR_YOU_WERE_NOT_AUTHENTICATED", 6);
|
define("CAS_STR_YOU_WERE_NOT_AUTHENTICATED", 6);
|
||||||
define("CAS_STR_SERVICE_UNAVAILABLE", 7);
|
define("CAS_STR_SERVICE_UNAVAILABLE", 7);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('PHPCAS_VERSION')) die();
|
if (!defined('PHPCAS_VERSION')) die();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file languages/spanish.php
|
* @file languages/spanish.php
|
||||||
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com
|
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com
|
||||||
* @sa @link internalLang Internationalization @endlink
|
* @sa @link internalLang Internationalization @endlink
|
||||||
* @ingroup internalLang
|
* @ingroup internalLang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->_strings = array(
|
$this->_strings = array(
|
||||||
CAS_STR_USING_SERVER
|
CAS_STR_USING_SERVER
|
||||||
=> 'usando servidor',
|
=> 'usando servidor',
|
||||||
CAS_STR_AUTHENTICATION_WANTED
|
CAS_STR_AUTHENTICATION_WANTED
|
||||||
=> '¡Autentificación CAS necesaria!',
|
=> '¡Autentificación CAS necesaria!',
|
||||||
CAS_STR_LOGOUT
|
CAS_STR_LOGOUT
|
||||||
=> '¡Salida CAS necesaria!',
|
=> '¡Salida CAS necesaria!',
|
||||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
|
||||||
=> 'Ya debería haber sido redireccionado al servidor CAS. Haga click <a href="%s">aquí</a> para continuar.',
|
=> 'Ya debería haber sido redireccionado al servidor CAS. Haga click <a href="%s">aquí</a> para continuar.',
|
||||||
CAS_STR_AUTHENTICATION_FAILED
|
CAS_STR_AUTHENTICATION_FAILED
|
||||||
=> '¡Autentificación CAS fallida!',
|
=> '¡Autentificación CAS fallida!',
|
||||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
|
||||||
=> '<p>No estás autentificado.</p><p>Puedes volver a intentarlo haciendo click <a href="%s">aquí</a>.</p><p>Si el problema persiste debería contactar con el <a href="mailto:%s">administrador de este sitio</a>.</p>',
|
=> '<p>No estás autentificado.</p><p>Puedes volver a intentarlo haciendo click <a href="%s">aquí</a>.</p><p>Si el problema persiste debería contactar con el <a href="mailto:%s">administrador de este sitio</a>.</p>',
|
||||||
CAS_STR_SERVICE_UNAVAILABLE
|
CAS_STR_SERVICE_UNAVAILABLE
|
||||||
=> 'El servicio `<b>%s</b>\' no está disponible (<b>%s</b>).'
|
=> 'El servicio `<b>%s</b>\' no está disponible (<b>%s</b>).'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+122
-122
@@ -1,122 +1,122 @@
|
|||||||
Sentences that contain all letters commonly used in a language
|
Sentences that contain all letters commonly used in a language
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2001-09-02
|
Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2001-09-02
|
||||||
|
|
||||||
This file is UTF-8 encoded.
|
This file is UTF-8 encoded.
|
||||||
|
|
||||||
|
|
||||||
Danish (da)
|
Danish (da)
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen
|
Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen
|
||||||
Wolther spillede på xylofon.
|
Wolther spillede på xylofon.
|
||||||
(= Quiz contestants were eating strawbery with cream while Wolther
|
(= Quiz contestants were eating strawbery with cream while Wolther
|
||||||
the circus clown played on xylophone.)
|
the circus clown played on xylophone.)
|
||||||
|
|
||||||
German (de)
|
German (de)
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Falsches Üben von Xylophonmusik quält jeden größeren Zwerg
|
Falsches Üben von Xylophonmusik quält jeden größeren Zwerg
|
||||||
(= Wrongful practicing of xylophone music tortures every larger dwarf)
|
(= Wrongful practicing of xylophone music tortures every larger dwarf)
|
||||||
|
|
||||||
Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich
|
Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich
|
||||||
(= Twelve boxing fighters hunted Eva across the dike of Sylt)
|
(= Twelve boxing fighters hunted Eva across the dike of Sylt)
|
||||||
|
|
||||||
Heizölrückstoßabdämpfung
|
Heizölrückstoßabdämpfung
|
||||||
(= fuel oil recoil absorber)
|
(= fuel oil recoil absorber)
|
||||||
(jqvwxy missing, but all non-ASCII letters in one word)
|
(jqvwxy missing, but all non-ASCII letters in one word)
|
||||||
|
|
||||||
English (en)
|
English (en)
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The quick brown fox jumps over the lazy dog
|
The quick brown fox jumps over the lazy dog
|
||||||
|
|
||||||
Spanish (es)
|
Spanish (es)
|
||||||
------------
|
------------
|
||||||
|
|
||||||
El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y
|
El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y
|
||||||
frío, añoraba a su querido cachorro.
|
frío, añoraba a su querido cachorro.
|
||||||
(Contains every letter and every accent, but not every combination
|
(Contains every letter and every accent, but not every combination
|
||||||
of vowel + acute.)
|
of vowel + acute.)
|
||||||
|
|
||||||
French (fr)
|
French (fr)
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à
|
Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à
|
||||||
côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce
|
côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce
|
||||||
qui lui permet de penser à la cænogenèse de l'être dont il est question
|
qui lui permet de penser à la cænogenèse de l'être dont il est question
|
||||||
dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui,
|
dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui,
|
||||||
pense-t-il, diminue çà et là la qualité de son œuvre.
|
pense-t-il, diminue çà et là la qualité de son œuvre.
|
||||||
|
|
||||||
l'île exiguë
|
l'île exiguë
|
||||||
Où l'obèse jury mûr
|
Où l'obèse jury mûr
|
||||||
Fête l'haï volapük,
|
Fête l'haï volapük,
|
||||||
Âne ex aéquo au whist,
|
Âne ex aéquo au whist,
|
||||||
Ôtez ce vœu déçu.
|
Ôtez ce vœu déçu.
|
||||||
|
|
||||||
Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en
|
Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en
|
||||||
canoë au delà des îles, près du mälström où brûlent les novæ.
|
canoë au delà des îles, près du mälström où brûlent les novæ.
|
||||||
|
|
||||||
Irish Gaelic (ga)
|
Irish Gaelic (ga)
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh
|
D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh
|
||||||
|
|
||||||
Hungarian (hu)
|
Hungarian (hu)
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Árvíztűrő tükörfúrógép
|
Árvíztűrő tükörfúrógép
|
||||||
(= flood-proof mirror-drilling machine, only all non-ASCII letters)
|
(= flood-proof mirror-drilling machine, only all non-ASCII letters)
|
||||||
|
|
||||||
Icelandic (is)
|
Icelandic (is)
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa
|
Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa
|
||||||
|
|
||||||
Sævör grét áðan því úlpan var ónýt
|
Sævör grét áðan því úlpan var ónýt
|
||||||
(some ASCII letters missing)
|
(some ASCII letters missing)
|
||||||
|
|
||||||
Greek (el)
|
Greek (el)
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο
|
Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο
|
||||||
(= No more shall I see acacias or myrtles in the golden clearing)
|
(= No more shall I see acacias or myrtles in the golden clearing)
|
||||||
|
|
||||||
Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία
|
Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία
|
||||||
(= I uncover the soul-destroying abhorrence)
|
(= I uncover the soul-destroying abhorrence)
|
||||||
|
|
||||||
Hebrew (iw)
|
Hebrew (iw)
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה
|
? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה
|
||||||
|
|
||||||
Polish (pl)
|
Polish (pl)
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Pchnąć w tę łódź jeża lub osiem skrzyń fig
|
Pchnąć w tę łódź jeża lub osiem skrzyń fig
|
||||||
(= To push a hedgehog or eight bins of figs in this boat)
|
(= To push a hedgehog or eight bins of figs in this boat)
|
||||||
|
|
||||||
Zażółć gęślą jaźń
|
Zażółć gęślą jaźń
|
||||||
|
|
||||||
Russian (ru)
|
Russian (ru)
|
||||||
------------
|
------------
|
||||||
|
|
||||||
В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
|
В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
|
||||||
(= Would a citrus live in the bushes of south? Yes, but only a fake one!)
|
(= Would a citrus live in the bushes of south? Yes, but only a fake one!)
|
||||||
|
|
||||||
Thai (th)
|
Thai (th)
|
||||||
---------
|
---------
|
||||||
|
|
||||||
[--------------------------|------------------------]
|
[--------------------------|------------------------]
|
||||||
๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน
|
๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน
|
||||||
จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร
|
จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร
|
||||||
ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย
|
ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย
|
||||||
ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ
|
ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ
|
||||||
|
|
||||||
[The copyright for the Thai example is owned by The Computer
|
[The copyright for the Thai example is owned by The Computer
|
||||||
Association of Thailand under the Royal Patronage of His Majesty the
|
Association of Thailand under the Royal Patronage of His Majesty the
|
||||||
King.]
|
King.]
|
||||||
|
|
||||||
Please let me know if you find others! Special thanks to the people
|
Please let me know if you find others! Special thanks to the people
|
||||||
from all over the world who contributed these sentences.
|
from all over the world who contributed these sentences.
|
||||||
|
|||||||
@@ -1,108 +1,108 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('tcpdf.php');
|
require_once('tcpdf.php');
|
||||||
|
|
||||||
class PDF extends TCPDF
|
class PDF extends TCPDF
|
||||||
{
|
{
|
||||||
function PDF($orientation='L', $unit='mm', $format='A4')
|
function PDF($orientation='L', $unit='mm', $format='A4')
|
||||||
{
|
{
|
||||||
parent::__construct($orientation,$unit,$format);
|
parent::__construct($orientation,$unit,$format);
|
||||||
$this->SetAutoPageBreak(true,10);
|
$this->SetAutoPageBreak(true,10);
|
||||||
$this->AliasNbPages();
|
$this->AliasNbPages();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function intopdf($text,$format='',$bStripHTML=true)
|
function intopdf($text,$format='',$bStripHTML=true)
|
||||||
{
|
{
|
||||||
if ($bStripHTML)
|
if ($bStripHTML)
|
||||||
{
|
{
|
||||||
$text = $this->delete_html($text);
|
$text = $this->delete_html($text);
|
||||||
}
|
}
|
||||||
$oldformat = $this->FontStyle;
|
$oldformat = $this->FontStyle;
|
||||||
$this->SetFont('',$format,$this->FontSizePt);
|
$this->SetFont('',$format,$this->FontSizePt);
|
||||||
$this->Write(5,$text);
|
$this->Write(5,$text);
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
$this->SetFont('',$oldformat,$this->FontSizePt);
|
$this->SetFont('',$oldformat,$this->FontSizePt);
|
||||||
}
|
}
|
||||||
function helptextintopdf($text)
|
function helptextintopdf($text)
|
||||||
{
|
{
|
||||||
$oldsize = $this->FontSizePt;
|
$oldsize = $this->FontSizePt;
|
||||||
$this->SetFontSize($oldsize-2);
|
$this->SetFontSize($oldsize-2);
|
||||||
$this->Write(5,$this->delete_html($text));
|
$this->Write(5,$this->delete_html($text));
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
$this->SetFontSize($oldsize);
|
$this->SetFontSize($oldsize);
|
||||||
}
|
}
|
||||||
function titleintopdf($title,$description='')
|
function titleintopdf($title,$description='')
|
||||||
{
|
{
|
||||||
if(!empty($title))
|
if(!empty($title))
|
||||||
{
|
{
|
||||||
$title = $this->delete_html($title);
|
$title = $this->delete_html($title);
|
||||||
$oldsize = $this->FontSizePt;
|
$oldsize = $this->FontSizePt;
|
||||||
$this->SetFontSize($oldsize+4);
|
$this->SetFontSize($oldsize+4);
|
||||||
$this->Line(5,$this->y,($this->w-5),$this->y);
|
$this->Line(5,$this->y,($this->w-5),$this->y);
|
||||||
$this->ln(3);
|
$this->ln(3);
|
||||||
$this->MultiCell('','',$title,'','C',0);
|
$this->MultiCell('','',$title,'','C',0);
|
||||||
if(!empty($description) && isset($description))
|
if(!empty($description) && isset($description))
|
||||||
{
|
{
|
||||||
$description = $this->delete_html($description);
|
$description = $this->delete_html($description);
|
||||||
$this->ln(7);
|
$this->ln(7);
|
||||||
$this->SetFontSize($oldsize+2);
|
$this->SetFontSize($oldsize+2);
|
||||||
$this->MultiCell('','',$description,'','C',0);
|
$this->MultiCell('','',$description,'','C',0);
|
||||||
$this->ln(2);
|
$this->ln(2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->ln(4);
|
$this->ln(4);
|
||||||
}
|
}
|
||||||
$this->Line(5,$this->y,($this->w-5),$this->y);
|
$this->Line(5,$this->y,($this->w-5),$this->y);
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
$this->SetFontSize($oldsize);
|
$this->SetFontSize($oldsize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function tableintopdf($array)
|
function tableintopdf($array)
|
||||||
{
|
{
|
||||||
$maxwidth = array();
|
$maxwidth = array();
|
||||||
$maxwidth = $this->getmaxwidth($array);
|
$maxwidth = $this->getmaxwidth($array);
|
||||||
for($a=0;$a<sizeof($array);$a++)
|
for($a=0;$a<sizeof($array);$a++)
|
||||||
{
|
{
|
||||||
for($b=0;$b<sizeof($array[$a]);$b++)
|
for($b=0;$b<sizeof($array[$a]);$b++)
|
||||||
{
|
{
|
||||||
$this->Cell($maxwidth[$b]*($this->FontSize),4,$this->delete_html($array[$a][$b]),0,0,'C');
|
$this->Cell($maxwidth[$b]*($this->FontSize),4,$this->delete_html($array[$a][$b]),0,0,'C');
|
||||||
}
|
}
|
||||||
$this->ln();
|
$this->ln();
|
||||||
}
|
}
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
}
|
}
|
||||||
function getmaxwidth($array)
|
function getmaxwidth($array)
|
||||||
{
|
{
|
||||||
for($i=0;$i<sizeof($array);$i++)
|
for($i=0;$i<sizeof($array);$i++)
|
||||||
{
|
{
|
||||||
for($j=0;$j<sizeof($array[$i]);$j++)
|
for($j=0;$j<sizeof($array[$i]);$j++)
|
||||||
{
|
{
|
||||||
if(($i-1)>=0)
|
if(($i-1)>=0)
|
||||||
{
|
{
|
||||||
if(strlen($array[($i-1)][$j]) < strlen($array[$i][$j]))
|
if(strlen($array[($i-1)][$j]) < strlen($array[$i][$j]))
|
||||||
{
|
{
|
||||||
$width[$j] = strlen($array[$i][$j]);
|
$width[$j] = strlen($array[$i][$j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$width[$j]=strlen($array[$i][$j]);
|
$width[$j]=strlen($array[$i][$j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ($width);
|
return ($width);
|
||||||
}
|
}
|
||||||
function write_out($name)
|
function write_out($name)
|
||||||
{
|
{
|
||||||
$this->Output($name,"D");
|
$this->Output($name,"D");
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_html($text)
|
function delete_html($text)
|
||||||
{
|
{
|
||||||
$text = html_entity_decode($text);
|
$text = html_entity_decode($text);
|
||||||
return strip_tags($text);
|
return strip_tags($text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,102 +1,102 @@
|
|||||||
<?php
|
<?php
|
||||||
$type='TrueTypeUnicode';
|
$type='TrueTypeUnicode';
|
||||||
$name='AlMohanad';
|
$name='AlMohanad';
|
||||||
$desc=array('Ascent'=>1093,'Descent'=>-509,'CapHeight'=>1093,'Flags'=>32,'FontBBox'=>'[-278 -507 1124 1093]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600);
|
$desc=array('Ascent'=>1093,'Descent'=>-509,'CapHeight'=>1093,'Flags'=>32,'FontBBox'=>'[-278 -507 1124 1093]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600);
|
||||||
$up=-136;
|
$up=-136;
|
||||||
$ut=64;
|
$ut=64;
|
||||||
$dw=600;
|
$dw=600;
|
||||||
$cw=array(
|
$cw=array(
|
||||||
0=>0,32=>139,33=>185,34=>308,35=>278,36=>278,37=>556,38=>463,39=>154,40=>185,41=>185,42=>278,43=>317,44=>139,45=>185,46=>139,
|
0=>0,32=>139,33=>185,34=>308,35=>278,36=>278,37=>556,38=>463,39=>154,40=>185,41=>185,42=>278,43=>317,44=>139,45=>185,46=>139,
|
||||||
47=>154,48=>278,49=>278,50=>278,51=>278,52=>278,53=>278,54=>278,55=>278,56=>278,57=>278,58=>185,59=>185,60=>317,61=>317,62=>317,
|
47=>154,48=>278,49=>278,50=>278,51=>278,52=>278,53=>278,54=>278,55=>278,56=>278,57=>278,58=>185,59=>185,60=>317,61=>317,62=>317,
|
||||||
63=>278,64=>517,65=>401,66=>371,67=>401,68=>402,69=>371,70=>339,71=>432,72=>430,73=>214,74=>278,75=>424,76=>369,77=>524,78=>401,
|
63=>278,64=>517,65=>401,66=>371,67=>401,68=>402,69=>371,70=>339,71=>432,72=>430,73=>214,74=>278,75=>424,76=>369,77=>524,78=>401,
|
||||||
79=>432,80=>339,81=>432,82=>396,83=>309,84=>371,85=>401,86=>401,87=>556,88=>401,89=>401,90=>371,91=>185,92=>154,93=>185,94=>323,
|
79=>432,80=>339,81=>432,82=>396,83=>309,84=>371,85=>401,86=>401,87=>556,88=>401,89=>401,90=>371,91=>185,92=>154,93=>185,94=>323,
|
||||||
95=>278,96=>185,97=>278,98=>309,99=>247,100=>309,101=>247,102=>185,103=>278,104=>309,105=>154,106=>185,107=>309,108=>154,109=>463,110=>309,
|
95=>278,96=>185,97=>278,98=>309,99=>247,100=>309,101=>247,102=>185,103=>278,104=>309,105=>154,106=>185,107=>309,108=>154,109=>463,110=>309,
|
||||||
111=>278,112=>309,113=>309,114=>247,115=>216,116=>185,117=>309,118=>278,119=>401,120=>278,121=>278,122=>247,123=>219,124=>122,125=>219,126=>289,
|
111=>278,112=>309,113=>309,114=>247,115=>216,116=>185,117=>309,118=>278,119=>401,120=>278,121=>278,122=>247,123=>219,124=>122,125=>219,126=>289,
|
||||||
8364=>278,1027=>339,8218=>185,1107=>254,8222=>278,8230=>556,8224=>278,8225=>278,710=>185,8240=>556,352=>309,8249=>185,338=>556,1036=>432,381=>371,1039=>432,
|
8364=>278,1027=>339,8218=>185,1107=>254,8222=>278,8230=>556,8224=>278,8225=>278,710=>185,8240=>556,352=>309,8249=>185,338=>556,1036=>432,381=>371,1039=>432,
|
||||||
8216=>185,8217=>185,8220=>278,8221=>278,8226=>194,8211=>278,8212=>556,732=>185,8482=>556,353=>216,8250=>185,339=>401,1116=>297,382=>247,376=>401,161=>185,
|
8216=>185,8217=>185,8220=>278,8221=>278,8226=>194,8211=>278,8212=>556,732=>185,8482=>556,353=>216,8250=>185,339=>401,1116=>297,382=>247,376=>401,161=>185,
|
||||||
162=>278,163=>278,164=>278,165=>278,166=>122,167=>278,168=>185,169=>415,170=>167,171=>278,172=>317,174=>415,175=>185,176=>222,177=>317,178=>167,
|
162=>278,163=>278,164=>278,165=>278,166=>122,167=>278,168=>185,169=>415,170=>167,171=>278,172=>317,174=>415,175=>185,176=>222,177=>317,178=>167,
|
||||||
179=>167,180=>185,181=>309,182=>300,183=>139,184=>185,185=>167,186=>183,187=>278,188=>417,189=>417,190=>417,191=>278,192=>401,193=>401,194=>401,
|
179=>167,180=>185,181=>309,182=>300,183=>139,184=>185,185=>167,186=>183,187=>278,188=>417,189=>417,190=>417,191=>278,192=>401,193=>401,194=>401,
|
||||||
195=>401,196=>401,197=>401,198=>556,199=>401,200=>371,201=>371,202=>371,203=>371,204=>216,205=>216,206=>216,207=>216,208=>401,209=>401,210=>432,
|
195=>401,196=>401,197=>401,198=>556,199=>401,200=>371,201=>371,202=>371,203=>371,204=>216,205=>216,206=>216,207=>216,208=>401,209=>401,210=>432,
|
||||||
211=>432,212=>432,213=>432,214=>432,215=>317,216=>432,217=>401,218=>401,219=>401,220=>401,221=>401,222=>339,223=>309,224=>278,225=>278,226=>278,
|
211=>432,212=>432,213=>432,214=>432,215=>317,216=>432,217=>401,218=>401,219=>401,220=>401,221=>401,222=>339,223=>309,224=>278,225=>278,226=>278,
|
||||||
227=>278,228=>278,229=>278,230=>401,231=>247,232=>247,233=>247,234=>247,235=>247,236=>154,237=>154,238=>154,239=>154,240=>278,241=>309,242=>278,
|
227=>278,228=>278,229=>278,230=>401,231=>247,232=>247,233=>247,234=>247,235=>247,236=>154,237=>154,238=>154,239=>154,240=>278,241=>309,242=>278,
|
||||||
243=>278,244=>278,245=>278,246=>278,247=>317,248=>278,249=>309,250=>309,251=>309,252=>309,253=>278,254=>309,255=>278,256=>401,257=>278,258=>401,
|
243=>278,244=>278,245=>278,246=>278,247=>317,248=>278,249=>309,250=>309,251=>309,252=>309,253=>278,254=>309,255=>278,256=>401,257=>278,258=>401,
|
||||||
259=>278,260=>401,261=>278,262=>401,263=>247,264=>401,265=>247,266=>401,267=>247,268=>401,269=>247,270=>401,271=>309,272=>401,273=>309,274=>371,
|
259=>278,260=>401,261=>278,262=>401,263=>247,264=>401,265=>247,266=>401,267=>247,268=>401,269=>247,270=>401,271=>309,272=>401,273=>309,274=>371,
|
||||||
275=>247,276=>371,277=>247,278=>371,279=>247,280=>371,281=>247,282=>371,283=>247,284=>432,285=>278,286=>432,287=>278,288=>432,289=>278,290=>432,
|
275=>247,276=>371,277=>247,278=>371,279=>247,280=>371,281=>247,282=>371,283=>247,284=>432,285=>278,286=>432,287=>278,288=>432,289=>278,290=>432,
|
||||||
291=>278,292=>432,293=>309,294=>432,295=>309,296=>216,297=>154,298=>216,299=>154,300=>216,301=>154,302=>216,303=>154,304=>216,305=>154,306=>490,
|
291=>278,292=>432,293=>309,294=>432,295=>309,296=>216,297=>154,298=>216,299=>154,300=>216,301=>154,302=>216,303=>154,304=>216,305=>154,306=>490,
|
||||||
307=>270,308=>278,309=>185,310=>432,311=>309,312=>297,313=>371,314=>154,315=>371,316=>154,317=>371,318=>154,319=>371,320=>293,321=>371,322=>154,
|
307=>270,308=>278,309=>185,310=>432,311=>309,312=>297,313=>371,314=>154,315=>371,316=>154,317=>371,318=>154,319=>371,320=>293,321=>371,322=>154,
|
||||||
323=>401,324=>309,325=>401,326=>309,327=>401,328=>309,329=>391,330=>401,331=>309,332=>432,333=>278,334=>432,335=>278,336=>432,337=>278,340=>401,
|
323=>401,324=>309,325=>401,326=>309,327=>401,328=>309,329=>391,330=>401,331=>309,332=>432,333=>278,334=>432,335=>278,336=>432,337=>278,340=>401,
|
||||||
341=>247,342=>401,343=>247,344=>401,345=>247,346=>309,347=>216,348=>309,349=>216,350=>309,351=>216,354=>371,355=>185,356=>371,357=>185,358=>371,
|
341=>247,342=>401,343=>247,344=>401,345=>247,346=>309,347=>216,348=>309,349=>216,350=>309,351=>216,354=>371,355=>185,356=>371,357=>185,358=>371,
|
||||||
359=>185,360=>401,361=>309,362=>401,363=>309,364=>401,365=>309,366=>401,367=>309,368=>401,369=>309,370=>401,371=>309,372=>556,373=>401,374=>401,
|
359=>185,360=>401,361=>309,362=>401,363=>309,364=>401,365=>309,366=>401,367=>309,368=>401,369=>309,370=>401,371=>309,372=>556,373=>401,374=>401,
|
||||||
375=>278,377=>371,378=>247,379=>371,380=>247,383=>185,450=>317,477=>247,484=>432,485=>278,536=>309,537=>216,538=>371,539=>185,658=>282,711=>185,
|
375=>278,377=>371,378=>247,379=>371,380=>247,383=>185,450=>317,477=>247,484=>432,485=>278,536=>309,537=>216,538=>371,539=>185,658=>282,711=>185,
|
||||||
728=>185,729=>185,730=>185,731=>185,733=>185,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,
|
728=>185,729=>185,730=>185,731=>185,733=>185,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,
|
||||||
779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,
|
779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,
|
||||||
795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,
|
795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,
|
||||||
811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,
|
811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,
|
||||||
827=>0,828=>0,829=>0,830=>0,831=>0,864=>0,865=>0,884=>111,885=>111,890=>0,894=>185,900=>100,901=>183,902=>401,903=>139,904=>451,
|
827=>0,828=>0,829=>0,830=>0,831=>0,864=>0,865=>0,884=>111,885=>111,890=>0,894=>185,900=>100,901=>183,902=>401,903=>139,904=>451,
|
||||||
905=>532,906=>316,908=>451,910=>501,911=>451,912=>183,913=>401,914=>371,915=>339,916=>422,917=>371,918=>371,919=>432,920=>432,921=>216,922=>432,
|
905=>532,906=>316,908=>451,910=>501,911=>451,912=>183,913=>401,914=>371,915=>339,916=>422,917=>371,918=>371,919=>432,920=>432,921=>216,922=>432,
|
||||||
923=>401,924=>524,925=>401,926=>361,927=>432,928=>451,929=>339,931=>361,932=>371,933=>401,934=>482,935=>401,936=>482,937=>451,938=>0,939=>401,
|
923=>401,924=>524,925=>401,926=>361,927=>432,928=>451,929=>339,931=>361,932=>371,933=>401,934=>482,935=>401,936=>482,937=>451,938=>0,939=>401,
|
||||||
940=>336,941=>244,942=>336,943=>183,944=>306,945=>336,946=>306,947=>306,948=>306,949=>244,950=>275,951=>336,952=>306,953=>183,954=>338,955=>275,
|
940=>336,941=>244,942=>336,943=>183,944=>306,945=>336,946=>306,947=>306,948=>306,949=>244,950=>275,951=>336,952=>306,953=>183,954=>338,955=>275,
|
||||||
956=>336,957=>275,958=>275,959=>306,960=>336,961=>306,962=>244,963=>306,964=>244,965=>306,966=>367,967=>275,968=>397,969=>397,970=>183,971=>306,
|
956=>336,957=>275,958=>275,959=>306,960=>336,961=>306,962=>244,963=>306,964=>244,965=>306,966=>367,967=>275,968=>397,969=>397,970=>183,971=>306,
|
||||||
972=>306,973=>306,974=>397,976=>306,977=>306,978=>401,979=>401,980=>401,981=>367,982=>336,986=>283,987=>237,988=>339,989=>261,1024=>371,1025=>371,
|
972=>306,973=>306,974=>397,976=>306,977=>306,978=>401,979=>401,980=>401,981=>367,982=>336,986=>283,987=>237,988=>339,989=>261,1024=>371,1025=>371,
|
||||||
1026=>371,1028=>401,1029=>309,1030=>216,1031=>216,1032=>278,1033=>573,1034=>573,1035=>449,1037=>432,1038=>401,1040=>401,1041=>371,1042=>371,1043=>328,1044=>432,
|
1026=>371,1028=>401,1029=>309,1030=>216,1031=>216,1032=>278,1033=>573,1034=>573,1035=>449,1037=>432,1038=>401,1040=>401,1041=>371,1042=>371,1043=>328,1044=>432,
|
||||||
1045=>371,1046=>615,1047=>313,1048=>429,1049=>429,1050=>424,1051=>432,1052=>524,1053=>432,1054=>432,1055=>430,1056=>339,1057=>401,1058=>371,1059=>401,1060=>444,
|
1045=>371,1046=>615,1047=>313,1048=>429,1049=>429,1050=>424,1051=>432,1052=>524,1053=>432,1054=>432,1055=>430,1056=>339,1057=>401,1058=>371,1059=>401,1060=>444,
|
||||||
1061=>401,1062=>429,1063=>432,1064=>618,1065=>618,1066=>482,1067=>539,1068=>350,1069=>401,1070=>619,1071=>408,1072=>278,1073=>278,1074=>279,1075=>246,1076=>309,
|
1061=>401,1062=>429,1063=>432,1064=>618,1065=>618,1066=>482,1067=>539,1068=>350,1069=>401,1070=>619,1071=>408,1072=>278,1073=>278,1074=>279,1075=>246,1076=>309,
|
||||||
1077=>247,1078=>417,1079=>227,1080=>319,1081=>319,1082=>297,1083=>302,1084=>376,1085=>309,1086=>278,1087=>309,1088=>309,1089=>247,1090=>274,1091=>278,1092=>458,
|
1077=>247,1078=>417,1079=>227,1080=>319,1081=>319,1082=>297,1083=>302,1084=>376,1085=>309,1086=>278,1087=>309,1088=>309,1089=>247,1090=>274,1091=>278,1092=>458,
|
||||||
1093=>278,1094=>309,1095=>309,1096=>454,1097=>454,1098=>340,1099=>423,1100=>284,1101=>247,1102=>439,1103=>284,1104=>247,1105=>247,1106=>309,1108=>247,1109=>216,
|
1093=>278,1094=>309,1095=>309,1096=>454,1097=>454,1098=>340,1099=>423,1100=>284,1101=>247,1102=>439,1103=>284,1104=>247,1105=>247,1106=>309,1108=>247,1109=>216,
|
||||||
1110=>154,1111=>154,1112=>185,1113=>440,1114=>437,1115=>309,1117=>309,1118=>278,1119=>309,1164=>339,1165=>284,1166=>339,1167=>309,1168=>339,1169=>254,1170=>339,
|
1110=>154,1111=>154,1112=>185,1113=>440,1114=>437,1115=>309,1117=>309,1118=>278,1119=>309,1164=>339,1165=>284,1166=>339,1167=>309,1168=>339,1169=>254,1170=>339,
|
||||||
1171=>254,1172=>339,1173=>254,1174=>615,1175=>417,1176=>322,1177=>216,1178=>432,1179=>297,1180=>432,1181=>297,1182=>432,1183=>297,1184=>537,1185=>352,1186=>432,
|
1171=>254,1172=>339,1173=>254,1174=>615,1175=>417,1176=>322,1177=>216,1178=>432,1179=>297,1180=>432,1181=>297,1182=>432,1183=>297,1184=>537,1185=>352,1186=>432,
|
||||||
1187=>309,1188=>563,1189=>408,1190=>432,1191=>461,1192=>401,1193=>247,1194=>401,1195=>247,1196=>371,1197=>274,1198=>401,1199=>278,1200=>401,1201=>278,1202=>401,
|
1187=>309,1188=>563,1189=>408,1190=>432,1191=>461,1192=>401,1193=>247,1194=>401,1195=>247,1196=>371,1197=>274,1198=>401,1199=>278,1200=>401,1201=>278,1202=>401,
|
||||||
1203=>278,1204=>581,1205=>432,1206=>432,1207=>309,1208=>432,1209=>309,1210=>432,1211=>309,1212=>367,1213=>247,1214=>367,1215=>247,1216=>216,1217=>615,1218=>417,
|
1203=>278,1204=>581,1205=>432,1206=>432,1207=>309,1208=>432,1209=>309,1210=>432,1211=>309,1212=>367,1213=>247,1214=>367,1215=>247,1216=>216,1217=>615,1218=>417,
|
||||||
1219=>432,1220=>297,1223=>432,1224=>309,1227=>432,1228=>309,1232=>401,1233=>278,1234=>401,1235=>278,1236=>556,1237=>401,1238=>371,1239=>247,1240=>367,1241=>247,
|
1219=>432,1220=>297,1223=>432,1224=>309,1227=>432,1228=>309,1232=>401,1233=>278,1234=>401,1235=>278,1236=>556,1237=>401,1238=>371,1239=>247,1240=>367,1241=>247,
|
||||||
1242=>367,1243=>247,1244=>615,1245=>417,1246=>313,1247=>227,1248=>322,1249=>216,1250=>432,1251=>309,1252=>432,1253=>309,1254=>432,1255=>278,1256=>432,1257=>278,
|
1242=>367,1243=>247,1244=>615,1245=>417,1246=>313,1247=>227,1248=>322,1249=>216,1250=>432,1251=>309,1252=>432,1253=>309,1254=>432,1255=>278,1256=>432,1257=>278,
|
||||||
1258=>432,1259=>278,1260=>401,1261=>247,1262=>401,1263=>278,1264=>401,1265=>278,1266=>401,1267=>278,1268=>432,1269=>309,1272=>548,1273=>423,1488=>280,1489=>280,
|
1258=>432,1259=>278,1260=>401,1261=>247,1262=>401,1263=>278,1264=>401,1265=>278,1266=>401,1267=>278,1268=>432,1269=>309,1272=>548,1273=>423,1488=>280,1489=>280,
|
||||||
1490=>174,1491=>280,1492=>280,1493=>158,1494=>158,1495=>280,1496=>280,1497=>158,1498=>287,1499=>280,1500=>280,1501=>280,1502=>280,1503=>156,1504=>158,1505=>280,
|
1490=>174,1491=>280,1492=>280,1493=>158,1494=>158,1495=>280,1496=>280,1497=>158,1498=>287,1499=>280,1500=>280,1501=>280,1502=>280,1503=>156,1504=>158,1505=>280,
|
||||||
1506=>280,1507=>292,1508=>280,1509=>273,1510=>280,1511=>305,1512=>285,1513=>299,1514=>280,1548=>195,1563=>246,1567=>340,1569=>392,1570=>306,1571=>247,1572=>447,
|
1506=>280,1507=>292,1508=>280,1509=>273,1510=>280,1511=>305,1512=>285,1513=>299,1514=>280,1548=>195,1563=>246,1567=>340,1569=>392,1570=>306,1571=>247,1572=>447,
|
||||||
1573=>247,1574=>602,1575=>192,1576=>635,1577=>369,1578=>635,1579=>635,1580=>548,1581=>1173,1582=>548,1583=>363,1584=>363,1585=>439,1586=>442,1587=>875,1588=>875,
|
1573=>247,1574=>602,1575=>192,1576=>635,1577=>369,1578=>635,1579=>635,1580=>548,1581=>1173,1582=>548,1583=>363,1584=>363,1585=>439,1586=>442,1587=>875,1588=>875,
|
||||||
1589=>1061,1590=>1061,1591=>811,1592=>811,1593=>549,1594=>547,1600=>389,1601=>755,1602=>574,1603=>717,1604=>555,1605=>423,1606=>532,1607=>371,1608=>454,1609=>633,
|
1589=>1061,1590=>1061,1591=>811,1592=>811,1593=>549,1594=>547,1600=>389,1601=>755,1602=>574,1603=>717,1604=>555,1605=>423,1606=>532,1607=>371,1608=>454,1609=>633,
|
||||||
1610=>643,1611=>-19,1612=>-26,1613=>-20,1614=>-19,1615=>-18,1616=>-19,1617=>-19,1618=>-15,1632=>383,1633=>383,1634=>383,1635=>383,1636=>383,1637=>383,1638=>383,
|
1610=>643,1611=>-19,1612=>-26,1613=>-20,1614=>-19,1615=>-18,1616=>-19,1617=>-19,1618=>-15,1632=>383,1633=>383,1634=>383,1635=>383,1636=>383,1637=>383,1638=>383,
|
||||||
1639=>383,1640=>383,1641=>383,1642=>383,1645=>398,7936=>336,7937=>336,7938=>336,7939=>336,7940=>336,7941=>336,7942=>336,7943=>336,7944=>401,7945=>401,7946=>401,
|
1639=>383,1640=>383,1641=>383,1642=>383,1645=>398,7936=>336,7937=>336,7938=>336,7939=>336,7940=>336,7941=>336,7942=>336,7943=>336,7944=>401,7945=>401,7946=>401,
|
||||||
7947=>401,7948=>401,7949=>401,7950=>401,7951=>401,7952=>244,7953=>244,7954=>244,7955=>244,7956=>244,7957=>244,7960=>371,7961=>371,7962=>371,7963=>371,7964=>371,
|
7947=>401,7948=>401,7949=>401,7950=>401,7951=>401,7952=>244,7953=>244,7954=>244,7955=>244,7956=>244,7957=>244,7960=>371,7961=>371,7962=>371,7963=>371,7964=>371,
|
||||||
7965=>371,7968=>336,7969=>336,7970=>336,7971=>336,7972=>336,7973=>336,7974=>336,7975=>336,7976=>432,7977=>432,7978=>432,7979=>432,7980=>432,7981=>432,7982=>432,
|
7965=>371,7968=>336,7969=>336,7970=>336,7971=>336,7972=>336,7973=>336,7974=>336,7975=>336,7976=>432,7977=>432,7978=>432,7979=>432,7980=>432,7981=>432,7982=>432,
|
||||||
7983=>432,7984=>183,7985=>183,7986=>183,7987=>183,7988=>183,7989=>183,7990=>183,7991=>183,7992=>216,7993=>216,7994=>216,7995=>216,7996=>216,7997=>216,7998=>216,
|
7983=>432,7984=>183,7985=>183,7986=>183,7987=>183,7988=>183,7989=>183,7990=>183,7991=>183,7992=>216,7993=>216,7994=>216,7995=>216,7996=>216,7997=>216,7998=>216,
|
||||||
7999=>216,8000=>306,8001=>306,8002=>306,8003=>306,8004=>306,8005=>306,8008=>432,8009=>432,8010=>432,8011=>432,8012=>432,8013=>432,8016=>306,8017=>306,8018=>306,
|
7999=>216,8000=>306,8001=>306,8002=>306,8003=>306,8004=>306,8005=>306,8008=>432,8009=>432,8010=>432,8011=>432,8012=>432,8013=>432,8016=>306,8017=>306,8018=>306,
|
||||||
8019=>306,8020=>306,8021=>306,8022=>306,8023=>306,8025=>401,8027=>401,8029=>401,8031=>401,8032=>397,8033=>397,8034=>397,8035=>397,8036=>397,8037=>397,8038=>397,
|
8019=>306,8020=>306,8021=>306,8022=>306,8023=>306,8025=>401,8027=>401,8029=>401,8031=>401,8032=>397,8033=>397,8034=>397,8035=>397,8036=>397,8037=>397,8038=>397,
|
||||||
8039=>397,8040=>451,8041=>451,8042=>451,8043=>451,8044=>451,8045=>451,8046=>451,8047=>451,8048=>336,8049=>336,8050=>244,8051=>244,8052=>336,8053=>336,8054=>183,
|
8039=>397,8040=>451,8041=>451,8042=>451,8043=>451,8044=>451,8045=>451,8046=>451,8047=>451,8048=>336,8049=>336,8050=>244,8051=>244,8052=>336,8053=>336,8054=>183,
|
||||||
8055=>183,8056=>306,8057=>306,8058=>306,8059=>306,8060=>397,8061=>397,8064=>336,8065=>336,8066=>336,8067=>336,8068=>336,8069=>336,8070=>336,8071=>336,8072=>401,
|
8055=>183,8056=>306,8057=>306,8058=>306,8059=>306,8060=>397,8061=>397,8064=>336,8065=>336,8066=>336,8067=>336,8068=>336,8069=>336,8070=>336,8071=>336,8072=>401,
|
||||||
8073=>401,8074=>401,8075=>401,8076=>401,8077=>401,8078=>401,8079=>401,8080=>336,8081=>336,8082=>336,8083=>336,8084=>336,8085=>336,8086=>336,8087=>336,8088=>432,
|
8073=>401,8074=>401,8075=>401,8076=>401,8077=>401,8078=>401,8079=>401,8080=>336,8081=>336,8082=>336,8083=>336,8084=>336,8085=>336,8086=>336,8087=>336,8088=>432,
|
||||||
8089=>432,8090=>432,8091=>432,8092=>432,8093=>432,8094=>432,8095=>432,8096=>397,8097=>397,8098=>397,8099=>397,8100=>397,8101=>397,8102=>397,8103=>397,8104=>451,
|
8089=>432,8090=>432,8091=>432,8092=>432,8093=>432,8094=>432,8095=>432,8096=>397,8097=>397,8098=>397,8099=>397,8100=>397,8101=>397,8102=>397,8103=>397,8104=>451,
|
||||||
8105=>451,8106=>451,8107=>451,8108=>451,8109=>451,8110=>451,8111=>451,8112=>336,8113=>336,8114=>336,8115=>336,8116=>336,8118=>336,8119=>336,8120=>401,8121=>401,
|
8105=>451,8106=>451,8107=>451,8108=>451,8109=>451,8110=>451,8111=>451,8112=>336,8113=>336,8114=>336,8115=>336,8116=>336,8118=>336,8119=>336,8120=>401,8121=>401,
|
||||||
8122=>401,8123=>401,8124=>401,8125=>278,8126=>0,8127=>278,8128=>278,8129=>306,8130=>336,8131=>336,8132=>336,8134=>336,8135=>336,8136=>371,8137=>371,8138=>432,
|
8122=>401,8123=>401,8124=>401,8125=>278,8126=>0,8127=>278,8128=>278,8129=>306,8130=>336,8131=>336,8132=>336,8134=>336,8135=>336,8136=>371,8137=>371,8138=>432,
|
||||||
8139=>432,8140=>432,8141=>278,8142=>278,8143=>278,8144=>183,8145=>183,8146=>183,8147=>183,8150=>183,8151=>183,8152=>216,8153=>216,8154=>216,8155=>216,8157=>278,
|
8139=>432,8140=>432,8141=>278,8142=>278,8143=>278,8144=>183,8145=>183,8146=>183,8147=>183,8150=>183,8151=>183,8152=>216,8153=>216,8154=>216,8155=>216,8157=>278,
|
||||||
8158=>278,8159=>278,8160=>306,8161=>306,8162=>306,8163=>306,8164=>306,8165=>306,8166=>306,8167=>306,8168=>401,8169=>401,8170=>401,8171=>401,8172=>339,8173=>306,
|
8158=>278,8159=>278,8160=>306,8161=>306,8162=>306,8163=>306,8164=>306,8165=>306,8166=>306,8167=>306,8168=>401,8169=>401,8170=>401,8171=>401,8172=>339,8173=>306,
|
||||||
8174=>306,8175=>278,8178=>397,8179=>397,8180=>397,8182=>397,8183=>397,8184=>432,8185=>432,8186=>451,8187=>451,8188=>451,8189=>278,8190=>278,8208=>185,8209=>185,
|
8174=>306,8175=>278,8178=>397,8179=>397,8180=>397,8182=>397,8183=>397,8184=>432,8185=>432,8186=>451,8187=>451,8188=>451,8189=>278,8190=>278,8208=>185,8209=>185,
|
||||||
8219=>185,8223=>278,8227=>311,8241=>1011,8248=>261,8251=>404,8253=>386,8255=>529,8256=>529,8257=>188,8258=>517,8259=>185,8260=>93,8261=>184,8262=>184,8267=>300,
|
8219=>185,8223=>278,8227=>311,8241=>1011,8248=>261,8251=>404,8253=>386,8255=>529,8256=>529,8257=>188,8258=>517,8259=>185,8260=>93,8261=>184,8262=>184,8267=>300,
|
||||||
8308=>167,8309=>556,8321=>167,8322=>167,8323=>167,8324=>167,8352=>394,8353=>401,8354=>435,8355=>339,8356=>278,8357=>463,8358=>401,8359=>389,8361=>556,8470=>530,
|
8308=>167,8309=>556,8321=>167,8322=>167,8323=>167,8324=>167,8352=>394,8353=>401,8354=>435,8355=>339,8356=>278,8357=>463,8358=>401,8359=>389,8361=>556,8470=>530,
|
||||||
8471=>415,8479=>401,8483=>401,8486=>451,8487=>451,8494=>306,8498=>339,8543=>417,8706=>274,8710=>340,8721=>396,8722=>317,8730=>305,8734=>418,8800=>317,8804=>317,
|
8471=>415,8479=>401,8483=>401,8486=>451,8487=>451,8494=>306,8498=>339,8543=>417,8706=>274,8710=>340,8721=>396,8722=>317,8730=>305,8734=>418,8800=>317,8804=>317,
|
||||||
8805=>317,9674=>274,12353=>556,12354=>556,12355=>556,12356=>556,12357=>556,12358=>556,12359=>556,12360=>556,12361=>556,12362=>556,12363=>556,12364=>556,12365=>556,12366=>556,
|
8805=>317,9674=>274,12353=>556,12354=>556,12355=>556,12356=>556,12357=>556,12358=>556,12359=>556,12360=>556,12361=>556,12362=>556,12363=>556,12364=>556,12365=>556,12366=>556,
|
||||||
12367=>556,12368=>556,12369=>556,12370=>556,12371=>556,12372=>556,12373=>556,12374=>556,12375=>556,12376=>556,12377=>556,12378=>556,12379=>556,12380=>556,12381=>556,12382=>556,
|
12367=>556,12368=>556,12369=>556,12370=>556,12371=>556,12372=>556,12373=>556,12374=>556,12375=>556,12376=>556,12377=>556,12378=>556,12379=>556,12380=>556,12381=>556,12382=>556,
|
||||||
12383=>556,12384=>556,12385=>556,12386=>556,12387=>556,12388=>556,12389=>556,12390=>556,12391=>556,12392=>556,12393=>556,12394=>556,12395=>556,12396=>556,12397=>556,12398=>556,
|
12383=>556,12384=>556,12385=>556,12386=>556,12387=>556,12388=>556,12389=>556,12390=>556,12391=>556,12392=>556,12393=>556,12394=>556,12395=>556,12396=>556,12397=>556,12398=>556,
|
||||||
12399=>556,12400=>556,12401=>556,12402=>556,12403=>556,12404=>556,12405=>556,12406=>556,12407=>556,12408=>556,12409=>556,12410=>556,12411=>556,12412=>556,12413=>556,12414=>556,
|
12399=>556,12400=>556,12401=>556,12402=>556,12403=>556,12404=>556,12405=>556,12406=>556,12407=>556,12408=>556,12409=>556,12410=>556,12411=>556,12412=>556,12413=>556,12414=>556,
|
||||||
12415=>556,12416=>556,12417=>556,12418=>556,12419=>556,12420=>556,12421=>556,12422=>556,12423=>556,12424=>556,12425=>556,12426=>556,12427=>556,12428=>556,12429=>556,12430=>556,
|
12415=>556,12416=>556,12417=>556,12418=>556,12419=>556,12420=>556,12421=>556,12422=>556,12423=>556,12424=>556,12425=>556,12426=>556,12427=>556,12428=>556,12429=>556,12430=>556,
|
||||||
12431=>556,12432=>556,12433=>556,12434=>556,12435=>556,12449=>556,12450=>556,12451=>556,12452=>556,12453=>556,12454=>556,12455=>556,12456=>556,12457=>556,12458=>556,12459=>556,
|
12431=>556,12432=>556,12433=>556,12434=>556,12435=>556,12449=>556,12450=>556,12451=>556,12452=>556,12453=>556,12454=>556,12455=>556,12456=>556,12457=>556,12458=>556,12459=>556,
|
||||||
12460=>556,12461=>556,12462=>556,12463=>556,12464=>556,12465=>556,12466=>556,12467=>556,12468=>556,12469=>556,12470=>556,12471=>556,12472=>556,12473=>556,12474=>556,12475=>556,
|
12460=>556,12461=>556,12462=>556,12463=>556,12464=>556,12465=>556,12466=>556,12467=>556,12468=>556,12469=>556,12470=>556,12471=>556,12472=>556,12473=>556,12474=>556,12475=>556,
|
||||||
12476=>556,12477=>556,12478=>556,12479=>556,12480=>556,12481=>556,12482=>556,12483=>556,12484=>556,12485=>556,12486=>556,12487=>556,12488=>556,12489=>556,12490=>556,12491=>556,
|
12476=>556,12477=>556,12478=>556,12479=>556,12480=>556,12481=>556,12482=>556,12483=>556,12484=>556,12485=>556,12486=>556,12487=>556,12488=>556,12489=>556,12490=>556,12491=>556,
|
||||||
12492=>556,12493=>556,12494=>556,12495=>556,12496=>556,12497=>556,12498=>556,12499=>556,12500=>556,12501=>556,12502=>556,12503=>556,12504=>556,12505=>556,12506=>556,12507=>556,
|
12492=>556,12493=>556,12494=>556,12495=>556,12496=>556,12497=>556,12498=>556,12499=>556,12500=>556,12501=>556,12502=>556,12503=>556,12504=>556,12505=>556,12506=>556,12507=>556,
|
||||||
12508=>556,12509=>556,12510=>556,12511=>556,12512=>556,12513=>556,12514=>556,12515=>556,12516=>556,12517=>556,12518=>556,12519=>556,12520=>556,12521=>556,12522=>556,12523=>556,
|
12508=>556,12509=>556,12510=>556,12511=>556,12512=>556,12513=>556,12514=>556,12515=>556,12516=>556,12517=>556,12518=>556,12519=>556,12520=>556,12521=>556,12522=>556,12523=>556,
|
||||||
12524=>556,12525=>556,12526=>556,12527=>556,12528=>556,12529=>556,12530=>556,12531=>556,12532=>556,12533=>556,12534=>556,63033=>278,63034=>278,63035=>278,63036=>278,63037=>278,
|
12524=>556,12525=>556,12526=>556,12527=>556,12528=>556,12529=>556,12530=>556,12531=>556,12532=>556,12533=>556,12534=>556,63033=>278,63034=>278,63035=>278,63036=>278,63037=>278,
|
||||||
63038=>278,63039=>278,63040=>278,63041=>278,63171=>185,63196=>278,64256=>309,64257=>309,64258=>309,64259=>463,64260=>463,64262=>402,64606=>0,64607=>0,64608=>0,64609=>0,
|
63038=>278,63039=>278,63040=>278,63041=>278,63171=>185,63196=>278,64256=>309,64257=>309,64258=>309,64259=>463,64260=>463,64262=>402,64606=>0,64607=>0,64608=>0,64609=>0,
|
||||||
64610=>0,64830=>467,64831=>467,65010=>814,65152=>392,65153=>306,65154=>281,65155=>247,65156=>250,65157=>447,65158=>412,65159=>247,65160=>222,65161=>602,65162=>535,65163=>360,
|
64610=>0,64830=>467,64831=>467,65010=>814,65152=>392,65153=>306,65154=>281,65155=>247,65156=>250,65157=>447,65158=>412,65159=>247,65160=>222,65161=>602,65162=>535,65163=>360,
|
||||||
65164=>329,65165=>192,65166=>220,65167=>635,65168=>644,65169=>338,65170=>321,65171=>369,65172=>419,65173=>635,65174=>644,65175=>345,65176=>336,65177=>635,65178=>644,65179=>393,
|
65164=>329,65165=>192,65166=>220,65167=>635,65168=>644,65169=>338,65170=>321,65171=>369,65172=>419,65173=>635,65174=>644,65175=>345,65176=>336,65177=>635,65178=>644,65179=>393,
|
||||||
65180=>345,65181=>548,65182=>553,65183=>637,65184=>652,65185=>548,65186=>546,65187=>637,65188=>656,65189=>548,65190=>544,65191=>637,65192=>656,65193=>363,65194=>439,65195=>363,
|
65180=>345,65181=>548,65182=>553,65183=>637,65184=>652,65185=>548,65186=>546,65187=>637,65188=>656,65189=>548,65190=>544,65191=>637,65192=>656,65193=>363,65194=>439,65195=>363,
|
||||||
65196=>439,65197=>440,65198=>471,65199=>439,65200=>474,65201=>875,65202=>871,65203=>608,65204=>588,65205=>875,65206=>871,65207=>609,65208=>587,65209=>1061,65210=>1033,65211=>794,
|
65196=>439,65197=>440,65198=>471,65199=>439,65200=>474,65201=>875,65202=>871,65203=>608,65204=>588,65205=>875,65206=>871,65207=>609,65208=>587,65209=>1061,65210=>1033,65211=>794,
|
||||||
65212=>758,65213=>1061,65214=>1033,65215=>794,65216=>761,65217=>811,65218=>793,65219=>659,65220=>647,65221=>811,65222=>793,65223=>659,65224=>642,65225=>549,65226=>481,65227=>512,
|
65212=>758,65213=>1061,65214=>1033,65215=>794,65216=>761,65217=>811,65218=>793,65219=>659,65220=>647,65221=>811,65222=>793,65223=>659,65224=>642,65225=>549,65226=>481,65227=>512,
|
||||||
65228=>409,65229=>547,65230=>476,65231=>512,65232=>409,65233=>755,65234=>748,65235=>416,65236=>442,65237=>574,65238=>550,65239=>416,65240=>442,65241=>717,65242=>687,65243=>883,
|
65228=>409,65229=>547,65230=>476,65231=>512,65232=>409,65233=>755,65234=>748,65235=>416,65236=>442,65237=>574,65238=>550,65239=>416,65240=>442,65241=>717,65242=>687,65243=>883,
|
||||||
65244=>409,65245=>555,65246=>511,65247=>338,65248=>297,65249=>423,65250=>478,65251=>489,65252=>476,65253=>532,65254=>548,65255=>336,65256=>326,65257=>371,65258=>391,65259=>524,
|
65244=>409,65245=>555,65246=>511,65247=>338,65248=>297,65249=>423,65250=>478,65251=>489,65252=>476,65253=>532,65254=>548,65255=>336,65256=>326,65257=>371,65258=>391,65259=>524,
|
||||||
65260=>412,65261=>454,65262=>412,65263=>633,65264=>566,65265=>643,65266=>560,65267=>357,65268=>333,65269=>623,65270=>617,65271=>603,65272=>621,65273=>576,65274=>617,65275=>576,
|
65260=>412,65261=>454,65262=>412,65263=>633,65264=>566,65265=>643,65266=>560,65267=>357,65268=>333,65269=>623,65270=>617,65271=>603,65272=>621,65273=>576,65274=>617,65275=>576,
|
||||||
65276=>625);
|
65276=>625);
|
||||||
$enc='';
|
$enc='';
|
||||||
$diff='';
|
$diff='';
|
||||||
$file='almohanad.z';
|
$file='almohanad.z';
|
||||||
$ctg='almohanad.ctg.z';
|
$ctg='almohanad.ctg.z';
|
||||||
$originalsize=227760;
|
$originalsize=227760;
|
||||||
// --- EOF ---
|
// --- EOF ---
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
// core font definition file for TCPDF (www.tcpdf.org)
|
// core font definition file for TCPDF (www.tcpdf.org)
|
||||||
$type='core';
|
$type='core';
|
||||||
$dw=500;
|
$dw=500;
|
||||||
$cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,
|
$cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,
|
||||||
10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,
|
10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,
|
||||||
20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,
|
20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,
|
||||||
30=>250,31=>250,32=>250,33=>333,34=>713,35=>500,36=>549,37=>833,38=>778,39=>439,
|
30=>250,31=>250,32=>250,33=>333,34=>713,35=>500,36=>549,37=>833,38=>778,39=>439,
|
||||||
40=>333,41=>333,42=>500,43=>549,44=>250,45=>549,46=>250,47=>278,48=>500,49=>500,
|
40=>333,41=>333,42=>500,43=>549,44=>250,45=>549,46=>250,47=>278,48=>500,49=>500,
|
||||||
50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278,
|
50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278,
|
||||||
60=>549,61=>549,62=>549,63=>444,64=>549,65=>722,66=>667,67=>722,68=>612,69=>611,
|
60=>549,61=>549,62=>549,63=>444,64=>549,65=>722,66=>667,67=>722,68=>612,69=>611,
|
||||||
70=>763,71=>603,72=>722,73=>333,74=>631,75=>722,76=>686,77=>889,78=>722,79=>722,
|
70=>763,71=>603,72=>722,73=>333,74=>631,75=>722,76=>686,77=>889,78=>722,79=>722,
|
||||||
80=>768,81=>741,82=>556,83=>592,84=>611,85=>690,86=>439,87=>768,88=>645,89=>795,
|
80=>768,81=>741,82=>556,83=>592,84=>611,85=>690,86=>439,87=>768,88=>645,89=>795,
|
||||||
90=>611,91=>333,92=>863,93=>333,94=>658,95=>500,96=>500,97=>631,98=>549,99=>549,
|
90=>611,91=>333,92=>863,93=>333,94=>658,95=>500,96=>500,97=>631,98=>549,99=>549,
|
||||||
100=>494,101=>439,102=>521,103=>411,104=>603,105=>329,106=>603,107=>549,108=>549,
|
100=>494,101=>439,102=>521,103=>411,104=>603,105=>329,106=>603,107=>549,108=>549,
|
||||||
109=>576,110=>521,111=>549,112=>549,113=>521,114=>549,115=>603,116=>439,117=>576,
|
109=>576,110=>521,111=>549,112=>549,113=>521,114=>549,115=>603,116=>439,117=>576,
|
||||||
118=>713,119=>686,120=>493,121=>686,122=>494,123=>480,124=>200,125=>480,126=>549,
|
118=>713,119=>686,120=>493,121=>686,122=>494,123=>480,124=>200,125=>480,126=>549,
|
||||||
127=>0,128=>0,129=>0,130=>0,131=>0,132=>0,133=>0,134=>0,135=>0,136=>0,137=>0,
|
127=>0,128=>0,129=>0,130=>0,131=>0,132=>0,133=>0,134=>0,135=>0,136=>0,137=>0,
|
||||||
138=>0,139=>0,140=>0,141=>0,142=>0,143=>0,144=>0,145=>0,146=>0,147=>0,148=>0,
|
138=>0,139=>0,140=>0,141=>0,142=>0,143=>0,144=>0,145=>0,146=>0,147=>0,148=>0,
|
||||||
149=>0,150=>0,151=>0,152=>0,153=>0,154=>0,155=>0,156=>0,157=>0,158=>0,159=>0,
|
149=>0,150=>0,151=>0,152=>0,153=>0,154=>0,155=>0,156=>0,157=>0,158=>0,159=>0,
|
||||||
160=>750,161=>620,162=>247,163=>549,164=>167,165=>713,166=>500,167=>753,168=>753,
|
160=>750,161=>620,162=>247,163=>549,164=>167,165=>713,166=>500,167=>753,168=>753,
|
||||||
169=>753,170=>753,171=>1042,172=>987,173=>603,174=>987,175=>603,176=>400,177=>549,
|
169=>753,170=>753,171=>1042,172=>987,173=>603,174=>987,175=>603,176=>400,177=>549,
|
||||||
178=>411,179=>549,180=>549,181=>713,182=>494,183=>460,184=>549,185=>549,186=>549,
|
178=>411,179=>549,180=>549,181=>713,182=>494,183=>460,184=>549,185=>549,186=>549,
|
||||||
187=>549,188=>1000,189=>603,190=>1000,191=>658,192=>823,193=>686,194=>795,195=>987,
|
187=>549,188=>1000,189=>603,190=>1000,191=>658,192=>823,193=>686,194=>795,195=>987,
|
||||||
196=>768,197=>768,198=>823,199=>768,200=>768,201=>713,202=>713,203=>713,204=>713,
|
196=>768,197=>768,198=>823,199=>768,200=>768,201=>713,202=>713,203=>713,204=>713,
|
||||||
205=>713,206=>713,207=>713,208=>768,209=>713,210=>790,211=>790,212=>890,213=>823,
|
205=>713,206=>713,207=>713,208=>768,209=>713,210=>790,211=>790,212=>890,213=>823,
|
||||||
214=>549,215=>250,216=>713,217=>603,218=>603,219=>1042,220=>987,221=>603,222=>987,
|
214=>549,215=>250,216=>713,217=>603,218=>603,219=>1042,220=>987,221=>603,222=>987,
|
||||||
223=>603,224=>494,225=>329,226=>790,227=>790,228=>786,229=>713,230=>384,231=>384,
|
223=>603,224=>494,225=>329,226=>790,227=>790,228=>786,229=>713,230=>384,231=>384,
|
||||||
232=>384,233=>384,234=>384,235=>384,236=>494,237=>494,238=>494,239=>494,240=>0,
|
232=>384,233=>384,234=>384,235=>384,236=>494,237=>494,238=>494,239=>494,240=>0,
|
||||||
241=>329,242=>274,243=>686,244=>686,245=>686,246=>384,247=>384,248=>384,249=>384,
|
241=>329,242=>274,243=>686,244=>686,245=>686,246=>384,247=>384,248=>384,249=>384,
|
||||||
250=>384,251=>384,252=>494,253=>494,254=>494,255=>0);
|
250=>384,251=>384,252=>494,253=>494,254=>494,255=>0);
|
||||||
// --- EOF ---
|
// --- EOF ---
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,69 +1,69 @@
|
|||||||
<?php
|
<?php
|
||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : makeallttffonts.php
|
// File name : makeallttffonts.php
|
||||||
// Begin : 2008-12-07
|
// Begin : 2008-12-07
|
||||||
// Last Update : 2010-08-08
|
// Last Update : 2010-08-08
|
||||||
//
|
//
|
||||||
// Description : Process all TTF files on current directory to
|
// Description : Process all TTF files on current directory to
|
||||||
// build TCPDF compatible font files.
|
// build TCPDF compatible font files.
|
||||||
//
|
//
|
||||||
// Author: Nicola Asuni
|
// Author: Nicola Asuni
|
||||||
//
|
//
|
||||||
// (c) Copyright:
|
// (c) Copyright:
|
||||||
// Nicola Asuni
|
// Nicola Asuni
|
||||||
// Tecnick.com S.r.l.
|
// Tecnick.com S.r.l.
|
||||||
// Via della Pace, 11
|
// Via della Pace, 11
|
||||||
// 09044 Quartucciu (CA)
|
// 09044 Quartucciu (CA)
|
||||||
// ITALY
|
// ITALY
|
||||||
// www.tecnick.com
|
// www.tecnick.com
|
||||||
// info@tecnick.com
|
// info@tecnick.com
|
||||||
//
|
//
|
||||||
// License:
|
// License:
|
||||||
// Copyright (C) 2004-2010 Nicola Asuni - Tecnick.com S.r.l.
|
// Copyright (C) 2004-2010 Nicola Asuni - Tecnick.com S.r.l.
|
||||||
//
|
//
|
||||||
// This file is part of TCPDF software library.
|
// This file is part of TCPDF software library.
|
||||||
//
|
//
|
||||||
// TCPDF is free software: you can redistribute it and/or modify it
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
// under the terms of the GNU Lesser General Public License as
|
// under the terms of the GNU Lesser General Public License as
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
// License, or (at your option) any later version.
|
// License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// TCPDF is distributed in the hope that it will be useful, but
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
// See the GNU Lesser General Public License for more details.
|
// See the GNU Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
// See LICENSE.TXT file for more information.
|
// See LICENSE.TXT file for more information.
|
||||||
//============================================================+
|
//============================================================+
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process all TTF files on current directory to build TCPDF compatible font files.
|
* Process all TTF files on current directory to build TCPDF compatible font files.
|
||||||
* @package com.tecnick.tcpdf
|
* @package com.tecnick.tcpdf
|
||||||
* @author Nicola Asuni
|
* @author Nicola Asuni
|
||||||
* @copyright Copyright © 2004-2009, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com
|
* @copyright Copyright © 2004-2009, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
* @link www.tecnick.com
|
* @link www.tecnick.com
|
||||||
* @since 2008-12-07
|
* @since 2008-12-07
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// read directory for files (only graphics files).
|
// read directory for files (only graphics files).
|
||||||
$handle = opendir('.');
|
$handle = opendir('.');
|
||||||
while($file = readdir($handle)) {
|
while($file = readdir($handle)) {
|
||||||
$path_parts = pathinfo($file);
|
$path_parts = pathinfo($file);
|
||||||
$file_ext = strtolower($path_parts['extension']);
|
$file_ext = strtolower($path_parts['extension']);
|
||||||
if ($file_ext == 'ttf') {
|
if ($file_ext == 'ttf') {
|
||||||
exec('./ttf2ufm -a -F '.$path_parts['basename'].'');
|
exec('./ttf2ufm -a -F '.$path_parts['basename'].'');
|
||||||
exec('php -q makefont.php '.$path_parts['basename'].' '.$path_parts['filename'].'.ufm');
|
exec('php -q makefont.php '.$path_parts['basename'].' '.$path_parts['filename'].'.ufm');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
|
|
||||||
//============================================================+
|
//============================================================+
|
||||||
// END OF FILE
|
// END OF FILE
|
||||||
//============================================================+
|
//============================================================+
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
To embed TrueType and OpenType font files, you need to extract the
|
To embed TrueType and OpenType font files, you need to extract the
|
||||||
font metrics from the font files and build the required tables using
|
font metrics from the font files and build the required tables using
|
||||||
the utility TTF2UFM.
|
the utility TTF2UFM.
|
||||||
|
|
||||||
TTF2UFM is a modified version of Mark Heath's TTF 2 PT1 converter
|
TTF2UFM is a modified version of Mark Heath's TTF 2 PT1 converter
|
||||||
(http://ttf2pt1.sourceforge.net/) by Steven Wittens <steven@acko.net>
|
(http://ttf2pt1.sourceforge.net/) by Steven Wittens <steven@acko.net>
|
||||||
(http://www.acko.net/blog/ufpdf). That version has been further
|
(http://www.acko.net/blog/ufpdf). That version has been further
|
||||||
modified by Ulrich Telle for use with the wxWidgets component
|
modified by Ulrich Telle for use with the wxWidgets component
|
||||||
wxPdfDocument.
|
wxPdfDocument.
|
||||||
|
|
||||||
Following changes where made:
|
Following changes where made:
|
||||||
|
|
||||||
1) Generated AFM files contain the glyph number for each character.
|
1) Generated AFM files contain the glyph number for each character.
|
||||||
2) Generated UFM files contain the bounding box for each character.
|
2) Generated UFM files contain the bounding box for each character.
|
||||||
3) OpenType support has been activated for the Windows binary,
|
3) OpenType support has been activated for the Windows binary,
|
||||||
and the generated AFM/UFM files contain the associated
|
and the generated AFM/UFM files contain the associated
|
||||||
original Unicode codes for each character.
|
original Unicode codes for each character.
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
// core font definition file for TCPDF (www.tcpdf.org)
|
// core font definition file for TCPDF (www.tcpdf.org)
|
||||||
$type='core';
|
$type='core';
|
||||||
$dw=788;
|
$dw=788;
|
||||||
$cw=array(0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0,10=>0,11=>0,12=>0,
|
$cw=array(0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0,10=>0,11=>0,12=>0,
|
||||||
13=>0,14=>0,15=>0,16=>0,17=>0,18=>0,19=>0,20=>0,21=>0,22=>0,23=>0,24=>0,25=>0,
|
13=>0,14=>0,15=>0,16=>0,17=>0,18=>0,19=>0,20=>0,21=>0,22=>0,23=>0,24=>0,25=>0,
|
||||||
26=>0,27=>0,28=>0,29=>0,30=>0,31=>0,32=>278,33=>974,34=>961,35=>974,36=>980,
|
26=>0,27=>0,28=>0,29=>0,30=>0,31=>0,32=>278,33=>974,34=>961,35=>974,36=>980,
|
||||||
37=>719,38=>789,39=>790,40=>791,41=>690,42=>960,43=>939,44=>549,45=>855,46=>911,
|
37=>719,38=>789,39=>790,40=>791,41=>690,42=>960,43=>939,44=>549,45=>855,46=>911,
|
||||||
47=>933,48=>911,49=>945,50=>974,51=>755,52=>846,53=>762,54=>761,55=>571,56=>677,
|
47=>933,48=>911,49=>945,50=>974,51=>755,52=>846,53=>762,54=>761,55=>571,56=>677,
|
||||||
57=>763,58=>760,59=>759,60=>754,61=>494,62=>552,63=>537,64=>577,65=>692,66=>786,
|
57=>763,58=>760,59=>759,60=>754,61=>494,62=>552,63=>537,64=>577,65=>692,66=>786,
|
||||||
67=>788,68=>788,69=>790,70=>793,71=>794,72=>816,73=>823,74=>789,75=>841,76=>823,
|
67=>788,68=>788,69=>790,70=>793,71=>794,72=>816,73=>823,74=>789,75=>841,76=>823,
|
||||||
77=>833,78=>816,79=>831,80=>923,81=>744,82=>723,83=>749,84=>790,85=>792,86=>695,
|
77=>833,78=>816,79=>831,80=>923,81=>744,82=>723,83=>749,84=>790,85=>792,86=>695,
|
||||||
87=>776,88=>768,89=>792,90=>759,91=>707,92=>708,93=>682,94=>701,95=>826,96=>815,
|
87=>776,88=>768,89=>792,90=>759,91=>707,92=>708,93=>682,94=>701,95=>826,96=>815,
|
||||||
97=>789,98=>789,99=>707,100=>687,101=>696,102=>689,103=>786,104=>787,105=>713,
|
97=>789,98=>789,99=>707,100=>687,101=>696,102=>689,103=>786,104=>787,105=>713,
|
||||||
106=>791,107=>785,108=>791,109=>873,110=>761,111=>762,112=>762,113=>759,114=>759,
|
106=>791,107=>785,108=>791,109=>873,110=>761,111=>762,112=>762,113=>759,114=>759,
|
||||||
115=>892,116=>892,117=>788,118=>784,119=>438,120=>138,121=>277,122=>415,123=>392,
|
115=>892,116=>892,117=>788,118=>784,119=>438,120=>138,121=>277,122=>415,123=>392,
|
||||||
124=>392,125=>668,126=>668,127=>0,128=>390,129=>390,130=>317,131=>317,132=>276,
|
124=>392,125=>668,126=>668,127=>0,128=>390,129=>390,130=>317,131=>317,132=>276,
|
||||||
133=>276,134=>509,135=>509,136=>410,137=>410,138=>234,139=>234,140=>334,141=>334,
|
133=>276,134=>509,135=>509,136=>410,137=>410,138=>234,139=>234,140=>334,141=>334,
|
||||||
142=>0,143=>0,144=>0,145=>0,146=>0,147=>0,148=>0,149=>0,150=>0,151=>0,152=>0,
|
142=>0,143=>0,144=>0,145=>0,146=>0,147=>0,148=>0,149=>0,150=>0,151=>0,152=>0,
|
||||||
153=>0,154=>0,155=>0,156=>0,157=>0,158=>0,159=>0,160=>0,161=>732,162=>544,163=>544,
|
153=>0,154=>0,155=>0,156=>0,157=>0,158=>0,159=>0,160=>0,161=>732,162=>544,163=>544,
|
||||||
164=>910,165=>667,166=>760,167=>760,168=>776,169=>595,170=>694,171=>626,172=>788,
|
164=>910,165=>667,166=>760,167=>760,168=>776,169=>595,170=>694,171=>626,172=>788,
|
||||||
173=>788,174=>788,175=>788,176=>788,177=>788,178=>788,179=>788,180=>788,181=>788,
|
173=>788,174=>788,175=>788,176=>788,177=>788,178=>788,179=>788,180=>788,181=>788,
|
||||||
182=>788,183=>788,184=>788,185=>788,186=>788,187=>788,188=>788,189=>788,190=>788,
|
182=>788,183=>788,184=>788,185=>788,186=>788,187=>788,188=>788,189=>788,190=>788,
|
||||||
191=>788,192=>788,193=>788,194=>788,195=>788,196=>788,197=>788,198=>788,199=>788,
|
191=>788,192=>788,193=>788,194=>788,195=>788,196=>788,197=>788,198=>788,199=>788,
|
||||||
200=>788,201=>788,202=>788,203=>788,204=>788,205=>788,206=>788,207=>788,208=>788,
|
200=>788,201=>788,202=>788,203=>788,204=>788,205=>788,206=>788,207=>788,208=>788,
|
||||||
209=>788,210=>788,211=>788,212=>894,213=>838,214=>1016,215=>458,216=>748,217=>924,
|
209=>788,210=>788,211=>788,212=>894,213=>838,214=>1016,215=>458,216=>748,217=>924,
|
||||||
218=>748,219=>918,220=>927,221=>928,222=>928,223=>834,224=>873,225=>828,226=>924,
|
218=>748,219=>918,220=>927,221=>928,222=>928,223=>834,224=>873,225=>828,226=>924,
|
||||||
227=>924,228=>917,229=>930,230=>931,231=>463,232=>883,233=>836,234=>836,235=>867,
|
227=>924,228=>917,229=>930,230=>931,231=>463,232=>883,233=>836,234=>836,235=>867,
|
||||||
236=>867,237=>696,238=>696,239=>874,240=>0,241=>874,242=>760,243=>946,244=>771,
|
236=>867,237=>696,238=>696,239=>874,240=>0,241=>874,242=>760,243=>946,244=>771,
|
||||||
245=>865,246=>771,247=>888,248=>967,249=>888,250=>831,251=>873,252=>927,253=>970,
|
245=>865,246=>771,247=>888,248=>967,249=>888,250=>831,251=>873,252=>927,253=>970,
|
||||||
254=>918,255=>0);
|
254=>918,255=>0);
|
||||||
// --- EOF ---
|
// --- EOF ---
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Mohammad Ali Golkar
|
/* Mohammad Ali Golkar
|
||||||
m.a.golkar@gmail.com
|
m.a.golkar@gmail.com
|
||||||
http://www.30minonline.com
|
http://www.30minonline.com
|
||||||
LICENSE : GPLv2 */
|
LICENSE : GPLv2 */
|
||||||
$type='TrueTypeUnicode';
|
$type='TrueTypeUnicode';
|
||||||
$name='ZarBold';
|
$name='ZarBold';
|
||||||
$desc=array('Ascent'=>733,'Descent'=>-317,'CapHeight'=>733,'Flags'=>32,'FontBBox'=>'[-126 -535 1164 1046]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600);
|
$desc=array('Ascent'=>733,'Descent'=>-317,'CapHeight'=>733,'Flags'=>32,'FontBBox'=>'[-126 -535 1164 1046]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600);
|
||||||
$up=-356;
|
$up=-356;
|
||||||
$ut=49;
|
$ut=49;
|
||||||
$dw=600;
|
$dw=600;
|
||||||
$cw=array(
|
$cw=array(
|
||||||
0=>0,32=>227,33=>235,34=>282,35=>667,36=>458,37=>493,38=>635,39=>156,40=>303,41=>303,42=>489,43=>489,44=>237,45=>489,46=>231,47=>277,
|
0=>0,32=>227,33=>235,34=>282,35=>667,36=>458,37=>493,38=>635,39=>156,40=>303,41=>303,42=>489,43=>489,44=>237,45=>489,46=>231,47=>277,
|
||||||
48=>552,49=>552,50=>552,51=>552,52=>552,53=>552,54=>552,55=>552,56=>552,57=>552,58=>231,59=>237,60=>667,61=>489,62=>667,63=>448,
|
48=>552,49=>552,50=>552,51=>552,52=>552,53=>552,54=>552,55=>552,56=>552,57=>552,58=>231,59=>237,60=>667,61=>489,62=>667,63=>448,
|
||||||
64=>917,65=>604,66=>542,67=>615,68=>708,69=>479,70=>427,71=>667,72=>688,73=>302,74=>292,75=>583,76=>469,77=>885,78=>677,79=>729,
|
64=>917,65=>604,66=>542,67=>615,68=>708,69=>479,70=>427,71=>667,72=>688,73=>302,74=>292,75=>583,76=>469,77=>885,78=>677,79=>729,
|
||||||
80=>479,81=>729,82=>542,83=>448,84=>521,85=>677,86=>615,87=>969,88=>604,89=>583,90=>594,91=>208,92=>510,93=>208,94=>469,95=>500,
|
80=>479,81=>729,82=>542,83=>448,84=>521,85=>677,86=>615,87=>969,88=>604,89=>583,90=>594,91=>208,92=>510,93=>208,94=>469,95=>500,
|
||||||
96=>333,97=>469,98=>510,99=>448,100=>521,101=>438,102=>313,103=>500,104=>552,105=>271,106=>260,107=>500,108=>271,109=>802,110=>552,111=>490,
|
96=>333,97=>469,98=>510,99=>448,100=>521,101=>438,102=>313,103=>500,104=>552,105=>271,106=>260,107=>500,108=>271,109=>802,110=>552,111=>490,
|
||||||
112=>531,113=>521,114=>396,115=>365,116=>292,117=>552,118=>479,119=>750,120=>521,121=>469,122=>448,123=>479,124=>510,125=>479,126=>667,8218=>240,
|
112=>531,113=>521,114=>396,115=>365,116=>292,117=>552,118=>479,119=>750,120=>521,121=>469,122=>448,123=>479,124=>510,125=>479,126=>667,8218=>240,
|
||||||
402=>531,8222=>458,8230=>1000,8224=>438,8225=>438,710=>333,8240=>1010,352=>448,8249=>250,338=>865,8216=>240,8217=>240,8220=>317,8221=>317,8226=>281,8211=>500,
|
402=>531,8222=>458,8230=>1000,8224=>438,8225=>438,710=>333,8240=>1010,352=>448,8249=>250,338=>865,8216=>240,8217=>240,8220=>317,8221=>317,8226=>281,8211=>500,
|
||||||
8212=>1000,8482=>906,353=>365,8250=>250,339=>823,376=>583,160=>244,161=>317,162=>448,163=>583,164=>500,165=>583,166=>200,167=>417,168=>333,169=>765,
|
8212=>1000,8482=>906,353=>365,8250=>250,339=>823,376=>583,160=>244,161=>317,162=>448,163=>583,164=>500,165=>583,166=>200,167=>417,168=>333,169=>765,
|
||||||
170=>313,171=>417,172=>667,173=>564,174=>765,175=>333,176=>375,177=>462,178=>354,179=>354,180=>333,181=>510,182=>438,183=>198,184=>333,185=>354,
|
170=>313,171=>417,172=>667,173=>564,174=>765,175=>333,176=>375,177=>462,178=>354,179=>354,180=>333,181=>510,182=>438,183=>198,184=>333,185=>354,
|
||||||
186=>323,187=>417,188=>854,189=>854,190=>854,191=>448,192=>604,711=>333,215=>462,224=>469,226=>469,231=>448,232=>438,233=>438,234=>438,235=>438,
|
186=>323,187=>417,188=>854,189=>854,190=>854,191=>448,192=>604,711=>333,215=>462,224=>469,226=>469,231=>448,232=>438,233=>438,234=>438,235=>438,
|
||||||
238=>271,239=>271,244=>490,305=>271,247=>483,249=>552,251=>552,252=>552,255=>469,9249=>781,1548=>237,1563=>237,1567=>340,1569=>426,1570=>416,1571=>238,
|
238=>271,239=>271,244=>490,305=>271,247=>483,249=>552,251=>552,252=>552,255=>469,9249=>781,1548=>237,1563=>237,1567=>340,1569=>426,1570=>416,1571=>238,
|
||||||
1572=>429,1573=>260,1574=>817,1575=>238,1576=>853,1577=>439,1578=>853,1579=>853,1580=>720,1581=>720,1582=>720,1583=>485,1584=>485,1585=>423,1586=>423,1587=>1016,
|
1572=>429,1573=>260,1574=>817,1575=>238,1576=>853,1577=>439,1578=>853,1579=>853,1580=>720,1581=>720,1582=>720,1583=>485,1584=>485,1585=>423,1586=>423,1587=>1016,
|
||||||
1588=>1016,1589=>1128,1590=>1128,1591=>794,1592=>794,1593=>685,1594=>685,1600=>371,1601=>840,1602=>696,1603=>1148,1604=>744,1605=>514,1606=>686,1607=>439,1608=>429,
|
1588=>1016,1589=>1128,1590=>1128,1591=>794,1592=>794,1593=>685,1594=>685,1600=>371,1601=>840,1602=>696,1603=>1148,1604=>744,1605=>514,1606=>686,1607=>439,1608=>429,
|
||||||
1609=>817,1610=>817,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1632=>479,1633=>479,1634=>479,1635=>479,1636=>479,1637=>479,
|
1609=>817,1610=>817,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1632=>479,1633=>479,1634=>479,1635=>479,1636=>479,1637=>479,
|
||||||
1638=>479,1639=>479,1640=>479,1641=>483,1642=>493,1645=>563,1648=>227,1649=>363,1652=>227,1662=>853,1670=>720,1688=>423,1700=>840,1705=>1148,1711=>1149,1740=>817,
|
1638=>479,1639=>479,1640=>479,1641=>483,1642=>493,1645=>563,1648=>227,1649=>363,1652=>227,1662=>853,1670=>720,1688=>423,1700=>840,1705=>1148,1711=>1149,1740=>817,
|
||||||
1749=>439,1764=>227,1776=>479,1777=>479,1778=>479,1779=>479,1780=>479,1781=>479,1782=>479,1783=>479,1784=>479,1785=>483,8204=>22,8205=>22,8206=>22,8207=>22,
|
1749=>439,1764=>227,1776=>479,1777=>479,1778=>479,1779=>479,1780=>479,1781=>479,1782=>479,1783=>479,1784=>479,1785=>483,8204=>22,8205=>22,8206=>22,8207=>22,
|
||||||
59424=>227,59425=>227,59426=>227,59427=>227,59428=>227,59429=>227,59430=>227,59431=>227,59432=>227,59433=>227,59434=>227,59435=>227,59436=>227,59416=>227,59437=>227,59442=>227,
|
59424=>227,59425=>227,59426=>227,59427=>227,59428=>227,59429=>227,59430=>227,59431=>227,59432=>227,59433=>227,59434=>227,59435=>227,59436=>227,59416=>227,59437=>227,59442=>227,
|
||||||
59443=>227,59444=>227,59445=>227,59446=>227,64336=>363,64337=>263,64342=>853,64343=>967,64344=>267,64345=>271,64362=>840,64363=>959,64364=>305,64365=>341,64378=>720,64379=>725,
|
59443=>227,59444=>227,59445=>227,59446=>227,64336=>363,64337=>263,64342=>853,64343=>967,64344=>267,64345=>271,64362=>840,64363=>959,64364=>305,64365=>341,64378=>720,64379=>725,
|
||||||
64380=>630,64381=>652,64394=>423,64395=>450,64398=>1148,64399=>1089,64400=>522,64401=>461,64402=>1149,64403=>1084,64404=>525,64405=>462,64508=>817,64509=>784,64606=>227,64607=>227,
|
64380=>630,64381=>652,64394=>423,64395=>450,64398=>1148,64399=>1089,64400=>522,64401=>461,64402=>1149,64403=>1084,64404=>525,64405=>462,64508=>817,64509=>784,64606=>227,64607=>227,
|
||||||
64608=>227,64609=>227,64610=>227,64754=>371,64755=>371,64756=>371,64828=>331,64829=>276,64830=>303,64831=>303,65010=>866,65136=>227,65137=>371,65138=>227,65140=>227,65142=>227,
|
64608=>227,64609=>227,64610=>227,64754=>371,64755=>371,64756=>371,64828=>331,64829=>276,64830=>303,64831=>303,65010=>866,65136=>227,65137=>371,65138=>227,65140=>227,65142=>227,
|
||||||
65143=>371,65144=>227,65145=>371,65146=>227,65147=>371,65148=>227,65149=>371,65150=>227,65151=>371,65152=>426,65153=>416,65154=>354,65155=>238,65156=>282,65157=>429,65158=>507,
|
65143=>371,65144=>227,65145=>371,65146=>227,65147=>371,65148=>227,65149=>371,65150=>227,65151=>371,65152=>426,65153=>416,65154=>354,65155=>238,65156=>282,65157=>429,65158=>507,
|
||||||
65159=>260,65160=>286,65161=>817,65162=>784,65163=>190,65164=>276,65165=>238,65166=>263,65167=>853,65168=>967,65169=>186,65170=>271,65171=>439,65172=>452,65173=>853,65174=>967,
|
65159=>260,65160=>286,65161=>817,65162=>784,65163=>190,65164=>276,65165=>238,65166=>263,65167=>853,65168=>967,65169=>186,65170=>271,65171=>439,65172=>452,65173=>853,65174=>967,
|
||||||
65175=>256,65176=>271,65177=>853,65178=>967,65179=>267,65180=>271,65181=>720,65182=>725,65183=>630,65184=>652,65185=>720,65186=>725,65187=>630,65188=>652,65189=>720,65190=>725,
|
65175=>256,65176=>271,65177=>853,65178=>967,65179=>267,65180=>271,65181=>720,65182=>725,65183=>630,65184=>652,65185=>720,65186=>725,65187=>630,65188=>652,65189=>720,65190=>725,
|
||||||
65191=>630,65192=>652,65193=>485,65194=>608,65195=>485,65196=>608,65197=>423,65198=>450,65199=>423,65200=>450,65201=>1016,65202=>1041,65203=>498,65204=>475,65205=>1016,65206=>1041,
|
65191=>630,65192=>652,65193=>485,65194=>608,65195=>485,65196=>608,65197=>423,65198=>450,65199=>423,65200=>450,65201=>1016,65202=>1041,65203=>498,65204=>475,65205=>1016,65206=>1041,
|
||||||
65207=>498,65208=>475,65209=>1128,65210=>1150,65211=>633,65212=>655,65213=>1128,65214=>1150,65215=>633,65216=>655,65217=>794,65218=>814,65219=>566,65220=>588,65221=>794,65222=>814,
|
65207=>498,65208=>475,65209=>1128,65210=>1150,65211=>633,65212=>655,65213=>1128,65214=>1150,65215=>633,65216=>655,65217=>794,65218=>814,65219=>566,65220=>588,65221=>794,65222=>814,
|
||||||
65223=>566,65224=>588,65225=>685,65226=>655,65227=>414,65228=>330,65229=>685,65230=>655,65231=>414,65232=>330,65233=>840,65234=>959,65235=>305,65236=>341,65237=>696,65238=>780,
|
65223=>566,65224=>588,65225=>685,65226=>655,65227=>414,65228=>330,65229=>685,65230=>655,65231=>414,65232=>330,65233=>840,65234=>959,65235=>305,65236=>341,65237=>696,65238=>780,
|
||||||
65239=>305,65240=>341,65241=>1148,65242=>1089,65243=>522,65244=>461,65245=>744,65246=>741,65247=>202,65248=>259,65249=>514,65250=>585,65251=>345,65252=>477,65253=>686,65254=>764,
|
65239=>305,65240=>341,65241=>1148,65242=>1089,65243=>522,65244=>461,65245=>744,65246=>741,65247=>202,65248=>259,65249=>514,65250=>585,65251=>345,65252=>477,65253=>686,65254=>764,
|
||||||
65255=>186,65256=>271,65257=>439,65258=>452,65259=>501,65260=>381,65261=>429,65262=>507,65263=>817,65264=>784,65265=>817,65266=>784,64510=>265,64511=>271,65269=>610,65270=>652,
|
65255=>186,65256=>271,65257=>439,65258=>452,65259=>501,65260=>381,65261=>429,65262=>507,65263=>817,65264=>784,65265=>817,65266=>784,64510=>265,64511=>271,65269=>610,65270=>652,
|
||||||
65271=>539,65272=>611,65273=>539,65274=>611,65275=>539,65276=>611,65279=>0,64486=>408,64487=>408);
|
65271=>539,65272=>611,65273=>539,65274=>611,65275=>539,65276=>611,65279=>0,64486=>408,64487=>408);
|
||||||
$enc='';
|
$enc='';
|
||||||
$diff='';
|
$diff='';
|
||||||
$file='zarbold.z';
|
$file='zarbold.z';
|
||||||
$ctg='zarbold.ctg.z';
|
$ctg='zarbold.ctg.z';
|
||||||
$originalsize=73296;
|
$originalsize=73296;
|
||||||
// --- EOF ---
|
// --- EOF ---
|
||||||
|
|||||||
@@ -1,337 +1,337 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('tcpdf.php');
|
require_once('tcpdf.php');
|
||||||
|
|
||||||
class MyPDF extends TCPDF
|
class MyPDF extends TCPDF
|
||||||
{
|
{
|
||||||
function MyPDF($orientation='P', $unit='mm', $format='A4')
|
function MyPDF($orientation='P', $unit='mm', $format='A4')
|
||||||
{
|
{
|
||||||
parent::__construct($orientation,$unit,$format);
|
parent::__construct($orientation,$unit,$format);
|
||||||
$this->SetAutoPageBreak(true,10);
|
$this->SetAutoPageBreak(true,10);
|
||||||
$this->AliasNbPages();
|
$this->AliasNbPages();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* obsolete
|
* obsolete
|
||||||
* @param $text
|
* @param $text
|
||||||
* @param $format
|
* @param $format
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function intopdf($text,$format='')
|
function intopdf($text,$format='')
|
||||||
{
|
{
|
||||||
$text = $this->delete_html($text);
|
$text = $this->delete_html($text);
|
||||||
$oldformat = $this->FontStyle;
|
$oldformat = $this->FontStyle;
|
||||||
$this->SetFont('',$format,$this->FontSizePt);
|
$this->SetFont('',$format,$this->FontSizePt);
|
||||||
$this->Write(5,$text);
|
$this->Write(5,$text);
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
$this->SetFont('',$oldformat,$this->FontSizePt);
|
$this->SetFont('',$oldformat,$this->FontSizePt);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* obsolete
|
* obsolete
|
||||||
* @param $text
|
* @param $text
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function helptextintopdf($text)
|
function helptextintopdf($text)
|
||||||
{
|
{
|
||||||
$oldsize = $this->FontSizePt;
|
$oldsize = $this->FontSizePt;
|
||||||
$this->SetFontSize($oldsize-2);
|
$this->SetFontSize($oldsize-2);
|
||||||
$this->Write(5,$this->delete_html($text));
|
$this->Write(5,$this->delete_html($text));
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
$this->SetFontSize($oldsize);
|
$this->SetFontSize($oldsize);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* writes a big title in the page + description
|
* writes a big title in the page + description
|
||||||
* @param $title
|
* @param $title
|
||||||
* @param $description
|
* @param $description
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function titleintopdf($title,$description='')
|
function titleintopdf($title,$description='')
|
||||||
{
|
{
|
||||||
if(!empty($title))
|
if(!empty($title))
|
||||||
{
|
{
|
||||||
$title = $this->delete_html($title);
|
$title = $this->delete_html($title);
|
||||||
$oldsize = $this->FontSizePt;
|
$oldsize = $this->FontSizePt;
|
||||||
$this->SetFontSize($oldsize+4);
|
$this->SetFontSize($oldsize+4);
|
||||||
$this->Line(5,$this->y,($this->w-5),$this->y);
|
$this->Line(5,$this->y,($this->w-5),$this->y);
|
||||||
$this->ln(3);
|
$this->ln(3);
|
||||||
$this->MultiCell('','',$title,'','C',0);
|
$this->MultiCell('','',$title,'','C',0);
|
||||||
if(!empty($description) && isset($description))
|
if(!empty($description) && isset($description))
|
||||||
{
|
{
|
||||||
$description = $this->delete_html($description);
|
$description = $this->delete_html($description);
|
||||||
$this->ln(7);
|
$this->ln(7);
|
||||||
$this->SetFontSize($oldsize+2);
|
$this->SetFontSize($oldsize+2);
|
||||||
$this->MultiCell('','',$description,'','C',0);
|
$this->MultiCell('','',$description,'','C',0);
|
||||||
$this->ln(2);
|
$this->ln(2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->ln(4);
|
$this->ln(4);
|
||||||
}
|
}
|
||||||
$this->Line(5,$this->y,($this->w-5),$this->y);
|
$this->Line(5,$this->y,($this->w-5),$this->y);
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
$this->SetFontSize($oldsize);
|
$this->SetFontSize($oldsize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Creates a Table with equal cell width and Bold text. Used as Head for equalTable()
|
* Creates a Table with equal cell width and Bold text. Used as Head for equalTable()
|
||||||
* @param $array(0=>)
|
* @param $array(0=>)
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function tablehead($array)
|
function tablehead($array)
|
||||||
{
|
{
|
||||||
//$maxwidth = array();
|
//$maxwidth = array();
|
||||||
$maxwidth = $this->getEqualWidth($array);
|
$maxwidth = $this->getEqualWidth($array);
|
||||||
$oldStyle = $this->FontStyle;
|
$oldStyle = $this->FontStyle;
|
||||||
$this->SetFont($this->FontFamily, 'B', $this->FontSizePt);
|
$this->SetFont($this->FontFamily, 'B', $this->FontSizePt);
|
||||||
for($a=0;$a<sizeof($array);$a++)
|
for($a=0;$a<sizeof($array);$a++)
|
||||||
{
|
{
|
||||||
for($b=0;$b<sizeof($array[$a]);$b++)
|
for($b=0;$b<sizeof($array[$a]);$b++)
|
||||||
{
|
{
|
||||||
$this->Cell($maxwidth,4,$this->delete_html($array[$a][$b]),0,0,'L');
|
$this->Cell($maxwidth,4,$this->delete_html($array[$a][$b]),0,0,'L');
|
||||||
}
|
}
|
||||||
$this->ln();
|
$this->ln();
|
||||||
}
|
}
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
$this->SetFont($this->FontFamily, $oldStyle, $this->FontSizePt);
|
$this->SetFont($this->FontFamily, $oldStyle, $this->FontSizePt);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Creates a Table with equal cell width.
|
* Creates a Table with equal cell width.
|
||||||
* @param $array - table array( 0=> array("td", "td", "td"),
|
* @param $array - table array( 0=> array("td", "td", "td"),
|
||||||
* 1=> array("td", "td", "td"))
|
* 1=> array("td", "td", "td"))
|
||||||
* @param $modulo - fills each second row with a light-grey for better visibility. Default is on turn off with 0
|
* @param $modulo - fills each second row with a light-grey for better visibility. Default is on turn off with 0
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function equalTable($array, $modulo=1)
|
function equalTable($array, $modulo=1)
|
||||||
{
|
{
|
||||||
//$maxwidth = array();
|
//$maxwidth = array();
|
||||||
$maxwidth = $this->getEqualWidth($array);
|
$maxwidth = $this->getEqualWidth($array);
|
||||||
$this->SetFillColor(220, 220, 220);
|
$this->SetFillColor(220, 220, 220);
|
||||||
for($a=0;$a<sizeof($array);$a++)
|
for($a=0;$a<sizeof($array);$a++)
|
||||||
{
|
{
|
||||||
if($modulo){
|
if($modulo){
|
||||||
if($a%2 === 0){$fill=0;}
|
if($a%2 === 0){$fill=0;}
|
||||||
else{$fill=1;}
|
else{$fill=1;}
|
||||||
}
|
}
|
||||||
else{$fill=0;}
|
else{$fill=0;}
|
||||||
for($b=0;$b<sizeof($array[$a]);$b++)
|
for($b=0;$b<sizeof($array[$a]);$b++)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->Cell($maxwidth,4,$this->delete_html($array[$a][$b]),0,0,'L',$fill);
|
$this->Cell($maxwidth,4,$this->delete_html($array[$a][$b]),0,0,'L',$fill);
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->ln();
|
$this->ln();
|
||||||
}
|
}
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* creates a table using the full width of page
|
* creates a table using the full width of page
|
||||||
* @param $array - table array( 0=> array("td", "td", "td"),
|
* @param $array - table array( 0=> array("td", "td", "td"),
|
||||||
* 1=> array("td", "td", "td"))
|
* 1=> array("td", "td", "td"))
|
||||||
* @param $modulo - fills each second row with a light-grey for better visibility. Default is off, turn on with 1
|
* @param $modulo - fills each second row with a light-grey for better visibility. Default is off, turn on with 1
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function tableintopdf($array, $modulo=1 )
|
function tableintopdf($array, $modulo=1 )
|
||||||
{
|
{
|
||||||
$maxwidth = array();
|
$maxwidth = array();
|
||||||
$maxwidth = $this->getFullWidth($array);
|
$maxwidth = $this->getFullWidth($array);
|
||||||
|
|
||||||
$this->SetFillColor(220, 220, 220);
|
$this->SetFillColor(220, 220, 220);
|
||||||
for($a=0;$a<sizeof($array);$a++)
|
for($a=0;$a<sizeof($array);$a++)
|
||||||
{
|
{
|
||||||
if($modulo){
|
if($modulo){
|
||||||
if($a%2 === 0){$fill=0;}
|
if($a%2 === 0){$fill=0;}
|
||||||
else{$fill=1;}
|
else{$fill=1;}
|
||||||
}
|
}
|
||||||
else{$fill=0;}
|
else{$fill=0;}
|
||||||
for($b=0;$b<sizeof($array[$a]);$b++)
|
for($b=0;$b<sizeof($array[$a]);$b++)
|
||||||
{
|
{
|
||||||
//echo $maxwidth[$b]." max $b.Spalte<br/>";
|
//echo $maxwidth[$b]." max $b.Spalte<br/>";
|
||||||
$this->Cell($maxwidth[$b],4,$this->delete_html($array[$a][$b]),0,0,'L',$fill);
|
$this->Cell($maxwidth[$b],4,$this->delete_html($array[$a][$b]),0,0,'L',$fill);
|
||||||
}
|
}
|
||||||
$this->ln();
|
$this->ln();
|
||||||
}
|
}
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* creates a table with a bold head using the full width of page
|
* creates a table with a bold head using the full width of page
|
||||||
* @param $head - head array( 0=> array("th", "th", "th"))
|
* @param $head - head array( 0=> array("th", "th", "th"))
|
||||||
* @param $table - table array( 0=> array("td", "td", "td"),
|
* @param $table - table array( 0=> array("td", "td", "td"),
|
||||||
* 1=> array("td", "td", "td"))
|
* 1=> array("td", "td", "td"))
|
||||||
* @param $modulo - fills each second row with a light-grey for better visibility. Default is on, turn off with 0
|
* @param $modulo - fills each second row with a light-grey for better visibility. Default is on, turn off with 0
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function headTable($head, $table, $modulo=1 )
|
function headTable($head, $table, $modulo=1 )
|
||||||
{
|
{
|
||||||
$array = array_merge_recursive($head, $table);
|
$array = array_merge_recursive($head, $table);
|
||||||
//print_r($array);
|
//print_r($array);
|
||||||
$maxwidth = array();
|
$maxwidth = array();
|
||||||
$maxwidth = $this->getFullWidth($array);
|
$maxwidth = $this->getFullWidth($array);
|
||||||
|
|
||||||
$this->SetFillColor(220, 220, 220);
|
$this->SetFillColor(220, 220, 220);
|
||||||
for($a=0;$a<sizeof($array);$a++)
|
for($a=0;$a<sizeof($array);$a++)
|
||||||
{
|
{
|
||||||
if($modulo){
|
if($modulo){
|
||||||
if($a%2 === 0){$fill=1;}
|
if($a%2 === 0){$fill=1;}
|
||||||
else{$fill=0;}
|
else{$fill=0;}
|
||||||
}
|
}
|
||||||
else{$fill=0;}
|
else{$fill=0;}
|
||||||
for($b=0;$b<sizeof($array[$a]);$b++)
|
for($b=0;$b<sizeof($array[$a]);$b++)
|
||||||
{
|
{
|
||||||
$bEndOfCell=0;
|
$bEndOfCell=0;
|
||||||
if ($b==sizeof($array[$a])-1)
|
if ($b==sizeof($array[$a])-1)
|
||||||
{
|
{
|
||||||
$bEndOfCell=1;
|
$bEndOfCell=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($a==0)
|
if($a==0)
|
||||||
{
|
{
|
||||||
$oldStyle = $this->FontStyle;
|
$oldStyle = $this->FontStyle;
|
||||||
$this->SetFont($this->FontFamily, 'B', $this->FontSizePt);
|
$this->SetFont($this->FontFamily, 'B', $this->FontSizePt);
|
||||||
|
|
||||||
if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
|
if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
|
||||||
if ($maxwidth[$b] < 20) $maxwidth[$b]=20;
|
if ($maxwidth[$b] < 20) $maxwidth[$b]=20;
|
||||||
$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',1,$bEndOfCell);
|
$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',1,$bEndOfCell);
|
||||||
|
|
||||||
$this->SetFont($this->FontFamily, $oldStyle, $this->FontSizePt);
|
$this->SetFont($this->FontFamily, $oldStyle, $this->FontSizePt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($a==1)
|
if ($a==1)
|
||||||
{
|
{
|
||||||
$this->SetFillColor(250, 250, 250);
|
$this->SetFillColor(250, 250, 250);
|
||||||
}
|
}
|
||||||
//echo $maxwidth[$b]." max $b.Spalte<br/>";
|
//echo $maxwidth[$b]." max $b.Spalte<br/>";
|
||||||
|
|
||||||
if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
|
if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
|
||||||
if ($b==0)
|
if ($b==0)
|
||||||
{
|
{
|
||||||
$iLines=$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
|
$iLines=$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->MultiCell($maxwidth[$b],$iLines,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
|
$this->MultiCell($maxwidth[$b],$iLines,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->ln(5);
|
$this->ln(5);
|
||||||
}
|
}
|
||||||
function getminwidth($array)
|
function getminwidth($array)
|
||||||
{
|
{
|
||||||
$width = array();
|
$width = array();
|
||||||
for($i=0;$i<sizeof($array);$i++)
|
for($i=0;$i<sizeof($array);$i++)
|
||||||
{
|
{
|
||||||
for($j=0;$j<sizeof($array[$i]);$j++)
|
for($j=0;$j<sizeof($array[$i]);$j++)
|
||||||
{
|
{
|
||||||
$stringWidth=0;
|
$stringWidth=0;
|
||||||
$chars = str_split($this->delete_html($array[$i][$j]),1);
|
$chars = str_split($this->delete_html($array[$i][$j]),1);
|
||||||
foreach($chars as $char)
|
foreach($chars as $char)
|
||||||
{
|
{
|
||||||
$stringWidth = $stringWidth+$this->GetCharWidth($char);
|
$stringWidth = $stringWidth+$this->GetCharWidth($char);
|
||||||
|
|
||||||
//echo $stringWidth.": ".$char."<br/>";
|
//echo $stringWidth.": ".$char."<br/>";
|
||||||
}
|
}
|
||||||
if($stringWidth!=0 && $stringWidth<8)
|
if($stringWidth!=0 && $stringWidth<8)
|
||||||
$stringWidth = $stringWidth*3;
|
$stringWidth = $stringWidth*3;
|
||||||
if(!isset($width[$j])|| $stringWidth>$width[$j])
|
if(!isset($width[$j])|| $stringWidth>$width[$j])
|
||||||
{
|
{
|
||||||
$width[$j] = $stringWidth;
|
$width[$j] = $stringWidth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $width;
|
return $width;
|
||||||
}
|
}
|
||||||
function getmaxwidth($array)
|
function getmaxwidth($array)
|
||||||
{
|
{
|
||||||
for($i=0;$i<sizeof($array);$i++)
|
for($i=0;$i<sizeof($array);$i++)
|
||||||
{
|
{
|
||||||
for($j=0;$j<sizeof($array[$i]);$j++)
|
for($j=0;$j<sizeof($array[$i]);$j++)
|
||||||
{
|
{
|
||||||
if(($i-1)>=0)
|
if(($i-1)>=0)
|
||||||
{
|
{
|
||||||
if(strlen($this->delete_html($array[($i-1)][$j])) < strlen($this->delete_html($array[$i][$j])))
|
if(strlen($this->delete_html($array[($i-1)][$j])) < strlen($this->delete_html($array[$i][$j])))
|
||||||
{
|
{
|
||||||
$width[$j] = strlen($this->delete_html($array[$i][$j]));
|
$width[$j] = strlen($this->delete_html($array[$i][$j]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$width[$j]=strlen($this->delete_html($array[$i][$j]));
|
$width[$j]=strlen($this->delete_html($array[$i][$j]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ($width);
|
return ($width);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Gets the width for columns in a table based on their Stringlength and the width of the page...
|
* Gets the width for columns in a table based on their Stringlength and the width of the page...
|
||||||
* @param $array
|
* @param $array
|
||||||
* @return array with column width
|
* @return array with column width
|
||||||
*/
|
*/
|
||||||
function getFullWidth($array)
|
function getFullWidth($array)
|
||||||
{
|
{
|
||||||
$maxlength = array();
|
$maxlength = array();
|
||||||
$width = array();
|
$width = array();
|
||||||
$width = $this->getminwidth($array);
|
$width = $this->getminwidth($array);
|
||||||
|
|
||||||
$margins = $this->getMargins();
|
$margins = $this->getMargins();
|
||||||
$deadSpace = $margins['left']+$margins['right'];
|
$deadSpace = $margins['left']+$margins['right'];
|
||||||
$fullWidth = ($this->GetLineWidth()*1000)-$deadSpace;
|
$fullWidth = ($this->GetLineWidth()*1000)-$deadSpace;
|
||||||
$faktor = $fullWidth/array_sum($width);
|
$faktor = $fullWidth/array_sum($width);
|
||||||
|
|
||||||
for($i=0;$i<sizeof($width);$i++)
|
for($i=0;$i<sizeof($width);$i++)
|
||||||
{
|
{
|
||||||
$maxlength[$i]=$faktor*$width[$i];
|
$maxlength[$i]=$faktor*$width[$i];
|
||||||
}
|
}
|
||||||
return $maxlength;
|
return $maxlength;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* gets the width for each column in tables, based on pagewidth and count of columns.
|
* gets the width for each column in tables, based on pagewidth and count of columns.
|
||||||
* Good for static tables with equal value String-length
|
* Good for static tables with equal value String-length
|
||||||
* @param $array
|
* @param $array
|
||||||
* @return unknown_type
|
* @return unknown_type
|
||||||
*/
|
*/
|
||||||
function getEqualWidth($array)
|
function getEqualWidth($array)
|
||||||
{
|
{
|
||||||
$margins = $this->getMargins();
|
$margins = $this->getMargins();
|
||||||
$deadSpace = $margins['left']+$margins['right'];
|
$deadSpace = $margins['left']+$margins['right'];
|
||||||
|
|
||||||
$width = ($this->GetLineWidth()*1000)-$deadSpace;
|
$width = ($this->GetLineWidth()*1000)-$deadSpace;
|
||||||
$count = 0;
|
$count = 0;
|
||||||
for($i=0;$i<sizeof($array);$i++)
|
for($i=0;$i<sizeof($array);$i++)
|
||||||
{
|
{
|
||||||
for($j=0;$j<sizeof($array[$i]);$j++)
|
for($j=0;$j<sizeof($array[$i]);$j++)
|
||||||
{
|
{
|
||||||
if(sizeof($array[$i])>$count)
|
if(sizeof($array[$i])>$count)
|
||||||
{
|
{
|
||||||
$count = sizeof($array[$i]);
|
$count = sizeof($array[$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($count!=0)
|
if($count!=0)
|
||||||
return ($width/$count);
|
return ($width/$count);
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
function write_out($name)
|
function write_out($name)
|
||||||
{
|
{
|
||||||
$this->Output($name,"D");
|
$this->Output($name,"D");
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_html($text)
|
function delete_html($text)
|
||||||
{
|
{
|
||||||
$text = html_entity_decode($text);
|
$text = html_entity_decode($text);
|
||||||
return strip_tags($text);
|
return strip_tags($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -6234,10 +6234,10 @@ class TCPDF {
|
|||||||
$this->y = $y;
|
$this->y = $y;
|
||||||
$this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']);
|
$this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']);
|
||||||
}
|
}
|
||||||
$this->setContentMark();
|
$this->setContentMark();
|
||||||
$this->cell_padding = $prev_cell_padding;
|
$this->cell_padding = $prev_cell_padding;
|
||||||
$this->cell_margin = $prev_cell_margin;
|
$this->cell_margin = $prev_cell_margin;
|
||||||
return $currentY-$this->y;
|
return $currentY-$this->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: cmdline_importsurvey.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: cmdline_importsurvey.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
$_SERVER['HTTP_HOST']="127.0.1.1";
|
$_SERVER['HTTP_HOST']="127.0.1.1";
|
||||||
include_once(dirname(__FILE__).'/../../config-defaults.php');
|
include_once(dirname(__FILE__).'/../../config-defaults.php');
|
||||||
$use_firebug_lite="";
|
$use_firebug_lite="";
|
||||||
include_once(dirname(__FILE__).'/../../common.php');
|
include_once(dirname(__FILE__).'/../../common.php');
|
||||||
include_once($rootdir.'/classes/core/language.php');
|
include_once($rootdir.'/classes/core/language.php');
|
||||||
$cron='1';
|
$cron='1';
|
||||||
$clang = new limesurvey_lang("en");
|
$clang = new limesurvey_lang("en");
|
||||||
$_SESSION['loginID']='1';
|
$_SESSION['loginID']='1';
|
||||||
$surveyidoriginal=$argv[1];
|
$surveyidoriginal=$argv[1];
|
||||||
$subaction="bounceprocessing";
|
$subaction="bounceprocessing";
|
||||||
require_once(dirname(__FILE__).'/../bounceprocessing.php');
|
require_once(dirname(__FILE__).'/../bounceprocessing.php');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: database.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: database.php 12242 2012-01-27 23:41:13Z c_schmitz $
|
||||||
*/
|
*/
|
||||||
//Last security audit on 2009-10-11
|
//Last security audit on 2009-10-11
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ if(isset($surveyid))
|
|||||||
//Clean XSS
|
//Clean XSS
|
||||||
if ($filterxsshtml)
|
if ($filterxsshtml)
|
||||||
{
|
{
|
||||||
$_POST['group_name_'.$grouplang]=$myFilter->process($_POST['group_name_'.$grouplang]);
|
$_POST['group_name_'.$grouplang]=$myFilter->process(html_entity_decode($_POST['group_name_'.$grouplang], ENT_QUOTES, "UTF-8"));
|
||||||
$_POST['description_'.$grouplang]=$myFilter->process($_POST['description_'.$grouplang]);
|
$_POST['description_'.$grouplang]=$myFilter->process(html_entity_decode($_POST['description_'.$grouplang], ENT_QUOTES, "UTF-8"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -87,18 +87,19 @@ if(isset($surveyid))
|
|||||||
// Fix bug with FCKEditor saving strange BR types
|
// Fix bug with FCKEditor saving strange BR types
|
||||||
$_POST['group_name_'.$grouplang]=fix_FCKeditor_text($_POST['group_name_'.$grouplang]);
|
$_POST['group_name_'.$grouplang]=fix_FCKeditor_text($_POST['group_name_'.$grouplang]);
|
||||||
$_POST['description_'.$grouplang]=fix_FCKeditor_text($_POST['description_'.$grouplang]);
|
$_POST['description_'.$grouplang]=fix_FCKeditor_text($_POST['description_'.$grouplang]);
|
||||||
|
$grelevance = (isset($_POST['grelevance']) ? $_POST['grelevance'] : 1);
|
||||||
|
|
||||||
|
|
||||||
if ($first)
|
if ($first)
|
||||||
{
|
{
|
||||||
$query = "INSERT INTO ".db_table_name('groups')." (sid, group_name, description,group_order,language) VALUES ('".db_quote($postsid)."', '".db_quote($_POST['group_name_'.$grouplang])."', '".db_quote($_POST['description_'.$grouplang])."',".getMaxgrouporder(returnglobal('sid')).",'{$grouplang}')";
|
$query = "INSERT INTO ".db_table_name('groups')." (sid, group_name, description, grelevance, group_order, language) VALUES ('".db_quote($postsid)."', '".db_quote($_POST['group_name_'.$grouplang])."', '".db_quote($_POST['description_'.$grouplang])."','".db_quote($grelevance)."',".getMaxgrouporder(returnglobal('sid')).",'{$grouplang}')";
|
||||||
$result = $connect->Execute($query); // Checked
|
$result = $connect->Execute($query); // Checked
|
||||||
$groupid=$connect->Insert_Id(db_table_name_nq('groups'),"gid");
|
$groupid=$connect->Insert_Id(db_table_name_nq('groups'),"gid");
|
||||||
$first=false;
|
$first=false;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
db_switchIDInsert('groups',true);
|
db_switchIDInsert('groups',true);
|
||||||
$query = "INSERT INTO ".db_table_name('groups')." (gid, sid, group_name, description,group_order,language) VALUES ('{$groupid}','".db_quote($postsid)."', '".db_quote($_POST['group_name_'.$grouplang])."', '".db_quote($_POST['description_'.$grouplang])."',".getMaxgrouporder(returnglobal('sid')).",'{$grouplang}')";
|
$query = "INSERT INTO ".db_table_name('groups')." (gid, sid, group_name, description, grelevance, group_order, language) VALUES ('{$groupid}','".db_quote($postsid)."', '".db_quote($_POST['group_name_'.$grouplang])."', '".db_quote($_POST['description_'.$grouplang])."','".db_quote($grelevance)."',".getMaxgrouporder(returnglobal('sid')).",'{$grouplang}')";
|
||||||
$result = $connect->Execute($query) or safe_die("Error<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
$result = $connect->Execute($query) or safe_die("Error<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
||||||
db_switchIDInsert('groups',false);
|
db_switchIDInsert('groups',false);
|
||||||
}
|
}
|
||||||
@@ -147,7 +148,7 @@ if(isset($surveyid))
|
|||||||
// don't use array_map db_quote on POST
|
// don't use array_map db_quote on POST
|
||||||
// since this is iterated for each language
|
// since this is iterated for each language
|
||||||
//$_POST = array_map('db_quote', $_POST);
|
//$_POST = array_map('db_quote', $_POST);
|
||||||
$ugquery = "UPDATE ".db_table_name('groups')." SET group_name='".db_quote($_POST['group_name_'.$grplang])."', description='".db_quote($_POST['description_'.$grplang])."' WHERE sid=".db_quote($postsid)." AND gid=".db_quote($postgid)." AND language='{$grplang}'";
|
$ugquery = "UPDATE ".db_table_name('groups')." SET group_name='".db_quote($_POST['group_name_'.$grplang])."', description='".db_quote($_POST['description_'.$grplang])."', grelevance='".db_quote($_POST['grelevance'])."' WHERE sid=".db_quote($postsid)." AND gid=".db_quote($postgid)." AND language='{$grplang}'";
|
||||||
$ugresult = $connect->Execute($ugquery); // Checked
|
$ugresult = $connect->Execute($ugquery); // Checked
|
||||||
if ($ugresult)
|
if ($ugresult)
|
||||||
{
|
{
|
||||||
@@ -166,6 +167,8 @@ if(isset($surveyid))
|
|||||||
|
|
||||||
elseif ($action == "delgroup" && bHasSurveyPermission($surveyid, 'surveycontent','delete'))
|
elseif ($action == "delgroup" && bHasSurveyPermission($surveyid, 'surveycontent','delete'))
|
||||||
{
|
{
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($surveyid);
|
||||||
|
|
||||||
if (!isset($gid)) $gid=returnglobal('gid');
|
if (!isset($gid)) $gid=returnglobal('gid');
|
||||||
$query = "SELECT qid FROM ".db_table_name('groups')." g, ".db_table_name('questions')." q WHERE g.gid=q.gid AND g.gid=$gid AND q.parent_qid=0 group by qid";
|
$query = "SELECT qid FROM ".db_table_name('groups')." g, ".db_table_name('questions')." q WHERE g.gid=q.gid AND g.gid=$gid AND q.parent_qid=0 group by qid";
|
||||||
if ($result = db_execute_assoc($query)) // Checked
|
if ($result = db_execute_assoc($query)) // Checked
|
||||||
@@ -196,6 +199,7 @@ if(isset($surveyid))
|
|||||||
{
|
{
|
||||||
$databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Group could not be deleted","js")."\n$error\")\n //-->\n</script>\n";
|
$databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Group could not be deleted","js")."\n$error\")\n //-->\n</script>\n";
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($surveyid);
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == "insertquestion" && bHasSurveyPermission($surveyid, 'surveycontent','create'))
|
elseif ($action == "insertquestion" && bHasSurveyPermission($surveyid, 'surveycontent','create'))
|
||||||
@@ -244,9 +248,9 @@ if(isset($surveyid))
|
|||||||
$_POST['help_'.$baselang]=fix_FCKeditor_text($_POST['help_'.$baselang]);
|
$_POST['help_'.$baselang]=fix_FCKeditor_text($_POST['help_'.$baselang]);
|
||||||
|
|
||||||
$_POST = array_map('db_quote', $_POST);
|
$_POST = array_map('db_quote', $_POST);
|
||||||
$query = "INSERT INTO ".db_table_name('questions')." (sid, gid, type, title, question, preg, help, other, mandatory, question_order, language)"
|
$query = "INSERT INTO ".db_table_name('questions')." (sid, gid, type, title, question, preg, help, other, mandatory, question_order, relevance, language)"
|
||||||
." VALUES ('{$postsid}', '{$postgid}', '{$_POST['type']}', '{$_POST['title']}',"
|
." VALUES ('{$postsid}', '{$postgid}', '{$_POST['type']}', '{$_POST['title']}',"
|
||||||
." '{$_POST['question_'.$baselang]}', '{$_POST['preg']}', '{$_POST['help_'.$baselang]}', '{$_POST['other']}', '{$_POST['mandatory']}', $question_order,'{$baselang}')";
|
." '{$_POST['question_'.$baselang]}', '{$_POST['preg']}', '{$_POST['help_'.$baselang]}', '{$_POST['other']}', '{$_POST['mandatory']}', $question_order,'".db_quote($_POST['relevance'])."','{$baselang}')";
|
||||||
$result = $connect->Execute($query); // Checked
|
$result = $connect->Execute($query); // Checked
|
||||||
// Get the last inserted questionid for other languages
|
// Get the last inserted questionid for other languages
|
||||||
$qid=$connect->Insert_ID(db_table_name_nq('questions'),"qid");
|
$qid=$connect->Insert_ID(db_table_name_nq('questions'),"qid");
|
||||||
@@ -304,13 +308,16 @@ if(isset($surveyid))
|
|||||||
//include("surveytable_functions.php");
|
//include("surveytable_functions.php");
|
||||||
//surveyFixColumns($surveyid);
|
//surveyFixColumns($surveyid);
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::SetDirtyFlag(); // so refreshes syntax highlighting
|
||||||
}
|
}
|
||||||
elseif ($action == "renumberquestions" && bHasSurveyPermission($surveyid, 'surveycontent','update'))
|
elseif ($action == "renumberquestions" && bHasSurveyPermission($surveyid, 'surveycontent','update'))
|
||||||
{
|
{
|
||||||
//Automatically renumbers the "question codes" so that they follow
|
//Automatically renumbers the "question codes" so that they follow
|
||||||
//a methodical numbering method
|
//a methodical numbering method
|
||||||
|
$style = ((isset($_POST['style']) && $_POST['style']=="bygroup") ? 'bygroup' : 'straight');
|
||||||
$question_number=1;
|
$question_number=1;
|
||||||
$group_number=0;
|
$group_number=0;
|
||||||
|
$gseq=0;
|
||||||
$gselect="SELECT a.qid, a.gid\n"
|
$gselect="SELECT a.qid, a.gid\n"
|
||||||
."FROM ".db_table_name('questions')." as a, ".db_table_name('groups')."\n"
|
."FROM ".db_table_name('questions')." as a, ".db_table_name('groups')."\n"
|
||||||
."WHERE a.gid=".db_table_name('groups').".gid AND a.sid=$surveyid AND a.parent_qid=0 "
|
."WHERE a.gid=".db_table_name('groups').".gid AND a.sid=$surveyid AND a.parent_qid=0 "
|
||||||
@@ -322,13 +329,16 @@ if(isset($surveyid))
|
|||||||
foreach($grows as $grow)
|
foreach($grows as $grow)
|
||||||
{
|
{
|
||||||
//Go through all the questions
|
//Go through all the questions
|
||||||
if ((isset($_POST['style']) && $_POST['style']=="bygroup") && (!isset($group_number) || $group_number != $grow['gid']))
|
if ($style == 'bygroup' && (!isset($group_number) || $group_number != $grow['gid']))
|
||||||
{ //If we're doing this by group, restart the numbering when the group number changes
|
{ //If we're doing this by group, restart the numbering when the group number changes
|
||||||
$question_number=1;
|
$question_number=1;
|
||||||
$group_number++;
|
$group_number = $grow['gid'];
|
||||||
|
$gseq++;
|
||||||
}
|
}
|
||||||
$usql="UPDATE ".db_table_name('questions')."\n"
|
$usql="UPDATE ".db_table_name('questions')."\n"
|
||||||
."SET title='".str_pad($question_number, 4, "0", STR_PAD_LEFT)."'\n"
|
."SET title='"
|
||||||
|
.(($style == 'bygroup') ? ('G' . $gseq . '_') : '')
|
||||||
|
."Q".str_pad($question_number, 4, "0", STR_PAD_LEFT)."'\n"
|
||||||
."WHERE qid=".$grow['qid'];
|
."WHERE qid=".$grow['qid'];
|
||||||
//$databaseoutput .= "[$sql]";
|
//$databaseoutput .= "[$sql]";
|
||||||
$uresult=$connect->Execute($usql) or safe_die("Error: ".$connect->ErrorMsg()); // Checked
|
$uresult=$connect->Execute($usql) or safe_die("Error: ".$connect->ErrorMsg()); // Checked
|
||||||
@@ -336,7 +346,8 @@ if(isset($surveyid))
|
|||||||
$group_number=$grow['gid'];
|
$group_number=$grow['gid'];
|
||||||
}
|
}
|
||||||
$_SESSION['flashmessage'] = $clang->gT("Question codes were successfully regenerated.");
|
$_SESSION['flashmessage'] = $clang->gT("Question codes were successfully regenerated.");
|
||||||
}
|
LimeExpressionManager::SetDirtyFlag(); // so refreshes syntax highlighting
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
elseif ($action == "updatedefaultvalues" && bHasSurveyPermission($surveyid, 'surveycontent','update'))
|
elseif ($action == "updatedefaultvalues" && bHasSurveyPermission($surveyid, 'surveycontent','update'))
|
||||||
@@ -408,12 +419,25 @@ if(isset($surveyid))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($qtproperties[$questiontype]['answerscales']==0 && $qtproperties[$questiontype]['subquestions']==0)
|
||||||
|
{
|
||||||
|
foreach ($questlangs as $language)
|
||||||
|
{
|
||||||
|
if (isset($_POST['defaultanswerscale_0_'.$language.'_0']))
|
||||||
|
{
|
||||||
|
Updatedefaultvalues($postqid,0,0,'',$language,$_POST['defaultanswerscale_0_'.$language.'_0'],true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$_SESSION['flashmessage'] = $clang->gT("Default value settings were successfully saved.");
|
$_SESSION['flashmessage'] = $clang->gT("Default value settings were successfully saved.");
|
||||||
|
LimeExpressionManager::SetDirtyFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
elseif ($action == "updatequestion" && bHasSurveyPermission($surveyid, 'surveycontent','update'))
|
elseif ($action == "updatequestion" && bHasSurveyPermission($surveyid, 'surveycontent','update'))
|
||||||
{
|
{
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($surveyid);
|
||||||
|
|
||||||
$cqquery = "SELECT type, gid FROM ".db_table_name('questions')." WHERE qid={$postqid}";
|
$cqquery = "SELECT type, gid FROM ".db_table_name('questions')." WHERE qid={$postqid}";
|
||||||
$cqresult=db_execute_assoc($cqquery) or safe_die ("Couldn't get question type to check for change<br />".$cqquery."<br />".$connect->ErrorMsg()); // Checked
|
$cqresult=db_execute_assoc($cqquery) or safe_die ("Couldn't get question type to check for change<br />".$cqquery."<br />".$connect->ErrorMsg()); // Checked
|
||||||
$cqr=$cqresult->FetchRow();
|
$cqr=$cqresult->FetchRow();
|
||||||
@@ -425,7 +449,7 @@ if(isset($surveyid))
|
|||||||
require_once("../classes/inputfilter/class.inputfilter_clean.php");
|
require_once("../classes/inputfilter/class.inputfilter_clean.php");
|
||||||
$myFilter = new InputFilter('','',1,1,1);
|
$myFilter = new InputFilter('','',1,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove invalid question attributes on saving
|
// Remove invalid question attributes on saving
|
||||||
$qattributes=questionAttributes();
|
$qattributes=questionAttributes();
|
||||||
$attsql="delete from ".db_table_name('question_attributes')." where qid='{$postqid}' and ";
|
$attsql="delete from ".db_table_name('question_attributes')." where qid='{$postqid}' and ";
|
||||||
@@ -447,23 +471,32 @@ if(isset($surveyid))
|
|||||||
|
|
||||||
if (isset($_POST[$validAttribute['name']]))
|
if (isset($_POST[$validAttribute['name']]))
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($filterxsshtml)
|
if ($filterxsshtml)
|
||||||
{
|
{
|
||||||
$_POST[$validAttribute['name']]=$myFilter->process($_POST[$validAttribute['name']]);
|
$sAttributeValue=$myFilter->process($_POST[$validAttribute['name']]);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sAttributeValue=$_POST[$validAttribute['name']];
|
||||||
|
}
|
||||||
|
if ($validAttribute['name']=='multiflexible_step' && trim($sAttributeValue)!='') {
|
||||||
|
$sAttributeValue=floatval($sAttributeValue);
|
||||||
|
if ($sAttributeValue==0) $sAttributeValue=1;
|
||||||
|
};
|
||||||
$query = "select qaid from ".db_table_name('question_attributes')."
|
$query = "select qaid from ".db_table_name('question_attributes')."
|
||||||
WHERE attribute='".$validAttribute['name']."' AND qid=".$qid;
|
WHERE attribute='".$validAttribute['name']."' AND qid=".$qid;
|
||||||
$result = $connect->Execute($query) or safe_die("Error updating attribute value<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
$result = $connect->Execute($query) or safe_die("Error updating attribute value<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
||||||
if ($result->Recordcount()>0)
|
if ($result->Recordcount()>0)
|
||||||
{
|
{
|
||||||
$query = "UPDATE ".db_table_name('question_attributes')."
|
$query = "UPDATE ".db_table_name('question_attributes')."
|
||||||
SET value='".db_quote($_POST[$validAttribute['name']])."' WHERE attribute='".$validAttribute['name']."' AND qid=".$qid;
|
SET value='".db_quote($sAttributeValue)."' WHERE attribute='".$validAttribute['name']."' AND qid=".$qid;
|
||||||
$result = $connect->Execute($query) or safe_die("Error updating attribute value<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
$result = $connect->Execute($query) or safe_die("Error updating attribute value<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$query = "INSERT into ".db_table_name('question_attributes')."
|
$query = "INSERT into ".db_table_name('question_attributes')."
|
||||||
(qid, value, attribute) values ($qid,'".db_quote($_POST[$validAttribute['name']])."','{$validAttribute['name']}')";
|
(qid, value, attribute) values ($qid,'".db_quote($sAttributeValue)."','{$validAttribute['name']}')";
|
||||||
$result = $connect->Execute($query) or safe_die("Error updating attribute value<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
$result = $connect->Execute($query) or safe_die("Error updating attribute value<br />".$query."<br />".$connect->ErrorMsg()); // Checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -483,7 +516,7 @@ if(isset($surveyid))
|
|||||||
|
|
||||||
// These are the questions types that have no validation - so zap it accordingly
|
// These are the questions types that have no validation - so zap it accordingly
|
||||||
if ($_POST['type']== "!" || $_POST['type']== "L" || $_POST['type']== "M" || $_POST['type']== "P" ||
|
if ($_POST['type']== "!" || $_POST['type']== "L" || $_POST['type']== "M" || $_POST['type']== "P" ||
|
||||||
$_POST['type']== "F" || $_POST['type']== "H" || $_POST['type']== ":" || $_POST['type']== ";" ||
|
$_POST['type']== "F" || $_POST['type']== "H" ||
|
||||||
$_POST['type']== "X" || $_POST['type']== "")
|
$_POST['type']== "X" || $_POST['type']== "")
|
||||||
{
|
{
|
||||||
$_POST['preg']='';
|
$_POST['preg']='';
|
||||||
@@ -514,11 +547,6 @@ if(isset($surveyid))
|
|||||||
if (isset($postgid) && $postgid != "")
|
if (isset($postgid) && $postgid != "")
|
||||||
{
|
{
|
||||||
|
|
||||||
$array_result=checkMovequestionConstraintsForConditions(sanitize_int($postsid),sanitize_int($postqid), sanitize_int($postgid));
|
|
||||||
// If there is no blocking conditions that could prevent this move
|
|
||||||
if (is_null($array_result['notAbove']) && is_null($array_result['notBelow']))
|
|
||||||
{
|
|
||||||
|
|
||||||
$questlangs = GetAdditionalLanguagesFromSurveyID($postsid);
|
$questlangs = GetAdditionalLanguagesFromSurveyID($postsid);
|
||||||
$baselang = GetBaseLanguageFromSurveyID($postsid);
|
$baselang = GetBaseLanguageFromSurveyID($postsid);
|
||||||
array_push($questlangs,$baselang);
|
array_push($questlangs,$baselang);
|
||||||
@@ -538,8 +566,8 @@ if(isset($surveyid))
|
|||||||
{
|
{
|
||||||
if ($filterxsshtml)
|
if ($filterxsshtml)
|
||||||
{
|
{
|
||||||
$_POST['question_'.$qlang]=$myFilter->process($_POST['question_'.$qlang]);
|
$_POST['question_'.$qlang]=$myFilter->process(html_entity_decode($_POST['question_'.$qlang], ENT_QUOTES, "UTF-8"));
|
||||||
$_POST['help_'.$qlang]=$myFilter->process($_POST['help_'.$qlang]);
|
$_POST['help_'.$qlang]=$myFilter->process(html_entity_decode($_POST['help_'.$qlang], ENT_QUOTES, "UTF-8"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -556,7 +584,8 @@ if(isset($surveyid))
|
|||||||
. "SET type='".db_quote($_POST['type'])."', title='".db_quote($_POST['title'])."', "
|
. "SET type='".db_quote($_POST['type'])."', title='".db_quote($_POST['title'])."', "
|
||||||
. "question='".db_quote($_POST['question_'.$qlang])."', preg='".db_quote($_POST['preg'])."', help='".db_quote($_POST['help_'.$qlang])."', "
|
. "question='".db_quote($_POST['question_'.$qlang])."', preg='".db_quote($_POST['preg'])."', help='".db_quote($_POST['help_'.$qlang])."', "
|
||||||
. "gid='".db_quote($postgid)."', other='".db_quote($_POST['other'])."', "
|
. "gid='".db_quote($postgid)."', other='".db_quote($_POST['other'])."', "
|
||||||
. "mandatory='".db_quote($_POST['mandatory'])."'";
|
. "mandatory='".db_quote($_POST['mandatory'])."'"
|
||||||
|
. ", relevance='".db_quote($_POST['relevance'])."'";;
|
||||||
if ($oldgid!=$postgid)
|
if ($oldgid!=$postgid)
|
||||||
{
|
{
|
||||||
if ( getGroupOrder(returnglobal('sid'),$oldgid) > getGroupOrder(returnglobal('sid'),returnglobal('gid')) )
|
if ( getGroupOrder(returnglobal('sid'),$oldgid) > getGroupOrder(returnglobal('sid'),returnglobal('gid')) )
|
||||||
@@ -609,44 +638,13 @@ if(isset($surveyid))
|
|||||||
$_SESSION['flashmessage'] = $clang->gT("Question was successfully saved.");
|
$_SESSION['flashmessage'] = $clang->gT("Question was successfully saved.");
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// There are conditions constraints: alert the user
|
|
||||||
$errormsg="";
|
|
||||||
if (!is_null($array_result['notAbove']))
|
|
||||||
{
|
|
||||||
$errormsg.=$clang->gT("This question relies on other question's answers and can't be moved above groupId:","js")
|
|
||||||
. " " . $array_result['notAbove'][0][0] . " " . $clang->gT("in position","js")." ".$array_result['notAbove'][0][1]."\\n"
|
|
||||||
. $clang->gT("See conditions:")."\\n";
|
|
||||||
|
|
||||||
foreach ($array_result['notAbove'] as $notAboveCond)
|
|
||||||
{
|
|
||||||
$errormsg.="- cid:". $notAboveCond[3]."\\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (!is_null($array_result['notBelow']))
|
|
||||||
{
|
|
||||||
$errormsg.=$clang->gT("Some questions rely on this question's answers. You can't move this question below groupId:","js")
|
|
||||||
. " " . $array_result['notBelow'][0][0] . " " . $clang->gT("in position","js")." ".$array_result['notBelow'][0][1]."\\n"
|
|
||||||
. $clang->gT("See conditions:")."\\n";
|
|
||||||
|
|
||||||
foreach ($array_result['notBelow'] as $notBelowCond)
|
|
||||||
{
|
|
||||||
$errormsg.="- cid:". $notBelowCond[3]."\\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"$errormsg\")\n //-->\n</script>\n";
|
|
||||||
$gid= $oldgid; // group move impossible ==> keep display on oldgid
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Question could not be updated","js")."\")\n //-->\n</script>\n";
|
$databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Question could not be updated","js")."\")\n //-->\n</script>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($surveyid);
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == "copynewquestion" && bHasSurveyPermission($surveyid, 'surveycontent','create'))
|
elseif ($action == "copynewquestion" && bHasSurveyPermission($surveyid, 'surveycontent','create'))
|
||||||
@@ -686,8 +684,8 @@ if(isset($surveyid))
|
|||||||
$_POST['question_'.$baselang]=fix_FCKeditor_text($_POST['question_'.$baselang]);
|
$_POST['question_'.$baselang]=fix_FCKeditor_text($_POST['question_'.$baselang]);
|
||||||
$_POST['help_'.$baselang]=fix_FCKeditor_text($_POST['help_'.$baselang]);
|
$_POST['help_'.$baselang]=fix_FCKeditor_text($_POST['help_'.$baselang]);
|
||||||
$_POST = array_map('db_quote', $_POST);
|
$_POST = array_map('db_quote', $_POST);
|
||||||
$query = "INSERT INTO {$dbprefix}questions (sid, gid, type, title, question, preg, help, other, mandatory, question_order, language)
|
$query = "INSERT INTO {$dbprefix}questions (sid, gid, type, title, question, preg, help, other, mandatory, relevance, question_order, language)
|
||||||
VALUES ({$postsid}, {$postgid}, '{$_POST['type']}', '{$_POST['title']}', '".$_POST['question_'.$baselang]."', '{$_POST['preg']}', '".$_POST['help_'.$baselang]."', '{$_POST['other']}', '{$_POST['mandatory']}', $max,".db_quoteall($baselang).")";
|
VALUES ({$postsid}, {$postgid}, '{$_POST['type']}', '{$_POST['title']}', '".$_POST['question_'.$baselang]."', '{$_POST['preg']}', '".$_POST['help_'.$baselang]."', '{$_POST['other']}', '{$_POST['mandatory']}', '{$_POST['relevance']}', $max,".db_quoteall($baselang).")";
|
||||||
$result = $connect->Execute($query) or safe_die($connect->ErrorMsg()); // Checked
|
$result = $connect->Execute($query) or safe_die($connect->ErrorMsg()); // Checked
|
||||||
$newqid = $connect->Insert_ID("{$dbprefix}questions","qid");
|
$newqid = $connect->Insert_ID("{$dbprefix}questions","qid");
|
||||||
if (!$result)
|
if (!$result)
|
||||||
@@ -714,8 +712,8 @@ if(isset($surveyid))
|
|||||||
$_POST['help_'.$qlanguage]=fix_FCKeditor_text($_POST['help_'.$qlanguage]);
|
$_POST['help_'.$qlanguage]=fix_FCKeditor_text($_POST['help_'.$qlanguage]);
|
||||||
|
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
$query = "INSERT INTO {$dbprefix}questions (qid, sid, gid, type, title, question, help, other, mandatory, question_order, language)
|
$query = "INSERT INTO {$dbprefix}questions (qid, sid, gid, type, title, question, help, other, mandatory, relevance, question_order, language)
|
||||||
VALUES ($newqid,{$postsid}, {$postgid}, '{$_POST['type']}', '{$_POST['title']}', '".$_POST['question_'.$qlanguage]."', '".$_POST['help_'.$qlanguage]."', '{$_POST['other']}', '{$_POST['mandatory']}', $max,".db_quoteall($qlanguage).")";
|
VALUES ($newqid,{$postsid}, {$postgid}, '{$_POST['type']}', '{$_POST['title']}', '".$_POST['question_'.$qlanguage]."', '".$_POST['help_'.$qlanguage]."', '{$_POST['other']}', '{$_POST['mandatory']}', '{$_POST['relevance']}', $max,".db_quoteall($qlanguage).")";
|
||||||
$result = $connect->Execute($query) or safe_die($connect->ErrorMsg()); // Checked
|
$result = $connect->Execute($query) or safe_die($connect->ErrorMsg()); // Checked
|
||||||
db_switchIDInsert('questions',false);
|
db_switchIDInsert('questions',false);
|
||||||
}
|
}
|
||||||
@@ -769,10 +767,10 @@ if(isset($surveyid))
|
|||||||
while ($qr1 = $r1->FetchRow())
|
while ($qr1 = $r1->FetchRow())
|
||||||
{
|
{
|
||||||
$qr1 = array_map('db_quote', $qr1);
|
$qr1 = array_map('db_quote', $qr1);
|
||||||
$i1 = "INSERT INTO {$dbprefix}answers (qid, code, answer, sortorder, language, scale_id) "
|
$i1 = "INSERT INTO {$dbprefix}answers (qid, code, answer, sortorder, language, scale_id, assessment_value) "
|
||||||
. "VALUES ('$newqid', '{$qr1['code']}', "
|
. "VALUES ('$newqid', '{$qr1['code']}', "
|
||||||
. "'{$qr1['answer']}', "
|
. "'{$qr1['answer']}', "
|
||||||
. "'{$qr1['sortorder']}', '{$qr1['language']}', '{$qr1['scale_id']}')";
|
. "'{$qr1['sortorder']}', '{$qr1['language']}', '{$qr1['scale_id']}', '{$qr1['assessment_value']}')";
|
||||||
$ir1 = $connect->Execute($i1); // Checked
|
$ir1 = $connect->Execute($i1); // Checked
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -799,12 +797,15 @@ if(isset($surveyid))
|
|||||||
$qid=$newqid; //Sets the qid so that admin.php displays the newly created question
|
$qid=$newqid; //Sets the qid so that admin.php displays the newly created question
|
||||||
$_SESSION['flashmessage'] = $clang->gT("Question was successfully copied.");
|
$_SESSION['flashmessage'] = $clang->gT("Question was successfully copied.");
|
||||||
|
|
||||||
|
LimeExpressionManager::SetDirtyFlag(); // so refreshes syntax highlighting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($action == "delquestion" && bHasSurveyPermission($surveyid, 'surveycontent','delete'))
|
elseif ($action == "delquestion" && bHasSurveyPermission($surveyid, 'surveycontent','delete'))
|
||||||
{
|
{
|
||||||
if (!isset($qid)) {$qid=returnglobal('qid');}
|
if (!isset($qid)) {$qid=returnglobal('qid');}
|
||||||
//check if any other questions have conditions which rely on this question. Don't delete if there are.
|
//check if any other questions have conditions which rely on this question. Don't delete if there are.
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance(NULL,$qid);
|
||||||
|
|
||||||
$ccquery = "SELECT * FROM {$dbprefix}conditions WHERE cqid=$qid";
|
$ccquery = "SELECT * FROM {$dbprefix}conditions WHERE cqid=$qid";
|
||||||
$ccresult = db_execute_assoc($ccquery) or safe_die ("Couldn't get list of cqids for this question<br />".$ccquery."<br />".$connect->ErrorMsg()); // Checked
|
$ccresult = db_execute_assoc($ccquery) or safe_die ("Couldn't get list of cqids for this question<br />".$ccquery."<br />".$connect->ErrorMsg()); // Checked
|
||||||
$cccount=$ccresult->RecordCount();
|
$cccount=$ccresult->RecordCount();
|
||||||
@@ -860,6 +861,8 @@ if(isset($surveyid))
|
|||||||
$query = "delete from ".db_table_name('answers')." where qid=".db_quote($qid);
|
$query = "delete from ".db_table_name('answers')." where qid=".db_quote($qid);
|
||||||
$result = $connect->Execute($query); // Checked
|
$result = $connect->Execute($query); // Checked
|
||||||
|
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($surveyid);
|
||||||
|
|
||||||
for ($scale_id=0;$scale_id<$scalecount;$scale_id++)
|
for ($scale_id=0;$scale_id<$scalecount;$scale_id++)
|
||||||
{
|
{
|
||||||
$maxcount=(int)$_POST['answercount_'.$scale_id];
|
$maxcount=(int)$_POST['answercount_'.$scale_id];
|
||||||
@@ -908,6 +911,8 @@ if(isset($surveyid))
|
|||||||
} // for ($sortorderid=0;$sortorderid<$maxcount;$sortorderid++)
|
} // for ($sortorderid=0;$sortorderid<$maxcount;$sortorderid++)
|
||||||
} // for ($scale_id=0;
|
} // for ($scale_id=0;
|
||||||
|
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($surveyid);
|
||||||
|
|
||||||
if ($invalidCode == 1) $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Answers with a code of 0 (zero) or blank code are not allowed, and will not be saved","js")."\")\n //-->\n</script>\n";
|
if ($invalidCode == 1) $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Answers with a code of 0 (zero) or blank code are not allowed, and will not be saved","js")."\")\n //-->\n</script>\n";
|
||||||
if ($duplicateCode == 1) $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Duplicate codes found, these entries won't be updated","js")."\")\n //-->\n</script>\n";
|
if ($duplicateCode == 1) $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Duplicate codes found, these entries won't be updated","js")."\")\n //-->\n</script>\n";
|
||||||
|
|
||||||
@@ -933,6 +938,8 @@ if(isset($surveyid))
|
|||||||
// First delete any deleted ids
|
// First delete any deleted ids
|
||||||
$deletedqids=explode(' ', trim($_POST['deletedqids']));
|
$deletedqids=explode(' ', trim($_POST['deletedqids']));
|
||||||
|
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($surveyid);
|
||||||
|
|
||||||
foreach ($deletedqids as $deletedqid)
|
foreach ($deletedqids as $deletedqid)
|
||||||
{
|
{
|
||||||
$deletedqid=(int)$deletedqid;
|
$deletedqid=(int)$deletedqid;
|
||||||
@@ -987,7 +994,8 @@ if(isset($surveyid))
|
|||||||
$myFilter = new InputFilter('','',1,1,1);
|
$myFilter = new InputFilter('','',1,1,1);
|
||||||
|
|
||||||
|
|
||||||
$insertqids=array();
|
//$insertqids=array(); //?
|
||||||
|
$insertqid = array();
|
||||||
for ($scale_id=0;$scale_id<$scalecount;$scale_id++)
|
for ($scale_id=0;$scale_id<$scalecount;$scale_id++)
|
||||||
{
|
{
|
||||||
foreach ($anslangs as $language)
|
foreach ($anslangs as $language)
|
||||||
@@ -1010,18 +1018,18 @@ if(isset($surveyid))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!isset($insertqid[$position]))
|
if (!isset($insertqid[$scale_id][$position]))
|
||||||
{
|
{
|
||||||
$query='INSERT into '.db_table_name('questions').' (sid, gid, question_order, title, question, parent_qid, language, scale_id) values ('.$surveyid.','.$gid.','.($position+1).','.db_quoteall($codes[$scale_id][$position]).','.db_quoteall($subquestionvalue).','.$qid.','.db_quoteall($language).','.$scale_id.')';
|
$query='INSERT into '.db_table_name('questions').' (sid, gid, question_order, title, question, parent_qid, language, scale_id) values ('.$surveyid.','.$gid.','.($position+1).','.db_quoteall($codes[$scale_id][$position]).','.db_quoteall($subquestionvalue).','.$qid.','.db_quoteall($language).','.$scale_id.')';
|
||||||
$connect->execute($query);
|
$connect->execute($query);
|
||||||
$insertqid[$position]=$connect->Insert_Id(db_table_name_nq('questions'),"qid");
|
$insertqid[$scale_id][$position]=$connect->Insert_Id(db_table_name_nq('questions'),"qid");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
$query='INSERT into '.db_table_name('questions').' (qid, sid, gid, question_order, title, question, parent_qid, language, scale_id) values ('.$insertqid[$position].','.$surveyid.','.$gid.','.($position+1).','.db_quoteall($codes[$scale_id][$position]).','.db_quoteall($subquestionvalue).','.$qid.','.db_quoteall($language).','.$scale_id.')';
|
$query='INSERT into '.db_table_name('questions').' (qid, sid, gid, question_order, title, question, parent_qid, language, scale_id) values ('.$insertqid[$scale_id][$position].','.$surveyid.','.$gid.','.($position+1).','.db_quoteall($codes[$scale_id][$position]).','.db_quoteall($subquestionvalue).','.$qid.','.db_quoteall($language).','.$scale_id.')';
|
||||||
$connect->execute($query);
|
$connect->execute($query);
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$position++;
|
$position++;
|
||||||
@@ -1029,6 +1037,8 @@ if(isset($surveyid))
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($surveyid);
|
||||||
|
|
||||||
//include("surveytable_functions.php");
|
//include("surveytable_functions.php");
|
||||||
//surveyFixColumns($surveyid);
|
//surveyFixColumns($surveyid);
|
||||||
$_SESSION['flashmessage'] = $clang->gT("Subquestions were successfully saved.");
|
$_SESSION['flashmessage'] = $clang->gT("Subquestions were successfully saved.");
|
||||||
@@ -1100,7 +1110,7 @@ if(isset($surveyid))
|
|||||||
'printanswers'=>$_POST['printanswers'],
|
'printanswers'=>$_POST['printanswers'],
|
||||||
'publicstatistics'=>$_POST['publicstatistics'],
|
'publicstatistics'=>$_POST['publicstatistics'],
|
||||||
'autoredirect'=>$_POST['autoredirect'],
|
'autoredirect'=>$_POST['autoredirect'],
|
||||||
'showXquestions'=>$_POST['showXquestions'],
|
'showxquestions'=>$_POST['showxquestions'],
|
||||||
'showgroupinfo'=>$_POST['showgroupinfo'],
|
'showgroupinfo'=>$_POST['showgroupinfo'],
|
||||||
'showqnumcode'=>$_POST['showqnumcode'],
|
'showqnumcode'=>$_POST['showqnumcode'],
|
||||||
'shownoanswer'=>$_POST['shownoanswer'],
|
'shownoanswer'=>$_POST['shownoanswer'],
|
||||||
@@ -1116,6 +1126,8 @@ if(isset($surveyid))
|
|||||||
'usecaptcha'=>$_POST['usecaptcha'],
|
'usecaptcha'=>$_POST['usecaptcha'],
|
||||||
'emailresponseto'=>trim($_POST['emailresponseto']),
|
'emailresponseto'=>trim($_POST['emailresponseto']),
|
||||||
'emailnotificationto'=>trim($_POST['emailnotificationto']),
|
'emailnotificationto'=>trim($_POST['emailnotificationto']),
|
||||||
|
'googleanalyticsapikey'=>trim($_POST['googleanalyticsapikey']),
|
||||||
|
'googleanalyticsstyle'=>trim($_POST['googleanalyticsstyle']),
|
||||||
'tokenlength'=>$_POST['tokenlength']
|
'tokenlength'=>$_POST['tokenlength']
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1399,7 +1411,7 @@ elseif ($action == "insertsurvey" && $_SESSION['USER_RIGHT_CREATE_SURVEY'])
|
|||||||
'allowsave'=>$_POST['allowsave'],
|
'allowsave'=>$_POST['allowsave'],
|
||||||
'navigationdelay'=>$_POST['navigationdelay'],
|
'navigationdelay'=>$_POST['navigationdelay'],
|
||||||
'autoredirect'=>$_POST['autoredirect'],
|
'autoredirect'=>$_POST['autoredirect'],
|
||||||
'showXquestions'=>$_POST['showXquestions'],
|
'showxquestions'=>$_POST['showxquestions'],
|
||||||
'showgroupinfo'=>$_POST['showgroupinfo'],
|
'showgroupinfo'=>$_POST['showgroupinfo'],
|
||||||
'showqnumcode'=>$_POST['showqnumcode'],
|
'showqnumcode'=>$_POST['showqnumcode'],
|
||||||
'shownoanswer'=>$_POST['shownoanswer'],
|
'shownoanswer'=>$_POST['shownoanswer'],
|
||||||
@@ -1474,6 +1486,7 @@ elseif ($action == "insertsurvey" && $_SESSION['USER_RIGHT_CREATE_SURVEY'])
|
|||||||
|
|
||||||
// Update survey permissions
|
// Update survey permissions
|
||||||
GiveAllSurveyPermissions($_SESSION['loginID'],$surveyid);
|
GiveAllSurveyPermissions($_SESSION['loginID'],$surveyid);
|
||||||
|
LimeExpressionManager::SetSurveyId($surveyid);
|
||||||
|
|
||||||
$surveyselect = getsurveylist();
|
$surveyselect = getsurveylist();
|
||||||
|
|
||||||
@@ -1490,11 +1503,13 @@ elseif ($action == "insertsurvey" && $_SESSION['USER_RIGHT_CREATE_SURVEY'])
|
|||||||
elseif ($action == "savepersonalsettings")
|
elseif ($action == "savepersonalsettings")
|
||||||
{
|
{
|
||||||
$_POST = array_map('db_quote', $_POST);
|
$_POST = array_map('db_quote', $_POST);
|
||||||
$uquery = "UPDATE {$dbprefix}users SET lang='{$_POST['lang']}', dateformat='{$_POST['dateformat']}', htmleditormode= '{$_POST['htmleditormode']}'
|
$uquery = "UPDATE {$dbprefix}users SET lang='{$_POST['lang']}', dateformat='{$_POST['dateformat']}', htmleditormode= '{$_POST['htmleditormode']}', questionselectormode= '{$_POST['questionselectormode']}', templateeditormode= '{$_POST['templateeditormode']}'
|
||||||
WHERE uid={$_SESSION['loginID']}";
|
WHERE uid={$_SESSION['loginID']}";
|
||||||
$uresult = $connect->Execute($uquery) or safe_die ($uquery."<br />".$connect->ErrorMsg()); // Checked
|
$uresult = $connect->Execute($uquery) or safe_die ($uquery."<br />".$connect->ErrorMsg()); // Checked
|
||||||
$_SESSION['adminlang']=$_POST['lang'];
|
$_SESSION['adminlang']=$_POST['lang'];
|
||||||
$_SESSION['htmleditormode']=$_POST['htmleditormode'];
|
$_SESSION['htmleditormode']=$_POST['htmleditormode'];
|
||||||
|
$_SESSION['questionselectormode']=$_POST['questionselectormode'];
|
||||||
|
$_SESSION['templateeditormode']=$_POST['templateeditormode'];
|
||||||
$_SESSION['dateformat']= $_POST['dateformat'];
|
$_SESSION['dateformat']= $_POST['dateformat'];
|
||||||
$_SESSION['flashmessage'] = $clang->gT("Your personal settings were successfully saved.");
|
$_SESSION['flashmessage'] = $clang->gT("Your personal settings were successfully saved.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: dataentry.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: dataentry.php 12452 2012-02-14 11:33:25Z maziminke $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -267,7 +267,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$columns[] .= db_quote_id($fieldname);
|
$columns[] .= db_quote_id($fieldname);
|
||||||
$values[] .= db_quoteall(json_encode($phparray), true);
|
$values[] .= db_quoteall(ls_json_encode($phparray), true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -351,7 +351,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
"identifier"=>$saver['identifier'],
|
"identifier"=>$saver['identifier'],
|
||||||
"access_code"=>$password,
|
"access_code"=>$password,
|
||||||
"email"=>$saver['email'],
|
"email"=>$saver['email'],
|
||||||
"ip"=>$_SERVER['REMOTE_ADDR'],
|
"ip"=>getIPAddress(),
|
||||||
"refurl"=>getenv("HTTP_REFERER"),
|
"refurl"=>getenv("HTTP_REFERER"),
|
||||||
'saved_thisstep' => 0,
|
'saved_thisstep' => 0,
|
||||||
"status"=>"S",
|
"status"=>"S",
|
||||||
@@ -553,6 +553,10 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
//$dataentryoutput .= "<pre>"; print_r($fname);$dataentryoutput .= "</pre>";
|
//$dataentryoutput .= "<pre>"; print_r($fname);$dataentryoutput .= "</pre>";
|
||||||
if (isset($idrow[$fname['fieldname']])) $answer = $idrow[$fname['fieldname']];
|
if (isset($idrow[$fname['fieldname']])) $answer = $idrow[$fname['fieldname']];
|
||||||
$question=$fname['question'];
|
$question=$fname['question'];
|
||||||
|
|
||||||
|
//get survey details
|
||||||
|
$thissurvey=getSurveyInfo($surveyid);
|
||||||
|
|
||||||
$dataentryoutput .= "\t<tr";
|
$dataentryoutput .= "\t<tr";
|
||||||
if ($highlight) $dataentryoutput .=" class='odd'";
|
if ($highlight) $dataentryoutput .=" class='odd'";
|
||||||
else $dataentryoutput .=" class='even'";
|
else $dataentryoutput .=" class='even'";
|
||||||
@@ -596,7 +600,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
case "Q":
|
case "Q":
|
||||||
case "K":
|
case "K":
|
||||||
$dataentryoutput .= "\t{$fname['subquestion']} <input type='text' name='{$fname['fieldname']}' value='"
|
$dataentryoutput .= "\t{$fname['subquestion']} <input type='text' name='{$fname['fieldname']}' value='"
|
||||||
.$idrow[$fname['fieldname']] . "' />\n";
|
.htmlspecialchars($idrow[$fname['fieldname']],ENT_QUOTES) . "' />\n";
|
||||||
break;
|
break;
|
||||||
case "id":
|
case "id":
|
||||||
$dataentryoutput .= "<span style='font-weight:bold;'> {$idrow[$fname['fieldname']]}</span>";
|
$dataentryoutput .= "<span style='font-weight:bold;'> {$idrow[$fname['fieldname']]}</span>";
|
||||||
@@ -605,7 +609,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
for ($x=1; $x<=5; $x++)
|
for ($x=1; $x<=5; $x++)
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='$x'";
|
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='$x'";
|
||||||
if ($idrow[$fname['fieldname']] == $x) {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == $x) {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />$x \n";
|
$dataentryoutput .= " />$x \n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -925,7 +929,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "\t<input type='checkbox' class='checkboxbtn' name='{$fname['fieldname']}' value='Y'";
|
$dataentryoutput .= "\t<input type='checkbox' class='checkboxbtn' name='{$fname['fieldname']}' value='Y'";
|
||||||
if ($idrow[$fname['fieldname']] == "Y") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "Y") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />{$fname['subquestion']}<br />\n";
|
$dataentryoutput .= " />{$fname['subquestion']}<br />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -987,7 +991,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
{
|
{
|
||||||
$dataentryoutput .= "\t<tr>\n"
|
$dataentryoutput .= "\t<tr>\n"
|
||||||
."<td><input type='checkbox' class='checkboxbtn' name=\"{$fname['fieldname']}\" value='Y'";
|
."<td><input type='checkbox' class='checkboxbtn' name=\"{$fname['fieldname']}\" value='Y'";
|
||||||
if ($idrow[$fname['fieldname']] == "Y") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "Y") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />{$fname['subquestion']}</td>\n";
|
$dataentryoutput .= " />{$fname['subquestion']}</td>\n";
|
||||||
}
|
}
|
||||||
$fname=next($fnames);
|
$fname=next($fnames);
|
||||||
@@ -1014,7 +1018,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
.'<tr><td></td><td><input type="hidden" class="'.$fname['fieldname'].'" id="'.$fname['fieldname'].'_ext_'.$i .'" name="ext" size=50 value="'.htmlspecialchars($metadata[$i]["ext"]) .'" /></td></tr>'
|
.'<tr><td></td><td><input type="hidden" class="'.$fname['fieldname'].'" id="'.$fname['fieldname'].'_ext_'.$i .'" name="ext" size=50 value="'.htmlspecialchars($metadata[$i]["ext"]) .'" /></td></tr>'
|
||||||
.'<tr><td></td><td><input type="hidden" class="'.$fname['fieldname'].'" id="'.$fname['fieldname'].'_filename_'.$i .'" name="filename" size=50 value="'.htmlspecialchars(rawurldecode($metadata[$i]["filename"])) .'" /></td></tr>';
|
.'<tr><td></td><td><input type="hidden" class="'.$fname['fieldname'].'" id="'.$fname['fieldname'].'_filename_'.$i .'" name="filename" size=50 value="'.htmlspecialchars(rawurldecode($metadata[$i]["filename"])) .'" /></td></tr>';
|
||||||
}
|
}
|
||||||
$dataentryoutput .= '<tr><td></td><td><input type="hidden" id="'.$fname['fieldname'].'" name="'.$fname['fieldname'].'" size=50 value="'.htmlspecialchars($idrow[$fname['fieldname']]).'" /></td></tr>';
|
$dataentryoutput .= '<tr><td></td><td><input type="hidden" id="'.$fname['fieldname'].'" name="'.$fname['fieldname'].'" size=50 value="'.htmlspecialchars($idrow[$fname['fieldname']],ENT_QUOTES).'" /></td></tr>';
|
||||||
$dataentryoutput .= '</table>';
|
$dataentryoutput .= '</table>';
|
||||||
$dataentryoutput .= '<script type="text/javascript">
|
$dataentryoutput .= '<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
@@ -1042,25 +1046,233 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//file count
|
{//file count
|
||||||
$dataentryoutput .= '<input readonly id="'.$fname['fieldname'].'" name="'.$fname['fieldname'].'" value ="'.htmlspecialchars($idrow[$fname['fieldname']]).'" /></td></table>';
|
$dataentryoutput .= '<input readonly id="'.$fname['fieldname'].'" name="'.$fname['fieldname'].'" value ="'.htmlspecialchars($idrow[$fname['fieldname']],ENT_QUOTES).'" /></td></table>';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case "N": //NUMERICAL TEXT
|
case "N": //NUMERICAL TEXT
|
||||||
$dataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' value='{$idrow[$fname['fieldname']]}' "
|
|
||||||
."onkeypress=\"return goodchars(event,'0123456789.,')\" />\n";
|
//get question attributes to change some style and validation settings
|
||||||
|
$qidattributes = getQuestionAttributes($fname['qid']);
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='') {
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='')
|
||||||
|
{
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (intval(trim($qidattributes['maximum_chars']))>0 && intval(trim($qidattributes['maximum_chars']))<20) // Limt to 20 chars for numeric
|
||||||
|
{
|
||||||
|
$maximum_chars= intval(trim($qidattributes['maximum_chars']));
|
||||||
|
$maxlength= "maxlength='{$maximum_chars}' ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$maxlength= "maxlength='20' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trim($qidattributes['num_value_int_only'])==1)
|
||||||
|
{
|
||||||
|
$acomma="";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$acomma=getRadixPointData($thissurvey['surveyls_numberformat']);
|
||||||
|
$acomma = $acomma['seperator'];
|
||||||
|
|
||||||
|
}
|
||||||
|
$sSeperator = getRadixPointData($thissurvey['surveyls_numberformat']);
|
||||||
|
|
||||||
|
$dataentryoutput .= $prefix. "<input type='text' size='".$tiwidth."' name='{$fname['fieldname']}' value='".htmlspecialchars($idrow[$fname['fieldname']],ENT_QUOTES)."'
|
||||||
|
title='".$clang->gT('Only numbers may be entered in this field')."' $maxlength onkeypress=\"return goodchars(event,'-0123456789{$acomma}')\" />".$suffix;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "S": //SHORT FREE TEXT
|
case "S": //SHORT FREE TEXT
|
||||||
$dataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' value='"
|
|
||||||
.htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "' />\n";
|
//get question attributes to change some style and validation settings
|
||||||
|
$qidattributes = getQuestionAttributes($fname['qid']);
|
||||||
|
|
||||||
|
if ($qidattributes['numbers_only']==1)
|
||||||
|
{
|
||||||
|
$sSeperator = getRadixPointData($thissurvey['surveyls_numberformat']);
|
||||||
|
$sSeperator = $sSeperator['seperator'];
|
||||||
|
$numbersonly = 'onkeypress="return goodchars(event,\'-0123456789'.$sSeperator.'\')"';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$numbersonly = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (intval(trim($qidattributes['maximum_chars']))>0)
|
||||||
|
{
|
||||||
|
// Only maxlength attribute, use textarea[maxlength] jquery selector for textarea
|
||||||
|
$maximum_chars= intval(trim($qidattributes['maximum_chars']));
|
||||||
|
$maxlength= "maxlength='{$maximum_chars}' ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$maxlength= "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=50;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='')
|
||||||
|
{
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='')
|
||||||
|
{
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trim($qidattributes['display_rows'])!='')
|
||||||
|
{
|
||||||
|
//question attribute "display_rows" is set -> we need a textarea to be able to show several rows
|
||||||
|
$drows=$qidattributes['display_rows'];
|
||||||
|
|
||||||
|
//if a textarea should be displayed we make it equal width to the long text question
|
||||||
|
//this looks nicer and more continuous
|
||||||
|
if($tiwidth == 50)
|
||||||
|
{
|
||||||
|
$tiwidth=40;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dataentryoutput .= $prefix."<textarea $numbersonly name='{$fname['fieldname']}' rows='".$drows."' cols='".$tiwidth."' >";
|
||||||
|
$dataentryoutput .= htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) ."</textarea>$suffix\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//no question attribute set, use common input text field
|
||||||
|
$dataentryoutput .= $prefix."<input type=\"text\" size=\"$tiwidth\"
|
||||||
|
name='{$fname['fieldname']}' value='"
|
||||||
|
.htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "' ";
|
||||||
|
$dataentryoutput .=" {$maxlength} $numbersonly />\n\t$suffix\n\n";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case "T": //LONG FREE TEXT
|
case "T": //LONG FREE TEXT
|
||||||
$dataentryoutput .= "\t<textarea rows='5' cols='45' name='{$fname['fieldname']}'>"
|
|
||||||
.htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "</textarea>\n";
|
//get question attributes to change some style and validation settings
|
||||||
|
$qidattributes=getQuestionAttributes($fname['qid']);
|
||||||
|
|
||||||
|
if (trim($qidattributes['display_rows'])!='')
|
||||||
|
{
|
||||||
|
$drows=$qidattributes['display_rows'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$drows=5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=40;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='')
|
||||||
|
{
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='')
|
||||||
|
{
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$dataentryoutput .= $prefix."<textarea name='{$fname['fieldname']}' rows='$drows' cols='$tiwidth' >"
|
||||||
|
.htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) ."</textarea>$suffix\n";
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case "U": //HUGE FREE TEXT
|
case "U": //HUGE FREE TEXT
|
||||||
$dataentryoutput .= "\t<textarea rows='50' cols='70' name='{$fname['fieldname']}'>"
|
|
||||||
.htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "</textarea>\n";
|
//get question attributes to change some style and validation settings
|
||||||
|
$qidattributes=getQuestionAttributes($fname['qid']);
|
||||||
|
|
||||||
|
if (trim($qidattributes['display_rows'])!='')
|
||||||
|
{
|
||||||
|
$drows=$qidattributes['display_rows'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$drows=70;
|
||||||
|
}
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=50;
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='') {
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='') {
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
$dataentryoutput .= $prefix.'<textarea name="'.$fname['fieldname'].'" rows="'.$drows.'" cols="'.$tiwidth.'">';
|
||||||
|
$dataentryoutput .= htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "</textarea>$suffix\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case "Y": //YES/NO radio-buttons
|
case "Y": //YES/NO radio-buttons
|
||||||
$dataentryoutput .= "\t<select name='{$fname['fieldname']}'>\n"
|
$dataentryoutput .= "\t<select name='{$fname['fieldname']}'>\n"
|
||||||
."<option value=''";
|
."<option value=''";
|
||||||
@@ -1085,7 +1297,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
for ($j=1; $j<=5; $j++)
|
for ($j=1; $j<=5; $j++)
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='$j'";
|
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='$j'";
|
||||||
if ($idrow[$fname['fieldname']] == $j) {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == $j) {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />$j \n";
|
$dataentryoutput .= " />$j \n";
|
||||||
}
|
}
|
||||||
$dataentryoutput .= "</td>\n"
|
$dataentryoutput .= "</td>\n"
|
||||||
@@ -1107,7 +1319,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
for ($j=1; $j<=10; $j++)
|
for ($j=1; $j<=10; $j++)
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='$j'";
|
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='$j'";
|
||||||
if ($idrow[$fname['fieldname']] == $j) {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == $j) {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />$j \n";
|
$dataentryoutput .= " />$j \n";
|
||||||
}
|
}
|
||||||
$dataentryoutput .= "</td>\n"
|
$dataentryoutput .= "</td>\n"
|
||||||
@@ -1127,13 +1339,13 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
."<td align='right'>{$fname['subquestion']}</td>\n"
|
."<td align='right'>{$fname['subquestion']}</td>\n"
|
||||||
."<td>\n"
|
."<td>\n"
|
||||||
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='Y'";
|
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='Y'";
|
||||||
if ($idrow[$fname['fieldname']] == "Y") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "Y") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />".$clang->gT("Yes")." \n"
|
$dataentryoutput .= " />".$clang->gT("Yes")." \n"
|
||||||
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='U'";
|
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='U'";
|
||||||
if ($idrow[$fname['fieldname']] == "U") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "U") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />".$clang->gT("Uncertain")." \n"
|
$dataentryoutput .= " />".$clang->gT("Uncertain")." \n"
|
||||||
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='N'";
|
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='N'";
|
||||||
if ($idrow[$fname['fieldname']] == "N") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "N") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />".$clang->gT("No")." \n"
|
$dataentryoutput .= " />".$clang->gT("No")." \n"
|
||||||
."</td>\n"
|
."</td>\n"
|
||||||
."\t</tr>\n";
|
."\t</tr>\n";
|
||||||
@@ -1152,13 +1364,13 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
."<td align='right'>{$fname['subquestion']}</td>\n"
|
."<td align='right'>{$fname['subquestion']}</td>\n"
|
||||||
."<td>\n"
|
."<td>\n"
|
||||||
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='I'";
|
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='I'";
|
||||||
if ($idrow[$fname['fieldname']] == "I") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "I") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />Increase \n"
|
$dataentryoutput .= " />Increase \n"
|
||||||
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='S'";
|
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='S'";
|
||||||
if ($idrow[$fname['fieldname']] == "I") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "I") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />Same \n"
|
$dataentryoutput .= " />Same \n"
|
||||||
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='D'";
|
."\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='D'";
|
||||||
if ($idrow[$fname['fieldname']] == "D") {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == "D") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />Decrease \n"
|
$dataentryoutput .= " />Decrease \n"
|
||||||
."</td>\n"
|
."</td>\n"
|
||||||
."\t</tr>\n";
|
."\t</tr>\n";
|
||||||
@@ -1190,12 +1402,12 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
while ($frow=$fresult->FetchRow())
|
while ($frow=$fresult->FetchRow())
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='{$frow['code']}'";
|
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value='{$frow['code']}'";
|
||||||
if ($idrow[$fname['fieldname']] == $frow['code']) {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == $frow['code']) {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />".$frow['answer']." \n";
|
$dataentryoutput .= " />".$frow['answer']." \n";
|
||||||
}
|
}
|
||||||
//Add 'No Answer'
|
//Add 'No Answer'
|
||||||
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value=''";
|
$dataentryoutput .= "\t<input type='radio' class='radiobtn' name='{$fname['fieldname']}' value=''";
|
||||||
if ($idrow[$fname['fieldname']] == '') {$dataentryoutput .= " checked";}
|
if ($idrow[$fname['fieldname']] == '') {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " />".$clang->gT("No answer")." \n";
|
$dataentryoutput .= " />".$clang->gT("No answer")." \n";
|
||||||
|
|
||||||
$dataentryoutput .= "</td>\n"
|
$dataentryoutput .= "</td>\n"
|
||||||
@@ -1247,17 +1459,18 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
$dataentryoutput .= "<td>\n";
|
$dataentryoutput .= "<td>\n";
|
||||||
if ($qidattributes['input_boxes']!=0) {
|
if ($qidattributes['input_boxes']!=0) {
|
||||||
$dataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' value='";
|
$dataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' value='";
|
||||||
if (!empty($idrow[$fname['fieldname']])) {$datentryoutput .= $idrow[$fname['fieldname']];}
|
if (!empty($idrow[$fname['fieldname']])) {$dataentryoutput .= htmlspecialchars($idrow[$fname['fieldname']],ENT_QUOTES);}
|
||||||
$dataentryoutput .= "' size=4 />";
|
$dataentryoutput .= "' size=\"4\" />";
|
||||||
} else {
|
} else {
|
||||||
$dataentryoutput .= "\t<select name='{$fname['fieldname']}'>\n";
|
$dataentryoutput .= "\t<select name='{$fname['fieldname']}'>\n";
|
||||||
$dataentryoutput .= "<option value=''>...</option>\n";
|
$dataentryoutput .= "<option value=''>...</option>\n";
|
||||||
for($ii=$minvalue;$ii<=$maxvalue;$ii+=$stepvalue)
|
for($ii=$minvalue;$ii<=$maxvalue;$ii+=$stepvalue)
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "<option value='$ii'";
|
$dataentryoutput .= "<option value='$ii'";
|
||||||
if($idrow[$fname['fieldname']] == $ii) {$dataentryoutput .= " selected";}
|
if($idrow[$fname['fieldname']] == $ii) {$dataentryoutput .= " selected='selected'";}
|
||||||
$dataentryoutput .= ">$ii</option>\n";
|
$dataentryoutput .= ">$ii</option>\n";
|
||||||
}
|
}
|
||||||
|
$dataentryoutput .= "</select>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$dataentryoutput .= "</td>\n"
|
$dataentryoutput .= "</td>\n"
|
||||||
@@ -1277,7 +1490,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
. "<td align='right' valign='top'>{$fname['subquestion1']}:{$fname['subquestion2']}</td>\n";
|
. "<td align='right' valign='top'>{$fname['subquestion1']}:{$fname['subquestion2']}</td>\n";
|
||||||
$dataentryoutput .= "<td>\n";
|
$dataentryoutput .= "<td>\n";
|
||||||
$dataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' value='";
|
$dataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' value='";
|
||||||
if(!empty($idrow[$fname['fieldname']])) {$dataentryoutput .= $idrow[$fname['fieldname']];}
|
if(!empty($idrow[$fname['fieldname']])) {$dataentryoutput .= htmlspecialchars($idrow[$fname['fieldname']],ENT_QUOTES);}
|
||||||
$dataentryoutput .= "' /></td>\n"
|
$dataentryoutput .= "' /></td>\n"
|
||||||
."\t</tr>\n";
|
."\t</tr>\n";
|
||||||
$fname=next($fnames);
|
$fname=next($fnames);
|
||||||
@@ -1296,19 +1509,19 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
} while ($fname=next($fnames));
|
} while ($fname=next($fnames));
|
||||||
}
|
}
|
||||||
$dataentryoutput .= "</table>\n"
|
$dataentryoutput .= "</table>\n"
|
||||||
."<p>\n";
|
."\n";
|
||||||
if (!bHasSurveyPermission($surveyid, 'responses','update'))
|
if (!bHasSurveyPermission($surveyid, 'responses','update'))
|
||||||
{ // if you are not survey owner or super admin you cannot modify responses
|
{ // if you are not survey owner or super admin you cannot modify responses
|
||||||
$dataentryoutput .= "<input type='button' value='".$clang->gT("Save")."' disabled='disabled'/>\n";
|
$dataentryoutput .= "<p><input type='button' value='".$clang->gT("Save")."' disabled='disabled'/></p>\n";
|
||||||
}
|
}
|
||||||
elseif ($subaction == "edit" && bHasSurveyPermission($surveyid,'responses','update'))
|
elseif ($subaction == "edit" && bHasSurveyPermission($surveyid,'responses','update'))
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "
|
$dataentryoutput .= "<p>
|
||||||
<input type='submit' value='".$clang->gT("Save")."' />
|
<input type='submit' value='".$clang->gT("Save")."' />
|
||||||
<input type='hidden' name='id' value='$id' />
|
<input type='hidden' name='id' value='$id' />
|
||||||
<input type='hidden' name='sid' value='$surveyid' />
|
<input type='hidden' name='sid' value='$surveyid' />
|
||||||
<input type='hidden' name='subaction' value='update' />
|
<input type='hidden' name='subaction' value='update' />
|
||||||
<input type='hidden' name='language' value='".$sDataEntryLanguage."' />";
|
<input type='hidden' name='language' value='".$sDataEntryLanguage."' /></p>";
|
||||||
}
|
}
|
||||||
elseif ($subaction == "editsaved" && bHasSurveyPermission($surveyid,'responses','update'))
|
elseif ($subaction == "editsaved" && bHasSurveyPermission($surveyid,'responses','update'))
|
||||||
{
|
{
|
||||||
@@ -1333,11 +1546,11 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
//-->
|
//-->
|
||||||
</script>\n";
|
</script>\n";
|
||||||
$dataentryoutput .= "<table><tr><td align='left'>\n";
|
$dataentryoutput .= "<table><tr><td align='left'>\n";
|
||||||
$dataentryoutput .= "\t<input type='checkbox' class='checkboxbtn' name='closerecord' id='closerecord' /><label for='closerecord'>".$clang->gT("Finalize response submission")."</label></td></tr>\n";
|
|
||||||
$dataentryoutput .="<input type='hidden' name='closedate' value='".date_shift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $timeadjust)."' />\n";
|
$dataentryoutput .="<input type='hidden' name='closedate' value='".date_shift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $timeadjust)."' />\n";
|
||||||
|
$dataentryoutput .= "\t<input type='checkbox' class='checkboxbtn' name='closerecord' id='closerecord' /><label for='closerecord'>".$clang->gT("Finalize response submission")."</label></td></tr>\n";
|
||||||
$dataentryoutput .= "\t<tr><td align='left'><input type='checkbox' class='checkboxbtn' name='save' id='save' onclick='saveshow(this.id)' /><label for='save'>".$clang->gT("Save for further completion by survey user")."</label>\n";
|
$dataentryoutput .= "\t<tr><td align='left'><input type='checkbox' class='checkboxbtn' name='save' id='save' onclick='saveshow(this.id)' /><label for='save'>".$clang->gT("Save for further completion by survey user")."</label>\n";
|
||||||
$dataentryoutput .= "</td></tr></table>\n";
|
$dataentryoutput .= "</td></tr></table>\n";
|
||||||
$dataentryoutput .= "<div name='saveoptions' id='saveoptions' style='display: none'>\n";
|
$dataentryoutput .= "<div id='saveoptions' style='display: none'>\n";
|
||||||
$dataentryoutput .= "<table align='center' class='outlinetable' cellspacing='0'>
|
$dataentryoutput .= "<table align='center' class='outlinetable' cellspacing='0'>
|
||||||
<tr><td align='right'>".$clang->gT("Identifier:")."</td>
|
<tr><td align='right'>".$clang->gT("Identifier:")."</td>
|
||||||
<td><input type='text' name='save_identifier'";
|
<td><input type='text' name='save_identifier'";
|
||||||
@@ -1493,6 +1706,10 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
$thissurvey=getSurveyInfo($surveyid);
|
$thissurvey=getSurveyInfo($surveyid);
|
||||||
//This is the default, presenting a blank dataentry form
|
//This is the default, presenting a blank dataentry form
|
||||||
$fieldmap=createFieldMap($surveyid);
|
$fieldmap=createFieldMap($surveyid);
|
||||||
|
|
||||||
|
LimeExpressionManager::StartSurvey($surveyid, 'survey',NULL,false,LEM_PRETTY_PRINT_ALL_SYNTAX);
|
||||||
|
$moveResult = LimeExpressionManager::NavigateForwards();
|
||||||
|
|
||||||
// PRESENT SURVEY DATAENTRY SCREEN
|
// PRESENT SURVEY DATAENTRY SCREEN
|
||||||
$dataentryoutput .= $surveyoptions;
|
$dataentryoutput .= $surveyoptions;
|
||||||
|
|
||||||
@@ -1604,159 +1821,34 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
//GET ANY CONDITIONS THAT APPLY TO THIS QUESTION
|
//GET ANY CONDITIONS THAT APPLY TO THIS QUESTION
|
||||||
$explanation = ""; //reset conditions explanation
|
$explanation = ""; //reset conditions explanation
|
||||||
$s=0;
|
$s=0;
|
||||||
$scenarioquery="SELECT DISTINCT scenario FROM ".db_table_name("conditions")." WHERE ".db_table_name("conditions").".qid={$deqrow['qid']} ORDER BY scenario";
|
|
||||||
$scenarioresult=db_execute_assoc($scenarioquery);
|
$qinfo = LimeExpressionManager::GetQuestionStatus($deqrow['qid']);
|
||||||
while ($scenariorow=$scenarioresult->FetchRow())
|
$relevance = trim($qinfo['info']['relevance']);
|
||||||
{
|
$explanation = trim($qinfo['relEqn']);
|
||||||
if ($s == 0 && $scenarioresult->RecordCount() > 1) { $explanation .= " <br />-------- <i>Scenario {$scenariorow['scenario']}</i> --------<br />";}
|
$validation = trim($qinfo['prettyValidTip']);
|
||||||
if ($s > 0) { $explanation .= " <br />-------- <i>".$clang->gT("OR")." Scenario {$scenariorow['scenario']}</i> --------<br />";}
|
$qidattributes=getQuestionAttributes($deqrow['qid']);
|
||||||
|
$array_filter_help = FlattenText(array_filter_help($qidattributes, $sDataEntryLanguage, $surveyid));
|
||||||
$x=0;
|
|
||||||
$distinctquery="SELECT DISTINCT cqid, ".db_table_name("questions").".title FROM ".db_table_name("conditions").", ".db_table_name("questions")." WHERE ".db_table_name("conditions").".cqid=".db_table_name("questions").".qid AND ".db_table_name("conditions").".qid={$deqrow['qid']} AND ".db_table_name("conditions").".scenario={$scenariorow['scenario']} ORDER BY cqid";
|
if (($relevance != '' && $relevance != '1') || ($validation != '') || ($array_filter_help != ''))
|
||||||
$distinctresult=db_execute_assoc($distinctquery);
|
|
||||||
|
|
||||||
while ($distinctrow=$distinctresult->FetchRow())
|
|
||||||
{
|
|
||||||
if ($x > 0) {$explanation .= " <i>".$blang->gT("AND")."</i><br />";}
|
|
||||||
$conquery="SELECT cid, cqid, cfieldname, ".db_table_name("questions").".title, ".db_table_name("questions").".question, value, ".db_table_name("questions").".type, method FROM ".db_table_name("conditions").", ".db_table_name("questions")." WHERE ".db_table_name("conditions").".cqid=".db_table_name("questions").".qid AND ".db_table_name("conditions").".cqid={$distinctrow['cqid']} AND ".db_table_name("conditions").".qid={$deqrow['qid']} AND ".db_table_name("conditions").".scenario={$scenariorow['scenario']}";
|
|
||||||
$conresult=db_execute_assoc($conquery);
|
|
||||||
while ($conrow=$conresult->FetchRow())
|
|
||||||
{
|
|
||||||
if ($conrow['method']=="==") {$conrow['method']="= ";} else {$conrow['method']=$conrow['method']." ";}
|
|
||||||
switch($conrow['type'])
|
|
||||||
{
|
|
||||||
case "Y":
|
|
||||||
switch ($conrow['value'])
|
|
||||||
{
|
|
||||||
case "Y": $conditions[]=$conrow['method']."'".$blang->gT("Yes")."'"; break;
|
|
||||||
case "N": $conditions[]=$conrow['method']."'".$blang->gT("No")."'"; break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "G":
|
|
||||||
switch($conrow['value'])
|
|
||||||
{
|
|
||||||
case "M": $conditions[]=$conrow['method']."'".$blang->gT("Male")."'"; break;
|
|
||||||
case "F": $conditions[]=$conrow['method']."'".$blang->gT("Female")."'"; break;
|
|
||||||
} // switch
|
|
||||||
break;
|
|
||||||
case "A":
|
|
||||||
case "B":
|
|
||||||
$conditions[]=$conrow['method']."'".$conrow['value']."'";
|
|
||||||
break;
|
|
||||||
case "C":
|
|
||||||
switch($conrow['value'])
|
|
||||||
{
|
|
||||||
case "Y": $conditions[]=$conrow['method']."'".$blang->gT("Yes")."'"; break;
|
|
||||||
case "U": $conditions[]=$conrow['method']."'".$blang->gT("Uncertain")."'"; break;
|
|
||||||
case "N": $conditions[]=$conrow['method']."'".$blang->gT("No")."'"; break;
|
|
||||||
} // switch
|
|
||||||
break;
|
|
||||||
case "1":
|
|
||||||
$value=substr($conrow['cfieldname'], strpos($conrow['cfieldname'], "X".$conrow['cqid'])+strlen("X".$conrow['cqid']), strlen($conrow['cfieldname']));
|
|
||||||
$fquery = "SELECT * FROM ".db_table_name("labels")."\n"
|
|
||||||
. "WHERE lid='{$conrow['lid']}'\n and language='$sDataEntryLanguage' "
|
|
||||||
. "AND code='{$conrow['value']}'";
|
|
||||||
$fresult=db_execute_assoc($fquery) or safe_die("$fquery<br />".$connect->ErrorMsg());
|
|
||||||
while($frow=$fresult->FetchRow())
|
|
||||||
{
|
|
||||||
$postans=$frow['title'];
|
|
||||||
$conditions[]=$conrow['method']."'".$frow['title']."'";
|
|
||||||
} // while
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "E":
|
|
||||||
switch($conrow['value'])
|
|
||||||
{
|
|
||||||
case "I": $conditions[]=$conrow['method']."'".$blang->gT("Increase")."'"; break;
|
|
||||||
case "D": $conditions[]=$conrow['method']."'".$blang->gT("Decrease")."'"; break;
|
|
||||||
case "S": $conditions[]=$conrow['method']."'".$blang->gT("Same")."'"; break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "F":
|
|
||||||
case "H":
|
|
||||||
default:
|
|
||||||
$value=substr($conrow['cfieldname'], strpos($conrow['cfieldname'], "X".$conrow['cqid'])+strlen("X".$conrow['cqid']), strlen($conrow['cfieldname']));
|
|
||||||
$fquery = "SELECT * FROM ".db_table_name("questions")."\n"
|
|
||||||
. "WHERE qid='{$conrow['cqid']}'\n and language='$sDataEntryLanguage' "
|
|
||||||
. "AND title='{$conrow['title']}' and scale_id=0";
|
|
||||||
$fresult=db_execute_assoc($fquery) or safe_die("$fquery<br />".$connect->ErrorMsg());
|
|
||||||
if ($fresult->RecordCount() <= 0) die($fquery);
|
|
||||||
while($frow=$fresult->FetchRow())
|
|
||||||
{
|
|
||||||
$postans=$frow['title'];
|
|
||||||
$conditions[]=$conrow['method']."'".$frow['title']."'";
|
|
||||||
} // while
|
|
||||||
break;
|
|
||||||
} // switch
|
|
||||||
$answer_section="";
|
|
||||||
switch($conrow['type'])
|
|
||||||
{
|
|
||||||
|
|
||||||
case "1":
|
|
||||||
$ansquery="SELECT answer FROM ".db_table_name("answers")." WHERE qid='{$conrow['cqid']}' AND code='{$conrow['value']}' AND language='{$baselang}'";
|
|
||||||
$ansresult=db_execute_assoc($ansquery);
|
|
||||||
while ($ansrow=$ansresult->FetchRow())
|
|
||||||
{
|
|
||||||
$conditions[]=$conrow['method']."'".$ansrow['answer']."'";
|
|
||||||
}
|
|
||||||
$operator=$clang->gT("OR");
|
|
||||||
if (isset($conditions)) $conditions = array_unique($conditions);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "A":
|
|
||||||
case "B":
|
|
||||||
case "C":
|
|
||||||
case "E":
|
|
||||||
case "F":
|
|
||||||
case "H":
|
|
||||||
case ":":
|
|
||||||
case ";":
|
|
||||||
$thiscquestion=$fieldmap[$conrow['cfieldname']];
|
|
||||||
$ansquery="SELECT answer FROM ".db_table_name("answers")." WHERE qid='{$conrow['cqid']}' AND code='{$thiscquestion['aid']}' AND language='{$sDataEntryLanguage}'";
|
|
||||||
$ansresult=db_execute_assoc($ansquery);
|
|
||||||
$i=0;
|
|
||||||
while ($ansrow=$ansresult->FetchRow())
|
|
||||||
{
|
|
||||||
if (isset($conditions) && count($conditions) > 0)
|
|
||||||
{
|
|
||||||
$conditions[sizeof($conditions)-1]="(".$ansrow['answer'].") : ".end($conditions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$operator=$blang->gT("AND"); // this is a dirty, DIRTY fix but it works since only array questions seem to be ORd
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$ansquery="SELECT answer FROM ".db_table_name("answers")." WHERE qid='{$conrow['cqid']}' AND code='{$conrow['value']}' AND language='{$sDataEntryLanguage}'";
|
|
||||||
$ansresult=db_execute_assoc($ansquery);
|
|
||||||
while ($ansrow=$ansresult->FetchRow())
|
|
||||||
{
|
|
||||||
$conditions[]=$conrow['method']."'".$ansrow['answer']."'";
|
|
||||||
}
|
|
||||||
$operator=$blang->gT("OR");
|
|
||||||
if (isset($conditions)) $conditions = array_unique($conditions);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($conditions) && count($conditions) > 1)
|
|
||||||
{
|
|
||||||
$conanswers = implode(" ".$operator." ", $conditions);
|
|
||||||
$explanation .= " -" . str_replace("{ANSWER}", $conanswers, $blang->gT("to question {QUESTION}, answer {ANSWER}"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(empty($conditions[0])) $conditions[0] = "'".$blang->gT("No Answer")."'";
|
|
||||||
$explanation .= " -" . str_replace("{ANSWER}", $conditions[0], $blang->gT("to question {QUESTION}, answer {ANSWER}"));
|
|
||||||
}
|
|
||||||
unset($conditions);
|
|
||||||
$explanation = str_replace("{QUESTION}", "'{$distinctrow['title']}$answer_section'", $explanation);
|
|
||||||
$x++;
|
|
||||||
}
|
|
||||||
$s++;
|
|
||||||
}
|
|
||||||
if ($explanation)
|
|
||||||
{
|
{
|
||||||
|
$showme = '';
|
||||||
if ($bgc == "even") {$bgc = "odd";} else {$bgc = "even";} //Do no alternate on explanation row
|
if ($bgc == "even") {$bgc = "odd";} else {$bgc = "even";} //Do no alternate on explanation row
|
||||||
$explanation = "[".$blang->gT("Only answer this if the following conditions are met:")."]<br />$explanation\n";
|
if ($relevance != '' && $relevance != '1') {
|
||||||
$dataentryoutput .= "<tr class ='data-entry-explanation'><td class='data-entry-small-text' colspan='3' align='left'>$explanation</td></tr>\n";
|
$showme = "[".$blang->gT("Only answer this if the following conditions are met:")."]<br />$explanation\n";
|
||||||
|
}
|
||||||
|
if ($showme != '' && $validation != '') {
|
||||||
|
$showme .= '<br/>';
|
||||||
|
}
|
||||||
|
if ($validation != '') {
|
||||||
|
$showme .= "[".$blang->gT("The answer(s) must meet these validation criteria:")."]<br />$validation\n";
|
||||||
|
}
|
||||||
|
if ($showme != '' && $array_filter_help != '') {
|
||||||
|
$showme .= '<br/>';
|
||||||
|
}
|
||||||
|
if ($array_filter_help != '') {
|
||||||
|
$showme .= "[".$blang->gT("The answer(s) must meet these array_filter criteria:")."]<br />$array_filter_help\n";
|
||||||
|
}
|
||||||
|
$dataentryoutput .= "<tr class ='data-entry-explanation'><td class='data-entry-small-text' colspan='3' align='left'>$showme</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//END OF GETTING CONDITIONS
|
//END OF GETTING CONDITIONS
|
||||||
@@ -1772,6 +1864,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
$dataentryoutput .= "\t<tr class='$bgc'>\n"
|
$dataentryoutput .= "\t<tr class='$bgc'>\n"
|
||||||
."<td class='data-entry-small-text' valign='top' width='1%'>{$deqrow['title']}</td>\n"
|
."<td class='data-entry-small-text' valign='top' width='1%'>{$deqrow['title']}</td>\n"
|
||||||
."<td valign='top' align='right' width='30%'>";
|
."<td valign='top' align='right' width='30%'>";
|
||||||
|
// TMSW - Mandatory->EM
|
||||||
if ($deqrow['mandatory']=="Y") //question is mandatory
|
if ($deqrow['mandatory']=="Y") //question is mandatory
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "<font color='red'>*</font>";
|
$dataentryoutput .= "<font color='red'>*</font>";
|
||||||
@@ -1873,7 +1966,8 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
.$clang->gT("Other").":"
|
.$clang->gT("Other").":"
|
||||||
."<input type='text' name='{$fieldname}other' value='' />\n";
|
."<input type='text' name='{$fieldname}other' value='' />\n";
|
||||||
}
|
}
|
||||||
$dataentryoutput .= "</tr></table>";
|
//OLD: invalid HTML -> $dataentryoutput .= "</tr></table>";
|
||||||
|
$dataentryoutput .= "</table>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "L": //LIST drop-down/radio-button list
|
case "L": //LIST drop-down/radio-button list
|
||||||
@@ -2190,7 +2284,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
while ($mearow = $mearesult->FetchRow())
|
while ($mearow = $mearesult->FetchRow())
|
||||||
{
|
{
|
||||||
$dataentryoutput .= "\t<input type='checkbox' class='checkboxbtn' name='$fieldname{$mearow['code']}' id='answer$fieldname{$mearow['code']}' value='Y'";
|
$dataentryoutput .= "\t<input type='checkbox' class='checkboxbtn' name='$fieldname{$mearow['code']}' id='answer$fieldname{$mearow['code']}' value='Y'";
|
||||||
if ($mearow['default_value'] == "Y") {$dataentryoutput .= " checked";}
|
if ($mearow['default_value'] == "Y") {$dataentryoutput .= " checked='checked'";}
|
||||||
$dataentryoutput .= " /><label for='$fieldname{$mearow['code']}'>{$mearow['answer']}</label><br />\n";
|
$dataentryoutput .= " /><label for='$fieldname{$mearow['code']}'>{$mearow['answer']}</label><br />\n";
|
||||||
}
|
}
|
||||||
if ($deqrow['other'] == "Y")
|
if ($deqrow['other'] == "Y")
|
||||||
@@ -2220,7 +2314,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
break;
|
break;
|
||||||
case "P": //Multiple choice with comments checkbox + text
|
case "P": //Multiple choice with comments checkbox + text
|
||||||
$dataentryoutput .= "<table border='0'>\n";
|
$dataentryoutput .= "<table border='0'>\n";
|
||||||
$meaquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND language='{$sDataEntryLanguage}' ORDER BY question_order, question";
|
$meaquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$deqrow['qid']} AND language='{$sDataEntryLanguage}' ORDER BY question_order";
|
||||||
$mearesult = db_execute_assoc($meaquery);
|
$mearesult = db_execute_assoc($meaquery);
|
||||||
while ($mearow = $mearesult->FetchRow())
|
while ($mearow = $mearesult->FetchRow())
|
||||||
{
|
{
|
||||||
@@ -2277,7 +2371,13 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
else
|
else
|
||||||
$dataentryoutput .= "jsonstr += '\"comment\":\"\",';";
|
$dataentryoutput .= "jsonstr += '\"comment\":\"\",';";
|
||||||
|
|
||||||
$dataentryoutput .= "jsonstr += '\"name\":\"'+$('#".$fieldname."_file_'+i).val()+'\"}';";
|
$dataentryoutput .= "filename = $('#".$fieldname."_file_'+i).val();";
|
||||||
|
$dataentryoutput .= "if( filename.indexOf('\\\') != '-1' ) {
|
||||||
|
file = filename.split('\\\');
|
||||||
|
var max = file.length;
|
||||||
|
filename = file[max-1];
|
||||||
|
}";
|
||||||
|
$dataentryoutput .= "jsonstr += '\"name\":\"'+filename+'\"}';";
|
||||||
|
|
||||||
$dataentryoutput .= "jsonstr += ',';\n
|
$dataentryoutput .= "jsonstr += ',';\n
|
||||||
filecount++;
|
filecount++;
|
||||||
@@ -2321,17 +2421,198 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
$dataentryoutput .= "<tr><td align='center'><input type='hidden' name='".$fieldname."_filecount' id='".$fieldname."_filecount' value='' /></td>\n</tr>\n";
|
$dataentryoutput .= "<tr><td align='center'><input type='hidden' name='".$fieldname."_filecount' id='".$fieldname."_filecount' value='' /></td>\n</tr>\n";
|
||||||
$dataentryoutput .= "</table>\n";
|
$dataentryoutput .= "</table>\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "N": //NUMERICAL TEXT
|
case "N": //NUMERICAL TEXT
|
||||||
$dataentryoutput .= "\t<input type='text' name='$fieldname' onkeypress=\"return goodchars(event,'0123456789.,')\" />";
|
//get question attributes to change some style and validation settings
|
||||||
|
$qidattributes = getQuestionAttributes($qid);
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='') {
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='')
|
||||||
|
{
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
if (intval(trim($qidattributes['maximum_chars']))>0 && intval(trim($qidattributes['maximum_chars']))<20) // Limt to 20 chars for numeric
|
||||||
|
{
|
||||||
|
$maximum_chars= intval(trim($qidattributes['maximum_chars']));
|
||||||
|
$maxlength= "maxlength='{$maximum_chars}' ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$maxlength= "maxlength='20' ";
|
||||||
|
}
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trim($qidattributes['num_value_int_only'])==1)
|
||||||
|
{
|
||||||
|
$acomma="";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$acomma=getRadixPointData($thissurvey['surveyls_numberformat']);
|
||||||
|
$acomma = $acomma['seperator'];
|
||||||
|
|
||||||
|
}
|
||||||
|
$sSeperator = getRadixPointData($thissurvey['surveyls_numberformat']);
|
||||||
|
|
||||||
|
$dataentryoutput .= $prefix. "<input type='text' size='".$tiwidth."' name='".$fieldname."'
|
||||||
|
title='".$clang->gT('Only numbers may be entered in this field')."' $maxlength onkeypress=\"return goodchars(event,'-0123456789{$acomma}')\" />".$suffix;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "S": //SHORT FREE TEXT
|
case "S": //SHORT FREE TEXT
|
||||||
$dataentryoutput .= "\t<input type='text' name='$fieldname' />\n";
|
//get question attributes to change some style and validation settings
|
||||||
|
$qidattributes = getQuestionAttributes($qid);
|
||||||
|
if ($qidattributes['numbers_only']==1)
|
||||||
|
{
|
||||||
|
$sSeperator = getRadixPointData($thissurvey['surveyls_numberformat']);
|
||||||
|
$sSeperator = $sSeperator['seperator'];
|
||||||
|
$numbersonly = 'onkeypress="return goodchars(event,\'-0123456789'.$sSeperator.'\')"';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$numbersonly = '';
|
||||||
|
}
|
||||||
|
if (intval(trim($qidattributes['maximum_chars']))>0)
|
||||||
|
{
|
||||||
|
// Only maxlength attribute, use textarea[maxlength] jquery selector for textarea
|
||||||
|
$maximum_chars= intval(trim($qidattributes['maximum_chars']));
|
||||||
|
$maxlength= "maxlength='{$maximum_chars}' ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$maxlength= "";
|
||||||
|
}
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=50;
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='') {
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='') {
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
if (trim($qidattributes['display_rows'])!='')
|
||||||
|
{
|
||||||
|
//question attribute "display_rows" is set -> we need a textarea to be able to show several rows
|
||||||
|
$drows=$qidattributes['display_rows'];
|
||||||
|
|
||||||
|
//if a textarea should be displayed we make it equal width to the long text question
|
||||||
|
//this looks nicer and more continuous
|
||||||
|
if($tiwidth == 50)
|
||||||
|
{
|
||||||
|
$tiwidth=40;
|
||||||
|
}
|
||||||
|
$dataentryoutput .= $prefix."<textarea $numbersonly name='".$fieldname."' rows='".$drows."'
|
||||||
|
cols='".$tiwidth."' >";
|
||||||
|
$dataentryoutput .= "</textarea>$suffix\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//no question attribute set, use common input text field
|
||||||
|
$dataentryoutput .= $prefix."<input type=\"text\" size=\"$tiwidth\" name=\"$fieldname\" ";
|
||||||
|
$dataentryoutput .=" {$maxlength} $numbersonly />\n\t$suffix\n\n";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "T": //LONG FREE TEXT
|
case "T": //LONG FREE TEXT
|
||||||
$dataentryoutput .= "\t<textarea cols='40' rows='5' name='$fieldname'></textarea>\n";
|
$qidattributes=getQuestionAttributes($qid);
|
||||||
|
if (trim($qidattributes['display_rows'])!='')
|
||||||
|
{
|
||||||
|
$drows=$qidattributes['display_rows'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$drows=5;
|
||||||
|
}
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=40;
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='') {
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='') {
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
$dataentryoutput .= $prefix.'<textarea name="'.$fieldname.'" rows="'.$drows.'" cols="'.$tiwidth.'" >';
|
||||||
|
$dataentryoutput .= "</textarea>$suffix\n";
|
||||||
break;
|
break;
|
||||||
case "U": //LONG FREE TEXT
|
|
||||||
$dataentryoutput .= "\t<textarea cols='50' rows='70' name='$fieldname'></textarea>\n";
|
case "U": //HUGE FREE TEXT
|
||||||
|
$qidattributes=getQuestionAttributes($qid);
|
||||||
|
|
||||||
|
if (trim($qidattributes['display_rows'])!='')
|
||||||
|
{
|
||||||
|
$drows=$qidattributes['display_rows'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$drows=70;
|
||||||
|
}
|
||||||
|
if (trim($qidattributes['text_input_width'])!='')
|
||||||
|
{
|
||||||
|
$tiwidth=$qidattributes['text_input_width'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tiwidth=50;
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['prefix']) && trim($qidattributes['prefix'])!='') {
|
||||||
|
$prefix=$qidattributes['prefix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
if (isset($qidattributes['suffix']) && trim($qidattributes['suffix'])!='') {
|
||||||
|
$suffix=$qidattributes['suffix'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$suffix = '';
|
||||||
|
}
|
||||||
|
$dataentryoutput .= $prefix.'<textarea name="'.$fieldname.'" rows="'.$drows.'" cols="'.$tiwidth.'">';
|
||||||
|
$dataentryoutput .= "</textarea>$suffix\n";
|
||||||
break;
|
break;
|
||||||
case "Y": //YES/NO radio-buttons
|
case "Y": //YES/NO radio-buttons
|
||||||
$dataentryoutput .= "\t<select name='$fieldname'>\n";
|
$dataentryoutput .= "\t<select name='$fieldname'>\n";
|
||||||
@@ -2489,7 +2770,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
{
|
{
|
||||||
$dataentryoutput .= "<td>\n";
|
$dataentryoutput .= "<td>\n";
|
||||||
if ($qidattributes['input_boxes']!=0) {
|
if ($qidattributes['input_boxes']!=0) {
|
||||||
$dataentryoutput .= "\t<input type='text' name='$fieldname{$mearow['title']}_$ld' size=4 />";
|
$dataentryoutput .= "\t<input type='text' name='$fieldname{$mearow['title']}_$ld' size='4' />";
|
||||||
} else {
|
} else {
|
||||||
$dataentryoutput .= "\t<select name='$fieldname{$mearow['title']}_$ld'>\n";
|
$dataentryoutput .= "\t<select name='$fieldname{$mearow['title']}_$ld'>\n";
|
||||||
$dataentryoutput .= "<option value=''>...</option>\n";
|
$dataentryoutput .= "<option value=''>...</option>\n";
|
||||||
@@ -2625,7 +2906,7 @@ if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission(
|
|||||||
//Show Save Option
|
//Show Save Option
|
||||||
$dataentryoutput .= "\t<tr><td align='left'><input type='checkbox' class='checkboxbtn' name='save' id='save' onclick='saveshow(this.id)' /><label for='save'>".$clang->gT("Save for further completion by survey user")."</label>\n";
|
$dataentryoutput .= "\t<tr><td align='left'><input type='checkbox' class='checkboxbtn' name='save' id='save' onclick='saveshow(this.id)' /><label for='save'>".$clang->gT("Save for further completion by survey user")."</label>\n";
|
||||||
$dataentryoutput .= "</td></tr></table>\n";
|
$dataentryoutput .= "</td></tr></table>\n";
|
||||||
$dataentryoutput .= "<div name='saveoptions' id='saveoptions' style='display: none'>\n";
|
$dataentryoutput .= "<div id='saveoptions' style='display: none'>\n";
|
||||||
$dataentryoutput .= "<table align='center' class='outlinetable' cellspacing='0'>
|
$dataentryoutput .= "<table align='center' class='outlinetable' cellspacing='0'>
|
||||||
<tr><td align='right'>".$clang->gT("Identifier:")."</td>
|
<tr><td align='right'>".$clang->gT("Identifier:")."</td>
|
||||||
<td><input type='text' name='save_identifier' /></td></tr>
|
<td><input type='text' name='save_identifier' /></td></tr>
|
||||||
@@ -2719,4 +3000,31 @@ function array_in_array($needle, $haystack)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is a duplicate of the array_filter_help function in printablesurvey.php
|
||||||
|
*/
|
||||||
|
function array_filter_help($qidattributes, $surveyprintlang, $surveyid) {
|
||||||
|
global $clang;
|
||||||
|
$output = "";
|
||||||
|
if(!empty($qidattributes['array_filter']))
|
||||||
|
{
|
||||||
|
$newquery="SELECT question FROM ".db_table_name("questions")." WHERE title='{$qidattributes['array_filter']}' AND language='{$surveyprintlang}' AND sid = '$surveyid'";
|
||||||
|
$newresult=db_execute_assoc($newquery);
|
||||||
|
$newquestiontext=$newresult->fetchRow();
|
||||||
|
$output .= "\n<p class='extrahelp'>
|
||||||
|
".sprintf($clang->gT("Only answer this question for the items you selected in question *%s* ('%s')"),$qidattributes['array_filter'], FlattenText(br2nl($newquestiontext['question'])))."
|
||||||
|
</p>\n";
|
||||||
|
}
|
||||||
|
if(!empty($qidattributes['array_filter_exclude']))
|
||||||
|
{
|
||||||
|
$newquery="SELECT question FROM ".db_table_name("questions")." WHERE title='{$qidattributes['array_filter_exclude']}' AND language='{$surveyprintlang}' AND sid = '$surveyid'";
|
||||||
|
$newresult=db_execute_assoc($newquery);
|
||||||
|
$newquestiontext=$newresult->fetchRow();
|
||||||
|
$output .= "\n <p class='extrahelp'>
|
||||||
|
".sprintf($clang->gT("Only answer this question for the items you did not select in question *%s* ('%s')"),$qidattributes['array_filter_exclude'], br2nl($newquestiontext['question']))."
|
||||||
|
</p>\n";
|
||||||
|
}
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: deactivate.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: deactivate.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: deletesurvey.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: deletesurvey.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Ensure script is not run directly, avoid path disclosure
|
//Ensure script is not run directly, avoid path disclosure
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: dumpdb.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: dumpdb.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: dumpgroup.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: dumpgroup.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: dumplabel.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: dumplabel.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: dumpquestion.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: dumpquestion.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
// Insert some Javascript variables
|
// Insert some Javascript variables
|
||||||
$surveysummary .= "\n<script type='text/javascript'>
|
$surveysummary .= "\n<script type='text/javascript'>
|
||||||
var languagecount=".count($anslangs).";\n
|
var languagecount=".count($anslangs).";
|
||||||
var scalecount=".$scalecount.";
|
var scalecount=".$scalecount.";
|
||||||
var assessmentvisible=".($assessmentvisible?'true':'false').";
|
var assessmentvisible=".($assessmentvisible?'true':'false').";
|
||||||
var newansweroption_text='".$clang->gT('New answer option','js')."';
|
var newansweroption_text='".$clang->gT('New answer option','js')."';
|
||||||
@@ -118,6 +118,7 @@
|
|||||||
var quickaddtitle='".$clang->gT('Quick-add answers','js')."';
|
var quickaddtitle='".$clang->gT('Quick-add answers','js')."';
|
||||||
var sAssessmentValue='".$clang->gT('Assessment value','js')."';
|
var sAssessmentValue='".$clang->gT('Assessment value','js')."';
|
||||||
var duplicateanswercode='".$clang->gT('Error: You are trying to use duplicate answer codes.','js')."';
|
var duplicateanswercode='".$clang->gT('Error: You are trying to use duplicate answer codes.','js')."';
|
||||||
|
var strNoLabelSet='".$clang->gT('There are no label sets which match the survey default language','js')."';
|
||||||
var langs='".implode(';',$anslangs)."';</script>\n";
|
var langs='".implode(';',$anslangs)."';</script>\n";
|
||||||
|
|
||||||
foreach ($anslangs as $anslang)
|
foreach ($anslangs as $anslang)
|
||||||
@@ -239,20 +240,20 @@
|
|||||||
}
|
}
|
||||||
// Label set browser
|
// Label set browser
|
||||||
// <br/><input type='checkbox' checked='checked' id='languagefilter' /><label for='languagefilter'>".$clang->gT('Match language')."</label>
|
// <br/><input type='checkbox' checked='checked' id='languagefilter' /><label for='languagefilter'>".$clang->gT('Match language')."</label>
|
||||||
$vasummary .= "<div id='labelsetbrowser' style='display:none;'><div style='float:left;width:260px;'>
|
$vasummary .= "<div id='labelsetbrowser' class='labelsets-update' style='display:none;'><div class='labelset-list' style='float:left;width:260px;'>
|
||||||
<label for='labelsets'>".$clang->gT('Available label sets:')."</label>
|
<label for='labelsets'>".$clang->gT('Available label sets:')."</label>
|
||||||
<br /><select id='labelsets' size='10' style='width:250px;'><option> </option></select>
|
<select id='labelsets' size='10' style='width:250px;'><option> </option></select>
|
||||||
<br /><button id='btnlsreplace' type='button'>".$clang->gT('Replace')."</button>
|
<p class='button-list'><button id='btnlsreplace' type='button'>".$clang->gT('Replace')."</button>
|
||||||
<button id='btnlsinsert' type='button'>".$clang->gT('Add')."</button>
|
<button id='btnlsinsert' type='button'>".$clang->gT('Add')."</button>
|
||||||
<button id='btncancel' type='button'>".$clang->gT('Cancel')."</button></div>
|
<button id='btncancel' type='button'>".$clang->gT('Cancel')."</button></p></div>
|
||||||
|
|
||||||
<div id='labelsetpreview' style='float:right;width:500px;'></div></div> ";
|
<div id='labelsetpreview' style='float:right;width:500px;'></div></div> ";
|
||||||
$vasummary .= "<div id='quickadd' style='display:none;'><div style='float:left;'>
|
$vasummary .= "<div id='quickadd' class='labelsets-update' style='display:none;'><div class='labelset-list' style='float:left;'>
|
||||||
<label for='quickadd'>".$clang->gT('Enter your answers:')."</label>
|
<label for='quickadd'>".$clang->gT('Enter your answers:')."</label>
|
||||||
<br /><textarea id='quickaddarea' class='tipme' title='".$clang->gT('Enter one answer per line. You can provide a code by separating code and answer text with a semikolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semikolon/tab.')."' rows='30' style='width:570px;'></textarea>
|
<textarea id='quickaddarea' class='tipme' title='".$clang->gT('Enter one answer per line. You can provide a code by separating code and answer text with a semikolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semikolon/tab.')."' rows='30' style='width:570px;'></textarea>
|
||||||
<br /><button id='btnqareplace' type='button'>".$clang->gT('Replace')."</button>
|
<p class='button-list'><button id='btnqareplace' type='button'>".$clang->gT('Replace')."</button>
|
||||||
<button id='btnqainsert' type='button'>".$clang->gT('Add')."</button>
|
<button id='btnqainsert' type='button'>".$clang->gT('Add')."</button>
|
||||||
<button id='btnqacancel' type='button'>".$clang->gT('Cancel')."</button></div>
|
<button id='btnqacancel' type='button'>".$clang->gT('Cancel')."</button></p></div>
|
||||||
</div> ";
|
</div> ";
|
||||||
// Save button
|
// Save button
|
||||||
$vasummary .= "<p><input type='submit' id='saveallbtn_$anslang' name='method' value='".$clang->gT("Save changes")."' />\n";
|
$vasummary .= "<p><input type='submit' id='saveallbtn_$anslang' name='method' value='".$clang->gT("Save changes")."' />\n";
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
var lsbrowsertitle='".$clang->gT('Label set browser','js')."';
|
var lsbrowsertitle='".$clang->gT('Label set browser','js')."';
|
||||||
var quickaddtitle='".$clang->gT('Quick-add subquestions','js')."';
|
var quickaddtitle='".$clang->gT('Quick-add subquestions','js')."';
|
||||||
var duplicateanswercode='".$clang->gT('Error: You are trying to use duplicate subquestion codes.','js')."';
|
var duplicateanswercode='".$clang->gT('Error: You are trying to use duplicate subquestion codes.','js')."';
|
||||||
|
var strNoLabelSet='".$clang->gT('There are no label sets which match the survey default language','js')."';
|
||||||
var langs='".implode(';',$anslangs)."';</script>\n";
|
var langs='".implode(';',$anslangs)."';</script>\n";
|
||||||
|
|
||||||
|
|
||||||
@@ -195,7 +196,7 @@
|
|||||||
}
|
}
|
||||||
elseif ($activated != 'Y' && $first) // If survey is decactivated
|
elseif ($activated != 'Y' && $first) // If survey is decactivated
|
||||||
{
|
{
|
||||||
$vasummary .= "<img class='handle' src='$imageurl/handle.png' /></td><td><input type='hidden' class='oldcode' id='oldcode_{$row['qid']}_{$row['scale_id']}' name='oldcode_{$row['qid']}_{$row['scale_id']}' value=\"{$row['title']}\" /><input type='text' id='code_{$row['qid']}_{$row['scale_id']}' class='code' name='code_{$row['qid']}_{$row['scale_id']}' value=\"{$row['title']}\" maxlength='5' size='5'"
|
$vasummary .= "<img class='handle' src='$imageurl/handle.png' /></td><td><input type='hidden' class='oldcode' id='oldcode_{$row['qid']}_{$row['scale_id']}' name='oldcode_{$row['qid']}_{$row['scale_id']}' value=\"{$row['title']}\" /><input type='text' id='code_{$row['qid']}_{$row['scale_id']}' class='code' name='code_{$row['qid']}_{$row['scale_id']}' value=\"{$row['title']}\" maxlength='20' size='5'"
|
||||||
." onkeypress=\" if(event.keyCode==13) {if (event && event.preventDefault) event.preventDefault(); document.getElementById('saveallbtn_$anslang').click(); return false;} return goodchars(event,'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ_')\""
|
." onkeypress=\" if(event.keyCode==13) {if (event && event.preventDefault) event.preventDefault(); document.getElementById('saveallbtn_$anslang').click(); return false;} return goodchars(event,'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ_')\""
|
||||||
." />";
|
." />";
|
||||||
|
|
||||||
@@ -239,19 +240,19 @@
|
|||||||
|
|
||||||
// Label set browser
|
// Label set browser
|
||||||
// <br/><input type='checkbox' checked='checked' id='languagefilter' /><label for='languagefilter'>".$clang->gT('Match language')."</label>
|
// <br/><input type='checkbox' checked='checked' id='languagefilter' /><label for='languagefilter'>".$clang->gT('Match language')."</label>
|
||||||
$vasummary .= "<div id='labelsetbrowser' style='display:none;'><div style='float:left; width:260px;'>
|
$vasummary .= "<div id='labelsetbrowser' style='display:none;'><div class='labelset-list' style='float:left; width:260px;'>
|
||||||
<label for='labelsets'>".$clang->gT('Available label sets:')."</label>
|
<label for='labelsets'>".$clang->gT('Available label sets:')."</label>
|
||||||
<br /><select id='labelsets' size='10' style='width:250px;'><option> </option></select>
|
<select id='labelsets' size='10' style='width:250px;'><option> </option></select>
|
||||||
<br /><button id='btnlsreplace' type='button'>".$clang->gT('Replace')."</button>
|
<p class=button-list'><button id='btnlsreplace' type='button'>".$clang->gT('Replace')."</button>
|
||||||
<button id='btnlsinsert' type='button'>".$clang->gT('Add')."</button>
|
<button id='btnlsinsert' type='button'>".$clang->gT('Add')."</button>
|
||||||
<button id='btncancel' type='button'>".$clang->gT('Cancel')."</button></div>
|
<button id='btncancel' type='button'>".$clang->gT('Cancel')."</button></p></div>
|
||||||
<div id='labelsetpreview' style='float:right;width:500px;'></div></div> ";
|
<div id='labelsetpreview' style='float:right;width:500px;'></div></div> ";
|
||||||
$vasummary .= "<div id='quickadd' style='display:none;'><div style='float:left;'>
|
$vasummary .= "<div id='quickadd' class='labelsets-update' style='display:none;'><div style='float:left;'>
|
||||||
<label for='quickadd'>".$clang->gT('Enter your subquestions:')."</label>
|
<label for='quickadd'>".$clang->gT('Enter your subquestions:')."</label>
|
||||||
<br /><textarea id='quickaddarea' class='tipme' title='".$clang->gT('Enter one subquestion per line. You can provide a code by separating code and subquestion text with a semikolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semikolon/tab.')."' rows='30' style='width:570px;'></textarea>
|
<textarea id='quickaddarea' class='tipme' title='".$clang->gT('Enter one subquestion per line. You can provide a code by separating code and subquestion text with a semikolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semikolon/tab.')."' rows='30' style='width:570px;'></textarea>
|
||||||
<br /><button id='btnqareplace' type='button'>".$clang->gT('Replace')."</button>
|
<p class=button-list'><button id='btnqareplace' type='button'>".$clang->gT('Replace')."</button>
|
||||||
<button id='btnqainsert' type='button'>".$clang->gT('Add')."</button>
|
<button id='btnqainsert' type='button'>".$clang->gT('Add')."</button>
|
||||||
<button id='btnqacancel' type='button'>".$clang->gT('Cancel')."</button></div>
|
<button id='btnqacancel' type='button'>".$clang->gT('Cancel')."</button></p></div>
|
||||||
</div> ";
|
</div> ";
|
||||||
$vasummary .= "<p>"
|
$vasummary .= "<p>"
|
||||||
."<input type='submit' id='saveallbtn_$anslang' name='method' value='".$clang->gT("Save changes")."' />\n";
|
."<input type='submit' id='saveallbtn_$anslang' name='method' value='".$clang->gT("Save changes")."' />\n";
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,118 +1,118 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* LimeSurvey
|
* LimeSurvey
|
||||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||||
* LimeSurvey is free software. This version may have been modified pursuant
|
* LimeSurvey is free software. This version may have been modified pursuant
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* to the GNU General Public License, and as distributed it includes or
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
* is derivative of works licensed under the GNU General Public License or
|
||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id:
|
* $Id:
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
||||||
|
|
||||||
if(bHasSurveyPermission($surveyid,'surveylocale','read'))
|
if(bHasSurveyPermission($surveyid,'surveylocale','read'))
|
||||||
{
|
{
|
||||||
|
|
||||||
$grplangs = GetAdditionalLanguagesFromSurveyID($surveyid);
|
$grplangs = GetAdditionalLanguagesFromSurveyID($surveyid);
|
||||||
$baselang = GetBaseLanguageFromSurveyID($surveyid);
|
$baselang = GetBaseLanguageFromSurveyID($surveyid);
|
||||||
array_unshift($grplangs,$baselang);
|
array_unshift($grplangs,$baselang);
|
||||||
|
|
||||||
$editsurvey = PrepareEditorScript();
|
$editsurvey = PrepareEditorScript();
|
||||||
|
|
||||||
|
|
||||||
$editsurvey .="<div class='header ui-widget-header'>".$clang->gT("Edit survey text elements")."</div>\n";
|
$editsurvey .="<div class='header ui-widget-header'>".$clang->gT("Edit survey text elements")."</div>\n";
|
||||||
$editsurvey .= "<form id='addnewsurvey' class='form30' name='addnewsurvey' action='$scriptname' method='post'>\n"
|
$editsurvey .= "<form id='addnewsurvey' class='form30' name='addnewsurvey' action='$scriptname' method='post'>\n"
|
||||||
. '<div id="tabs">';
|
. '<div id="tabs">';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($grplangs as $grouplang)
|
foreach ($grplangs as $grouplang)
|
||||||
{
|
{
|
||||||
// this one is created to get the right default texts fo each language
|
// this one is created to get the right default texts fo each language
|
||||||
$bplang = new limesurvey_lang($grouplang);
|
$bplang = new limesurvey_lang($grouplang);
|
||||||
$esquery = "SELECT * FROM ".db_table_name("surveys_languagesettings")." WHERE surveyls_survey_id=$surveyid and surveyls_language='$grouplang'";
|
$esquery = "SELECT * FROM ".db_table_name("surveys_languagesettings")." WHERE surveyls_survey_id=$surveyid and surveyls_language='$grouplang'";
|
||||||
$esresult = db_execute_assoc($esquery); //Checked
|
$esresult = db_execute_assoc($esquery); //Checked
|
||||||
$esrow = $esresult->FetchRow();
|
$esrow = $esresult->FetchRow();
|
||||||
|
if($esrow['surveyls_url']==""){$esrow['surveyls_url']="http://";}
|
||||||
$tab_title[$i] = getLanguageNameFromCode($esrow['surveyls_language'],false);
|
$tab_title[$i] = getLanguageNameFromCode($esrow['surveyls_language'],false);
|
||||||
|
|
||||||
if ($esrow['surveyls_language']==GetBaseLanguageFromSurveyID($surveyid))
|
if ($esrow['surveyls_language']==GetBaseLanguageFromSurveyID($surveyid))
|
||||||
$tab_title[$i] .= '('.$clang->gT("Base language").')';
|
$tab_title[$i] .= '('.$clang->gT("Base language").')';
|
||||||
|
|
||||||
$esrow = array_map('htmlspecialchars', $esrow);
|
$esrow = array_map('htmlspecialchars', $esrow);
|
||||||
$tab_content[$i] = "<ul>\n"
|
$tab_content[$i] = "<ul>\n"
|
||||||
. "<li><label for=''>".$clang->gT("Survey title").":</label>\n"
|
. "<li><label for=''>".$clang->gT("Survey title").":</label>\n"
|
||||||
. "<input type='text' size='80' name='short_title_".$esrow['surveyls_language']."' value=\"{$esrow['surveyls_title']}\" /></li>\n"
|
. "<input type='text' size='80' name='short_title_".$esrow['surveyls_language']."' value=\"{$esrow['surveyls_title']}\" /></li>\n"
|
||||||
. "<li><label for=''>".$clang->gT("Description:")."</label>\n"
|
. "<li><label for=''>".$clang->gT("Description:")."</label>\n"
|
||||||
. "<textarea cols='80' rows='15' name='description_".$esrow['surveyls_language']."'>{$esrow['surveyls_description']}</textarea>\n"
|
. "<textarea cols='80' rows='15' name='description_".$esrow['surveyls_language']."'>{$esrow['surveyls_description']}</textarea>\n"
|
||||||
. getEditor("survey-desc","description_".$esrow['surveyls_language'], "[".$clang->gT("Description:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action)
|
. getEditor("survey-desc","description_".$esrow['surveyls_language'], "[".$clang->gT("Description:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action)
|
||||||
. "</li>\n"
|
. "</li>\n"
|
||||||
. "<li><label for=''>".$clang->gT("Welcome message:")."</label>\n"
|
. "<li><label for=''>".$clang->gT("Welcome message:")."</label>\n"
|
||||||
. "<textarea cols='80' rows='15' name='welcome_".$esrow['surveyls_language']."'>{$esrow['surveyls_welcometext']}</textarea>\n"
|
. "<textarea cols='80' rows='15' name='welcome_".$esrow['surveyls_language']."'>{$esrow['surveyls_welcometext']}</textarea>\n"
|
||||||
. getEditor("survey-welc","welcome_".$esrow['surveyls_language'], "[".$clang->gT("Welcome:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action)
|
. getEditor("survey-welc","welcome_".$esrow['surveyls_language'], "[".$clang->gT("Welcome:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action)
|
||||||
. "</li>\n"
|
. "</li>\n"
|
||||||
. "<li><label for=''>".$clang->gT("End message:")."</label>\n"
|
. "<li><label for=''>".$clang->gT("End message:")."</label>\n"
|
||||||
. "<textarea cols='80' rows='15' name='endtext_".$esrow['surveyls_language']."'>{$esrow['surveyls_endtext']}</textarea>\n"
|
. "<textarea cols='80' rows='15' name='endtext_".$esrow['surveyls_language']."'>{$esrow['surveyls_endtext']}</textarea>\n"
|
||||||
. getEditor("survey-endtext","endtext_".$esrow['surveyls_language'], "[".$clang->gT("End message:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action)
|
. getEditor("survey-endtext","endtext_".$esrow['surveyls_language'], "[".$clang->gT("End message:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action)
|
||||||
. "</li>\n"
|
. "</li>\n"
|
||||||
. "<li><label for=''>".$clang->gT("End URL:")."</label>\n"
|
. "<li><label for=''>".$clang->gT("End URL:")."</label>\n"
|
||||||
. "<input type='text' size='80' name='url_".$esrow['surveyls_language']."' value=\"{$esrow['surveyls_url']}\" />\n"
|
. "<input type='text' size='80' name='url_".$esrow['surveyls_language']."' value=\"{$esrow['surveyls_url']}\" />\n"
|
||||||
. "</li>"
|
. "</li>"
|
||||||
. "<li><label for=''>".$clang->gT("URL description:")."</label>\n"
|
. "<li><label for=''>".$clang->gT("URL description:")."</label>\n"
|
||||||
. "<input type='text' size='80' name='urldescrip_".$esrow['surveyls_language']."' value=\"{$esrow['surveyls_urldescription']}\" />\n"
|
. "<input type='text' size='80' name='urldescrip_".$esrow['surveyls_language']."' value=\"{$esrow['surveyls_urldescription']}\" />\n"
|
||||||
. "</li>"
|
. "</li>"
|
||||||
. "<li><label for=''>".$clang->gT("Date format:")."</label>\n"
|
. "<li><label for=''>".$clang->gT("Date format:")."</label>\n"
|
||||||
. "<select size='1' name='dateformat_".$esrow['surveyls_language']."'>\n";
|
. "<select size='1' name='dateformat_".$esrow['surveyls_language']."'>\n";
|
||||||
foreach (getDateFormatData() as $index=>$dateformatdata)
|
foreach (getDateFormatData() as $index=>$dateformatdata)
|
||||||
{
|
{
|
||||||
$tab_content[$i].= "<option value='{$index}'";
|
$tab_content[$i].= "<option value='{$index}'";
|
||||||
if ($esrow['surveyls_dateformat']==$index) {
|
if ($esrow['surveyls_dateformat']==$index) {
|
||||||
$tab_content[$i].=" selected='selected'";
|
$tab_content[$i].=" selected='selected'";
|
||||||
}
|
}
|
||||||
$tab_content[$i].= ">".$dateformatdata['dateformat'].'</option>';
|
$tab_content[$i].= ">".$dateformatdata['dateformat'].'</option>';
|
||||||
}
|
}
|
||||||
$tab_content[$i].= "</select></li>"
|
$tab_content[$i].= "</select></li>"
|
||||||
. "<li><label for=''>".$clang->gT("Decimal separator:")."</label>\n";
|
. "<li><label for=''>".$clang->gT("Decimal separator:")."</label>\n";
|
||||||
$tab_content[$i].="<select size='1' name='numberformat_".$esrow['surveyls_language']."'>\n";
|
$tab_content[$i].="<select size='1' name='numberformat_".$esrow['surveyls_language']."'>\n";
|
||||||
foreach (getRadixPointData() as $index=>$radixptdata)
|
foreach (getRadixPointData() as $index=>$radixptdata)
|
||||||
{
|
{
|
||||||
$tab_content[$i].= "<option value='{$index}'";
|
$tab_content[$i].= "<option value='{$index}'";
|
||||||
if ($esrow['surveyls_numberformat']==$index) {
|
if ($esrow['surveyls_numberformat']==$index) {
|
||||||
$tab_content[$i].=" selected='selected'";
|
$tab_content[$i].=" selected='selected'";
|
||||||
}
|
}
|
||||||
$tab_content[$i].= ">".$radixptdata['desc'].'</option>';
|
$tab_content[$i].= ">".$radixptdata['desc'].'</option>';
|
||||||
}
|
}
|
||||||
$tab_content[$i].= "</select></li></ul>";
|
$tab_content[$i].= "</select></li></ul>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$editsurvey .= "<ul>";
|
$editsurvey .= "<ul>";
|
||||||
foreach($tab_title as $i=>$eachtitle){
|
foreach($tab_title as $i=>$eachtitle){
|
||||||
$editsurvey .= "<li style='clear:none'><a href='#edittxtele$i'>$eachtitle</a></li>";
|
$editsurvey .= "<li style='clear:none'><a href='#edittxtele$i'>$eachtitle</a></li>";
|
||||||
}
|
}
|
||||||
$editsurvey .= "</ul>";
|
$editsurvey .= "</ul>";
|
||||||
foreach ($tab_content as $i=>$eachcontent){
|
foreach ($tab_content as $i=>$eachcontent){
|
||||||
$editsurvey .= "<div id='edittxtele$i'>$eachcontent</div>";
|
$editsurvey .= "<div id='edittxtele$i'>$eachcontent</div>";
|
||||||
}
|
}
|
||||||
$editsurvey .= "</div>";
|
$editsurvey .= "</div>";
|
||||||
if(bHasSurveyPermission($surveyid,'surveylocale','update'))
|
if(bHasSurveyPermission($surveyid,'surveylocale','update'))
|
||||||
{
|
{
|
||||||
$editsurvey .= "<p><input type='submit' class='standardbtn' value='".$clang->gT("Save")."' />\n"
|
$editsurvey .= "<p><input type='submit' class='standardbtn' value='".$clang->gT("Save")."' />\n"
|
||||||
. "<input type='hidden' name='action' value='updatesurveylocalesettings' />\n"
|
. "<input type='hidden' name='action' value='updatesurveylocalesettings' />\n"
|
||||||
. "<input type='hidden' name='sid' value=\"{$surveyid}\" />\n"
|
. "<input type='hidden' name='sid' value=\"{$surveyid}\" />\n"
|
||||||
. "<input type='hidden' name='language' value=\"{$esrow['surveyls_language']}\" />\n"
|
. "<input type='hidden' name='language' value=\"{$esrow['surveyls_language']}\" />\n"
|
||||||
. "</p>\n"
|
. "</p>\n"
|
||||||
. "</form>\n";
|
. "</form>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
include("access_denied.php");
|
include("access_denied.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,305 +1,309 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* LimeSurvey
|
* LimeSurvey
|
||||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||||
* LimeSurvey is free software. This version may have been modified pursuant
|
* LimeSurvey is free software. This version may have been modified pursuant
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* to the GNU General Public License, and as distributed it includes or
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
* is derivative of works licensed under the GNU General Public License or
|
||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: export_data_r.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: export_data_r.php 12179 2012-01-24 13:27:31Z adevries $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
|
// Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The SPSS DATA LIST / BEGIN DATA parser is rather simple minded, the number after the type
|
* The SPSS DATA LIST / BEGIN DATA parser is rather simple minded, the number after the type
|
||||||
* specifier identifies the field width (maximum number of characters to scan)
|
* specifier identifies the field width (maximum number of characters to scan)
|
||||||
* It will stop short of that number of characters, honouring quote delimited
|
* It will stop short of that number of characters, honouring quote delimited
|
||||||
* space separated strings, however if the width is too small the remaining data in the current
|
* space separated strings, however if the width is too small the remaining data in the current
|
||||||
* line becomes part of the next column. Since we want to restrict this script to ONE scan of
|
* line becomes part of the next column. Since we want to restrict this script to ONE scan of
|
||||||
* the data (scan & output at same time), the information needed to construct the
|
* the data (scan & output at same time), the information needed to construct the
|
||||||
* DATA LIST is held in the $fields array, while the actual data is written to a
|
* DATA LIST is held in the $fields array, while the actual data is written to a
|
||||||
* to a temporary location, updating length (size) values in the $fields array as
|
* to a temporary location, updating length (size) values in the $fields array as
|
||||||
* the tmp file is generated (uses @fwrite's return value rather than strlen).
|
* the tmp file is generated (uses @fwrite's return value rather than strlen).
|
||||||
* Final output renders $fields to a DATA LIST, and then stitches in the tmp file data.
|
* Final output renders $fields to a DATA LIST, and then stitches in the tmp file data.
|
||||||
*
|
*
|
||||||
* Optimization opportunities remain in the VALUE LABELS section, which runs a query / column
|
* Optimization opportunities remain in the VALUE LABELS section, which runs a query / column
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$length_vallabel = '120'; // Set the max text length of Value Labels
|
$length_vallabel = '120'; // Set the max text length of Value Labels
|
||||||
$length_data = '25500'; // Set the max text length of Text Data
|
$length_data = '25500'; // Set the max text length of Text Data
|
||||||
$length_varlabel = '25500'; // Set the max text length of Variable Labels
|
$length_varlabel = '25500'; // Set the max text length of Variable Labels
|
||||||
$headerComment = '';
|
$headerComment = '';
|
||||||
$tempFile = '';
|
$tempFile = '';
|
||||||
|
|
||||||
include_once('login_check.php');
|
include_once('login_check.php');
|
||||||
//for scale 1=nominal, 2=ordinal, 3=scale
|
//for scale 1=nominal, 2=ordinal, 3=scale
|
||||||
$typeMap = array(
|
$typeMap = array(
|
||||||
'5'=>Array('name'=>'5 Point Choice','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
'5'=>Array('name'=>'5 Point Choice','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
||||||
'B'=>Array('name'=>'Array (10 Point Choice)','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
'B'=>Array('name'=>'Array (10 Point Choice)','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
||||||
'A'=>Array('name'=>'Array (5 Point Choice)','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
'A'=>Array('name'=>'Array (5 Point Choice)','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
||||||
'F'=>Array('name'=>'Array (Flexible Labels)','size'=>1,'SPSStype'=>'F'),
|
'F'=>Array('name'=>'Array (Flexible Labels)','size'=>1,'SPSStype'=>'F'),
|
||||||
'1'=>Array('name'=>'Array (Flexible Labels) Dual Scale','size'=>1,'SPSStype'=>'F'),
|
'1'=>Array('name'=>'Array (Flexible Labels) Dual Scale','size'=>1,'SPSStype'=>'F'),
|
||||||
'H'=>Array('name'=>'Array (Flexible Labels) by Column','size'=>1,'SPSStype'=>'F'),
|
'H'=>Array('name'=>'Array (Flexible Labels) by Column','size'=>1,'SPSStype'=>'F'),
|
||||||
'E'=>Array('name'=>'Array (Increase, Same, Decrease)','size'=>1,'SPSStype'=>'F','Scale'=>2),
|
'E'=>Array('name'=>'Array (Increase, Same, Decrease)','size'=>1,'SPSStype'=>'F','Scale'=>2),
|
||||||
'C'=>Array('name'=>'Array (Yes/No/Uncertain)','size'=>1,'SPSStype'=>'F'),
|
'C'=>Array('name'=>'Array (Yes/No/Uncertain)','size'=>1,'SPSStype'=>'F'),
|
||||||
'X'=>Array('name'=>'Boilerplate Question','size'=>1,'SPSStype'=>'A','hide'=>1),
|
'X'=>Array('name'=>'Boilerplate Question','size'=>1,'SPSStype'=>'A','hide'=>1),
|
||||||
'D'=>Array('name'=>'Date','size'=>10,'SPSStype'=>'SDATE'),
|
'D'=>Array('name'=>'Date','size'=>10,'SPSStype'=>'SDATE'),
|
||||||
'G'=>Array('name'=>'Gender','size'=>1,'SPSStype'=>'F'),
|
'G'=>Array('name'=>'Gender','size'=>1,'SPSStype'=>'F'),
|
||||||
'U'=>Array('name'=>'Huge Free Text','size'=>1,'SPSStype'=>'A'),
|
'U'=>Array('name'=>'Huge Free Text','size'=>1,'SPSStype'=>'A'),
|
||||||
'I'=>Array('name'=>'Language Switch','size'=>1,'SPSStype'=>'A'),
|
'I'=>Array('name'=>'Language Switch','size'=>1,'SPSStype'=>'A'),
|
||||||
'!'=>Array('name'=>'List (Dropdown)','size'=>1,'SPSStype'=>'F'),
|
'!'=>Array('name'=>'List (Dropdown)','size'=>1,'SPSStype'=>'F'),
|
||||||
'W'=>Array('name'=>'List (Flexible Labels) (Dropdown)','size'=>1,'SPSStype'=>'F'),
|
'W'=>Array('name'=>'List (Flexible Labels) (Dropdown)','size'=>1,'SPSStype'=>'F'),
|
||||||
'Z'=>Array('name'=>'List (Flexible Labels) (Radio)','size'=>1,'SPSStype'=>'F'),
|
'Z'=>Array('name'=>'List (Flexible Labels) (Radio)','size'=>1,'SPSStype'=>'F'),
|
||||||
'L'=>Array('name'=>'List (Radio)','size'=>1,'SPSStype'=>'F'),
|
'L'=>Array('name'=>'List (Radio)','size'=>1,'SPSStype'=>'F'),
|
||||||
'O'=>Array('name'=>'List With Comment','size'=>1,'SPSStype'=>'F'),
|
'O'=>Array('name'=>'List With Comment','size'=>1,'SPSStype'=>'F'),
|
||||||
'T'=>Array('name'=>'Long free text','size'=>1,'SPSStype'=>'A'),
|
'T'=>Array('name'=>'Long free text','size'=>1,'SPSStype'=>'A'),
|
||||||
'K'=>Array('name'=>'Multiple Numerical Input','size'=>1,'SPSStype'=>'F'),
|
'K'=>Array('name'=>'Multiple Numerical Input','size'=>1,'SPSStype'=>'F'),
|
||||||
'M'=>Array('name'=>'Multiple choice','size'=>1,'SPSStype'=>'F'),
|
'M'=>Array('name'=>'Multiple choice','size'=>1,'SPSStype'=>'F'),
|
||||||
'P'=>Array('name'=>'Multiple choice with comments','size'=>1,'SPSStype'=>'F'),
|
'P'=>Array('name'=>'Multiple choice with comments','size'=>1,'SPSStype'=>'F'),
|
||||||
'Q'=>Array('name'=>'Multiple Short Text','size'=>1,'SPSStype'=>'F'),
|
'Q'=>Array('name'=>'Multiple Short Text','size'=>1,'SPSStype'=>'F'),
|
||||||
'N'=>Array('name'=>'Numerical Input','size'=>3,'SPSStype'=>'F','Scale'=>3),
|
'N'=>Array('name'=>'Numerical Input','size'=>3,'SPSStype'=>'F','Scale'=>3),
|
||||||
'R'=>Array('name'=>'Ranking','size'=>1,'SPSStype'=>'F'),
|
'R'=>Array('name'=>'Ranking','size'=>1,'SPSStype'=>'F'),
|
||||||
'S'=>Array('name'=>'Short free text','size'=>1,'SPSStype'=>'F'),
|
'S'=>Array('name'=>'Short free text','size'=>1,'SPSStype'=>'F'),
|
||||||
'Y'=>Array('name'=>'Yes/No','size'=>1,'SPSStype'=>'F'),
|
'Y'=>Array('name'=>'Yes/No','size'=>1,'SPSStype'=>'F'),
|
||||||
':'=>Array('name'=>'Multi flexi numbers','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
':'=>Array('name'=>'Multi flexi numbers','size'=>1,'SPSStype'=>'F'),
|
||||||
';'=>Array('name'=>'Multi flexi text','size'=>1,'SPSStype'=>'A'),
|
';'=>Array('name'=>'Multi flexi text','size'=>1,'SPSStype'=>'A'),
|
||||||
);
|
'*'=>Array('name'=>'Equation','size'=>1,'SPSStype'=>'A'),
|
||||||
|
);
|
||||||
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
|
||||||
$filterstate = incompleteAnsFilterstate();
|
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
||||||
$quexsfilterstate = questionnaireSampleFilterstate();
|
$filterstate = incompleteAnsFilterstate();
|
||||||
|
|
||||||
$headerComment = '#$Rev: 10925 $' . " $filterstate.\n";
|
$quexsfilterstate = questionnaireSampleFilterstate();
|
||||||
|
|
||||||
if (isset($_GET['dldata'])) $subaction = "dldata";
|
$headerComment = '#$Rev: 12179 $' . " $filterstate.\n";
|
||||||
if (isset($_GET['dlstructure'])) $subaction = "dlstructure";
|
|
||||||
|
if (isset($_GET['dldata'])) $subaction = "dldata";
|
||||||
if (!isset($subaction))
|
if (isset($_GET['dlstructure'])) $subaction = "dlstructure";
|
||||||
{
|
|
||||||
$exportroutput = browsemenubar($clang->gT('Export results'));
|
if (!isset($subaction))
|
||||||
|
{
|
||||||
$exportroutput = browsemenubar($clang->gT('Export results'));
|
$exportroutput = browsemenubar($clang->gT('Export results'));
|
||||||
$exportroutput .= "<div class='header ui-widget-header'>".$clang->gT("Export result data to R")."</div>\n";
|
|
||||||
|
$exportroutput = browsemenubar($clang->gT('Export results'));
|
||||||
$selecthide="";
|
$exportroutput .= "<div class='header ui-widget-header'>".$clang->gT("Export result data to R")."</div>\n";
|
||||||
$selectshow="";
|
|
||||||
$selectinc="";
|
$selecthide="";
|
||||||
switch ($filterstate) {
|
$selectshow="";
|
||||||
case "inc":
|
$selectinc="";
|
||||||
$selectinc="selected='selected'";
|
switch ($filterstate) {
|
||||||
break;
|
case "inc":
|
||||||
case "filter":
|
$selectinc="selected='selected'";
|
||||||
$selecthide="selected='selected'";
|
break;
|
||||||
break;
|
case "filter":
|
||||||
default:
|
$selecthide="selected='selected'";
|
||||||
$selectshow="selected='selected'";
|
break;
|
||||||
}
|
default:
|
||||||
|
$selectshow="selected='selected'";
|
||||||
$exportroutput .= "<form action='$scriptname' id='exportspss' method='get'><ul>\n"
|
}
|
||||||
."<li><label for='filterinc'>".$clang->gT("Data selection:")."</label><select id='filterinc' name='filterinc' onchange='this.form.submit();'>\n"
|
|
||||||
."\t<option value='filter' $selecthide>".$clang->gT("Completed responses only")."</option>\n"
|
$exportroutput .= "<form action='$scriptname' id='exportspss' method='get'><ul>\n"
|
||||||
."\t<option value='show' $selectshow>".$clang->gT("All responses")."</option>\n"
|
."<li><label for='filterinc'>".$clang->gT("Data selection:")."</label><select id='filterinc' name='filterinc' onchange='this.form.submit();'>\n"
|
||||||
."\t<option value='incomplete' $selectinc>".$clang->gT("Incomplete responses only")."</option>\n"
|
."\t<option value='filter' $selecthide>".$clang->gT("Completed responses only")."</option>\n"
|
||||||
."</select></li>\n";
|
."\t<option value='show' $selectshow>".$clang->gT("All responses")."</option>\n"
|
||||||
|
."\t<option value='incomplete' $selectinc>".$clang->gT("Incomplete responses only")."</option>\n"
|
||||||
//queXS Addition
|
."</select></li>\n";
|
||||||
include_once("../quexs.php");
|
|
||||||
$exportroutput .= "<li><label for='quexsfilterinc'>".$clang->gT("Questionnaire and Sample selection:")."</label><select id='quexsfilterinc' name='quexsfilterinc' onchange='this.form.submit();'>\n"
|
//queXS Addition
|
||||||
."\t<option value='all' >".$clang->gT("All queXS questionnaires and samples associated with this instrument")."</option>\n"
|
include_once("../quexs.php");
|
||||||
. get_questionnaire_sample_list($surveyid,$quexsfilterstate)
|
$exportroutput .= "<li><label for='quexsfilterinc'>".$clang->gT("Questionnaire and Sample selection:")."</label><select id='quexsfilterinc' name='quexsfilterinc' onchange='this.form.submit();'>\n"
|
||||||
."</select></li>\n";
|
."\t<option value='all' >".$clang->gT("All queXS questionnaires and samples associated with this instrument")."</option>\n"
|
||||||
|
. get_questionnaire_sample_list($surveyid,$quexsfilterstate)
|
||||||
$filename = "survey_".$surveyid."_R_syntax_file.R";
|
."</select></li>\n";
|
||||||
|
|
||||||
$exportroutput .= "<input type='hidden' name='sid' value='$surveyid' />\n"
|
$filename = "survey_".$surveyid."_R_syntax_file.R";
|
||||||
."<input type='hidden' name='action' value='exportr' /></li>\n"
|
|
||||||
."<li><label for='dlstructure'>" . $clang->gT("Step 1:") . "</label><input type='submit' name='dlstructure' id='dlstructure' value='" . $clang->gT("Export R syntax file") . "'/></li>\n"
|
$exportroutput .= "<input type='hidden' name='sid' value='$surveyid' />\n"
|
||||||
."<li><label for='dldata'/>" . $clang->gT("Step 2:") . "</label><input type='submit' name='dldata' id='dldata' value='" . $clang->gT("Export .csv data file") . "'/></li></ul>\n"
|
."<input type='hidden' name='action' value='exportr' /></li>\n"
|
||||||
."</form>\n"
|
."<li><label for='dlstructure'>" . $clang->gT("Step 1:") . "</label><input type='submit' name='dlstructure' id='dlstructure' value='" . $clang->gT("Export R syntax file") . "'/></li>\n"
|
||||||
|
."<li><label for='dldata'/>" . $clang->gT("Step 2:") . "</label><input type='submit' name='dldata' id='dldata' value='" . $clang->gT("Export .csv data file") . "'/></li></ul>\n"
|
||||||
."<p><div class='messagebox ui-corner-all'><div class='header ui-widget-header'>".$clang->gT("Instructions for the impatient")."</div>"
|
."</form>\n"
|
||||||
."<br/><ol style='margin:0 auto; font-size:8pt;'>"
|
|
||||||
."<li>".$clang->gT("Download the data and the syntax file.")."</li>"
|
."<p><div class='messagebox ui-corner-all'><div class='header ui-widget-header'>".$clang->gT("Instructions for the impatient")."</div>"
|
||||||
."<li>".$clang->gT("Save both of them on the R working directory (use getwd() and setwd() on the R command window to get and set it)").".</li>"
|
."<br/><ol style='margin:0 auto; font-size:8pt;'>"
|
||||||
."<li>".sprintf($clang->gT("digit: source(\"%s\", encoding = \"UTF-8\") on the R command window"), $filename)."</li>"
|
."<li>".$clang->gT("Download the data and the syntax file.")."</li>"
|
||||||
."</ol><br />"
|
."<li>".$clang->gT("Save both of them on the R working directory (use getwd() and setwd() on the R command window to get and set it)").".</li>"
|
||||||
.$clang->gT("Your data should be imported now, the data.frame is named \"data\", the variable.labels are attributes of data (\"attributes(data)\$variable.labels\"), like for foreign:read.spss.")
|
."<li>".sprintf($clang->gT("digit: source(\"%s\", encoding = \"UTF-8\") on the R command window"), $filename)."</li>"
|
||||||
."</div>";
|
."</ol><br />"
|
||||||
}
|
.$clang->gT("Your data should be imported now, the data.frame is named \"data\", the variable.labels are attributes of data (\"attributes(data)\$variable.labels\"), like for foreign:read.spss.")
|
||||||
else
|
."</div>";
|
||||||
{
|
}
|
||||||
// Get Base language:
|
else
|
||||||
$language = GetBaseLanguageFromSurveyID($surveyid);
|
{
|
||||||
$clang = new limesurvey_lang($language);
|
// Get Base language:
|
||||||
require_once ("export_data_functions.php");
|
$language = GetBaseLanguageFromSurveyID($surveyid);
|
||||||
}
|
$clang = new limesurvey_lang($language);
|
||||||
|
require_once ("export_data_functions.php");
|
||||||
|
}
|
||||||
if ($subaction=='dldata')
|
|
||||||
{
|
|
||||||
header("Content-Disposition: attachment; filename=survey_".$surveyid."_R_data_file.csv");
|
if ($subaction=='dldata')
|
||||||
header("Content-type: text/comma-separated-values; charset=UTF-8");
|
{
|
||||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
header("Content-Disposition: attachment; filename=survey_".$surveyid."_R_data_file.csv");
|
||||||
header("Pragma: public");
|
header("Content-type: text/comma-separated-values; charset=UTF-8");
|
||||||
|
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||||
$na=""; //change to empty string instead of two double quotes to fix warnings on NA
|
header("Pragma: public");
|
||||||
spss_export_data($na);
|
|
||||||
|
$na=""; //change to empty string instead of two double quotes to fix warnings on NA
|
||||||
exit;
|
spss_export_data($na);
|
||||||
}
|
|
||||||
|
exit;
|
||||||
if ($subaction=='dlstructure')
|
}
|
||||||
{
|
|
||||||
header("Content-Disposition: attachment; filename=survey_".$surveyid."_R_syntax_file.R");
|
if ($subaction=='dlstructure')
|
||||||
header("Content-type: application/download; charset=UTF-8");
|
{
|
||||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
header("Content-Disposition: attachment; filename=survey_".$surveyid."_R_syntax_file.R");
|
||||||
header("Pragma: public");
|
header("Content-type: application/download; charset=UTF-8");
|
||||||
|
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||||
echo $headerComment;
|
header("Pragma: public");
|
||||||
echo "data <- read.table(\"survey_".$surveyid
|
|
||||||
."_R_data_file.csv\", sep=\",\", quote = \"'\", "
|
echo $headerComment;
|
||||||
."na.strings=c(\"\",\"\\\"\\\"\"), "
|
echo "data <- read.table(\"survey_".$surveyid
|
||||||
."stringsAsFactors=FALSE)\n\n";
|
."_R_data_file.csv\", sep=\",\", quote = \"'\", "
|
||||||
// echo "names(data) <- paste(\"V\",1:dim(data)[2],sep=\"\")\n\n";
|
."na.strings=c(\"\",\"\\\"\\\"\"), "
|
||||||
|
."stringsAsFactors=FALSE)\n\n";
|
||||||
// Build array that has to be returned
|
// echo "names(data) <- paste(\"V\",1:dim(data)[2],sep=\"\")\n\n";
|
||||||
$fields = spss_fieldmap("V");
|
|
||||||
|
// Build array that has to be returned
|
||||||
//Now get the query string with all fields to export
|
$fields = spss_fieldmap("V");
|
||||||
$query = spss_getquery();
|
|
||||||
|
//Now get the query string with all fields to export
|
||||||
$result=db_execute_num($query) or safe_die("Couldn't get results<br />$query<br />".$connect->ErrorMsg()); //Checked
|
$query = spss_getquery();
|
||||||
$num_fields = $result->FieldCount();
|
|
||||||
|
$result=db_execute_num($query) or safe_die("Couldn't get results<br />$query<br />".$connect->ErrorMsg()); //Checked
|
||||||
//Now we check if we need to adjust the size of the field or the type of the field
|
$num_fields = $result->FieldCount();
|
||||||
while ($row = $result->FetchRow()) {
|
|
||||||
$fieldno = 0;
|
//Now we check if we need to adjust the size of the field or the type of the field
|
||||||
while ($fieldno < $num_fields)
|
while ($row = $result->FetchRow()) {
|
||||||
{
|
$fieldno = 0;
|
||||||
//Performance improvement, don't recheck fields that have valuelabels
|
while ($fieldno < $num_fields)
|
||||||
if (!isset($fields[$fieldno]['answers'])) {
|
{
|
||||||
$strTmp=mb_substr(strip_tags_full($row[$fieldno]), 0, $length_data);
|
//Performance improvement, don't recheck fields that have valuelabels
|
||||||
$len = mb_strlen($strTmp);
|
if (!isset($fields[$fieldno]['answers'])) {
|
||||||
if($len > $fields[$fieldno]['size']) $fields[$fieldno]['size'] = $len;
|
$strTmp=mb_substr(strip_tags_full($row[$fieldno]), 0, $length_data);
|
||||||
|
$len = mb_strlen($strTmp);
|
||||||
if (trim($strTmp) != ''){
|
if($len > $fields[$fieldno]['size']) $fields[$fieldno]['size'] = $len;
|
||||||
if ($fields[$fieldno]['SPSStype']=='F' && (my_is_numeric($strTmp)===false || $fields[$fieldno]['size']>16))
|
|
||||||
{
|
if (trim($strTmp) != ''){
|
||||||
$fields[$fieldno]['SPSStype']='A';
|
if ($fields[$fieldno]['SPSStype']=='F' && (my_is_numeric($strTmp)===false || $fields[$fieldno]['size']>16))
|
||||||
}
|
{
|
||||||
}
|
$fields[$fieldno]['SPSStype']='A';
|
||||||
}
|
}
|
||||||
$fieldno++;
|
}
|
||||||
}
|
}
|
||||||
}
|
$fieldno++;
|
||||||
|
}
|
||||||
$errors = "";
|
}
|
||||||
$i = 1;
|
|
||||||
foreach ($fields as $field)
|
$errors = "";
|
||||||
{
|
$i = 1;
|
||||||
if($field['SPSStype'] == 'DATETIME23.2') $field['size']='';
|
foreach ($fields as $field)
|
||||||
if($field['LStype'] == 'N' || $field['LStype']=='K')
|
{
|
||||||
{
|
if($field['SPSStype'] == 'DATETIME23.2') $field['size']='';
|
||||||
$field['size'].='.'.($field['size']-1);
|
if($field['LStype'] == 'N' || $field['LStype']=='K')
|
||||||
}
|
{
|
||||||
switch ($field['SPSStype'])
|
$field['size'].='.'.($field['size']-1);
|
||||||
{
|
}
|
||||||
case 'F':
|
switch ($field['SPSStype'])
|
||||||
$type="numeric";
|
{
|
||||||
break;
|
case 'F':
|
||||||
case 'A':
|
$type="numeric";
|
||||||
$type="character";
|
break;
|
||||||
break;
|
case 'A':
|
||||||
case 'DATETIME23.2':
|
$type="character";
|
||||||
case 'SDATE':
|
break;
|
||||||
$type="character";
|
case 'DATETIME23.2':
|
||||||
//@TODO set $type to format for date
|
case 'SDATE':
|
||||||
break;
|
$type="character";
|
||||||
}
|
//@TODO set $type to format for date
|
||||||
|
break;
|
||||||
if (!$field['hide'])
|
}
|
||||||
{
|
|
||||||
echo "data[, " . $i . "] <- "
|
if (!$field['hide'])
|
||||||
."as.$type(data[, " . $i . "])\n";
|
{
|
||||||
|
echo "data[, " . $i . "] <- "
|
||||||
echo 'attributes(data)$variable.labels[' . $i . '] <- "'
|
."as.$type(data[, " . $i . "])\n";
|
||||||
. addslashes(
|
|
||||||
htmlspecialchars_decode(
|
echo 'attributes(data)$variable.labels[' . $i . '] <- "'
|
||||||
mb_substr(
|
. addslashes(
|
||||||
strip_tags_full(
|
htmlspecialchars_decode(
|
||||||
$field['VariableLabel']),0,$length_varlabel))) // <AdV> added htmlspecialchars_decode
|
mb_substr(
|
||||||
. '"' . "\n";
|
strip_tags_full(
|
||||||
|
$field['VariableLabel']),0,$length_varlabel)))
|
||||||
// Create the value Labels!
|
. '"' . "\n";
|
||||||
if (isset($field['answers']))
|
|
||||||
{
|
// Create the value Labels!
|
||||||
$answers = $field['answers'];
|
if (isset($field['answers']))
|
||||||
//print out the value labels!
|
{
|
||||||
// data$V14=factor(data$V14,levels=c(1,2,3),labels=c("Yes","No","Uncertain"))
|
$answers = $field['answers'];
|
||||||
echo 'data[, ' . $i .'] <- factor(data[, ' . $i . '], levels=c(';
|
//print out the value labels!
|
||||||
$str="";
|
if($field['LStype'] != ':') // Exclude array (numeric) type questions. There must be a better way of doing this, but I can't find it. (AdV)
|
||||||
foreach ($answers as $answer) {
|
{
|
||||||
if ($field['SPSStype']=="F" && my_is_numeric($answer['code'])) {
|
echo 'data[, ' . $i .'] <- factor(data[, ' . $i . '], levels=c(';
|
||||||
$str .= ",{$answer['code']}";
|
$str="";
|
||||||
} else {
|
foreach ($answers as $answer) {
|
||||||
$str .= ",\"{$answer['code']}\"";
|
if ($field['SPSStype']=="F" && my_is_numeric($answer['code'])) {
|
||||||
}
|
$str .= ",{$answer['code']}";
|
||||||
}
|
} else {
|
||||||
$str = mb_substr($str,1);
|
$str .= ",\"{$answer['code']}\"";
|
||||||
echo $str . '),labels=c(';
|
}
|
||||||
$str="";
|
}
|
||||||
foreach ($answers as $answer) {
|
$str = mb_substr($str,1);
|
||||||
$str .= ",\"{$answer['value']}\"";
|
echo $str . '),labels=c(';
|
||||||
}
|
$str="";
|
||||||
$str = mb_substr($str,1);
|
foreach ($answers as $answer) {
|
||||||
if($field['scale']!=='' && $field['scale'] == 2 ) {
|
$str .= ",\"{$answer['value']}\"";
|
||||||
$scale = ",ordered=TRUE";
|
}
|
||||||
} else {
|
$str = mb_substr($str,1);
|
||||||
$scale = "";
|
if($field['scale']!=='' && $field['scale'] == 2 ) {
|
||||||
}
|
$scale = ",ordered=TRUE";
|
||||||
echo "$str)$scale)\n";
|
} else {
|
||||||
}
|
$scale = "";
|
||||||
|
}
|
||||||
//Rename the Variables (in case somethings goes wrong, we still have the OLD values
|
echo "$str)$scale)\n";
|
||||||
if (isset($field['sql_name']))
|
}
|
||||||
{
|
}
|
||||||
$ftitle = $field['title'];
|
|
||||||
if (!preg_match ("/^([a-z]|[A-Z])+.*$/", $ftitle))
|
//Rename the Variables (in case somethings goes wrong, we still have the OLD values
|
||||||
{
|
if (isset($field['sql_name']))
|
||||||
$ftitle = "q_" . $ftitle;
|
{
|
||||||
}
|
$ftitle = $field['title'];
|
||||||
$ftitle = str_replace(array("-",":",";","!"), array("_hyph_","_dd_","_dc_","_excl_"), $ftitle);
|
if (!preg_match ("/^([a-z]|[A-Z])+.*$/", $ftitle))
|
||||||
if (!$field['hide'])
|
{
|
||||||
{
|
$ftitle = "q_" . $ftitle;
|
||||||
if ($ftitle != $field['title'])
|
}
|
||||||
{
|
$ftitle = str_replace(array("-",":",";","!"), array("_hyph_","_dd_","_dc_","_excl_"), $ftitle);
|
||||||
$errors .= "# Variable name was incorrect and was changed from {$field['title']} to $ftitle .\n";
|
if (!$field['hide'])
|
||||||
}
|
{
|
||||||
echo "names(data)[" . $i . "] <- "
|
if ($ftitle != $field['title'])
|
||||||
. "\"". $ftitle . "\"\n"; // <AdV> added \n
|
{
|
||||||
}
|
$errors .= "# Variable name was incorrect and was changed from {$field['title']} to $ftitle .\n";
|
||||||
$i++;
|
}
|
||||||
}
|
echo "names(data)[" . $i . "] <- "
|
||||||
else
|
. "\"". $ftitle . "\"\n"; // <AdV> added \n
|
||||||
{
|
}
|
||||||
echo "#sql_name not set\n";
|
$i++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
}
|
{
|
||||||
else
|
echo "#sql_name not set\n";
|
||||||
{
|
}
|
||||||
echo "#Field hidden\n";
|
|
||||||
}
|
}
|
||||||
echo "\n";
|
else
|
||||||
|
{
|
||||||
} // end foreach
|
echo "#Field hidden\n";
|
||||||
echo $errors;
|
}
|
||||||
exit;
|
echo "\n";
|
||||||
}
|
|
||||||
|
} // end foreach
|
||||||
?>
|
echo $errors;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: export_data_spss.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: export_data_spss.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
|
// Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
|
||||||
@@ -63,11 +63,14 @@ $typeMap = array(
|
|||||||
':'=>Array('name'=>'Multi flexi numbers','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
':'=>Array('name'=>'Multi flexi numbers','size'=>1,'SPSStype'=>'F','Scale'=>3),
|
||||||
';'=>Array('name'=>'Multi flexi text','size'=>1,'SPSStype'=>'A'),
|
';'=>Array('name'=>'Multi flexi text','size'=>1,'SPSStype'=>'A'),
|
||||||
'|'=>Array('name'=>'File upload','size'=>1,'SPSStype'=>'A'),
|
'|'=>Array('name'=>'File upload','size'=>1,'SPSStype'=>'A'),
|
||||||
|
'*'=>Array('name'=>'Equation','size'=>1,'SPSStype'=>'A'),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
||||||
$filterstate = incompleteAnsFilterstate();
|
$filterstate = incompleteAnsFilterstate();
|
||||||
|
|
||||||
$quexsfilterstate = questionnaireSampleFilterstate();
|
$quexsfilterstate = questionnaireSampleFilterstate();
|
||||||
|
|
||||||
$spssver = returnglobal('spssver');
|
$spssver = returnglobal('spssver');
|
||||||
if (is_null($spssver)) {
|
if (is_null($spssver)) {
|
||||||
if (!isset($_SESSION['spssversion'])) {
|
if (!isset($_SESSION['spssversion'])) {
|
||||||
@@ -93,7 +96,7 @@ switch ($spssver) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$headerComment = '*$Rev: 10925 $' . " $quexsfilterstate $filterstate $spssver.\n";
|
$headerComment = '*$Rev: 11664 $' . " $quexsfilterstate $filterstate $spssver.\n";
|
||||||
|
|
||||||
if (isset($_GET['dldata'])) $subaction = "dldata";
|
if (isset($_GET['dldata'])) $subaction = "dldata";
|
||||||
if (isset($_GET['dlstructure'])) $subaction = "dlstructure";
|
if (isset($_GET['dlstructure'])) $subaction = "dlstructure";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: export_resources_zip.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: export_resources_zip.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,172 +1,172 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* LimeSurvey
|
* LimeSurvey
|
||||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||||
* LimeSurvey is free software. This version may have been modified pursuant
|
* LimeSurvey is free software. This version may have been modified pursuant
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* to the GNU General Public License, and as distributed it includes or
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
* is derivative of works licensed under the GNU General Public License or
|
||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: export_structure_lsrc.php 9586 2010-12-06 03:08:07Z c_schmitz $
|
* $Id: export_structure_lsrc.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// DUMP THE RELATED DATA FOR A SINGLE SURVEY INTO A SQL FILE FOR IMPORTING LATER ON OR ON ANOTHER SURVEY SETUP
|
// DUMP THE RELATED DATA FOR A SINGLE SURVEY INTO A SQL FILE FOR IMPORTING LATER ON OR ON ANOTHER SURVEY SETUP
|
||||||
// DUMP ALL DATA WITH RELATED SID FROM THE FOLLOWING TABLES
|
// DUMP ALL DATA WITH RELATED SID FROM THE FOLLOWING TABLES
|
||||||
// 1. Surveys
|
// 1. Surveys
|
||||||
// 2. Surveys Language Table
|
// 2. Surveys Language Table
|
||||||
// 3. Groups
|
// 3. Groups
|
||||||
// 4. Questions
|
// 4. Questions
|
||||||
// 5. Answers
|
// 5. Answers
|
||||||
// 6. Conditions
|
// 6. Conditions
|
||||||
// 7. Label Sets
|
// 7. Label Sets
|
||||||
// 8. Labels
|
// 8. Labels
|
||||||
// 9. Question Attributes
|
// 9. Question Attributes
|
||||||
// 10. Assessments
|
// 10. Assessments
|
||||||
// 11. Quota
|
// 11. Quota
|
||||||
// 12. Quota Members
|
// 12. Quota Members
|
||||||
|
|
||||||
include_once("login_check.php");
|
include_once("login_check.php");
|
||||||
|
|
||||||
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
|
||||||
|
|
||||||
|
|
||||||
if (!$surveyid)
|
if (!$surveyid)
|
||||||
{
|
{
|
||||||
echo $htmlheader
|
echo $htmlheader
|
||||||
."<br />\n"
|
."<br />\n"
|
||||||
."<table width='350' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n"
|
."<table width='350' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n"
|
||||||
."\t<tr bgcolor='#555555'><td colspan='2' height='4'><font size='1' face='verdana' color='white'><strong>"
|
."\t<tr bgcolor='#555555'><td colspan='2' height='4'><font size='1' face='verdana' color='white'><strong>"
|
||||||
.$clang->gT("Export Survey")."</strong></td></tr>\n"
|
.$clang->gT("Export Survey")."</strong></td></tr>\n"
|
||||||
."\t<tr><td align='center'>\n"
|
."\t<tr><td align='center'>\n"
|
||||||
."<br /><strong><font color='red'>"
|
."<br /><strong><font color='red'>"
|
||||||
.$clang->gT("Error")."</font></strong><br />\n"
|
.$clang->gT("Error")."</font></strong><br />\n"
|
||||||
.$clang->gT("No SID has been provided. Cannot dump survey")."<br />\n"
|
.$clang->gT("No SID has been provided. Cannot dump survey")."<br />\n"
|
||||||
."<br /><input type='submit' value='"
|
."<br /><input type='submit' value='"
|
||||||
.$clang->gT("Main Admin Screen")."' onclick=\"window.open('$scriptname', '_self')\">\n"
|
.$clang->gT("Main Admin Screen")."' onclick=\"window.open('$scriptname', '_self')\">\n"
|
||||||
."\t</td></tr>\n"
|
."\t</td></tr>\n"
|
||||||
."</table>\n"
|
."</table>\n"
|
||||||
."</body></html>\n";
|
."</body></html>\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dumphead = "# LimeSurvey Survey Dump\n"
|
$dumphead = "# LimeSurvey Survey Dump\n"
|
||||||
. "# DBVersion $dbversionnumber\n"
|
. "# DBVersion $dbversionnumber\n"
|
||||||
. "# This is a dumped survey from the LimeSurvey Script\n"
|
. "# This is a dumped survey from the LimeSurvey Script\n"
|
||||||
. "# http://www.limesurvey.org/\n"
|
. "# http://www.limesurvey.org/\n"
|
||||||
. "# Do not change this header!\n";
|
. "# Do not change this header!\n";
|
||||||
|
|
||||||
//1: Surveys table
|
//1: Surveys table
|
||||||
$squery = "SELECT *
|
$squery = "SELECT *
|
||||||
FROM {$dbprefix}surveys
|
FROM {$dbprefix}surveys
|
||||||
WHERE sid=$surveyid";
|
WHERE sid=$surveyid";
|
||||||
$sdump = BuildCSVFromQuery($squery);
|
$sdump = BuildCSVFromQuery($squery);
|
||||||
|
|
||||||
//2: Surveys Languagsettings table
|
//2: Surveys Languagsettings table
|
||||||
$slsquery = "SELECT *
|
$slsquery = "SELECT *
|
||||||
FROM {$dbprefix}surveys_languagesettings
|
FROM {$dbprefix}surveys_languagesettings
|
||||||
WHERE surveyls_survey_id=$surveyid";
|
WHERE surveyls_survey_id=$surveyid";
|
||||||
$slsdump = BuildCSVFromQuery($slsquery);
|
$slsdump = BuildCSVFromQuery($slsquery);
|
||||||
|
|
||||||
//3: Groups Table
|
//3: Groups Table
|
||||||
$gquery = "SELECT *
|
$gquery = "SELECT *
|
||||||
FROM {$dbprefix}groups
|
FROM {$dbprefix}groups
|
||||||
WHERE sid=$surveyid
|
WHERE sid=$surveyid
|
||||||
ORDER BY gid";
|
ORDER BY gid";
|
||||||
$gdump = BuildCSVFromQuery($gquery);
|
$gdump = BuildCSVFromQuery($gquery);
|
||||||
|
|
||||||
//4: Questions Table
|
//4: Questions Table
|
||||||
$qquery = "SELECT *
|
$qquery = "SELECT *
|
||||||
FROM {$dbprefix}questions
|
FROM {$dbprefix}questions
|
||||||
WHERE sid=$surveyid
|
WHERE sid=$surveyid
|
||||||
ORDER BY qid";
|
ORDER BY qid";
|
||||||
$qdump = BuildCSVFromQuery($qquery);
|
$qdump = BuildCSVFromQuery($qquery);
|
||||||
|
|
||||||
//5: Answers table
|
//5: Answers table
|
||||||
$aquery = "SELECT {$dbprefix}answers.*
|
$aquery = "SELECT {$dbprefix}answers.*
|
||||||
FROM {$dbprefix}answers, {$dbprefix}questions
|
FROM {$dbprefix}answers, {$dbprefix}questions
|
||||||
WHERE {$dbprefix}answers.language={$dbprefix}questions.language
|
WHERE {$dbprefix}answers.language={$dbprefix}questions.language
|
||||||
AND {$dbprefix}answers.qid={$dbprefix}questions.qid
|
AND {$dbprefix}answers.qid={$dbprefix}questions.qid
|
||||||
AND {$dbprefix}questions.sid=$surveyid";
|
AND {$dbprefix}questions.sid=$surveyid";
|
||||||
$adump = BuildCSVFromQuery($aquery);
|
$adump = BuildCSVFromQuery($aquery);
|
||||||
|
|
||||||
//6: Conditions table
|
//6: Conditions table
|
||||||
$cquery = "SELECT DISTINCT {$dbprefix}conditions.*
|
$cquery = "SELECT DISTINCT {$dbprefix}conditions.*
|
||||||
FROM {$dbprefix}conditions, {$dbprefix}questions
|
FROM {$dbprefix}conditions, {$dbprefix}questions
|
||||||
WHERE {$dbprefix}conditions.qid={$dbprefix}questions.qid
|
WHERE {$dbprefix}conditions.qid={$dbprefix}questions.qid
|
||||||
AND {$dbprefix}questions.sid=$surveyid";
|
AND {$dbprefix}questions.sid=$surveyid";
|
||||||
$cdump = BuildCSVFromQuery($cquery);
|
$cdump = BuildCSVFromQuery($cquery);
|
||||||
|
|
||||||
//7: Label Sets
|
//7: Label Sets
|
||||||
$lsquery = "SELECT DISTINCT {$dbprefix}labelsets.lid, label_name, {$dbprefix}labelsets.languages
|
$lsquery = "SELECT DISTINCT {$dbprefix}labelsets.lid, label_name, {$dbprefix}labelsets.languages
|
||||||
FROM {$dbprefix}labelsets, {$dbprefix}questions
|
FROM {$dbprefix}labelsets, {$dbprefix}questions
|
||||||
WHERE ({$dbprefix}labelsets.lid={$dbprefix}questions.lid or {$dbprefix}labelsets.lid={$dbprefix}questions.lid1)
|
WHERE ({$dbprefix}labelsets.lid={$dbprefix}questions.lid or {$dbprefix}labelsets.lid={$dbprefix}questions.lid1)
|
||||||
AND type IN ('F', 'H', 'W', 'Z', '1', ':', ';')
|
AND type IN ('F', 'H', 'W', 'Z', '1', ':', ';')
|
||||||
AND sid=$surveyid";
|
AND sid=$surveyid";
|
||||||
$lsdump = BuildCSVFromQuery($lsquery);
|
$lsdump = BuildCSVFromQuery($lsquery);
|
||||||
|
|
||||||
//8: Labels
|
//8: Labels
|
||||||
$lquery = "SELECT {$dbprefix}labels.lid, {$dbprefix}labels.code, {$dbprefix}labels.title, {$dbprefix}labels.sortorder,{$dbprefix}labels.language
|
$lquery = "SELECT {$dbprefix}labels.lid, {$dbprefix}labels.code, {$dbprefix}labels.title, {$dbprefix}labels.sortorder,{$dbprefix}labels.language
|
||||||
FROM {$dbprefix}labels, {$dbprefix}questions
|
FROM {$dbprefix}labels, {$dbprefix}questions
|
||||||
WHERE ({$dbprefix}labels.lid={$dbprefix}questions.lid or {$dbprefix}labels.lid={$dbprefix}questions.lid1)
|
WHERE ({$dbprefix}labels.lid={$dbprefix}questions.lid or {$dbprefix}labels.lid={$dbprefix}questions.lid1)
|
||||||
AND type in ('F', 'W', 'H', 'Z', '1', ':', ';')
|
AND type in ('F', 'W', 'H', 'Z', '1', ':', ';')
|
||||||
AND sid=$surveyid
|
AND sid=$surveyid
|
||||||
GROUP BY {$dbprefix}labels.lid, {$dbprefix}labels.code, {$dbprefix}labels.title, {$dbprefix}labels.sortorder,{$dbprefix}labels.language";
|
GROUP BY {$dbprefix}labels.lid, {$dbprefix}labels.code, {$dbprefix}labels.title, {$dbprefix}labels.sortorder,{$dbprefix}labels.language";
|
||||||
$ldump = BuildCSVFromQuery($lquery);
|
$ldump = BuildCSVFromQuery($lquery);
|
||||||
|
|
||||||
//9: Question Attributes
|
//9: Question Attributes
|
||||||
$query = "SELECT DISTINCT {$dbprefix}question_attributes.*
|
$query = "SELECT DISTINCT {$dbprefix}question_attributes.*
|
||||||
FROM {$dbprefix}question_attributes, {$dbprefix}questions
|
FROM {$dbprefix}question_attributes, {$dbprefix}questions
|
||||||
WHERE {$dbprefix}question_attributes.qid={$dbprefix}questions.qid
|
WHERE {$dbprefix}question_attributes.qid={$dbprefix}questions.qid
|
||||||
AND {$dbprefix}questions.sid=$surveyid";
|
AND {$dbprefix}questions.sid=$surveyid";
|
||||||
$qadump = BuildCSVFromQuery($query);
|
$qadump = BuildCSVFromQuery($query);
|
||||||
|
|
||||||
//10: Assessments;
|
//10: Assessments;
|
||||||
$query = "SELECT {$dbprefix}assessments.*
|
$query = "SELECT {$dbprefix}assessments.*
|
||||||
FROM {$dbprefix}assessments
|
FROM {$dbprefix}assessments
|
||||||
WHERE {$dbprefix}assessments.sid=$surveyid";
|
WHERE {$dbprefix}assessments.sid=$surveyid";
|
||||||
$asdump = BuildCSVFromQuery($query);
|
$asdump = BuildCSVFromQuery($query);
|
||||||
|
|
||||||
//11: Quota;
|
//11: Quota;
|
||||||
$query = "SELECT {$dbprefix}quota.*
|
$query = "SELECT {$dbprefix}quota.*
|
||||||
FROM {$dbprefix}quota
|
FROM {$dbprefix}quota
|
||||||
WHERE {$dbprefix}quota.sid=$surveyid";
|
WHERE {$dbprefix}quota.sid=$surveyid";
|
||||||
$quotadump = BuildCSVFromQuery($query);
|
$quotadump = BuildCSVFromQuery($query);
|
||||||
|
|
||||||
//12: Quota Members;
|
//12: Quota Members;
|
||||||
$query = "SELECT {$dbprefix}quota_members.*
|
$query = "SELECT {$dbprefix}quota_members.*
|
||||||
FROM {$dbprefix}quota_members
|
FROM {$dbprefix}quota_members
|
||||||
WHERE {$dbprefix}quota_members.sid=$surveyid";
|
WHERE {$dbprefix}quota_members.sid=$surveyid";
|
||||||
$quotamemdump = BuildCSVFromQuery($query);
|
$quotamemdump = BuildCSVFromQuery($query);
|
||||||
|
|
||||||
$fn = "limesurvey_survey_$surveyid.csv";
|
$fn = "limesurvey_survey_$surveyid.csv";
|
||||||
|
|
||||||
//header("Content-Type: application/download");
|
//header("Content-Type: application/download");
|
||||||
//header("Content-Disposition: attachment; filename=$fn");
|
//header("Content-Disposition: attachment; filename=$fn");
|
||||||
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||||
//header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
//header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||||
//header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
//header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||||
//header("Pragma: cache"); // HTTP/1.0
|
//header("Pragma: cache"); // HTTP/1.0
|
||||||
|
|
||||||
//include("../config.php");
|
//include("../config.php");
|
||||||
include_once("../config-defaults.php");
|
include_once("../config-defaults.php");
|
||||||
include_once("../common.php");
|
include_once("../common.php");
|
||||||
include("remotecontrol/lsrc.config.php");
|
include("remotecontrol/lsrc.config.php");
|
||||||
|
|
||||||
$lsrcString = $dumphead. $sdump. $gdump. $qdump. $adump. $cdump. $lsdump. $ldump. $qadump. $asdump. $slsdump. $quotadump. $quotamemdump."\n";
|
$lsrcString = $dumphead. $sdump. $gdump. $qdump. $adump. $cdump. $lsdump. $ldump. $qadump. $asdump. $slsdump. $quotadump. $quotamemdump."\n";
|
||||||
|
|
||||||
//Select title as Filename and save
|
//Select title as Filename and save
|
||||||
$surveyTitleSql = "SELECT surveyls_title
|
$surveyTitleSql = "SELECT surveyls_title
|
||||||
FROM {$dbprefix}surveys_languagesettings
|
FROM {$dbprefix}surveys_languagesettings
|
||||||
WHERE surveyls_survey_id=$surveyid";
|
WHERE surveyls_survey_id=$surveyid";
|
||||||
$surveyTitleRs = db_execute_assoc($surveyTitleSql);
|
$surveyTitleRs = db_execute_assoc($surveyTitleSql);
|
||||||
$surveyTitle = $surveyTitleRs->FetchRow();
|
$surveyTitle = $surveyTitleRs->FetchRow();
|
||||||
file_put_contents("remotecontrol/".$coreDir.$surveyTitle['surveyls_title'].".csv",$lsrcString);
|
file_put_contents("remotecontrol/".$coreDir.$surveyTitle['surveyls_title'].".csv",$lsrcString);
|
||||||
|
|
||||||
header("Location: $scriptname?sid=$surveyid");
|
header("Location: $scriptname?sid=$surveyid");
|
||||||
exit;
|
exit;
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,209 +1,209 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* LimeSurvey
|
* LimeSurvey
|
||||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||||
* LimeSurvey is free software. This version may have been modified pursuant
|
* LimeSurvey is free software. This version may have been modified pursuant
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* to the GNU General Public License, and as distributed it includes or
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
* is derivative of works licensed under the GNU General Public License or
|
||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: export_structure_xml.php 9607 2010-12-08 22:59:51Z azammitdcarf $
|
* $Id: export_structure_xml.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// DUMP THE RELATED DATA FOR A SINGLE SURVEY INTO AN XML FILE FOR IMPORTING LATER ON OR ON ANOTHER SURVEY SETUP
|
// DUMP THE RELATED DATA FOR A SINGLE SURVEY INTO AN XML FILE FOR IMPORTING LATER ON OR ON ANOTHER SURVEY SETUP
|
||||||
// DUMP ALL DATA FOR RELATED SID FROM THE FOLLOWING TABLES:
|
// DUMP ALL DATA FOR RELATED SID FROM THE FOLLOWING TABLES:
|
||||||
// Answers
|
// Answers
|
||||||
// Assessments
|
// Assessments
|
||||||
// Conditions
|
// Conditions
|
||||||
// Default values
|
// Default values
|
||||||
// Groups
|
// Groups
|
||||||
// Questions
|
// Questions
|
||||||
// Question attributes
|
// Question attributes
|
||||||
// Quota
|
// Quota
|
||||||
// Quota Members
|
// Quota Members
|
||||||
// Surveys
|
// Surveys
|
||||||
// Surveys language settings
|
// Surveys language settings
|
||||||
|
|
||||||
include_once("login_check.php");
|
include_once("login_check.php");
|
||||||
require_once ("export_data_functions.php");
|
require_once ("export_data_functions.php");
|
||||||
|
|
||||||
if (!isset($surveyid))
|
if (!isset($surveyid))
|
||||||
{
|
{
|
||||||
$surveyid=returnglobal('sid');
|
$surveyid=returnglobal('sid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!$surveyid)
|
if (!$surveyid)
|
||||||
{
|
{
|
||||||
echo $htmlheader
|
echo $htmlheader
|
||||||
."<br />\n"
|
."<br />\n"
|
||||||
."<table width='350' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n"
|
."<table width='350' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n"
|
||||||
."\t<tr bgcolor='#555555'><td colspan='2' height='4'><font size='1' face='verdana' color='white'><strong>"
|
."\t<tr bgcolor='#555555'><td colspan='2' height='4'><font size='1' face='verdana' color='white'><strong>"
|
||||||
.$clang->gT("Export Survey")."</strong></td></tr>\n"
|
.$clang->gT("Export Survey")."</strong></td></tr>\n"
|
||||||
."\t<tr><td align='center'>\n"
|
."\t<tr><td align='center'>\n"
|
||||||
."<br /><strong><font color='red'>"
|
."<br /><strong><font color='red'>"
|
||||||
.$clang->gT("Error")."</font></strong><br />\n"
|
.$clang->gT("Error")."</font></strong><br />\n"
|
||||||
.$clang->gT("No SID has been provided. Cannot dump survey")."<br />\n"
|
.$clang->gT("No SID has been provided. Cannot dump survey")."<br />\n"
|
||||||
."<br /><input type='submit' value='"
|
."<br /><input type='submit' value='"
|
||||||
.$clang->gT("Main Admin Screen")."' onclick=\"window.open('$scriptname', '_self')\">\n"
|
.$clang->gT("Main Admin Screen")."' onclick=\"window.open('$scriptname', '_self')\">\n"
|
||||||
."\t</td></tr>\n"
|
."\t</td></tr>\n"
|
||||||
."</table>\n"
|
."</table>\n"
|
||||||
."</body></html>\n";
|
."</body></html>\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getXMLStructure($xmlwriter, $exclude=array())
|
function getXMLStructure($xmlwriter, $exclude=array())
|
||||||
{
|
{
|
||||||
global $dbprefix, $surveyid, $connect;
|
global $dbprefix, $surveyid, $connect;
|
||||||
|
|
||||||
$sdump = "";
|
$sdump = "";
|
||||||
|
|
||||||
if ((!isset($exclude) && $exclude['answers'] !== true) || empty($exclude))
|
if ((!isset($exclude) && $exclude['answers'] !== true) || empty($exclude))
|
||||||
{
|
{
|
||||||
//Answers table
|
//Answers table
|
||||||
$aquery = "SELECT {$dbprefix}answers.*
|
$aquery = "SELECT {$dbprefix}answers.*
|
||||||
FROM {$dbprefix}answers, {$dbprefix}questions
|
FROM {$dbprefix}answers, {$dbprefix}questions
|
||||||
WHERE {$dbprefix}answers.language={$dbprefix}questions.language
|
WHERE {$dbprefix}answers.language={$dbprefix}questions.language
|
||||||
AND {$dbprefix}answers.qid={$dbprefix}questions.qid
|
AND {$dbprefix}answers.qid={$dbprefix}questions.qid
|
||||||
AND {$dbprefix}questions.sid=$surveyid";
|
AND {$dbprefix}questions.sid=$surveyid";
|
||||||
BuildXMLFromQuery($xmlwriter,$aquery);
|
BuildXMLFromQuery($xmlwriter,$aquery);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assessments
|
// Assessments
|
||||||
$query = "SELECT {$dbprefix}assessments.*
|
$query = "SELECT {$dbprefix}assessments.*
|
||||||
FROM {$dbprefix}assessments
|
FROM {$dbprefix}assessments
|
||||||
WHERE {$dbprefix}assessments.sid=$surveyid";
|
WHERE {$dbprefix}assessments.sid=$surveyid";
|
||||||
BuildXMLFromQuery($xmlwriter,$query);
|
BuildXMLFromQuery($xmlwriter,$query);
|
||||||
|
|
||||||
if ((!isset($exclude) && $exclude['conditions'] !== true) || empty($exclude))
|
if ((!isset($exclude) && $exclude['conditions'] !== true) || empty($exclude))
|
||||||
{
|
{
|
||||||
//Conditions table
|
//Conditions table
|
||||||
$cquery = "SELECT DISTINCT {$dbprefix}conditions.*
|
$cquery = "SELECT DISTINCT {$dbprefix}conditions.*
|
||||||
FROM {$dbprefix}conditions, {$dbprefix}questions
|
FROM {$dbprefix}conditions, {$dbprefix}questions
|
||||||
WHERE {$dbprefix}conditions.qid={$dbprefix}questions.qid
|
WHERE {$dbprefix}conditions.qid={$dbprefix}questions.qid
|
||||||
AND {$dbprefix}questions.sid=$surveyid";
|
AND {$dbprefix}questions.sid=$surveyid";
|
||||||
BuildXMLFromQuery($xmlwriter,$cquery);
|
BuildXMLFromQuery($xmlwriter,$cquery);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Default values
|
//Default values
|
||||||
$query = "SELECT {$dbprefix}defaultvalues.*
|
$query = "SELECT {$dbprefix}defaultvalues.*
|
||||||
FROM {$dbprefix}defaultvalues JOIN {$dbprefix}questions ON {$dbprefix}questions.qid = {$dbprefix}defaultvalues.qid AND {$dbprefix}questions.sid=$surveyid AND {$dbprefix}questions.language={$dbprefix}defaultvalues.language ";
|
FROM {$dbprefix}defaultvalues JOIN {$dbprefix}questions ON {$dbprefix}questions.qid = {$dbprefix}defaultvalues.qid AND {$dbprefix}questions.sid=$surveyid AND {$dbprefix}questions.language={$dbprefix}defaultvalues.language ";
|
||||||
|
|
||||||
BuildXMLFromQuery($xmlwriter,$query);
|
BuildXMLFromQuery($xmlwriter,$query);
|
||||||
|
|
||||||
// Groups
|
// Groups
|
||||||
$gquery = "SELECT *
|
$gquery = "SELECT *
|
||||||
FROM {$dbprefix}groups
|
FROM {$dbprefix}groups
|
||||||
WHERE sid=$surveyid
|
WHERE sid=$surveyid
|
||||||
ORDER BY gid";
|
ORDER BY gid";
|
||||||
BuildXMLFromQuery($xmlwriter,$gquery);
|
BuildXMLFromQuery($xmlwriter,$gquery);
|
||||||
|
|
||||||
//Questions
|
//Questions
|
||||||
$qquery = "SELECT *
|
$qquery = "SELECT *
|
||||||
FROM {$dbprefix}questions
|
FROM {$dbprefix}questions
|
||||||
WHERE sid=$surveyid and parent_qid=0
|
WHERE sid=$surveyid and parent_qid=0
|
||||||
ORDER BY qid";
|
ORDER BY qid";
|
||||||
BuildXMLFromQuery($xmlwriter,$qquery);
|
BuildXMLFromQuery($xmlwriter,$qquery);
|
||||||
|
|
||||||
//Subquestions
|
//Subquestions
|
||||||
$qquery = "SELECT *
|
$qquery = "SELECT *
|
||||||
FROM {$dbprefix}questions
|
FROM {$dbprefix}questions
|
||||||
WHERE sid=$surveyid and parent_qid>0
|
WHERE sid=$surveyid and parent_qid>0
|
||||||
ORDER BY qid";
|
ORDER BY qid";
|
||||||
BuildXMLFromQuery($xmlwriter,$qquery,'subquestions');
|
BuildXMLFromQuery($xmlwriter,$qquery,'subquestions');
|
||||||
|
|
||||||
//Question attributes
|
//Question attributes
|
||||||
$sBaseLanguage=GetBaseLanguageFromSurveyID($surveyid);
|
$sBaseLanguage=GetBaseLanguageFromSurveyID($surveyid);
|
||||||
if ($connect->databaseType == 'odbc_mssql' || $connect->databaseType == 'odbtp' || $connect->databaseType == 'mssql_n' || $connect->databaseType =='mssqlnative')
|
if ($connect->databaseType == 'odbc_mssql' || $connect->databaseType == 'odbtp' || $connect->databaseType == 'mssql_n' || $connect->databaseType =='mssqlnative')
|
||||||
{
|
{
|
||||||
$query="SELECT qa.qid, qa.attribute, cast(qa.value as varchar(4000)) as value
|
$query="SELECT qa.qid, qa.attribute, cast(qa.value as varchar(4000)) as value
|
||||||
FROM {$dbprefix}question_attributes qa JOIN {$dbprefix}questions q ON q.qid = qa.qid AND q.sid={$surveyid}
|
FROM {$dbprefix}question_attributes qa JOIN {$dbprefix}questions q ON q.qid = qa.qid AND q.sid={$surveyid}
|
||||||
where q.language='{$sBaseLanguage}' group by qa.qid, qa.attribute, cast(qa.value as varchar(4000))";
|
where q.language='{$sBaseLanguage}' group by qa.qid, qa.attribute, cast(qa.value as varchar(4000))";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$query="SELECT qa.qid, qa.attribute, qa.value
|
$query="SELECT qa.qid, qa.attribute, qa.value
|
||||||
FROM {$dbprefix}question_attributes qa JOIN {$dbprefix}questions q ON q.qid = qa.qid AND q.sid={$surveyid}
|
FROM {$dbprefix}question_attributes qa JOIN {$dbprefix}questions q ON q.qid = qa.qid AND q.sid={$surveyid}
|
||||||
where q.language='{$sBaseLanguage}' group by qa.qid, qa.attribute, qa.value";
|
where q.language='{$sBaseLanguage}' group by qa.qid, qa.attribute, qa.value";
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildXMLFromQuery($xmlwriter,$query,'question_attributes');
|
BuildXMLFromQuery($xmlwriter,$query,'question_attributes');
|
||||||
|
|
||||||
if ((!isset($exclude) && $exclude['quotas'] !== true) || empty($exclude))
|
if ((!isset($exclude) && $exclude['quotas'] !== true) || empty($exclude))
|
||||||
{
|
{
|
||||||
//Quota
|
//Quota
|
||||||
$query = "SELECT {$dbprefix}quota.*
|
$query = "SELECT {$dbprefix}quota.*
|
||||||
FROM {$dbprefix}quota
|
FROM {$dbprefix}quota
|
||||||
WHERE {$dbprefix}quota.sid=$surveyid";
|
WHERE {$dbprefix}quota.sid=$surveyid";
|
||||||
BuildXMLFromQuery($xmlwriter,$query);
|
BuildXMLFromQuery($xmlwriter,$query);
|
||||||
|
|
||||||
//1Quota members
|
//1Quota members
|
||||||
$query = "SELECT {$dbprefix}quota_members.*
|
$query = "SELECT {$dbprefix}quota_members.*
|
||||||
FROM {$dbprefix}quota_members
|
FROM {$dbprefix}quota_members
|
||||||
WHERE {$dbprefix}quota_members.sid=$surveyid";
|
WHERE {$dbprefix}quota_members.sid=$surveyid";
|
||||||
BuildXMLFromQuery($xmlwriter,$query);
|
BuildXMLFromQuery($xmlwriter,$query);
|
||||||
|
|
||||||
//Quota languagesettings
|
//Quota languagesettings
|
||||||
$query = "SELECT {$dbprefix}quota_languagesettings.*
|
$query = "SELECT {$dbprefix}quota_languagesettings.*
|
||||||
FROM {$dbprefix}quota_languagesettings, {$dbprefix}quota
|
FROM {$dbprefix}quota_languagesettings, {$dbprefix}quota
|
||||||
WHERE {$dbprefix}quota.id = {$dbprefix}quota_languagesettings.quotals_quota_id
|
WHERE {$dbprefix}quota.id = {$dbprefix}quota_languagesettings.quotals_quota_id
|
||||||
AND {$dbprefix}quota.sid=$surveyid";
|
AND {$dbprefix}quota.sid=$surveyid";
|
||||||
BuildXMLFromQuery($xmlwriter,$query);
|
BuildXMLFromQuery($xmlwriter,$query);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Surveys
|
// Surveys
|
||||||
$squery = "SELECT *
|
$squery = "SELECT *
|
||||||
FROM {$dbprefix}surveys
|
FROM {$dbprefix}surveys
|
||||||
WHERE sid=$surveyid";
|
WHERE sid=$surveyid";
|
||||||
//Exclude some fields from the export
|
//Exclude some fields from the export
|
||||||
BuildXMLFromQuery($xmlwriter,$squery,'',array('owner_id','active','datecreated'));
|
BuildXMLFromQuery($xmlwriter,$squery,'',array('owner_id','active','datecreated'));
|
||||||
|
|
||||||
// Survey language settings
|
// Survey language settings
|
||||||
$slsquery = "SELECT *
|
$slsquery = "SELECT *
|
||||||
FROM {$dbprefix}surveys_languagesettings
|
FROM {$dbprefix}surveys_languagesettings
|
||||||
WHERE surveyls_survey_id=$surveyid";
|
WHERE surveyls_survey_id=$surveyid";
|
||||||
BuildXMLFromQuery($xmlwriter,$slsquery);
|
BuildXMLFromQuery($xmlwriter,$slsquery);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getXMLData($exclude = array())
|
function getXMLData($exclude = array())
|
||||||
{
|
{
|
||||||
global $dbversionnumber,$surveyid;
|
global $dbversionnumber,$surveyid;
|
||||||
$xml = getXMLWriter();
|
$xml = getXMLWriter();
|
||||||
$xml->openMemory();
|
$xml->openMemory();
|
||||||
$xml->setIndent(true);
|
$xml->setIndent(true);
|
||||||
$xml->startDocument('1.0', 'UTF-8');
|
$xml->startDocument('1.0', 'UTF-8');
|
||||||
$xml->startElement('document');
|
$xml->startElement('document');
|
||||||
$xml->writeElement('LimeSurveyDocType','Survey');
|
$xml->writeElement('LimeSurveyDocType','Survey');
|
||||||
$xml->writeElement('DBVersion',$dbversionnumber);
|
$xml->writeElement('DBVersion',$dbversionnumber);
|
||||||
$xml->startElement('languages');
|
$xml->startElement('languages');
|
||||||
$surveylanguages=GetAdditionalLanguagesFromSurveyID($surveyid);
|
$surveylanguages=GetAdditionalLanguagesFromSurveyID($surveyid);
|
||||||
$surveylanguages[]=GetBaseLanguageFromSurveyID($surveyid);
|
$surveylanguages[]=GetBaseLanguageFromSurveyID($surveyid);
|
||||||
foreach ($surveylanguages as $surveylanguage)
|
foreach ($surveylanguages as $surveylanguage)
|
||||||
{
|
{
|
||||||
$xml->writeElement('language',$surveylanguage);
|
$xml->writeElement('language',$surveylanguage);
|
||||||
}
|
}
|
||||||
$xml->endElement();
|
$xml->endElement();
|
||||||
getXMLStructure($xml,$exclude);
|
getXMLStructure($xml,$exclude);
|
||||||
$xml->endElement(); // close columns
|
$xml->endElement(); // close columns
|
||||||
$xml->endDocument();
|
$xml->endDocument();
|
||||||
return $xml->outputMemory(true);
|
return $xml->outputMemory(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($copyfunction))
|
if (!isset($copyfunction))
|
||||||
{
|
{
|
||||||
$fn = "limesurvey_survey_$surveyid.lss";
|
$fn = "limesurvey_survey_$surveyid.lss";
|
||||||
header("Content-Type: text/xml");
|
header("Content-Type: text/xml");
|
||||||
header("Content-Disposition: attachment; filename=$fn");
|
header("Content-Disposition: attachment; filename=$fn");
|
||||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||||
header("Pragma: public"); // HTTP/1.0
|
header("Pragma: public"); // HTTP/1.0
|
||||||
echo getXMLData();
|
echo getXMLData();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* LimeSurvey
|
* LimeSurvey
|
||||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||||
* LimeSurvey is free software. This version may have been modified pursuant
|
* LimeSurvey is free software. This version may have been modified pursuant
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* to the GNU General Public License, and as distributed it includes or
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
* is derivative of works licensed under the GNU General Public License or
|
||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: exportresults.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: exportresults.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//Ensure script is not run directly, avoid path disclosure
|
//Ensure script is not run directly, avoid path disclosure
|
||||||
@@ -44,7 +44,7 @@ if (!$exportstyle)
|
|||||||
{
|
{
|
||||||
|
|
||||||
//FIND OUT HOW MANY FIELDS WILL BE NEEDED - FOR 255 COLUMN LIMIT
|
//FIND OUT HOW MANY FIELDS WILL BE NEEDED - FOR 255 COLUMN LIMIT
|
||||||
$excesscols=createFieldMap($surveyid);
|
$excesscols=createFieldMap($surveyid,'full',false,false,$surveybaselang);
|
||||||
if ($thissurvey['savetimings'] === "Y") {
|
if ($thissurvey['savetimings'] === "Y") {
|
||||||
//Append survey timings to the fieldmap array
|
//Append survey timings to the fieldmap array
|
||||||
$excesscols = $excesscols + createTimingsFieldMap($surveyid);
|
$excesscols = $excesscols + createTimingsFieldMap($surveyid);
|
||||||
@@ -110,6 +110,7 @@ $quexsfilterstate = questionnaireSampleFilterstate();
|
|||||||
|
|
||||||
|
|
||||||
$exportoutput .='<fieldset><legend>'
|
$exportoutput .='<fieldset><legend>'
|
||||||
|
|
||||||
.$clang->gT("Questions")."</legend>\n"
|
.$clang->gT("Questions")."</legend>\n"
|
||||||
."<ul>\n"
|
."<ul>\n"
|
||||||
."<li><input type='radio' class='radiobtn' name='exportstyle' value='abrev' id='headabbrev' />"
|
."<li><input type='radio' class='radiobtn' name='exportstyle' value='abrev' id='headabbrev' />"
|
||||||
@@ -292,13 +293,15 @@ switch ( $_POST["type"] ) {
|
|||||||
$workbook->send('results-survey'.$surveyid.'.xls');
|
$workbook->send('results-survey'.$surveyid.'.xls');
|
||||||
// Creating the first worksheet
|
// Creating the first worksheet
|
||||||
|
|
||||||
$query="SELECT * FROM {$dbprefix}surveys_languagesettings WHERE surveyls_survey_id=".$surveyid;
|
$query="SELECT * FROM {$dbprefix}surveys_languagesettings WHERE surveyls_survey_id={$surveyid} AND surveyls_language='{$surveybaselang}'" ;
|
||||||
$result=db_execute_assoc($query) or safe_die("Couldn't get privacy data<br />$query<br />".$connect->ErrorMsg());
|
$result=db_execute_assoc($query) or safe_die("Couldn't get privacy data<br />$query<br />".$connect->ErrorMsg());
|
||||||
$row = $result->FetchRow();
|
$row = $result->FetchRow();
|
||||||
|
|
||||||
$row['surveyls_title']=substr(str_replace(array('*', ':', '/', '\\', '?', '[', ']'),array(' '),$row['surveyls_title']),0,31); // Remove invalid characters
|
$row['surveyls_title']=substr(str_replace(array('*', ':', '/', '\\', '?', '[', ']'),array(' '),$row['surveyls_title']),0,31); // Remove invalid characters
|
||||||
$sheet =& $workbook->addWorksheet($row['surveyls_title']); // do not translate/change this - the library does not support any special chars in sheet name
|
$sheet =& $workbook->addWorksheet(); // do not translate/change this - the library does not support any special chars in sheet name
|
||||||
|
// $row['surveyls_title']
|
||||||
$sheet->setInputEncoding('utf-8');
|
$sheet->setInputEncoding('utf-8');
|
||||||
|
$sheet->name=$row['surveyls_title'] ;
|
||||||
$separator="~|";
|
$separator="~|";
|
||||||
break;
|
break;
|
||||||
case "csv":
|
case "csv":
|
||||||
@@ -311,7 +314,7 @@ switch ( $_POST["type"] ) {
|
|||||||
$pdf->SetFont($pdfdefaultfont,'',$pdffontsize);
|
$pdf->SetFont($pdfdefaultfont,'',$pdffontsize);
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
$pdf->intopdf("PDF Export ".date("Y.m.d-H:i",time()));
|
$pdf->intopdf("PDF Export ".date("Y.m.d-H:i",time()));
|
||||||
$query="SELECT * FROM {$dbprefix}surveys_languagesettings WHERE surveyls_survey_id=".$surveyid;
|
$query="SELECT * FROM {$dbprefix}surveys_languagesettings WHERE surveyls_survey_id={$surveyid} AND surveyls_language='{$surveybaselang}'" ;
|
||||||
$result=db_execute_assoc($query) or safe_die("Couldn't get privacy data<br />$query<br />".$connect->ErrorMsg());
|
$result=db_execute_assoc($query) or safe_die("Couldn't get privacy data<br />$query<br />".$connect->ErrorMsg());
|
||||||
while ($row = $result->FetchRow())
|
while ($row = $result->FetchRow())
|
||||||
{
|
{
|
||||||
@@ -421,6 +424,7 @@ if ($tokenTableExists && $thissurvey['anonymized']=='N')
|
|||||||
. " ON $surveytable.token = {$dbprefix}tokens_$surveyid.token";
|
. " ON $surveytable.token = {$dbprefix}tokens_$surveyid.token";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$qfs = questionnaireSampleFilterstate();
|
$qfs = questionnaireSampleFilterstate();
|
||||||
if ($qfs != false)
|
if ($qfs != false)
|
||||||
{
|
{
|
||||||
@@ -507,57 +511,48 @@ for ($i=0; $i<$fieldcount; $i++)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Data field heading!
|
// Prepare the header line
|
||||||
$fielddata=$fieldmap[$fieldinfo];
|
$fielddata=$fieldmap[$fieldinfo];
|
||||||
$fqid=$fielddata['qid'];
|
$fqid=$fielddata['qid'];
|
||||||
$ftype=$fielddata['type'];
|
$ftype=$fielddata['type'];
|
||||||
$fsid=$fielddata['sid'];
|
$fsid=$fielddata['sid'];
|
||||||
$fgid=$fielddata['gid'];
|
$fgid=$fielddata['gid'];
|
||||||
$faid=$fielddata['aid'];
|
$faid=$fielddata['aid'];
|
||||||
$question=$fielddata['question'];
|
switch ($exportstyle)
|
||||||
if (isset($fielddata['scale'])) $question = "[{$fielddata['scale']}] ". $question;
|
|
||||||
if (isset($fielddata['subquestion'])) $question = "[{$fielddata['subquestion']}] ". $question;
|
|
||||||
if (isset($fielddata['subquestion2'])) $question = "[{$fielddata['subquestion2']}] ". $question;
|
|
||||||
if (isset($fielddata['subquestion1'])) $question = "[{$fielddata['subquestion1']}] ". $question;
|
|
||||||
if ($exportstyle == "abrev")
|
|
||||||
{
|
{
|
||||||
$qname=strip_tags_full($question);
|
case 'headcodes': // only question codes
|
||||||
$qname=mb_substr($qname, 0, 15)."..";
|
|
||||||
$firstline = str_replace("\n", "", $firstline);
|
|
||||||
$firstline = str_replace("\r", "", $firstline);
|
|
||||||
if ($type == "csv") {$firstline .= "\"$qname";}
|
|
||||||
else {$firstline .= "$qname";}
|
|
||||||
if (isset($faid)) {$firstline .= " [{$faid}]"; $faid="";}
|
|
||||||
if ($type == "csv") {$firstline .= "\"";}
|
|
||||||
$firstline .= "$separator";
|
|
||||||
}
|
|
||||||
else //headcode or full answer
|
|
||||||
{
|
|
||||||
if ($exportstyle == "headcodes")
|
|
||||||
{
|
|
||||||
$fquest=$fielddata['title'];
|
$fquest=$fielddata['title'];
|
||||||
if (!empty($fielddata['aid'])) $fquest .= ' [' . $fielddata['aid'] . ']';
|
if (!empty($fielddata['aid'])) $fquest .= ' [' . $fielddata['aid'] . ']';
|
||||||
}
|
if (isset($fielddata['scale_id'])) $fquest = $fquest."[{$fielddata['scale_id']}]";
|
||||||
else
|
$fquest=FlattenText($fquest,true);
|
||||||
{
|
break;
|
||||||
$fquest=$question;
|
case 'abrev': // Abbreviated question text
|
||||||
}
|
$fquest=FlattenText($fielddata['question']);
|
||||||
$fquest=FlattenText($fquest,true);
|
$fquest=mb_substr($fquest, 0, 15);
|
||||||
if ($type == "csv")
|
if (strlen($fquest)==15) $fquest.='...';
|
||||||
{
|
if (isset($faid)) {$fquest .= " [{$faid}]";}
|
||||||
$firstline .="\"$fquest\"$separator";
|
if (isset($fielddata['scale_id'])) $fquest = $fquest."[{$fielddata['scale_id']}]";
|
||||||
}
|
break;
|
||||||
else
|
default: // Full question text
|
||||||
{
|
$fquest=$fielddata['question'];
|
||||||
$firstline .= $fquest.$separator;
|
if (isset($fielddata['scale_id'])) $fquest = "[{$fielddata['scale_id']}] ". $fquest;
|
||||||
}
|
if (isset($fielddata['subquestion'])) $fquest = "[{$fielddata['subquestion']}] ". $fquest;
|
||||||
|
if (isset($fielddata['subquestion2'])) $fquest = "[{$fielddata['subquestion2']}] ". $fquest;
|
||||||
|
if (isset($fielddata['subquestion1'])) $fquest = "[{$fielddata['subquestion1']}] ". $fquest;
|
||||||
|
$fquest=FlattenText($fquest,true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if($convertspacetous == "Y")
|
if($convertspacetous == "Y")
|
||||||
{
|
{
|
||||||
$firstline=str_replace(" ", "_", $firstline);
|
$fquest=str_replace(" ", "_", $fquest);
|
||||||
}
|
}
|
||||||
|
if ($type == "csv") {$fquest = "\"$fquest\"";}
|
||||||
|
$firstline .= $fquest.$separator;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type == "csv") { $firstline = mb_substr(trim($firstline),0,strlen($firstline)-1);}
|
if ($type == "csv") { $firstline = mb_substr(trim($firstline),0,strlen($firstline)-1);}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -582,8 +577,8 @@ if ($type == "doc" || $type == "pdf")
|
|||||||
</style>';
|
</style>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ($type == "xls")
|
if ($type == "xls")
|
||||||
{
|
{
|
||||||
//var_dump ($firstline);
|
//var_dump ($firstline);
|
||||||
$flarray=explode($separator, $firstline);
|
$flarray=explode($separator, $firstline);
|
||||||
$fli=0;
|
$fli=0;
|
||||||
@@ -593,9 +588,9 @@ if ($type == "xls")
|
|||||||
$fli++;
|
$fli++;
|
||||||
}
|
}
|
||||||
//print_r($fieldmap);
|
//print_r($fieldmap);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$exportoutput .= $firstline; //Sending the header row
|
$exportoutput .= $firstline; //Sending the header row
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,7 +622,7 @@ if (isset($_POST['answerid']) && $_POST['answerid'] != "NULL") //this applies if
|
|||||||
{
|
{
|
||||||
$where[] = "$surveytable.id=".stripcslashes($_POST['answerid']);
|
$where[] = "$surveytable.id=".stripcslashes($_POST['answerid']);
|
||||||
}
|
}
|
||||||
if (count($where)>0) $dquery .= ' WHERE ' . join(' AND ', $where);
|
if (count($where)>0) $dquery .= ' WHERE ' . join(' AND ', $where);
|
||||||
|
|
||||||
$dquery .= " ORDER BY $surveytable.id";
|
$dquery .= " ORDER BY $surveytable.id";
|
||||||
|
|
||||||
@@ -1115,15 +1110,15 @@ elseif ($answers == "long") //chose complete answers
|
|||||||
}
|
}
|
||||||
if ($type=='xls')
|
if ($type=='xls')
|
||||||
{
|
{
|
||||||
// echo memory_get_peak_usage(true); die();
|
// echo memory_get_peak_usage(true); die();
|
||||||
$workbook->close();
|
$workbook->close();
|
||||||
}
|
}
|
||||||
else if($type=='pdf')
|
else if($type=='pdf')
|
||||||
{
|
{
|
||||||
$pdf->Output($clang->gT($surveyname)." ".$surveyid.".pdf","D");
|
$pdf->Output($clang->gT($surveyname)." ".$surveyid.".pdf","D");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo $exportoutput;
|
echo $exportoutput;
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -1,446 +1,446 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* LimeSurvey
|
* LimeSurvey
|
||||||
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* License: GNU/GPL License v2 or later, see LICENSE.php
|
* License: GNU/GPL License v2 or later, see LICENSE.php
|
||||||
* LimeSurvey is free software. This version may have been modified pursuant
|
* LimeSurvey is free software. This version may have been modified pursuant
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* to the GNU General Public License, and as distributed it includes or
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
* is derivative of works licensed under the GNU General Public License or
|
||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: fck_LimeReplacementFields.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: fck_LimeReplacementFields.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("login_check.php");
|
include_once("login_check.php");
|
||||||
|
|
||||||
if(!isset($_SESSION['loginID']))
|
if(!isset($_SESSION['loginID']))
|
||||||
{
|
{
|
||||||
die ("Unauthenticated Access Forbiden");
|
die ("Unauthenticated Access Forbiden");
|
||||||
}
|
}
|
||||||
|
|
||||||
$surveyid=returnglobal('sid');
|
$surveyid=returnglobal('sid');
|
||||||
if (!isset($gid)) {$gid=returnglobal('gid');}
|
if (!isset($gid)) {$gid=returnglobal('gid');}
|
||||||
if (!isset($qid)) {$qid=returnglobal('qid');}
|
if (!isset($qid)) {$qid=returnglobal('qid');}
|
||||||
$fieldtype=preg_replace("/[^_.a-zA-Z0-9-]/", "",$_GET['fieldtype']);
|
$fieldtype=preg_replace("/[^_.a-zA-Z0-9-]/", "",$_GET['fieldtype']);
|
||||||
$action=preg_replace("/[^_.a-zA-Z0-9-]/", "",$_GET['editedaction']);
|
$action=preg_replace("/[^_.a-zA-Z0-9-]/", "",$_GET['editedaction']);
|
||||||
|
|
||||||
//$InsertansUnsupportedtypes=Array('TEST-A','TEST-B','TEST-C','TEST-D');
|
//$InsertansUnsupportedtypes=Array('TEST-A','TEST-B','TEST-C','TEST-D');
|
||||||
$InsertansUnsupportedtypes=Array(); // Currently all question types are supported
|
$InsertansUnsupportedtypes=Array(); // Currently all question types are supported
|
||||||
|
|
||||||
$replFields=Array();
|
$replFields=Array();
|
||||||
$isInstertansEnabled=false;
|
$isInstertansEnabled=false;
|
||||||
|
|
||||||
$limereplacementoutput="\t\t<script language=\"javascript\">\n"
|
$limereplacementoutput="\t\t<script language=\"javascript\">\n"
|
||||||
. "\t\t\$(document).ready(function ()\n"
|
. "\t\t\$(document).ready(function ()\n"
|
||||||
. "\t\t\t{\n"
|
. "\t\t\t{\n"
|
||||||
. "\t\t\t\tLoadSelected() ;\n"
|
. "\t\t\t\tLoadSelected() ;\n"
|
||||||
. "\t\t\t\tmydialog.SetOkButton( true ) ;\n"
|
. "\t\t\t\tmydialog.SetOkButton( true ) ;\n"
|
||||||
. "\n"
|
. "\n"
|
||||||
. "SelectField( 'cquestions' ) ;\n"
|
. "SelectField( 'cquestions' ) ;\n"
|
||||||
. "\t});\n"
|
. "\t});\n"
|
||||||
. "\n";
|
. "\n";
|
||||||
|
|
||||||
/**$limereplacementoutput="\n"
|
/**$limereplacementoutput="\n"
|
||||||
. "if (! oEditor.FCKBrowserInfo.IsIE)\n"
|
. "if (! oEditor.FCKBrowserInfo.IsIE)\n"
|
||||||
. "{\n"
|
. "{\n"
|
||||||
. "\tinnertext = '' + dialog.EditorWindow.getSelection() + '' ;\n"
|
. "\tinnertext = '' + dialog.EditorWindow.getSelection() + '' ;\n"
|
||||||
. "}\n"
|
. "}\n"
|
||||||
. "else\n"
|
. "else\n"
|
||||||
. "{\n"
|
. "{\n"
|
||||||
. "\tinnertext = '' + dialog.EditorDocument.selection.createRange().text + '' ;\n"
|
. "\tinnertext = '' + dialog.EditorDocument.selection.createRange().text + '' ;\n"
|
||||||
. "}\n";
|
. "}\n";
|
||||||
**/
|
**/
|
||||||
|
|
||||||
$limereplacementoutput .= ""
|
$limereplacementoutput .= ""
|
||||||
. "\tvar eSelected = dialog.Selection.GetSelectedElement() ;\n"
|
. "\tvar eSelected = dialog.Selection.GetSelectedElement() ;\n"
|
||||||
. "\n";
|
. "\n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
$limereplacementoutput="\n"
|
$limereplacementoutput="\n"
|
||||||
. "function LoadSelected()\n"
|
. "function LoadSelected()\n"
|
||||||
. "{\n"
|
. "{\n"
|
||||||
. "\tif ( innertext == '' )\n"
|
. "\tif ( innertext == '' )\n"
|
||||||
. "return ;\n"
|
. "return ;\n"
|
||||||
. "var replcode=innertext.substring(innertext.indexOf('{')+1,innertext.lastIndexOf('}'));\n"
|
. "var replcode=innertext.substring(innertext.indexOf('{')+1,innertext.lastIndexOf('}'));\n"
|
||||||
. "document.getElementById('cquestions').value = replcode;\n"
|
. "document.getElementById('cquestions').value = replcode;\n"
|
||||||
. "}\n";
|
. "}\n";
|
||||||
**/
|
**/
|
||||||
|
|
||||||
$limereplacementoutput .= ""
|
$limereplacementoutput .= ""
|
||||||
. "\tfunction LoadSelected()\n"
|
. "\tfunction LoadSelected()\n"
|
||||||
. "\t{\n"
|
. "\t{\n"
|
||||||
. "if ( !eSelected )\n"
|
. "if ( !eSelected )\n"
|
||||||
. "\treturn ;\n"
|
. "\treturn ;\n"
|
||||||
. "if ( eSelected.tagName == 'SPAN' && eSelected._fckLimeReplacementFields )\n"
|
. "if ( eSelected.tagName == 'SPAN' && eSelected._fckLimeReplacementFields )\n"
|
||||||
. "\t document.getElementById('cquestions').value = eSelected._fckLimeReplacementFields ;\n"
|
. "\t document.getElementById('cquestions').value = eSelected._fckLimeReplacementFields ;\n"
|
||||||
. "else\n"
|
. "else\n"
|
||||||
. "\teSelected == null ;\n"
|
. "\teSelected == null ;\n"
|
||||||
. "\t}\n";
|
. "\t}\n";
|
||||||
|
|
||||||
$limereplacementoutput .= ""
|
$limereplacementoutput .= ""
|
||||||
. "\tfunction Ok()\n"
|
. "\tfunction Ok()\n"
|
||||||
. "\t{\n"
|
. "\t{\n"
|
||||||
. "var sValue = document.getElementById('cquestions').value ;\n"
|
. "var sValue = document.getElementById('cquestions').value ;\n"
|
||||||
|
|
||||||
. "FCKLimeReplacementFieldss.Add( sValue ) ;\n"
|
. "FCKLimeReplacementFieldss.Add( sValue ) ;\n"
|
||||||
. "return true ;\n"
|
. "return true ;\n"
|
||||||
. "\t}\n";
|
. "\t}\n";
|
||||||
|
|
||||||
$limereplacementoutput .= ""
|
$limereplacementoutput .= ""
|
||||||
. "\t</script>\n"
|
. "\t</script>\n"
|
||||||
. "</head>\n";
|
. "</head>\n";
|
||||||
|
|
||||||
$limereplacementoutput .= "\t<body scroll=\"no\" style=\"OVERFLOW: hidden;\">\n"
|
$limereplacementoutput .= "\t<body scroll=\"no\" style=\"OVERFLOW: hidden;\">\n"
|
||||||
. "<table height=\"100%\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\">\n"
|
. "<table height=\"100%\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\">\n"
|
||||||
. "\t<tr>\n"
|
. "\t<tr>\n"
|
||||||
. "<td>\n";
|
. "<td>\n";
|
||||||
|
|
||||||
switch ($fieldtype)
|
switch ($fieldtype)
|
||||||
{
|
{
|
||||||
case 'survey-desc':
|
case 'survey-desc':
|
||||||
case 'survey-welc':
|
case 'survey-welc':
|
||||||
case 'survey-endtext':
|
case 'survey-endtext':
|
||||||
case 'edittitle': // for translation
|
case 'edittitle': // for translation
|
||||||
case 'editdescription': // for translation
|
case 'editdescription': // for translation
|
||||||
case 'editwelcome': // for translation
|
case 'editwelcome': // for translation
|
||||||
case 'editend': // for translation
|
case 'editend': // for translation
|
||||||
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
||||||
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
||||||
$replFields[]=array('TOKEN:EMAIL',$clang->gT("Email from the token"));
|
$replFields[]=array('TOKEN:EMAIL',$clang->gT("Email from the token"));
|
||||||
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
||||||
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
||||||
foreach ($attributes as $attributefield=>$attributedescription)
|
foreach ($attributes as $attributefield=>$attributedescription)
|
||||||
{
|
{
|
||||||
$replFields[]=array('TOKEN:'.strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
$replFields[]=array('TOKEN:'.strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
||||||
}
|
}
|
||||||
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'email-admin-notification':
|
case 'email-admin-notification':
|
||||||
$replFields[]=array('RELOADURL',$clang->gT("Reload URL"));
|
$replFields[]=array('RELOADURL',$clang->gT("Reload URL"));
|
||||||
$replFields[]=array('VIEWRESPONSEURL',$clang->gT("View response URL"));
|
$replFields[]=array('VIEWRESPONSEURL',$clang->gT("View response URL"));
|
||||||
$replFields[]=array('EDITRESPONSEURL',$clang->gT("Edit response URL"));
|
$replFields[]=array('EDITRESPONSEURL',$clang->gT("Edit response URL"));
|
||||||
$replFields[]=array('STATISTICSURL',$clang->gT("Statistics URL"));
|
$replFields[]=array('STATISTICSURL',$clang->gT("Statistics URL"));
|
||||||
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
||||||
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
||||||
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
||||||
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
||||||
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
||||||
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
||||||
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
||||||
foreach ($attributes as $attributefield=>$attributedescription)
|
foreach ($attributes as $attributefield=>$attributedescription)
|
||||||
{
|
{
|
||||||
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
||||||
}
|
}
|
||||||
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
||||||
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
||||||
break;
|
break;
|
||||||
case 'email-admin-resp':
|
case 'email-admin-resp':
|
||||||
$replFields[]=array('RELOADURL',$clang->gT("Reload URL"));
|
$replFields[]=array('RELOADURL',$clang->gT("Reload URL"));
|
||||||
$replFields[]=array('VIEWRESPONSEURL',$clang->gT("View response URL"));
|
$replFields[]=array('VIEWRESPONSEURL',$clang->gT("View response URL"));
|
||||||
$replFields[]=array('EDITRESPONSEURL',$clang->gT("Edit response URL"));
|
$replFields[]=array('EDITRESPONSEURL',$clang->gT("Edit response URL"));
|
||||||
$replFields[]=array('STATISTICSURL',$clang->gT("Statistics URL"));
|
$replFields[]=array('STATISTICSURL',$clang->gT("Statistics URL"));
|
||||||
$replFields[]=array('ANSWERTABLE',$clang->gT("Answers from this response"));
|
$replFields[]=array('ANSWERTABLE',$clang->gT("Answers from this response"));
|
||||||
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
||||||
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
||||||
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
||||||
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
||||||
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
||||||
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
||||||
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
||||||
foreach ($attributes as $attributefield=>$attributedescription)
|
foreach ($attributes as $attributefield=>$attributedescription)
|
||||||
{
|
{
|
||||||
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
||||||
}
|
}
|
||||||
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
||||||
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
||||||
break;
|
break;
|
||||||
case 'email-inv':
|
case 'email-inv':
|
||||||
case 'email-rem':
|
case 'email-rem':
|
||||||
// these 3 fields are supported by email-inv and email-rem
|
// these 3 fields are supported by email-inv and email-rem
|
||||||
// but not email-reg for the moment
|
// but not email-reg for the moment
|
||||||
$replFields[]=array('EMAIL',$clang->gT("Email from the token"));
|
$replFields[]=array('EMAIL',$clang->gT("Email from the token"));
|
||||||
$replFields[]=array('USESLEFT',$clang->gT("Uses left"));
|
$replFields[]=array('USESLEFT',$clang->gT("Uses left"));
|
||||||
$replFields[]=array('OPTOUTURL',$clang->gT("URL for a respondent to opt-out this survey"));
|
$replFields[]=array('OPTOUTURL',$clang->gT("URL for a respondent to opt-out this survey"));
|
||||||
case 'email-reg':
|
case 'email-reg':
|
||||||
$replFields[]=array('FIRSTNAME',$clang->gT("First name from token"));
|
$replFields[]=array('FIRSTNAME',$clang->gT("First name from token"));
|
||||||
$replFields[]=array('LASTNAME',$clang->gT("Last name from token"));
|
$replFields[]=array('LASTNAME',$clang->gT("Last name from token"));
|
||||||
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
||||||
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
||||||
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
||||||
$replFields[]=array('SURVEYID',$clang->gT("ID of the survey"));
|
$replFields[]=array('SURVEYID',$clang->gT("ID of the survey"));
|
||||||
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
||||||
foreach ($attributes as $attributefield=>$attributedescription)
|
foreach ($attributes as $attributefield=>$attributedescription)
|
||||||
{
|
{
|
||||||
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
||||||
}
|
}
|
||||||
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
||||||
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
||||||
$replFields[]=array('SURVEYURL',$clang->gT("URL of the survey"));
|
$replFields[]=array('SURVEYURL',$clang->gT("URL of the survey"));
|
||||||
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'email-conf':
|
case 'email-conf':
|
||||||
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
$replFields[]=array('TOKEN',$clang->gT("Token code for this participant"));
|
||||||
$replFields[]=array('FIRSTNAME',$clang->gT("First name from token"));
|
$replFields[]=array('FIRSTNAME',$clang->gT("First name from token"));
|
||||||
$replFields[]=array('LASTNAME',$clang->gT("Last name from token"));
|
$replFields[]=array('LASTNAME',$clang->gT("Last name from token"));
|
||||||
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
$replFields[]=array('SURVEYNAME',$clang->gT("Name of the survey"));
|
||||||
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
$replFields[]=array('SURVEYDESCRIPTION',$clang->gT("Description of the survey"));
|
||||||
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
||||||
foreach ($attributes as $attributefield=>$attributedescription)
|
foreach ($attributes as $attributefield=>$attributedescription)
|
||||||
{
|
{
|
||||||
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
$replFields[]=array(strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
||||||
}
|
}
|
||||||
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
$replFields[]=array('ADMINNAME',$clang->gT("Name of the survey administrator"));
|
||||||
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
$replFields[]=array('ADMINEMAIL',$clang->gT("Email address of the survey administrator"));
|
||||||
$replFields[]=array('SURVEYURL',$clang->gT("URL of the survey"));
|
$replFields[]=array('SURVEYURL',$clang->gT("URL of the survey"));
|
||||||
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
||||||
|
|
||||||
// email-conf can accept insertans fields for non anonymous surveys
|
// email-conf can accept insertans fields for non anonymous surveys
|
||||||
if (isset($surveyid))
|
if (isset($surveyid))
|
||||||
{
|
{
|
||||||
$surveyInfo = getSurveyInfo($surveyid);
|
$surveyInfo = getSurveyInfo($surveyid);
|
||||||
if ($surveyInfo['anonymized'] == "N")
|
if ($surveyInfo['anonymized'] == "N")
|
||||||
{
|
{
|
||||||
$isInstertansEnabled=true;
|
$isInstertansEnabled=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group-desc':
|
case 'group-desc':
|
||||||
case 'question-text':
|
case 'question-text':
|
||||||
case 'question-help':
|
case 'question-help':
|
||||||
case 'editgroup': // for translation
|
case 'editgroup': // for translation
|
||||||
case 'editgroup_desc': // for translation
|
case 'editgroup_desc': // for translation
|
||||||
case 'editquestion': // for translation
|
case 'editquestion': // for translation
|
||||||
case 'editquestion_help': // for translation
|
case 'editquestion_help': // for translation
|
||||||
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
$replFields[]=array('TOKEN:FIRSTNAME',$clang->gT("First name from token"));
|
||||||
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
$replFields[]=array('TOKEN:LASTNAME',$clang->gT("Last name from token"));
|
||||||
$replFields[]=array('TOKEN:EMAIL',$clang->gT("Email from the token"));
|
$replFields[]=array('TOKEN:EMAIL',$clang->gT("Email from the token"));
|
||||||
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
$replFields[]=array('TOKEN:USESLEFT',$clang->gT("Uses left"));
|
||||||
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
$attributes=GetTokenFieldsAndNames($surveyid,true);
|
||||||
foreach ($attributes as $attributefield=>$attributedescription)
|
foreach ($attributes as $attributefield=>$attributedescription)
|
||||||
{
|
{
|
||||||
$replFields[]=array('TOKEN:'.strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
$replFields[]=array('TOKEN:'.strtoupper($attributefield), sprintf($clang->gT("Token attribute: %s"),$attributedescription));
|
||||||
}
|
}
|
||||||
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
$replFields[]=array('EXPIRY',$clang->gT("Survey expiration date"));
|
||||||
case 'editanswer':
|
case 'editanswer':
|
||||||
$isInstertansEnabled=true;
|
$isInstertansEnabled=true;
|
||||||
break;
|
break;
|
||||||
case 'assessment-text':
|
case 'assessment-text':
|
||||||
$replFields[]=array('TOTAL',$clang->gT("Overall assessment score"));
|
$replFields[]=array('TOTAL',$clang->gT("Overall assessment score"));
|
||||||
$replFields[]=array('PERC',$clang->gT("Assessment group score"));
|
$replFields[]=array('PERC',$clang->gT("Assessment group score"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($isInstertansEnabled===true)
|
if ($isInstertansEnabled===true)
|
||||||
{
|
{
|
||||||
if (empty($surveyid)) {safe_die("No SID provided.");}
|
if (empty($surveyid)) {safe_die("No SID provided.");}
|
||||||
|
|
||||||
//2: Get all other questions that occur before this question that are pre-determined answer types
|
//2: Get all other questions that occur before this question that are pre-determined answer types
|
||||||
$fieldmap = createFieldMap($surveyid, 'full');
|
$fieldmap = createFieldMap($surveyid, 'full');
|
||||||
|
|
||||||
$surveyInfo = getSurveyInfo($surveyid);
|
$surveyInfo = getSurveyInfo($surveyid);
|
||||||
$surveyformat = $surveyInfo['format'];// S, G, A
|
$surveyformat = $surveyInfo['format'];// S, G, A
|
||||||
$prevquestion=null;
|
$prevquestion=null;
|
||||||
$previouspagequestion = true;
|
$previouspagequestion = true;
|
||||||
//Go through each question until we reach the current one
|
//Go through each question until we reach the current one
|
||||||
//error_log(print_r($qrows,true));
|
//error_log(print_r($qrows,true));
|
||||||
$questionlist=array();
|
$questionlist=array();
|
||||||
foreach ($fieldmap as $field)
|
foreach ($fieldmap as $field)
|
||||||
{
|
{
|
||||||
if (empty($field['qid'])) continue;
|
if (empty($field['qid'])) continue;
|
||||||
$AddQuestion=True;
|
$AddQuestion=True;
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'addgroup':
|
case 'addgroup':
|
||||||
$AddQuestion=True;
|
$AddQuestion=True;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'editgroup':
|
case 'editgroup':
|
||||||
case 'editgroup_desc':
|
case 'editgroup_desc':
|
||||||
case 'translategroup':
|
case 'translategroup':
|
||||||
if (empty($gid)) {safe_die("No GID provided.");}
|
if (empty($gid)) {safe_die("No GID provided.");}
|
||||||
|
|
||||||
if ($field['gid'] == $gid)
|
if ($field['gid'] == $gid)
|
||||||
{
|
{
|
||||||
$AddQuestion=False;
|
$AddQuestion=False;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'addquestion':
|
case 'addquestion':
|
||||||
if (empty($gid)) {safe_die("No GID provided.");}
|
if (empty($gid)) {safe_die("No GID provided.");}
|
||||||
|
|
||||||
if ( !is_null($prevquestion) &&
|
if ( !is_null($prevquestion) &&
|
||||||
$prevquestion['gid'] == $gid &&
|
$prevquestion['gid'] == $gid &&
|
||||||
$field['gid'] != $gid)
|
$field['gid'] != $gid)
|
||||||
{
|
{
|
||||||
$AddQuestion=False;
|
$AddQuestion=False;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'editanswer':
|
case 'editanswer':
|
||||||
case 'copyquestion':
|
case 'copyquestion':
|
||||||
case 'editquestion':
|
case 'editquestion':
|
||||||
case 'translatequestion':
|
case 'translatequestion':
|
||||||
case 'translateanswer':
|
case 'translateanswer':
|
||||||
if (empty($gid)) {safe_die("No GID provided.");}
|
if (empty($gid)) {safe_die("No GID provided.");}
|
||||||
if (empty($qid)) {safe_die("No QID provided.");}
|
if (empty($qid)) {safe_die("No QID provided.");}
|
||||||
|
|
||||||
if ($field['gid'] == $gid &&
|
if ($field['gid'] == $gid &&
|
||||||
$field['qid'] == $qid)
|
$field['qid'] == $qid)
|
||||||
{
|
{
|
||||||
$AddQuestion=False;
|
$AddQuestion=False;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'emailtemplates':
|
case 'emailtemplates':
|
||||||
// this is the case for email-conf
|
// this is the case for email-conf
|
||||||
$AddQuestion=True;
|
$AddQuestion=True;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
safe_die("No Action provided.");
|
safe_die("No Action provided.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( $AddQuestion===True)
|
if ( $AddQuestion===True)
|
||||||
{
|
{
|
||||||
if ($action == 'tokens' && $fieldtype == 'email-conf')
|
if ($action == 'tokens' && $fieldtype == 'email-conf')
|
||||||
{
|
{
|
||||||
//For confirmation email all fields are valid
|
//For confirmation email all fields are valid
|
||||||
$previouspagequestion = true;
|
$previouspagequestion = true;
|
||||||
}
|
}
|
||||||
elseif ($surveyformat == "S")
|
elseif ($surveyformat == "S")
|
||||||
{
|
{
|
||||||
$previouspagequestion = true;
|
$previouspagequestion = true;
|
||||||
}
|
}
|
||||||
elseif ($surveyformat == "G")
|
elseif ($surveyformat == "G")
|
||||||
{
|
{
|
||||||
if ($previouspagequestion === true)
|
if ($previouspagequestion === true)
|
||||||
{ // Last question was on a previous page
|
{ // Last question was on a previous page
|
||||||
if ($field["gid"] == $gid)
|
if ($field["gid"] == $gid)
|
||||||
{ // This question is on same page
|
{ // This question is on same page
|
||||||
$previouspagequestion = false;
|
$previouspagequestion = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($surveyformat == "A")
|
elseif ($surveyformat == "A")
|
||||||
{
|
{
|
||||||
$previouspagequestion = false;
|
$previouspagequestion = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$questionlist[]=array_merge($field,Array( "previouspage" => $previouspagequestion));
|
$questionlist[]=array_merge($field,Array( "previouspage" => $previouspagequestion));
|
||||||
$prevquestion=$field;
|
$prevquestion=$field;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$questionscount=count($questionlist);
|
$questionscount=count($questionlist);
|
||||||
|
|
||||||
if ($questionscount > 0)
|
if ($questionscount > 0)
|
||||||
{
|
{
|
||||||
foreach($questionlist as $rows)
|
foreach($questionlist as $rows)
|
||||||
{
|
{
|
||||||
$question = $rows['question'];
|
$question = $rows['question'];
|
||||||
|
|
||||||
if (isset($rows['subquestion'])) $question = "[{$rows['subquestion']}] " . $question;
|
if (isset($rows['subquestion'])) $question = "[{$rows['subquestion']}] " . $question;
|
||||||
if (isset($rows['subquestion1'])) $question = "[{$rows['subquestion1']}] " . $question;
|
if (isset($rows['subquestion1'])) $question = "[{$rows['subquestion1']}] " . $question;
|
||||||
if (isset($rows['subquestion2'])) $question = "[{$rows['subquestion2']}] " . $question;
|
if (isset($rows['subquestion2'])) $question = "[{$rows['subquestion2']}] " . $question;
|
||||||
|
|
||||||
$shortquestion=$rows['title'].": ".FlattenText($question);
|
$shortquestion=$rows['title'].": ".FlattenText($question);
|
||||||
$cquestions[]=array($shortquestion, $rows['qid'], $rows['type'], $rows['fieldname'],$rows['previouspage']);
|
$cquestions[]=array($shortquestion, $rows['qid'], $rows['type'], $rows['fieldname'],$rows['previouspage']);
|
||||||
} //foreach questionlist
|
} //foreach questionlist
|
||||||
} //if questionscount > 0
|
} //if questionscount > 0
|
||||||
|
|
||||||
// Now I´ll add a hack to add the questions before as option
|
// Now I´ll add a hack to add the questions before as option
|
||||||
// if they are date type
|
// if they are date type
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($replFields) > 0 || isset($cquestions) )
|
if (count($replFields) > 0 || isset($cquestions) )
|
||||||
{
|
{
|
||||||
$limereplacementoutput .= "\t<select name='cquestions' id='cquestions' style='font-family:verdana; background-color: #FFFFFF; font-size:10; border: 0px;width:99%;' size='15' ondblclick='Ok();'>\n";
|
$limereplacementoutput .= "\t<select name='cquestions' id='cquestions' style='font-family:verdana; background-color: #FFFFFF; font-size:10; border: 0px;width:99%;' size='15' ondblclick='Ok();'>\n";
|
||||||
$noselection = false;
|
$noselection = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$limereplacementoutput .= $clang->gT("No replacement variable available for this field");
|
$limereplacementoutput .= $clang->gT("No replacement variable available for this field");
|
||||||
$noselection = true;
|
$noselection = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($replFields) > 0)
|
if (count($replFields) > 0)
|
||||||
{
|
{
|
||||||
$limereplacementoutput .= "<optgroup label='".$clang->gT("Standard Fields")."'>\n";
|
$limereplacementoutput .= "<optgroup label='".$clang->gT("Standard Fields")."'>\n";
|
||||||
|
|
||||||
foreach ($replFields as $stdfield)
|
foreach ($replFields as $stdfield)
|
||||||
{
|
{
|
||||||
$limereplacementoutput .= "\t<option value='".$stdfield[0]."' title='".$stdfield[1]."'";
|
$limereplacementoutput .= "\t<option value='".$stdfield[0]."' title='".$stdfield[1]."'";
|
||||||
$limereplacementoutput .= ">".$stdfield[1]."</option>\n";
|
$limereplacementoutput .= ">".$stdfield[1]."</option>\n";
|
||||||
}
|
}
|
||||||
$limereplacementoutput .= "</optgroup>\n";
|
$limereplacementoutput .= "</optgroup>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($cquestions))
|
if (isset($cquestions))
|
||||||
{
|
{
|
||||||
$limereplacementoutput .= "<optgroup label='".$clang->gT("Previous Answers Fields")."'>\n";
|
$limereplacementoutput .= "<optgroup label='".$clang->gT("Previous Answers Fields")."'>\n";
|
||||||
foreach ($cquestions as $cqn)
|
foreach ($cquestions as $cqn)
|
||||||
{
|
{
|
||||||
$isDisabled="";
|
$isDisabled="";
|
||||||
if (in_array($cqn[2],$InsertansUnsupportedtypes))
|
if (in_array($cqn[2],$InsertansUnsupportedtypes))
|
||||||
{
|
{
|
||||||
$isDisabled=" disabled='disabled'";
|
$isDisabled=" disabled='disabled'";
|
||||||
}
|
}
|
||||||
elseif ($cqn[4] === false)
|
elseif ($cqn[4] === false)
|
||||||
{
|
{
|
||||||
$isDisabled=" disabled='disabled'";
|
$isDisabled=" disabled='disabled'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$limereplacementoutput .= "\t<option value='INSERTANS:$cqn[3]' title='".$cqn[0]."'";
|
$limereplacementoutput .= "\t<option value='INSERTANS:$cqn[3]' title='".$cqn[0]."'";
|
||||||
$limereplacementoutput .= " $isDisabled >$cqn[0]</option>\n";
|
$limereplacementoutput .= " $isDisabled >$cqn[0]</option>\n";
|
||||||
}
|
}
|
||||||
$limereplacementoutput .= "</optgroup>\n";
|
$limereplacementoutput .= "</optgroup>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($noselection === false)
|
if ($noselection === false)
|
||||||
{
|
{
|
||||||
$limereplacementoutput .= "\t</select>\n";
|
$limereplacementoutput .= "\t</select>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$limereplacementoutput .= "</td>\n"
|
$limereplacementoutput .= "</td>\n"
|
||||||
. "\t</tr>\n";
|
. "\t</tr>\n";
|
||||||
|
|
||||||
if (isset($surveyformat))
|
if (isset($surveyformat))
|
||||||
{
|
{
|
||||||
switch ($surveyformat)
|
switch ($surveyformat)
|
||||||
{
|
{
|
||||||
case 'A':
|
case 'A':
|
||||||
$limereplacementoutput .= "\t<tr>\n"
|
$limereplacementoutput .= "\t<tr>\n"
|
||||||
. "<td>\n";
|
. "<td>\n";
|
||||||
$limereplacementoutput .= "\t<br />\n"
|
$limereplacementoutput .= "\t<br />\n"
|
||||||
. "\t<font color='orange'>".$clang->gT("Some Question have been disabled")."</font>\n";
|
. "\t<font color='orange'>".$clang->gT("Some Question have been disabled")."</font>\n";
|
||||||
$limereplacementoutput .= "\t<br />\n"
|
$limereplacementoutput .= "\t<br />\n"
|
||||||
. "\t".sprintf($clang->gT("Survey Format is %s:"), $clang->gT("All in one"))
|
. "\t".sprintf($clang->gT("Survey Format is %s:"), $clang->gT("All in one"))
|
||||||
. "\t<br />\n"
|
. "\t<br />\n"
|
||||||
. "\t<i>".$clang->gT("Only Previous pages answers are available")."</i>\n"
|
. "\t<i>".$clang->gT("Only Previous pages answers are available")."</i>\n"
|
||||||
. "\t<br />\n";
|
. "\t<br />\n";
|
||||||
$limereplacementoutput .= "</td>\n"
|
$limereplacementoutput .= "</td>\n"
|
||||||
. "\t</tr>\n";
|
. "\t</tr>\n";
|
||||||
break;
|
break;
|
||||||
case 'G':
|
case 'G':
|
||||||
$limereplacementoutput .= "\t<tr>\n"
|
$limereplacementoutput .= "\t<tr>\n"
|
||||||
. "<td>\n";
|
. "<td>\n";
|
||||||
$limereplacementoutput .= "\t<br /><font color='orange'>".$clang->gT("Some Question have been disabled")."</font>";
|
$limereplacementoutput .= "\t<br /><font color='orange'>".$clang->gT("Some Question have been disabled")."</font>";
|
||||||
$limereplacementoutput .= "<br />".sprintf($clang->gT("Survey mode is set to %s:"), $clang->gT("Group by Group"))."<br/><i>".$clang->gT("Only Previous pages answers are available")."</i><br />";
|
$limereplacementoutput .= "<br />".sprintf($clang->gT("Survey mode is set to %s:"), $clang->gT("Group by Group"))."<br/><i>".$clang->gT("Only Previous pages answers are available")."</i><br />";
|
||||||
$limereplacementoutput .= "</td>\n"
|
$limereplacementoutput .= "</td>\n"
|
||||||
. "\t</tr>\n";
|
. "\t</tr>\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$limereplacementoutput .= "</table>\n";
|
$limereplacementoutput .= "</table>\n";
|
||||||
echo $limereplacementoutput;
|
echo $limereplacementoutput;
|
||||||
exit;
|
exit;
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+303
-225
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: html.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: html.php 12398 2012-02-07 20:02:56Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Security Checked: POST, GET, SESSION, DB, REQUEST, returnglobal
|
//Security Checked: POST, GET, SESSION, DB, REQUEST, returnglobal
|
||||||
@@ -43,6 +43,48 @@ if ($action == "personalsettings")
|
|||||||
$edmod1="selected='selected'";
|
$edmod1="selected='selected'";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// prepare data for the questionselectormode preference
|
||||||
|
$qsmod1='';
|
||||||
|
$qsmod2='';
|
||||||
|
$qsmod3='';
|
||||||
|
$qsmod="default";
|
||||||
|
if( isset($_SESSION['questionselectormode']))
|
||||||
|
{
|
||||||
|
$qsmod=$_SESSION['questionselectormode'];
|
||||||
|
}
|
||||||
|
switch ($qsmod)
|
||||||
|
{
|
||||||
|
case 'full':
|
||||||
|
$qsmod2="selected='selected'";
|
||||||
|
break;
|
||||||
|
case 'none':
|
||||||
|
$qsmod3="selected='selected'";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$qsmod1="selected='selected'";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// prepare data for the templateeditormode preference
|
||||||
|
$temod1='';
|
||||||
|
$temod2='';
|
||||||
|
$temod3='';
|
||||||
|
$temod="default";
|
||||||
|
if( isset($_SESSION['templateeditormode']))
|
||||||
|
{
|
||||||
|
$temod=$_SESSION['templateeditormode'];
|
||||||
|
}
|
||||||
|
switch ($temod)
|
||||||
|
{
|
||||||
|
case 'full':
|
||||||
|
$temod2="selected='selected'";
|
||||||
|
break;
|
||||||
|
case 'none':
|
||||||
|
$temod3="selected='selected'";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$temod1="selected='selected'";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$cssummary = "<div class='formheader'>"
|
$cssummary = "<div class='formheader'>"
|
||||||
. "<strong>".$clang->gT("Your personal settings")."</strong>\n"
|
. "<strong>".$clang->gT("Your personal settings")."</strong>\n"
|
||||||
@@ -80,6 +122,26 @@ if ($action == "personalsettings")
|
|||||||
$cssummary .= "</select>\n"
|
$cssummary .= "</select>\n"
|
||||||
. "</li>\n";
|
. "</li>\n";
|
||||||
|
|
||||||
|
// Current questionselectormode
|
||||||
|
$cssummary .= "<li>\n"
|
||||||
|
. "<label for='questionselectormode'>".$clang->gT("Question type selector").":</label>\n"
|
||||||
|
. "<select id='questionselectormode' name='questionselectormode'>\n"
|
||||||
|
. "<option value='default' {$qsmod1}>".$clang->gT("Default")."</option>\n"
|
||||||
|
. "<option value='full' {$qsmod2}>".$clang->gT("Full selector")."</option>\n"
|
||||||
|
. "<option value='none' {$qsmod3}>".$clang->gT("Simple selector")."</option>\n";
|
||||||
|
$cssummary .= "</select>\n"
|
||||||
|
. "</li>\n";
|
||||||
|
|
||||||
|
// Current templateeditormode
|
||||||
|
$cssummary .= "<li>\n"
|
||||||
|
. "<label for='templateeditormode'>".$clang->gT("Template editor mode").":</label>\n"
|
||||||
|
. "<select id='templateeditormode' name='templateeditormode'>\n"
|
||||||
|
. "<option value='default' {$temod1}>".$clang->gT("Default")."</option>\n"
|
||||||
|
. "<option value='full' {$temod2}>".$clang->gT("Full template editor")."</option>\n"
|
||||||
|
. "<option value='none' {$temod3}>".$clang->gT("Simple template editor")."</option>\n";
|
||||||
|
$cssummary .= "</select>\n"
|
||||||
|
. "</li>\n";
|
||||||
|
|
||||||
// Date format
|
// Date format
|
||||||
$cssummary .= "<li>\n"
|
$cssummary .= "<li>\n"
|
||||||
. "<label for='dateformat'>".$clang->gT("Date format").":</label>\n"
|
. "<label for='dateformat'>".$clang->gT("Date format").":</label>\n"
|
||||||
@@ -213,7 +275,10 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
$icontext2=$clang->gTview("Execute This Survey");
|
$icontext2=$clang->gTview("Execute This Survey");
|
||||||
}
|
}
|
||||||
$baselang = GetBaseLanguageFromSurveyID($surveyid);
|
$baselang = GetBaseLanguageFromSurveyID($surveyid);
|
||||||
if (count(GetAdditionalLanguagesFromSurveyID($surveyid)) == 0)
|
$tmp_survlangs = GetAdditionalLanguagesFromSurveyID($surveyid);
|
||||||
|
$tmp_survlangs[] = $baselang;
|
||||||
|
rsort($tmp_survlangs);
|
||||||
|
if (count($tmp_survlangs) == 1)
|
||||||
{
|
{
|
||||||
$surveysummary .= "<li><a href='#' accesskey='d' onclick=\"window.open('"
|
$surveysummary .= "<li><a href='#' accesskey='d' onclick=\"window.open('"
|
||||||
. $publicurl."/index.php?sid={$surveyid}&newtest=Y&lang={$baselang}', '_blank')\" title=\"{$icontext2}\" >"
|
. $publicurl."/index.php?sid={$surveyid}&newtest=Y&lang={$baselang}', '_blank')\" title=\"{$icontext2}\" >"
|
||||||
@@ -227,9 +292,6 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
. "</a><ul>\n";
|
. "</a><ul>\n";
|
||||||
$surveysummary .= "<li><a accesskey='d' target='_blank' href='{$publicurl}/index.php?sid=$surveyid&newtest=Y'>"
|
$surveysummary .= "<li><a accesskey='d' target='_blank' href='{$publicurl}/index.php?sid=$surveyid&newtest=Y'>"
|
||||||
. "<img src='{$imageurl}/do_30.png' /> $icontext </a><ul>";
|
. "<img src='{$imageurl}/do_30.png' /> $icontext </a><ul>";
|
||||||
$tmp_survlangs = GetAdditionalLanguagesFromSurveyID($surveyid);
|
|
||||||
$tmp_survlangs[] = $baselang;
|
|
||||||
rsort($tmp_survlangs);
|
|
||||||
// Test Survey Language Selection Popup
|
// Test Survey Language Selection Popup
|
||||||
foreach ($tmp_survlangs as $tmp_lang)
|
foreach ($tmp_survlangs as $tmp_lang)
|
||||||
{
|
{
|
||||||
@@ -262,7 +324,7 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Survey permission item
|
// Survey permission item
|
||||||
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $surveyinfo['owner_id'] == $_SESSION['loginID'])
|
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $surveyinfo['owner_id'] == $_SESSION['loginID'] || bHasSurveyPermission($surveyid,'surveysecurity','read'))
|
||||||
{
|
{
|
||||||
$surveysummary .= "<li><a href='{$scriptname}?action=surveysecurity&sid={$surveyid}'>"
|
$surveysummary .= "<li><a href='{$scriptname}?action=surveysecurity&sid={$surveyid}'>"
|
||||||
. "<img src='{$imageurl}/survey_security_30.png' name='SurveySecurity'/> ".$clang->gT("Survey permissions")."</a></li>\n";
|
. "<img src='{$imageurl}/survey_security_30.png' name='SurveySecurity'/> ".$clang->gT("Survey permissions")."</a></li>\n";
|
||||||
@@ -309,12 +371,38 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
. "<img src='{$imageurl}/emailtemplates_30.png' name='EditEmailTemplates' /> ".$clang->gT("Email templates")."</a></li>\n";
|
. "<img src='{$imageurl}/emailtemplates_30.png' name='EditEmailTemplates' /> ".$clang->gT("Email templates")."</a></li>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QUALITY ASSURANCE BUTTON - SHOW LOGIC FILE
|
||||||
|
if(bHasSurveyPermission($surveyid,'translations','read'))
|
||||||
|
{
|
||||||
|
$icontext = $clang->gT("Survey Logic File");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($tmp_survlangs) == 1)
|
||||||
|
{
|
||||||
|
$surveysummary .= "<li><a href='#' onclick=\"window.open('{$scriptname}?action=showlogicfile&sid={$surveyid}', '_blank')\" title=\"{$icontext}\" >"
|
||||||
|
. "<img src='{$imageurl}/quality_assurance.png' alt='$icontext' />$icontext"
|
||||||
|
. "</a></li>\n";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$surveysummary .= "<li><a href='#' "
|
||||||
|
. "title='{$icontext}'>"
|
||||||
|
. "<img src='{$imageurl}/quality_assurance.png' alt='{$icontext}' />$icontext"
|
||||||
|
. "</a><ul>\n";
|
||||||
|
// Test Survey Language Selection Popup
|
||||||
|
foreach ($tmp_survlangs as $tmp_lang)
|
||||||
|
{
|
||||||
|
$surveysummary .= "<li><a target='_blank' href='{$scriptname}?action=showlogicfile&sid={$surveyid}&lang={$tmp_lang}'>"
|
||||||
|
. "<img src='{$imageurl}/quality_assurance.png' /> ".getLanguageNameFromCode($tmp_lang,false)."</a></li>";
|
||||||
|
}
|
||||||
|
$surveysummary .= "</ul></li>";
|
||||||
|
}
|
||||||
|
|
||||||
$surveysummary .='</ul></li>'; // End if survey properties
|
$surveysummary .='</ul></li>'; // End if survey properties
|
||||||
|
|
||||||
|
|
||||||
// Tools menu item
|
// Tools menu item
|
||||||
$surveysummary .= "<li><a href=\"#\">"
|
$surveysummary .= "<li><a href=\"#\">"
|
||||||
. "<img src='{$imageurl}/tools.png' name='SorveyTools' alt='".$clang->gT("Tools")."' /></a><ul>\n";
|
. "<img src='{$imageurl}/tools.png' name='SurveyTools' alt='".$clang->gT("Tools")."' /></a><ul>\n";
|
||||||
|
|
||||||
|
|
||||||
// Delete survey item
|
// Delete survey item
|
||||||
@@ -357,6 +445,14 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
. "<img src='{$imageurl}/resetsurveylogic_disabled_30.png' name='ResetSurveyLogic' /> ".$clang->gT("Reset Survey Logic")."</a></li>\n";
|
. "<img src='{$imageurl}/resetsurveylogic_disabled_30.png' name='ResetSurveyLogic' /> ".$clang->gT("Reset Survey Logic")."</a></li>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EXPRESSION MANAGER TEST SUITE
|
||||||
|
if (bHasSurveyPermission($surveyid,'surveycontent','update'))
|
||||||
|
{
|
||||||
|
$surveysummary .= "<li><a target='_blank' href='{$scriptname}?action=EMtest'>"
|
||||||
|
. "<img src='{$imageurl}/expressionManager_30.png' name='ExpressionManager' /> ".$clang->gT("Expression Manager")."</a></li>\n";
|
||||||
|
}
|
||||||
|
|
||||||
$surveysummary .='</ul></li>' ;
|
$surveysummary .='</ul></li>' ;
|
||||||
|
|
||||||
|
|
||||||
@@ -645,10 +741,10 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
{
|
{
|
||||||
$surveysummary2 .= $clang->gT("Regenerate question codes:")
|
$surveysummary2 .= $clang->gT("Regenerate question codes:")
|
||||||
. " [<a href='#' "
|
. " [<a href='#' "
|
||||||
. "onclick=\"if (confirm('".$clang->gT("Are you sure you want regenerate the question codes?","js")."')) {".get2post("$scriptname?action=renumberquestions&sid=$surveyid&style=straight")."}\" "
|
. "onclick=\"if (confirm('".$clang->gT("Are you sure you want to regenerate the question codes?\n\nWARNING:\nThis is safe if you only use the Conditions editor.\n\nHOWEVER, if you manually specified any relevance equations, regenerating the question codes will break all of that survey logic.","js")."')) {".get2post("$scriptname?action=renumberquestions&sid=$surveyid&style=straight")."}\" "
|
||||||
. ">".$clang->gT("Straight")."</a>] "
|
. ">".$clang->gT("Straight")."</a>] "
|
||||||
. " [<a href='#' "
|
. " [<a href='#' "
|
||||||
. "onclick=\"if (confirm('".$clang->gT("Are you sure you want regenerate the question codes?","js")."')) {".get2post("$scriptname?action=renumberquestions&sid=$surveyid&style=bygroup")."}\" "
|
. "onclick=\"if (confirm('".$clang->gT("Are you sure you want to regenerate the question codes?\n\nWARNING:\nThis is safe if you only use the Conditions editor.\n\nHOWEVER, if you manually specified any relevance equations, regenerating the question codes will break all of that survey logic.","js")."')) {".get2post("$scriptname?action=renumberquestions&sid=$surveyid&style=bygroup")."}\" "
|
||||||
. ">".$clang->gT("By Group")."</a>]";
|
. ">".$clang->gT("By Group")."</a>]";
|
||||||
$surveysummary2 .= "</td></tr>\n";
|
$surveysummary2 .= "</td></tr>\n";
|
||||||
}
|
}
|
||||||
@@ -674,12 +770,36 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
$surveysummary .= "</td></tr>\n"
|
$surveysummary .= "</td></tr>\n"
|
||||||
. "<tr><td align='right' valign='top'><strong>"
|
. "<tr><td align='right' valign='top'><strong>"
|
||||||
. $clang->gT("Description:")."</strong></td>\n<td align='left'>";
|
. $clang->gT("Description:")."</strong></td>\n<td align='left'>";
|
||||||
if (trim($surveyinfo['surveyls_description'])!='') {$surveysummary .= " {$surveyinfo['surveyls_description']}";}
|
|
||||||
|
LimeExpressionManager::StartProcessingPage(false,$rooturl,true); // so can click on syntax highlighting to edit questions
|
||||||
|
|
||||||
|
if (trim($surveyinfo['surveyls_description'])!='')
|
||||||
|
{
|
||||||
|
templatereplace($surveyinfo['surveyls_description']);
|
||||||
|
$surveysummary .= LimeExpressionManager::GetLastPrettyPrintExpression();
|
||||||
|
}
|
||||||
$surveysummary .= "</td></tr>\n"
|
$surveysummary .= "</td></tr>\n"
|
||||||
. "<tr >\n"
|
. "<tr >\n"
|
||||||
. "<td align='right' valign='top'><strong>"
|
. "<td align='right' valign='top'><strong>"
|
||||||
. $clang->gT("Welcome:")."</strong></td>\n"
|
. $clang->gT("Welcome:")."</strong></td>\n"
|
||||||
. "<td align='left'> {$surveyinfo['surveyls_welcometext']}</td></tr>\n"
|
. "<td align='left'>";
|
||||||
|
|
||||||
|
templatereplace($surveyinfo['surveyls_welcometext']);
|
||||||
|
$surveysummary .= LimeExpressionManager::GetLastPrettyPrintExpression();
|
||||||
|
|
||||||
|
if (trim($surveyinfo['surveyls_endtext'])!='')
|
||||||
|
{
|
||||||
|
$surveysummary .= "</td></tr>\n"
|
||||||
|
. "<tr >\n"
|
||||||
|
. "<td align='right' valign='top'><strong>"
|
||||||
|
. $clang->gT("End message:")."</strong></td>\n"
|
||||||
|
. "<td align='left'>";
|
||||||
|
|
||||||
|
templatereplace($surveyinfo['surveyls_endtext']);
|
||||||
|
$surveysummary .= LimeExpressionManager::GetLastPrettyPrintExpression();
|
||||||
|
}
|
||||||
|
|
||||||
|
$surveysummary .= "</td></tr>\n"
|
||||||
. "<tr ><td align='right' valign='top'><strong>"
|
. "<tr ><td align='right' valign='top'><strong>"
|
||||||
. $clang->gT("Administrator:")."</strong></td>\n"
|
. $clang->gT("Administrator:")."</strong></td>\n"
|
||||||
. "<td align='left'> {$surveyinfo['admin']} ({$surveyinfo['adminemail']})</td></tr>\n";
|
. "<td align='left'> {$surveyinfo['admin']} ({$surveyinfo['adminemail']})</td></tr>\n";
|
||||||
@@ -753,7 +873,11 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
|
|||||||
. "<td align='left'>";
|
. "<td align='left'>";
|
||||||
if ($surveyinfo['surveyls_url']!="")
|
if ($surveyinfo['surveyls_url']!="")
|
||||||
{
|
{
|
||||||
$surveysummary .=" <a target='_blank' href=\"".htmlspecialchars($surveyinfo['surveyls_url'])."\" title=\"".htmlspecialchars($surveyinfo['surveyls_url'])."\">{$surveyinfo['surveyls_urldescription']}</a>";
|
templatereplace($surveyinfo['surveyls_url']);
|
||||||
|
$_url = htmlspecialchars(strip_tags(LimeExpressionManager::GetLastPrettyPrintExpression()));
|
||||||
|
templatereplace($surveyinfo['surveyls_urldescription']);
|
||||||
|
$_desc = LimeExpressionManager::GetLastPrettyPrintExpression();
|
||||||
|
$surveysummary .=" <a target='_blank' href=\"".$_url."\" title=\"".$_url."\">{$_desc}</a>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -815,9 +939,6 @@ if (isset($surveyid) && $surveyid && $gid ) // Show the group toolbar
|
|||||||
language='".$baselang."' ORDER BY ".db_table_name('groups').".group_order";
|
language='".$baselang."' ORDER BY ".db_table_name('groups').".group_order";
|
||||||
$grpresult = db_execute_assoc($grpquery); //Checked
|
$grpresult = db_execute_assoc($grpquery); //Checked
|
||||||
|
|
||||||
// Check if other questions/groups are dependent upon this group
|
|
||||||
$condarray=GetGroupDepsForConditions($surveyid,"all",$gid,"by-targgid");
|
|
||||||
|
|
||||||
$groupsummary = "<div class='menubar'>\n"
|
$groupsummary = "<div class='menubar'>\n"
|
||||||
. "<div class='menubar-title ui-widget-header'>\n";
|
. "<div class='menubar-title ui-widget-header'>\n";
|
||||||
|
|
||||||
@@ -860,6 +981,14 @@ if (isset($surveyid) && $surveyid && $gid ) // Show the group toolbar
|
|||||||
. "<img src='$imageurl/edit.png' alt='".$clang->gT("Edit current question group")."' name='EditGroup' /></a>\n" ;
|
. "<img src='$imageurl/edit.png' alt='".$clang->gT("Edit current question group")."' name='EditGroup' /></a>\n" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QUALITY ASSURANCE BUTTON - SHOW LOGIC FILE FOR THIS QUESTION GROUP
|
||||||
|
if(bHasSurveyPermission($surveyid,'translations','read'))
|
||||||
|
{
|
||||||
|
$groupsummary .= "<img src='$imageurl/seperator.gif' alt='' />\n"
|
||||||
|
. "<a href=\"#\" onclick=\"window.open('$scriptname?action=showlogicfile&sid=$surveyid&gid=$gid','_blank')\""
|
||||||
|
. " title=\"".$clang->gTview("Survey logic file for current question group")."\">"
|
||||||
|
. "<img src='$imageurl/quality_assurance.png' alt='".$clang->gT("Survey logic file for current question group")."' name='ShowGroupLogicFile' /></a>\n" ;
|
||||||
|
}
|
||||||
|
|
||||||
// DELETE CURRENT QUESTION GROUP BUTTON
|
// DELETE CURRENT QUESTION GROUP BUTTON
|
||||||
|
|
||||||
@@ -867,20 +996,9 @@ if (isset($surveyid) && $surveyid && $gid ) // Show the group toolbar
|
|||||||
{
|
{
|
||||||
if ((($sumcount4 == 0 && $activated != "Y") || $activated != "Y"))
|
if ((($sumcount4 == 0 && $activated != "Y") || $activated != "Y"))
|
||||||
{
|
{
|
||||||
if (is_null($condarray))
|
|
||||||
{
|
|
||||||
// $groupsummary .= "<a href='$scriptname?action=delgroup&sid=$surveyid&gid=$gid' onclick=\"return confirm('".$clang->gT("Deleting this group will also delete any questions and answers it contains. Are you sure you want to continue?","js")."')\""
|
|
||||||
$groupsummary .= "<a href='#' onclick=\"if (confirm('".$clang->gT("Deleting this group will also delete any questions and answers it contains. Are you sure you want to continue?","js")."')) {".get2post("$scriptname?action=delgroup&sid=$surveyid&gid=$gid")."}\""
|
$groupsummary .= "<a href='#' onclick=\"if (confirm('".$clang->gT("Deleting this group will also delete any questions and answers it contains. Are you sure you want to continue?","js")."')) {".get2post("$scriptname?action=delgroup&sid=$surveyid&gid=$gid")."}\""
|
||||||
. " title=\"".$clang->gTview("Delete current question group")."\">"
|
. " title=\"".$clang->gTview("Delete current question group")."\">"
|
||||||
. "<img src='$imageurl/delete.png' alt='".$clang->gT("Delete current question group")."' name='DeleteWholeGroup' title='' /></a>\n";
|
. "<img src='$imageurl/delete.png' alt='".$clang->gT("Delete current question group")."' name='DeleteWholeGroup' title='' /></a>\n";
|
||||||
//get2post("$scriptname?action=delgroup&sid=$surveyid&gid=$gid");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$groupsummary .= "<a href='$scriptname?sid=$surveyid&gid=$gid' onclick=\"alert('".$clang->gT("Impossible to delete this group because there is at least one question having a condition on its content","js")."')\""
|
|
||||||
. " title=\"".$clang->gTview("Delete current question group")."\">"
|
|
||||||
. "<img src='$imageurl/delete_disabled.png' alt='".$clang->gT("Delete current question group")."' name='DeleteWholeGroup' /></a>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -906,8 +1024,6 @@ if (isset($surveyid) && $surveyid && $gid ) // Show the group toolbar
|
|||||||
$groupsummary .= "<img src='$imageurl/seperator.gif' alt='' />\n";
|
$groupsummary .= "<img src='$imageurl/seperator.gif' alt='' />\n";
|
||||||
if($activated!="Y" && getQuestionSum($surveyid, $gid)>1)
|
if($activated!="Y" && getQuestionSum($surveyid, $gid)>1)
|
||||||
{
|
{
|
||||||
// $groupsummary .= "<img src='$imageurl/blank.gif' alt='' width='40' />\n";
|
|
||||||
// $groupsummary .= "<img src='$imageurl/seperator.gif' alt='' />\n";
|
|
||||||
$groupsummary .= "<a href='$scriptname?action=orderquestions&sid=$surveyid&gid=$gid' title=\"".$clang->gTview("Change Question Order")."\" >"
|
$groupsummary .= "<a href='$scriptname?action=orderquestions&sid=$surveyid&gid=$gid' title=\"".$clang->gTview("Change Question Order")."\" >"
|
||||||
. "<img src='$imageurl/reorder.png' alt='".$clang->gT("Change Question Order")."' name='updatequestionorder' /></a>\n" ;
|
. "<img src='$imageurl/reorder.png' alt='".$clang->gT("Change Question Order")."' name='updatequestionorder' /></a>\n" ;
|
||||||
}
|
}
|
||||||
@@ -1010,25 +1126,20 @@ if (isset($surveyid) && $surveyid && $gid ) // Show the group toolbar
|
|||||||
. "{$grow['group_name']} ({$grow['gid']})</td></tr>\n"
|
. "{$grow['group_name']} ({$grow['gid']})</td></tr>\n"
|
||||||
. "<tr><td valign='top' align='right'><strong>"
|
. "<tr><td valign='top' align='right'><strong>"
|
||||||
. $clang->gT("Description:")."</strong></td>\n<td align='left'>";
|
. $clang->gT("Description:")."</strong></td>\n<td align='left'>";
|
||||||
if (trim($grow['description'])!='') {$groupsummary .=$grow['description'];}
|
if (trim($grow['description'])!='')
|
||||||
|
{
|
||||||
|
templatereplace($grow['description']);
|
||||||
|
$groupsummary .= LimeExpressionManager::GetLastPrettyPrintExpression();
|
||||||
|
}
|
||||||
|
if (trim($grow['grelevance'])!='')
|
||||||
|
{
|
||||||
|
$groupsummary .= "</td><tr><td valign='top' align='right'><strong>";
|
||||||
|
$groupsummary .= $clang->gT("Relevance:")."</td>\n<td align='left'>";
|
||||||
|
templatereplace('{' . $grow['grelevance'] . '}');
|
||||||
|
$groupsummary .= LimeExpressionManager::GetLastPrettyPrintExpression();
|
||||||
|
}
|
||||||
$groupsummary .= "</td></tr>\n";
|
$groupsummary .= "</td></tr>\n";
|
||||||
|
|
||||||
if (!is_null($condarray))
|
|
||||||
{
|
|
||||||
$groupsummary .= "<tr><td align='right'><strong>"
|
|
||||||
. $clang->gT("Questions with conditions to this group").":</strong></td>\n"
|
|
||||||
. "<td valign='bottom' align='left'>";
|
|
||||||
foreach ($condarray[$gid] as $depgid => $deprow)
|
|
||||||
{
|
|
||||||
foreach ($deprow['conditions'] as $depqid => $depcid)
|
|
||||||
{
|
|
||||||
//$groupsummary .= "[QID: ".$depqid."]";
|
|
||||||
$listcid=implode("-",$depcid);
|
|
||||||
$groupsummary .= " <a href='#' onclick=\"window.open('admin.php?sid=".$surveyid."&gid=".$depgid."&qid=".$depqid."&action=conditions&markcid=".$listcid."','_self')\">[QID: ".$depqid."]</a>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$groupsummary .= "</td></tr>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$groupsummary .= "\n</table>\n";
|
$groupsummary .= "\n</table>\n";
|
||||||
}
|
}
|
||||||
@@ -1055,18 +1166,12 @@ if (isset($surveyid) && $surveyid && $gid && $qid) // Show the question toolbar
|
|||||||
$qrresult = db_execute_assoc($qrquery) or safe_die($qrquery."<br />".$connect->ErrorMsg()); //Checked
|
$qrresult = db_execute_assoc($qrquery) or safe_die($qrquery."<br />".$connect->ErrorMsg()); //Checked
|
||||||
$questionsummary = "<div class='menubar'>\n";
|
$questionsummary = "<div class='menubar'>\n";
|
||||||
|
|
||||||
// Check if other questions in the Survey are dependent upon this question
|
|
||||||
$condarray=GetQuestDepsForConditions($surveyid,"all","all",$qid,"by-targqid","outsidegroup");
|
|
||||||
|
|
||||||
|
|
||||||
// PREVIEW THIS QUESTION BUTTON
|
// PREVIEW THIS QUESTION BUTTON
|
||||||
|
|
||||||
while ($qrrow = $qrresult->FetchRow())
|
while ($qrrow = $qrresult->FetchRow())
|
||||||
{
|
{
|
||||||
$qrrow = array_map('FlattenText', $qrrow);
|
|
||||||
//$qrrow = array_map('htmlspecialchars', $qrrow);
|
|
||||||
$questionsummary .= "<div class='menubar-title ui-widget-header'>\n"
|
$questionsummary .= "<div class='menubar-title ui-widget-header'>\n"
|
||||||
. "<strong>". $clang->gT("Question")."</strong> <span class='basic'>{$qrrow['question']} (".$clang->gT("ID").":$qid)</span>\n"
|
. "<strong>". $clang->gT("Question")."</strong> <span class='basic'>".FlattenText($qrrow['question'])." (".$clang->gT("ID").":$qid)</span>\n"
|
||||||
. "</div>\n"
|
. "</div>\n"
|
||||||
. "<div class='menubar-main'>\n"
|
. "<div class='menubar-main'>\n"
|
||||||
. "<div class='menubar-left'>\n"
|
. "<div class='menubar-left'>\n"
|
||||||
@@ -1101,41 +1206,34 @@ if (isset($surveyid) && $surveyid && $gid && $qid) // Show the question toolbar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SEPARATOR
|
|
||||||
|
|
||||||
// $questionsummary .= "<img src='$imageurl/blank.gif' alt='' width='117' height='20' />\n";
|
|
||||||
|
|
||||||
|
|
||||||
// EDIT CURRENT QUESTION BUTTON
|
// EDIT CURRENT QUESTION BUTTON
|
||||||
|
|
||||||
if(bHasSurveyPermission($surveyid,'surveycontent','update'))
|
if(bHasSurveyPermission($surveyid,'surveycontent','update'))
|
||||||
{
|
{
|
||||||
$questionsummary .= ""
|
$questionsummary .= ""
|
||||||
// ."<img src='$imageurl/seperator.gif' alt='' />\n"
|
|
||||||
. "<a href='$scriptname?action=editquestion&sid=$surveyid&gid=$gid&qid=$qid'"
|
. "<a href='$scriptname?action=editquestion&sid=$surveyid&gid=$gid&qid=$qid'"
|
||||||
. " title=\"".$clang->gTview("Edit current question")."\">"
|
. " title=\"".$clang->gTview("Edit current question")."\">"
|
||||||
. "<img src='$imageurl/edit.png' alt='".$clang->gT("Edit Current Question")."' name='EditQuestion' /></a>\n" ;
|
. "<img src='$imageurl/edit.png' alt='".$clang->gT("Edit Current Question")."' name='EditQuestion' /></a>\n" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QUALITY ASSURANCE BUTTON - SHOW LOGIC FILE FOR THIS QUESTION GROUP
|
||||||
|
if(bHasSurveyPermission($surveyid,'translations','read'))
|
||||||
|
{
|
||||||
|
$questionsummary .= "<img src='$imageurl/seperator.gif' alt='' />\n"
|
||||||
|
. "<a href=\"#\" onclick=\"window.open('$scriptname?action=showlogicfile&sid=$surveyid&gid=$gid&qid=$qid','_blank')\""
|
||||||
|
. " title=\"".$clang->gTview("Survey logic file for current question")."\">"
|
||||||
|
. "<img src='$imageurl/quality_assurance.png' alt='".$clang->gT("Survey logic file for current question")."' name='ShowQuestionLogicFile' /></a>\n" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// DELETE CURRENT QUESTION BUTTON
|
// DELETE CURRENT QUESTION BUTTON
|
||||||
|
|
||||||
if ((($qct == 0 && $activated != "Y") || $activated != "Y") && bHasSurveyPermission($surveyid,'surveycontent','delete'))
|
if ((($qct == 0 && $activated != "Y") || $activated != "Y") && bHasSurveyPermission($surveyid,'surveycontent','delete'))
|
||||||
{
|
{
|
||||||
if (is_null($condarray))
|
|
||||||
{
|
|
||||||
$questionsummary .= "<a href='#'" .
|
$questionsummary .= "<a href='#'" .
|
||||||
"onclick=\"if (confirm('".$clang->gT("Deleting this question will also delete any answer options and subquestions it includes. Are you sure you want to continue?","js")."')) {".get2post("$scriptname?action=delquestion&sid=$surveyid&gid=$gid&qid=$qid")."}\">"
|
"onclick=\"if (confirm('".$clang->gT("Deleting this question will also delete any answer options and subquestions it includes. Are you sure you want to continue?","js")."')) {".get2post("$scriptname?action=delquestion&sid=$surveyid&gid=$gid&qid=$qid")."}\">"
|
||||||
. "<img src='$imageurl/delete.png' name='DeleteWholeQuestion' alt='".$clang->gT("Delete current question")."' "
|
. "<img src='$imageurl/delete.png' name='DeleteWholeQuestion' alt='".$clang->gT("Delete current question")."' "
|
||||||
. "border='0' hspace='0' /></a>\n";
|
. "border='0' hspace='0' /></a>\n";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$questionsummary .= "<a href='$scriptname?sid=$surveyid&gid=$gid&qid=$qid'" .
|
|
||||||
"onclick=\"alert('".$clang->gT("It's impossible to delete this question because there is at least one question having a condition on it.","js")."')\""
|
|
||||||
. "title=\"".$clang->gTview("Disabled - Delete current question")."\">"
|
|
||||||
. "<img src='$imageurl/delete_disabled.png' name='DeleteWholeQuestion' alt='".$clang->gT("Disabled - Delete current question")."' /></a>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {$questionsummary .= "<img src='$imageurl/blank.gif' alt='' width='40' />\n";}
|
else {$questionsummary .= "<img src='$imageurl/blank.gif' alt='' width='40' />\n";}
|
||||||
|
|
||||||
@@ -1265,11 +1363,22 @@ if (isset($surveyid) && $surveyid && $gid && $qid) // Show the question toolbar
|
|||||||
else {$questionsummary .= ": (<i>".$clang->gT("Optional Question")."</i>)";}
|
else {$questionsummary .= ": (<i>".$clang->gT("Optional Question")."</i>)";}
|
||||||
}
|
}
|
||||||
$questionsummary .= "</td></tr>\n"
|
$questionsummary .= "</td></tr>\n"
|
||||||
. "<tr><td align='right' valign='top'><strong>"
|
. "<tr><td align='right' valign='top'><strong>";
|
||||||
. $clang->gT("Question:")."</strong></td>\n<td align='left'>".$qrrow['question']."</td></tr>\n"
|
$questionsummary .= $clang->gT("Question:") . "</strong></td>\n<td align='left'>";
|
||||||
|
|
||||||
|
// Color code the question, help, and relevance
|
||||||
|
|
||||||
|
templatereplace($qrrow['question'],false,false,$qid);
|
||||||
|
$questionsummary .= FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), false, 'UTF-8', true, true);
|
||||||
|
|
||||||
|
$questionsummary .= "</td></tr>\n"
|
||||||
. "<tr><td align='right' valign='top'><strong>"
|
. "<tr><td align='right' valign='top'><strong>"
|
||||||
. $clang->gT("Help:")."</strong></td>\n<td align='left'>";
|
. $clang->gT("Help:")."</strong></td>\n<td align='left'>";
|
||||||
if (trim($qrrow['help'])!=''){$questionsummary .= $qrrow['help'];}
|
if (trim($qrrow['help'])!='')
|
||||||
|
{
|
||||||
|
templatereplace($qrrow['help'],false,false,$qid);
|
||||||
|
$questionsummary .= FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), false, 'UTF-8', true, true);
|
||||||
|
}
|
||||||
$questionsummary .= "</td></tr>\n";
|
$questionsummary .= "</td></tr>\n";
|
||||||
if ($qrrow['preg'])
|
if ($qrrow['preg'])
|
||||||
{
|
{
|
||||||
@@ -1318,22 +1427,25 @@ if (isset($surveyid) && $surveyid && $gid && $qid) // Show the question toolbar
|
|||||||
$questionsummary .= ($qrrow['mandatory'] == "Y") ? ($clang->gT("Yes")) : ($clang->gT("No")) ;
|
$questionsummary .= ($qrrow['mandatory'] == "Y") ? ($clang->gT("Yes")) : ($clang->gT("No")) ;
|
||||||
$questionsummary .= "</td></tr>\n";
|
$questionsummary .= "</td></tr>\n";
|
||||||
}
|
}
|
||||||
if (!is_null($condarray))
|
if (is_null($qrrow['relevance']) || trim($qrrow['relevance']) == '')
|
||||||
{
|
{
|
||||||
|
$rel2show = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LimeExpressionManager::ProcessString("{" . $qrrow['relevance'] . "}", $qid); // tests Relevance equation so can pretty-print it
|
||||||
|
$rel2show = LimeExpressionManager::GetLastPrettyPrintExpression();
|
||||||
$questionsummary .= "<tr>"
|
$questionsummary .= "<tr>"
|
||||||
. "<td align='right' valign='top'><strong>"
|
. "<td align='right' valign='top'><strong>"
|
||||||
. $clang->gT("Other questions having conditions on this question:")
|
. $clang->gT("Relevance:")."</strong></td>\n"
|
||||||
. "</strong></td>\n<td align='left' valign='bottom'>\n";
|
. "<td align='left'>";
|
||||||
foreach ($condarray[$qid] as $depqid => $depcid)
|
$questionsummary .= $rel2show;
|
||||||
{
|
$questionsummary .= "</td></tr>\n";
|
||||||
$listcid=implode("-",$depcid);
|
|
||||||
$questionsummary .= " <a href='#' onclick=\"window.open('admin.php?sid=".$surveyid."&qid=".$depqid."&action=conditions&markcid=".$listcid."','_self')\">[QID: ".$depqid."]</a>";
|
|
||||||
}
|
|
||||||
$questionsummary .= "</td></tr>";
|
|
||||||
}
|
}
|
||||||
$questionsummary .= "</table>";
|
$questionsummary .= "</table>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::FinishProcessingPage();
|
||||||
|
|
||||||
// ============= EDIT ANSWER OPTIONS=====================================
|
// ============= EDIT ANSWER OPTIONS=====================================
|
||||||
|
|
||||||
@@ -1362,12 +1474,6 @@ if($action == "addsurveysecurity")
|
|||||||
$addsummary = "<div class='header ui-widget-header'>".$clang->gT("Add User")."</div>\n";
|
$addsummary = "<div class='header ui-widget-header'>".$clang->gT("Add User")."</div>\n";
|
||||||
$addsummary .= "<div class=\"messagebox ui-corner-all\">\n";
|
$addsummary .= "<div class=\"messagebox ui-corner-all\">\n";
|
||||||
|
|
||||||
$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID']." AND owner_id != ".$postuserid;
|
|
||||||
$result = db_execute_assoc($query); //Checked
|
|
||||||
if( ($result->RecordCount() > 0 && in_array($postuserid,getuserlist('onlyuidarray'))) ||
|
|
||||||
$_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
|
|
||||||
{
|
|
||||||
|
|
||||||
if($postuserid > 0){
|
if($postuserid > 0){
|
||||||
|
|
||||||
$isrquery = "INSERT INTO {$dbprefix}survey_permissions (sid,uid,permission,read_p) VALUES ({$surveyid},{$postuserid},'survey',1)";
|
$isrquery = "INSERT INTO {$dbprefix}survey_permissions (sid,uid,permission,read_p) VALUES ({$surveyid},{$postuserid},'survey',1)";
|
||||||
@@ -1396,11 +1502,6 @@ if($action == "addsurveysecurity")
|
|||||||
. "<br />" . $clang->gT("No Username selected.")."<br />\n";
|
. "<br />" . $clang->gT("No Username selected.")."<br />\n";
|
||||||
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?sid={$surveyid}&action=surveysecurity', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?sid={$surveyid}&action=surveysecurity', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
include("access_denied.php");
|
|
||||||
}
|
|
||||||
$addsummary .= "</div>\n";
|
$addsummary .= "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1410,57 +1511,48 @@ if($action == "addusergroupsurveysecurity")
|
|||||||
$addsummary = "<div class=\"header\">".$clang->gT("Add user group")."</div>\n";
|
$addsummary = "<div class=\"header\">".$clang->gT("Add user group")."</div>\n";
|
||||||
$addsummary .= "<div class=\"messagebox ui-corner-all\" >\n";
|
$addsummary .= "<div class=\"messagebox ui-corner-all\" >\n";
|
||||||
|
|
||||||
$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID'];
|
if($postusergroupid > 0){
|
||||||
$result = db_execute_assoc($query); //Checked
|
$query2 = "SELECT b.uid FROM (SELECT uid FROM ".db_table_name('survey_permissions')." WHERE sid = {$surveyid}) AS c RIGHT JOIN ".db_table_name('user_in_groups')." AS b ON b.uid = c.uid WHERE c.uid IS NULL AND b.ugid = {$postusergroupid}";
|
||||||
if( ($result->RecordCount() > 0 && in_array($postusergroupid,getsurveyusergrouplist('simpleugidarray'))) || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
|
$result2 = db_execute_assoc($query2); //Checked
|
||||||
{
|
if($result2->RecordCount() > 0)
|
||||||
if($postusergroupid > 0){
|
{
|
||||||
$query2 = "SELECT b.uid FROM (SELECT uid FROM ".db_table_name('survey_permissions')." WHERE sid = {$surveyid}) AS c RIGHT JOIN ".db_table_name('user_in_groups')." AS b ON b.uid = c.uid WHERE c.uid IS NULL AND b.ugid = {$postusergroupid}";
|
while ($row2 = $result2->FetchRow())
|
||||||
$result2 = db_execute_assoc($query2); //Checked
|
|
||||||
if($result2->RecordCount() > 0)
|
|
||||||
{
|
{
|
||||||
while ($row2 = $result2->FetchRow())
|
$uid_arr[] = $row2['uid'];
|
||||||
{
|
$isrquery = "INSERT INTO {$dbprefix}survey_permissions (sid,uid,permission,read_p) VALUES ({$surveyid}, {$row2['uid']},'survey',1) ";
|
||||||
$uid_arr[] = $row2['uid'];
|
$isrresult = $connect->Execute($isrquery); //Checked
|
||||||
$isrquery = "INSERT INTO {$dbprefix}survey_permissions (sid,uid,permission,read_p) VALUES ({$surveyid}, {$row2['uid']},'survey',1) ";
|
if (!$isrresult) break;
|
||||||
$isrresult = $connect->Execute($isrquery); //Checked
|
}
|
||||||
if (!$isrresult) break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($isrresult)
|
if($isrresult)
|
||||||
{
|
{
|
||||||
$addsummary .= "<div class=\"successheader\">".$clang->gT("User Group added.")."</div>\n";
|
$addsummary .= "<div class=\"successheader\">".$clang->gT("User Group added.")."</div>\n";
|
||||||
$_SESSION['uids'] = $uid_arr;
|
$_SESSION['uids'] = $uid_arr;
|
||||||
$addsummary .= "<br /><form method='post' action='$scriptname?sid={$surveyid}'>"
|
$addsummary .= "<br /><form method='post' action='$scriptname?sid={$surveyid}'>"
|
||||||
."<input type='submit' value='".$clang->gT("Set Survey Rights")."' />"
|
."<input type='submit' value='".$clang->gT("Set Survey Rights")."' />"
|
||||||
."<input type='hidden' name='action' value='setusergroupsurveysecurity' />"
|
."<input type='hidden' name='action' value='setusergroupsurveysecurity' />"
|
||||||
."<input type='hidden' name='ugid' value='{$postusergroupid}' />"
|
."<input type='hidden' name='ugid' value='{$postusergroupid}' />"
|
||||||
."</form>\n";
|
."</form>\n";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Error while adding user to the database
|
|
||||||
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add User Group.")."</div>\n";
|
|
||||||
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&sid={$surveyid}', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// no user to add
|
// Error while adding user to the database
|
||||||
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add User Group.")."</div>\n";
|
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add User Group.")."</div>\n";
|
||||||
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&sid={$surveyid}', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&sid={$surveyid}', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add user.")."</div>\n"
|
// no user to add
|
||||||
. "<br />" . $clang->gT("No Username selected.")."<br />\n";
|
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add User Group.")."</div>\n";
|
||||||
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&sid={$surveyid}', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&sid={$surveyid}', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
include("access_denied.php");
|
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add user.")."</div>\n"
|
||||||
|
. "<br />" . $clang->gT("No Username selected.")."<br />\n";
|
||||||
|
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&sid={$surveyid}', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
||||||
}
|
}
|
||||||
$addsummary .= "</div>\n";
|
$addsummary .= "</div>\n";
|
||||||
}
|
}
|
||||||
@@ -1470,57 +1562,40 @@ if($action == "delsurveysecurity")
|
|||||||
$addsummary = "<div class=\"header\">".$clang->gT("Deleting User")."</div>\n";
|
$addsummary = "<div class=\"header\">".$clang->gT("Deleting User")."</div>\n";
|
||||||
$addsummary .= "<div class=\"messagebox\">\n";
|
$addsummary .= "<div class=\"messagebox\">\n";
|
||||||
|
|
||||||
$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID']." AND owner_id != ".$postuserid;
|
if (isset($postuserid))
|
||||||
$result = db_execute_assoc($query); //Checked
|
|
||||||
if($result->RecordCount() > 0 || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
|
|
||||||
{
|
{
|
||||||
if (isset($postuserid))
|
$dquery="DELETE FROM".db_table_name('survey_permissions')." WHERE uid={$postuserid} AND sid={$surveyid}"; // added by Dennis
|
||||||
{
|
$dresult=$connect->Execute($dquery); //Checked
|
||||||
$dquery="DELETE FROM".db_table_name('survey_permissions')." WHERE uid={$postuserid} AND sid={$surveyid}"; // added by Dennis
|
|
||||||
$dresult=$connect->Execute($dquery); //Checked
|
|
||||||
|
|
||||||
$addsummary .= "<br />".$clang->gT("Username").": ".sanitize_xss_string($_POST['user'])."<br /><br />\n";
|
$addsummary .= "<br />".$clang->gT("Username").": ".sanitize_xss_string($_POST['user'])."<br /><br />\n";
|
||||||
$addsummary .= "<div class=\"successheader\">".$clang->gT("Success!")."</div>\n";
|
$addsummary .= "<div class=\"successheader\">".$clang->gT("Success!")."</div>\n";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Could not delete user. User was not supplied.")."</div>\n";
|
|
||||||
}
|
|
||||||
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?sid={$surveyid}&action=surveysecurity', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
include("access_denied.php");
|
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Could not delete user. User was not supplied.")."</div>\n";
|
||||||
}
|
}
|
||||||
|
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?sid={$surveyid}&action=surveysecurity', '_self')\" value=\"".$clang->gT("Continue")."\"/>\n";
|
||||||
$addsummary .= "</div>\n";
|
$addsummary .= "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($action == "setsurveysecurity" || $action == "setusergroupsurveysecurity")
|
if($action == "setsurveysecurity" || $action == "setusergroupsurveysecurity")
|
||||||
{
|
{
|
||||||
$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID'];
|
$js_admin_includes[]='../scripts/jquery/jquery.tablesorter.min.js';
|
||||||
|
$js_admin_includes[]='scripts/surveysecurity.js';
|
||||||
if ($action == "setsurveysecurity")
|
if ($action == "setsurveysecurity")
|
||||||
{
|
{
|
||||||
$query.= " AND owner_id != ".$postuserid;
|
$sUsername=$connect->GetOne("select users_name from ".db_table_name('users')." where uid={$postuserid}");
|
||||||
|
$usersummary = "<div class='header ui-widget-header'>".sprintf($clang->gT("Edit survey permissions for user %s"),"<span style='font-style:italic'>".$sUsername."</span>")."</div>";
|
||||||
}
|
}
|
||||||
$result = db_execute_assoc($query); //Checked
|
else
|
||||||
if($result->RecordCount() > 0 || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
|
|
||||||
{
|
{
|
||||||
$js_admin_includes[]='../scripts/jquery/jquery.tablesorter.min.js';
|
$sUsergroupName=$connect->GetOne("select name from ".db_table_name('user_groups')." where ugid={$postusergroupid}");
|
||||||
$js_admin_includes[]='scripts/surveysecurity.js';
|
$usersummary = "<div class='header ui-widget-header'>".sprintf($clang->gT("Edit survey permissions for group %s"),"<span style='font-style:italic'>".$sUsergroupName."</span>")."</div>";
|
||||||
if ($action == "setsurveysecurity")
|
}
|
||||||
{
|
$usersummary .= "<br /><form action='$scriptname?sid={$surveyid}' method='post'>\n"
|
||||||
$sUsername=$connect->GetOne("select users_name from ".db_table_name('users')." where uid={$postuserid}");
|
|
||||||
$usersummary = "<div class='header ui-widget-header'>".sprintf($clang->gT("Edit survey permissions for user %s"),"<span style='font-style:italic'>".$sUsername."</span>")."</div>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sUsergroupName=$connect->GetOne("select name from ".db_table_name('user_groups')." where ugid={$postusergroupid}");
|
|
||||||
$usersummary = "<div class='header ui-widget-header'>".sprintf($clang->gT("Edit survey permissions for group %s"),"<span style='font-style:italic'>".$sUsergroupName."</span>")."</div>";
|
|
||||||
}
|
|
||||||
$usersummary .= "<br /><form action='$scriptname?sid={$surveyid}' method='post'>\n"
|
|
||||||
. "<table style='margin:0 auto;' border='0' class='usersurveypermissions'><thead>\n";
|
. "<table style='margin:0 auto;' border='0' class='usersurveypermissions'><thead>\n";
|
||||||
|
|
||||||
$usersummary .= ""
|
$usersummary .= ""
|
||||||
. "<tr><th></th><th align='center'>".$clang->gT("Permission")."</th>\n"
|
. "<tr><th></th><th align='center'>".$clang->gT("Permission")."</th>\n"
|
||||||
. "<th align='center'><input type='button' id='btnToggleAdvanced' value='>>' /></th>\n"
|
. "<th align='center'><input type='button' id='btnToggleAdvanced' value='>>' /></th>\n"
|
||||||
. "<th align='center' class='extended'>".$clang->gT("Create")."</th>\n"
|
. "<th align='center' class='extended'>".$clang->gT("Create")."</th>\n"
|
||||||
@@ -1533,54 +1608,49 @@ if($action == "setsurveysecurity" || $action == "setusergroupsurveysecurity")
|
|||||||
|
|
||||||
//content
|
//content
|
||||||
|
|
||||||
$aBasePermissions=aGetBaseSurveyPermissions();
|
$aBasePermissions=aGetBaseSurveyPermissions();
|
||||||
$oddcolumn=false;
|
$oddcolumn=false;
|
||||||
foreach($aBasePermissions as $sPermissionKey=>$aCRUDPermissions)
|
foreach($aBasePermissions as $sPermissionKey=>$aCRUDPermissions)
|
||||||
|
{
|
||||||
|
$oddcolumn=!$oddcolumn;
|
||||||
|
$usersummary .= "<tr><td align='center'><img src='{$imageurl}/{$aCRUDPermissions['img']}_30.png' /></td>";
|
||||||
|
$usersummary .= "<td align='right'>{$aCRUDPermissions['title']}</td>";
|
||||||
|
$usersummary .= "<td align='center'><input type=\"checkbox\" class=\"markrow\" name='all_{$sPermissionKey}' /></td>";
|
||||||
|
foreach ($aCRUDPermissions as $sCRUDKey=>$CRUDValue)
|
||||||
{
|
{
|
||||||
$oddcolumn=!$oddcolumn;
|
if (!in_array($sCRUDKey,array('create','read','update','delete','import','export'))) continue;
|
||||||
$usersummary .= "<tr><td align='center'><img src='{$imageurl}/{$aCRUDPermissions['img']}_30.png' /></td>";
|
$usersummary .= "<td class='extended' align='center'>";
|
||||||
$usersummary .= "<td align='right'>{$aCRUDPermissions['title']}</td>";
|
|
||||||
$usersummary .= "<td align='center'><input type=\"checkbox\" class=\"markrow\" name='all_{$sPermissionKey}' /></td>";
|
if ($CRUDValue)
|
||||||
foreach ($aCRUDPermissions as $sCRUDKey=>$CRUDValue)
|
|
||||||
{
|
{
|
||||||
if (!in_array($sCRUDKey,array('create','read','update','delete','import','export'))) continue;
|
if (!($sPermissionKey=='survey' && $sCRUDKey=='read'))
|
||||||
$usersummary .= "<td class='extended' align='center'>";
|
|
||||||
|
|
||||||
if ($CRUDValue)
|
|
||||||
{
|
{
|
||||||
if (!($sPermissionKey=='survey' && $sCRUDKey=='read'))
|
$usersummary .= "<input type=\"checkbox\" class=\"checkboxbtn\" name='perm_{$sPermissionKey}_{$sCRUDKey}' ";
|
||||||
{
|
if($action=='setsurveysecurity' && bHasSurveyPermission( $surveyid,$sPermissionKey,$sCRUDKey,$postuserid)) {
|
||||||
$usersummary .= "<input type=\"checkbox\" class=\"checkboxbtn\" name='perm_{$sPermissionKey}_{$sCRUDKey}' ";
|
$usersummary .= ' checked="checked" ';
|
||||||
if($action=='setsurveysecurity' && bHasSurveyPermission( $surveyid,$sPermissionKey,$sCRUDKey,$postuserid)) {
|
|
||||||
$usersummary .= ' checked="checked" ';
|
|
||||||
}
|
|
||||||
$usersummary .=" />";
|
|
||||||
}
|
}
|
||||||
|
$usersummary .=" />";
|
||||||
}
|
}
|
||||||
$usersummary .= "</td>";
|
|
||||||
}
|
}
|
||||||
$usersummary .= "</tr>";
|
$usersummary .= "</td>";
|
||||||
}
|
}
|
||||||
|
$usersummary .= "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
$usersummary .= "\n</table>"
|
$usersummary .= "\n</table>"
|
||||||
."<p><input type='submit' value='".$clang->gT("Save Now")."' />"
|
."<p><input type='submit' value='".$clang->gT("Save Now")."' />"
|
||||||
."<input type='hidden' name='perm_survey_read' value='1' />"
|
."<input type='hidden' name='perm_survey_read' value='1' />"
|
||||||
."<input type='hidden' name='action' value='surveyrights' />";
|
."<input type='hidden' name='action' value='surveyrights' />";
|
||||||
|
|
||||||
if ($action=='setsurveysecurity')
|
if ($action=='setsurveysecurity')
|
||||||
{
|
{
|
||||||
$usersummary .="<input type='hidden' name='uid' value='{$postuserid}' />";
|
$usersummary .="<input type='hidden' name='uid' value='{$postuserid}' />";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$usersummary .="<input type='hidden' name='ugid' value='{$postusergroupid}' />";
|
|
||||||
}
|
|
||||||
$usersummary .= "</form>\n";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
include("access_denied.php");
|
$usersummary .="<input type='hidden' name='ugid' value='{$postusergroupid}' />";
|
||||||
}
|
}
|
||||||
|
$usersummary .= "</form>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the action to export the structure of a complete survey
|
// This is the action to export the structure of a complete survey
|
||||||
@@ -1792,18 +1862,24 @@ if($action == "surveysecurity")
|
|||||||
$surveysecurity .= "<tr>\n";
|
$surveysecurity .= "<tr>\n";
|
||||||
|
|
||||||
$surveysecurity .= "<td>\n";
|
$surveysecurity .= "<td>\n";
|
||||||
$surveysecurity .= "<form style='display:inline;' method='post' action='$scriptname?sid={$surveyid}'>"
|
if (bHasSurveyPermission($surveyid, 'surveysecurity', 'update'))
|
||||||
."<input type='image' src='{$imageurl}/token_edit.png' title='".$clang->gT("Edit permissions")."' />"
|
{
|
||||||
."<input type='hidden' name='action' value='setsurveysecurity' />"
|
$surveysecurity .= "<form style='display:inline;' method='post' action='$scriptname?sid={$surveyid}'>"
|
||||||
."<input type='hidden' name='user' value='{$PermissionRow['users_name']}' />"
|
."<input type='image' src='{$imageurl}/token_edit.png' title='".$clang->gT("Edit permissions")."' />"
|
||||||
."<input type='hidden' name='uid' value='{$PermissionRow['uid']}' />"
|
."<input type='hidden' name='action' value='setsurveysecurity' />"
|
||||||
."</form>\n";
|
."<input type='hidden' name='user' value='{$PermissionRow['users_name']}' />"
|
||||||
$surveysecurity .= "<form style='display:inline;' method='post' action='$scriptname?sid={$surveyid}'>"
|
."<input type='hidden' name='uid' value='{$PermissionRow['uid']}' />"
|
||||||
."<input type='image' src='{$imageurl}/token_delete.png' title='".$clang->gT("Delete")."' onclick='return confirm(\"".$clang->gT("Are you sure you want to delete this entry?","js")."\")' />"
|
."</form>\n";
|
||||||
."<input type='hidden' name='action' value='delsurveysecurity' />"
|
}
|
||||||
."<input type='hidden' name='user' value='{$PermissionRow['users_name']}' />"
|
if (bHasSurveyPermission($surveyid, 'surveysecurity', 'delete'))
|
||||||
."<input type='hidden' name='uid' value='{$PermissionRow['uid']}' />"
|
{
|
||||||
."</form>";
|
$surveysecurity .= "<form style='display:inline;' method='post' action='$scriptname?sid={$surveyid}'>"
|
||||||
|
."<input type='image' src='{$imageurl}/token_delete.png' title='".$clang->gT("Delete")."' onclick='return confirm(\"".$clang->gT("Are you sure you want to delete this entry?","js")."\")' />"
|
||||||
|
."<input type='hidden' name='action' value='delsurveysecurity' />"
|
||||||
|
."<input type='hidden' name='user' value='{$PermissionRow['users_name']}' />"
|
||||||
|
."<input type='hidden' name='uid' value='{$PermissionRow['uid']}' />"
|
||||||
|
."</form>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$surveysecurity .= "</td>\n";
|
$surveysecurity .= "</td>\n";
|
||||||
@@ -1856,21 +1932,24 @@ if($action == "surveysecurity")
|
|||||||
$surveysecurity .= "<tr><td colspan='18'></td></tr>"; //fix error on empty table
|
$surveysecurity .= "<tr><td colspan='18'></td></tr>"; //fix error on empty table
|
||||||
}
|
}
|
||||||
$surveysecurity .= "</tbody>\n"
|
$surveysecurity .= "</tbody>\n"
|
||||||
. "</table>\n"
|
. "</table>\n";
|
||||||
. "<form class='form44' action='$scriptname?sid={$surveyid}' method='post'><ul>\n"
|
if (bHasSurveyPermission($surveyid, 'surveysecurity', 'delete'))
|
||||||
. "<li><label for='uidselect'>".$clang->gT("User").": </label><select id='uidselect' name='uid'>\n"
|
{
|
||||||
. sGetSurveyUserlist(false,false)
|
$surveysecurity.= "<form class='form44' action='$scriptname?sid={$surveyid}' method='post'><ul>\n"
|
||||||
. "</select>\n"
|
. "<li><label for='uidselect'>".$clang->gT("User").": </label><select id='uidselect' name='uid'>\n"
|
||||||
. "<input style='width: 15em;' type='submit' value='".$clang->gT("Add User")."' onclick=\"if (document.getElementById('uidselect').value == -1) {alert('".$clang->gT("Please select a user first","js")."'); return false;}\"/>"
|
. sGetSurveyUserlist(false,false)
|
||||||
. "<input type='hidden' name='action' value='addsurveysecurity' />"
|
. "</select>\n"
|
||||||
. "</li></ul></form>\n"
|
. "<input style='width: 15em;' type='submit' value='".$clang->gT("Add User")."' onclick=\"if (document.getElementById('uidselect').value == -1) {alert('".$clang->gT("Please select a user first","js")."'); return false;}\"/>"
|
||||||
. "<form class='form44' action='$scriptname?sid={$surveyid}' method='post'><ul><li>\n"
|
. "<input type='hidden' name='action' value='addsurveysecurity' />"
|
||||||
. "<label for='ugidselect'>".$clang->gT("Groups").": </label><select id='ugidselect' name='ugid'>\n"
|
. "</li></ul></form>\n"
|
||||||
. getsurveyusergrouplist()
|
. "<form class='form44' action='$scriptname?sid={$surveyid}' method='post'><ul><li>\n"
|
||||||
. "</select>\n"
|
. "<label for='ugidselect'>".$clang->gT("Groups").": </label><select id='ugidselect' name='ugid'>\n"
|
||||||
. "<input style='width: 15em;' type='submit' value='".$clang->gT("Add User Group")."' onclick=\"if (document.getElementById('ugidselect').value == -1) {alert('".$clang->gT("Please select a user group first","js")."'); return false;}\" />"
|
. getsurveyusergrouplist()
|
||||||
. "<input type='hidden' name='action' value='addusergroupsurveysecurity' />\n"
|
. "</select>\n"
|
||||||
. "</li></ul></form>";
|
. "<input style='width: 15em;' type='submit' value='".$clang->gT("Add User Group")."' onclick=\"if (document.getElementById('ugidselect').value == -1) {alert('".$clang->gT("Please select a user group first","js")."'); return false;}\" />"
|
||||||
|
. "<input type='hidden' name='action' value='addusergroupsurveysecurity' />\n"
|
||||||
|
. "</li></ul></form>";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2038,13 +2117,12 @@ function showadminmenu()
|
|||||||
. "</strong>\n";
|
. "</strong>\n";
|
||||||
}
|
}
|
||||||
$adminmenu .="</div>\n";
|
$adminmenu .="</div>\n";
|
||||||
/*
|
/* queXS Disable
|
||||||
//queXS Disable
|
if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1 && isset($updatelastcheck) && $updatelastcheck>0 && isset($updateavailable) && $updateavailable==1)
|
||||||
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 && isset($updatelastcheck) && $updatelastcheck>0 && isset($updateavailable) && $updateavailable==1)
|
|
||||||
{
|
{
|
||||||
$adminmenu .="<div class='menubar-title-right'><a href='{$scriptname}?action=globalsettings'>".sprintf($clang->gT('Update available: %s'),$updateversion."($updatebuild)").'</a></div>';
|
$adminmenu .="<div class='menubar-title-right'><a href='{$scriptname}?action=globalsettings'>".sprintf($clang->gT('Update available: %s'),$updateversion."($updatebuild)").'</a></div>';
|
||||||
}
|
}
|
||||||
*/
|
end queXS Disable */
|
||||||
$adminmenu .= "</div>\n"
|
$adminmenu .= "</div>\n"
|
||||||
. "<div class='menubar-main'>\n"
|
. "<div class='menubar-main'>\n"
|
||||||
. "<div class='menubar-left'>\n"
|
. "<div class='menubar-left'>\n"
|
||||||
@@ -2061,7 +2139,7 @@ function showadminmenu()
|
|||||||
$adminmenu .="<a href=\"#\" onclick=\"window.open('{$scriptname}?action=editusergroups', '_self')\" title=\"".$clang->gTview("Create/Edit Groups")."\" >"
|
$adminmenu .="<a href=\"#\" onclick=\"window.open('{$scriptname}?action=editusergroups', '_self')\" title=\"".$clang->gTview("Create/Edit Groups")."\" >"
|
||||||
."<img src='{$imageurl}/usergroup.png' alt='".$clang->gT("Create/Edit Groups")."' /></a>\n" ;
|
."<img src='{$imageurl}/usergroup.png' alt='".$clang->gT("Create/Edit Groups")."' /></a>\n" ;
|
||||||
|
|
||||||
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
|
if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
|
||||||
{
|
{
|
||||||
$adminmenu .= "<a href=\"#\" onclick=\"window.open('{$scriptname}?action=globalsettings', '_self')\" title=\"".$clang->gTview("Global settings")."\" >"
|
$adminmenu .= "<a href=\"#\" onclick=\"window.open('{$scriptname}?action=globalsettings', '_self')\" title=\"".$clang->gTview("Global settings")."\" >"
|
||||||
. "<img src='{$imageurl}/global.png' name='GlobalSettings' alt='". $clang->gT("Global settings")."' /></a>"
|
. "<img src='{$imageurl}/global.png' name='GlobalSettings' alt='". $clang->gT("Global settings")."' /></a>"
|
||||||
@@ -2079,8 +2157,8 @@ function showadminmenu()
|
|||||||
."<img src='$imageurl/surveylist.png' name='ListSurveys' alt='".$clang->gT("List Surveys")."' />"
|
."<img src='$imageurl/surveylist.png' name='ListSurveys' alt='".$clang->gT("List Surveys")."' />"
|
||||||
."</a>" ;
|
."</a>" ;
|
||||||
|
|
||||||
// db backup & label editor
|
// db backup : limit only to SUPERADMIN, else user have all access to whole survey's and user information.
|
||||||
if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
|
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
|
||||||
{
|
{
|
||||||
if ($databasetype=='mysql' || $databasetype=='mysqli')
|
if ($databasetype=='mysql' || $databasetype=='mysqli')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: html_functions.php 9668 2010-12-21 00:49:44Z c_schmitz $
|
* $Id: html_functions.php 12211 2012-01-26 17:02:27Z shnoulle $
|
||||||
*/
|
*/
|
||||||
function browsemenubar($title='')
|
function browsemenubar($title='')
|
||||||
{
|
{
|
||||||
@@ -147,4 +147,15 @@ function browsemenubar($title='')
|
|||||||
|
|
||||||
return $browsemenubar;
|
return $browsemenubar;
|
||||||
}
|
}
|
||||||
|
function getQuestionlistMode(){
|
||||||
|
global $defaultquestionselectormode;
|
||||||
|
//TODO : put it on globalsettings $defaultquestionselectormode=getGlobalSetting('defaultquestionselectormode');
|
||||||
|
if (isset($_SESSION['questionselectormode']) && ($_SESSION['questionselectormode']=='full' || $_SESSION['questionselectormode']=='none'))
|
||||||
|
{
|
||||||
|
return $_SESSION['questionselectormode'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $defaultquestionselectormode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: htmleditor-functions.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: htmleditor-functions.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//include_once("login_check.php");
|
//include_once("login_check.php");
|
||||||
|
|||||||
@@ -10,14 +10,15 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: htmleditor-popup.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Ensure script is not run directly, avoid path disclosure
|
require_once(dirname(__FILE__).'/../classes/core/startup.php');
|
||||||
//include_once("login_check.php");
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__).'/../config-defaults.php');
|
require_once(dirname(__FILE__).'/../config-defaults.php');
|
||||||
require_once(dirname(__FILE__).'/../common.php');
|
require_once(dirname(__FILE__).'/../common.php');
|
||||||
|
require_once('login_check.php');
|
||||||
|
|
||||||
|
if (!isset($_SESSION['loginID'])) die();
|
||||||
|
|
||||||
if (!isset($_GET['lang']))
|
if (!isset($_GET['lang']))
|
||||||
{
|
{
|
||||||
@@ -28,6 +29,7 @@ else
|
|||||||
$clang = new limesurvey_lang($_GET['lang']);
|
$clang = new limesurvey_lang($_GET['lang']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!isset($_GET['fieldname']) || !isset($_GET['fieldtext']))
|
if (!isset($_GET['fieldname']) || !isset($_GET['fieldtext']))
|
||||||
{
|
{
|
||||||
$output = '
|
$output = '
|
||||||
@@ -45,8 +47,8 @@ if (!isset($_GET['fieldname']) || !isset($_GET['fieldtext']))
|
|||||||
LimeSurvey '.$clang->gT("HTML Editor").'
|
LimeSurvey '.$clang->gT("HTML Editor").'
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<tr><td align="center"><br /><span style="color:red;"><strong>
|
<tr><td align="center"><br /><span style="color:red;"><strong>
|
||||||
</strong></span><br />
|
</strong></span><br />
|
||||||
</table>
|
</table>
|
||||||
<form onsubmit="self.close()">
|
<form onsubmit="self.close()">
|
||||||
@@ -57,8 +59,11 @@ if (!isset($_GET['fieldname']) || !isset($_GET['fieldtext']))
|
|||||||
</html>';
|
</html>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$fieldname=$_GET['fieldname'];
|
require_once("../classes/inputfilter/class.inputfilter_clean.php");
|
||||||
$fieldtext=$_GET['fieldtext'];
|
$oFilter = new InputFilter('','',1,1,1);
|
||||||
|
|
||||||
|
$fieldname=$oFilter->process($_GET['fieldname']);
|
||||||
|
$fieldtext=$oFilter->process($_GET['fieldtext']);
|
||||||
if (get_magic_quotes_gpc()) $fieldtext = stripslashes($fieldtext);
|
if (get_magic_quotes_gpc()) $fieldtext = stripslashes($fieldtext);
|
||||||
$controlidena=$_GET['fieldname'].'_popupctrlena';
|
$controlidena=$_GET['fieldname'].'_popupctrlena';
|
||||||
$controliddis=$_GET['fieldname'].'_popupctrldis';
|
$controliddis=$_GET['fieldname'].'_popupctrldis';
|
||||||
@@ -186,4 +191,5 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo $output;
|
echo $output;
|
||||||
?>
|
|
||||||
|
// Yes, closing PHP tag was intentionally left out
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: http_importsurvey.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: http_importsurvey.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Ensure script is not run directly, avoid path disclosure
|
// Ensure script is not run directly, avoid path disclosure
|
||||||
@@ -19,7 +19,7 @@ include_once("login_check.php");
|
|||||||
// Enable 'Convert resource links and INSERTANS fields?' if selected
|
// Enable 'Convert resource links and INSERTANS fields?' if selected
|
||||||
if ( (isset($_POST['copysurveytranslinksfields']) && $_POST['copysurveytranslinksfields'] == "on") || (isset($_POST['translinksfields']) && $_POST['translinksfields'] == "on"))
|
if ( (isset($_POST['copysurveytranslinksfields']) && $_POST['copysurveytranslinksfields'] == "on") || (isset($_POST['translinksfields']) && $_POST['translinksfields'] == "on"))
|
||||||
{
|
{
|
||||||
$sTransLinks = true;
|
$sTransLinks = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the HTML
|
// Start the HTML
|
||||||
@@ -40,14 +40,14 @@ $importerror=false; // Put a var for continue
|
|||||||
|
|
||||||
if ($action == 'importsurvey')
|
if ($action == 'importsurvey')
|
||||||
{
|
{
|
||||||
$the_full_file_path = $tempdir . "/" . $_FILES['the_file']['name'];
|
$the_full_file_path = $tempdir . "/" . sRandomChars(20).'_'.$_FILES['the_file']['name'];
|
||||||
if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $the_full_file_path))
|
if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $the_full_file_path))
|
||||||
{
|
{
|
||||||
$importsurvey .= "<div class='errorheader'>".$clang->gT("Error")."</div>\n";
|
$importsurvey .= "<div class='errorheader'>".$clang->gT("Error")."</div>\n";
|
||||||
$importsurvey .= sprintf ($clang->gT("An error occurred uploading your file. This may be caused by incorrect permissions in your %s folder."),$tempdir)."<br /><br />\n";
|
$importsurvey .= sprintf ($clang->gT("An error occurred uploading your file. This may be caused by incorrect permissions in your %s folder."),$tempdir)."<br /><br />\n";
|
||||||
$importsurvey .= "<input type='submit' value='".$clang->gT("Main Admin Screen")."' onclick=\"window.open('$scriptname', '_self')\"><br /><br />\n";
|
$importsurvey .= "<input type='submit' value='".$clang->gT("Main Admin Screen")."' onclick=\"window.open('$scriptname', '_self')\"><br /><br />\n";
|
||||||
$importerror=true;
|
$importerror=true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$importsurvey .= "<div class='successheader'>".$clang->gT("Success")."</div> <br />\n";
|
$importsurvey .= "<div class='successheader'>".$clang->gT("Success")."</div> <br />\n";
|
||||||
@@ -145,13 +145,13 @@ if (!$importerror)
|
|||||||
$importsurvey .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br /><br />\n";
|
$importsurvey .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br /><br />\n";
|
||||||
if ($action == 'importsurvey')
|
if ($action == 'importsurvey')
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong>".$clang->gT("Survey copy summary")."</strong><br />\n";
|
$importsurvey .= "<strong>".$clang->gT("Survey copy summary")."</strong><br />\n";
|
||||||
}
|
}
|
||||||
elseif($action == 'copysurvey')
|
elseif($action == 'copysurvey')
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong>".$clang->gT("Survey import summary")."</strong><br />\n";
|
$importsurvey .= "<strong>".$clang->gT("Survey import summary")."</strong><br />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$importsurvey .= "<ul style=\"text-align:left;\">\n\t<li>".$clang->gT("Surveys").": {$aImportResults['surveys']}</li>\n";
|
$importsurvey .= "<ul style=\"text-align:left;\">\n\t<li>".$clang->gT("Surveys").": {$aImportResults['surveys']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Languages").": {$aImportResults['languages']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Languages").": {$aImportResults['languages']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Question groups").": {$aImportResults['groups']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Question groups").": {$aImportResults['groups']}</li>\n";
|
||||||
@@ -159,15 +159,15 @@ if (!$importerror)
|
|||||||
$importsurvey .= "\t<li>".$clang->gT("Answers").": {$aImportResults['answers']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Answers").": {$aImportResults['answers']}</li>\n";
|
||||||
if (isset($aImportResults['subquestions']))
|
if (isset($aImportResults['subquestions']))
|
||||||
{
|
{
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Subquestions").": {$aImportResults['subquestions']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Subquestions").": {$aImportResults['subquestions']}</li>\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['defaultvalues']))
|
if (isset($aImportResults['defaultvalues']))
|
||||||
{
|
{
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Default answers").": {$aImportResults['defaultvalues']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Default answers").": {$aImportResults['defaultvalues']}</li>\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['conditions']))
|
if (isset($aImportResults['conditions']))
|
||||||
{
|
{
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Conditions").": {$aImportResults['conditions']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Conditions").": {$aImportResults['conditions']}</li>\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['labelsets']))
|
if (isset($aImportResults['labelsets']))
|
||||||
{
|
{
|
||||||
@@ -180,8 +180,8 @@ if (!$importerror)
|
|||||||
$importsurvey .= "\t<li>".$clang->gT("Question attributes").": {$aImportResults['question_attributes']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Question attributes").": {$aImportResults['question_attributes']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Assessments").": {$aImportResults['assessments']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Assessments").": {$aImportResults['assessments']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Quotas").": {$aImportResults['quota']} ({$aImportResults['quotamembers']} ".$clang->gT("quota members")." ".$clang->gT("and")." {$aImportResults['quotals']} ".$clang->gT("quota language settings").")</li>\n</ul><br />\n";
|
$importsurvey .= "\t<li>".$clang->gT("Quotas").": {$aImportResults['quota']} ({$aImportResults['quotamembers']} ".$clang->gT("quota members")." ".$clang->gT("and")." {$aImportResults['quotals']} ".$clang->gT("quota language settings").")</li>\n</ul><br />\n";
|
||||||
|
|
||||||
if (count($aImportResults['importwarnings'])>0)
|
if (count($aImportResults['importwarnings'])>0)
|
||||||
{
|
{
|
||||||
$importsurvey .= "<div class='warningheader'>".$clang->gT("Warnings").":</div><ul style=\"text-align:left;\">";
|
$importsurvey .= "<div class='warningheader'>".$clang->gT("Warnings").":</div><ul style=\"text-align:left;\">";
|
||||||
foreach ($aImportResults['importwarnings'] as $warning)
|
foreach ($aImportResults['importwarnings'] as $warning)
|
||||||
@@ -190,23 +190,23 @@ if (!$importerror)
|
|||||||
}
|
}
|
||||||
$importsurvey .= "</ul><br />\n";
|
$importsurvey .= "</ul><br />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'importsurvey')
|
if ($action == 'importsurvey')
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong>".$clang->gT("Import of Survey is completed.")."</strong><br />\n"
|
$importsurvey .= "<strong>".$clang->gT("Import of Survey is completed.")."</strong><br />\n"
|
||||||
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
||||||
}
|
}
|
||||||
elseif($action == 'copysurvey')
|
elseif($action == 'copysurvey')
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong>".$clang->gT("Copy of survey is completed.")."</strong><br />\n"
|
$importsurvey .= "<strong>".$clang->gT("Copy of survey is completed.")."</strong><br />\n"
|
||||||
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'importsurvey')
|
if ($action == 'importsurvey')
|
||||||
{
|
{
|
||||||
unlink($sFullFilepath);
|
unlink($sFullFilepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// end of traitment an close message box
|
// end of traitment an close message box
|
||||||
$importsurvey .= "</div><br />\n";
|
$importsurvey .= "</div><br />\n";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: import_functions.php 9586 2010-12-06 03:08:07Z c_schmitz $
|
* $Id: import_functions.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
* Files Purpose:
|
* Files Purpose:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -1061,6 +1061,9 @@ function CSVImportSurvey($sFullFilepath,$iDesiredSurveyId=NULL)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($newsid);
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($newsid);
|
||||||
|
|
||||||
$importresults['importversion']=$importversion;
|
$importresults['importversion']=$importversion;
|
||||||
$importresults['newsid']=$newsid;
|
$importresults['newsid']=$newsid;
|
||||||
$importresults['oldsid']=$oldsid;
|
$importresults['oldsid']=$oldsid;
|
||||||
@@ -1078,6 +1081,7 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
|
|||||||
{
|
{
|
||||||
global $connect, $dbprefix, $clang, $timeadjust;
|
global $connect, $dbprefix, $clang, $timeadjust;
|
||||||
|
|
||||||
|
$iDesiredSurveyId=intval($iDesiredSurveyId);
|
||||||
$results['error']=false;
|
$results['error']=false;
|
||||||
if ($sXMLdata == NULL)
|
if ($sXMLdata == NULL)
|
||||||
{
|
{
|
||||||
@@ -1098,7 +1102,7 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
|
|||||||
//echo $clang->gT("This is VALID LimeSurvey survey structure XML file.");
|
//echo $clang->gT("This is VALID LimeSurvey survey structure XML file.");
|
||||||
//return $results;
|
//return $results;
|
||||||
}
|
}
|
||||||
$dbversion = (int) $xml->DBVersion;
|
$dbversion = (float) $xml->DBVersion;
|
||||||
$aQIDReplacements=array();
|
$aQIDReplacements=array();
|
||||||
$aQuotaReplacements=array();
|
$aQuotaReplacements=array();
|
||||||
$results['defaultvalues']=0;
|
$results['defaultvalues']=0;
|
||||||
@@ -1468,7 +1472,7 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
@@ -1578,6 +1582,10 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
|
|||||||
TranslateInsertansTags($newsid,$oldsid,$aOldNewFieldmap);
|
TranslateInsertansTags($newsid,$oldsid,$aOldNewFieldmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($newsid);
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($newsid);
|
||||||
|
LimeExpressionManager::SetSurveyId($newsid);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -10,10 +10,10 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: importgroup.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: importgroup.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Ensure script is not run directly, avoid path disclosure
|
//Ensure script is not run directly, avoid path disclosure
|
||||||
include_once("login_check.php");
|
include_once("login_check.php");
|
||||||
|
|
||||||
$importgroup = "<div class='header ui-widget-header'>".$clang->gT("Import question group")."</div>\n";
|
$importgroup = "<div class='header ui-widget-header'>".$clang->gT("Import question group")."</div>\n";
|
||||||
@@ -96,13 +96,13 @@ unlink($sFullFilepath);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function imports an old-school question group file (*.csv,*.sql)
|
* This function imports an old-school question group file (*.csv,*.sql)
|
||||||
*
|
*
|
||||||
* @param mixed $sFullFilepath Full file patch to the import file
|
* @param mixed $sFullFilepath Full file patch to the import file
|
||||||
* @param mixed $newsid Survey ID to which the question is attached
|
* @param mixed $newsid Survey ID to which the question is attached
|
||||||
*/
|
*/
|
||||||
function CSVImportGroup($sFullFilepath, $newsid)
|
function CSVImportGroup($sFullFilepath, $newsid)
|
||||||
{
|
{
|
||||||
global $dbprefix, $connect, $clang;
|
global $dbprefix, $connect, $clang;
|
||||||
$aLIDReplacements=array();
|
$aLIDReplacements=array();
|
||||||
$aQIDReplacements = array(); // this array will have the "new qid" for the questions, the key will be the "old qid"
|
$aQIDReplacements = array(); // this array will have the "new qid" for the questions, the key will be the "old qid"
|
||||||
$aGIDReplacements = array();
|
$aGIDReplacements = array();
|
||||||
@@ -117,7 +117,7 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
if (substr($bigarray[0], 0, 23) != "# LimeSurvey Group Dump")
|
if (substr($bigarray[0], 0, 23) != "# LimeSurvey Group Dump")
|
||||||
{
|
{
|
||||||
$results['fatalerror'] = $clang->gT("This file is not a LimeSurvey question file. Import failed.");
|
$results['fatalerror'] = $clang->gT("This file is not a LimeSurvey question file. Import failed.");
|
||||||
$importversion=0;
|
$importversion=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -128,7 +128,7 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
{
|
{
|
||||||
$results['fatalerror'] = $clang->gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
|
$results['fatalerror'] = $clang->gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i=0; $i<9; $i++) //skipping the first lines that are not needed
|
for ($i=0; $i<9; $i++) //skipping the first lines that are not needed
|
||||||
{
|
{
|
||||||
unset($bigarray[$i]);
|
unset($bigarray[$i]);
|
||||||
@@ -337,7 +337,7 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
return $results;
|
return $results;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($labelsetsarray) > 1)
|
if (count($labelsetsarray) > 1)
|
||||||
@@ -422,7 +422,7 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
$query2 = "SELECT code, title, sortorder, language, assessment_value
|
$query2 = "SELECT code, title, sortorder, language, assessment_value
|
||||||
FROM {$dbprefix}labels
|
FROM {$dbprefix}labels
|
||||||
WHERE lid=".$newlid."
|
WHERE lid=".$newlid."
|
||||||
ORDER BY language, sortorder, code";
|
ORDER BY language, sortorder, code";
|
||||||
$result2 = db_execute_num($query2) or safe_die("Died querying labelset $lid<br />$query2<br />".$connect->ErrorMsg());
|
$result2 = db_execute_num($query2) or safe_die("Died querying labelset $lid<br />$query2<br />".$connect->ErrorMsg());
|
||||||
while($row2=$result2->FetchRow())
|
while($row2=$result2->FetchRow())
|
||||||
{
|
{
|
||||||
@@ -527,7 +527,7 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
// GROUPS is DONE
|
// GROUPS is DONE
|
||||||
|
|
||||||
// Import questions
|
// Import questions
|
||||||
if (isset($questionarray) && $questionarray)
|
if (isset($questionarray) && $questionarray)
|
||||||
{
|
{
|
||||||
foreach ($questionarray as $qa)
|
foreach ($questionarray as $qa)
|
||||||
{
|
{
|
||||||
@@ -578,9 +578,9 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
elseif ($questionrowdata['type']=='Z')
|
elseif ($questionrowdata['type']=='Z')
|
||||||
{
|
{
|
||||||
$questionrowdata['type']='L';
|
$questionrowdata['type']='L';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($questionrowdata["question_order"]) || $questionrowdata["question_order"]=='') {$questionrowdata["question_order"]=0;}
|
if (!isset($questionrowdata["question_order"]) || $questionrowdata["question_order"]=='') {$questionrowdata["question_order"]=0;}
|
||||||
|
|
||||||
$questionrowdata=array_map('convertCsvreturn2return', $questionrowdata);
|
$questionrowdata=array_map('convertCsvreturn2return', $questionrowdata);
|
||||||
|
|
||||||
@@ -591,7 +591,7 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
|
|
||||||
$newvalues=array_values($questionrowdata);
|
$newvalues=array_values($questionrowdata);
|
||||||
$newvalues=array_map(array(&$connect, "qstr"),$newvalues); // quote everything accordingly
|
$newvalues=array_map(array(&$connect, "qstr"),$newvalues); // quote everything accordingly
|
||||||
|
|
||||||
if (isset($questionrowdata['qid']))
|
if (isset($questionrowdata['qid']))
|
||||||
{
|
{
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
@@ -606,17 +606,17 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
//GET NEW QID .... if is not done before and we count a question if a new qid is required
|
//GET NEW QID .... if is not done before and we count a question if a new qid is required
|
||||||
if (isset($questionrowdata['qid']))
|
if (isset($questionrowdata['qid']))
|
||||||
{
|
{
|
||||||
$saveqid=$questionrowdata['qid'];
|
$saveqid=$questionrowdata['qid'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$aQIDReplacements[$oldqid]=$connect->Insert_ID("{$dbprefix}questions",'qid');
|
$aQIDReplacements[$oldqid]=$connect->Insert_ID("{$dbprefix}questions",'qid');
|
||||||
$saveqid=$aQIDReplacements[$oldqid];
|
$saveqid=$aQIDReplacements[$oldqid];
|
||||||
}
|
}
|
||||||
$qtypes = getqtypelist("" ,"array");
|
$qtypes = getqtypelist("" ,"array");
|
||||||
$aSQIDReplacements=array();
|
$aSQIDReplacements=array();
|
||||||
db_switchIDInsert('questions',false);
|
db_switchIDInsert('questions',false);
|
||||||
|
|
||||||
// Now we will fix up old label sets where they are used as answers
|
// Now we will fix up old label sets where they are used as answers
|
||||||
if ((isset($oldlid1) || isset($oldlid2)) && ($qtypes[$questionrowdata['type']]['answerscales']>0 || $qtypes[$questionrowdata['type']]['subquestions']>1))
|
if ((isset($oldlid1) || isset($oldlid2)) && ($qtypes[$questionrowdata['type']]['answerscales']>0 || $qtypes[$questionrowdata['type']]['subquestions']>1))
|
||||||
{
|
{
|
||||||
@@ -626,11 +626,11 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
{
|
{
|
||||||
if (in_array($labelrow['language'],$aLanguagesSupported))
|
if (in_array($labelrow['language'],$aLanguagesSupported))
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($qtypes[$questionrowdata['type']]['subquestions']<2)
|
if ($qtypes[$questionrowdata['type']]['subquestions']<2)
|
||||||
{
|
{
|
||||||
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value)
|
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value)
|
||||||
VALUES ({$aQIDReplacements[$oldqid]},".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).")";
|
VALUES ({$aQIDReplacements[$oldqid]},".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).")";
|
||||||
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert answer (lid1) <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert answer (lid1) <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -638,19 +638,19 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
if (isset($aSQIDReplacements[$labelrow['code'].'_'.$saveqid])){
|
if (isset($aSQIDReplacements[$labelrow['code'].'_'.$saveqid])){
|
||||||
$fieldname='qid,';
|
$fieldname='qid,';
|
||||||
$data=$aSQIDReplacements[$labelrow['code'].'_'.$saveqid].',';
|
$data=$aSQIDReplacements[$labelrow['code'].'_'.$saveqid].',';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$fieldname='' ;
|
$fieldname='' ;
|
||||||
$data='';
|
$data='';
|
||||||
}
|
}
|
||||||
|
|
||||||
$qinsert = "insert INTO ".db_table_name('questions')." ($fieldname parent_qid,title,question,question_order,language,scale_id,type, sid, gid)
|
$qinsert = "insert INTO ".db_table_name('questions')." ($fieldname parent_qid,title,question,question_order,language,scale_id,type, sid, gid)
|
||||||
VALUES ($data{$aQIDReplacements[$oldqid]},".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",1,'{$questionrowdata['type']}',{$questionrowdata['sid']},{$questionrowdata['gid']})";
|
VALUES ($data{$aQIDReplacements[$oldqid]},".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",1,'{$questionrowdata['type']}',{$questionrowdata['sid']},{$questionrowdata['gid']})";
|
||||||
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert question <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert question <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
||||||
if ($fieldname=='')
|
if ($fieldname=='')
|
||||||
{
|
{
|
||||||
$aSQIDReplacements[$labelrow['code'].'_'.$saveqid]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
$aSQIDReplacements[$labelrow['code'].'_'.$saveqid]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -662,12 +662,12 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
while($labelrow=$oldlabelsresult->FetchRow())
|
while($labelrow=$oldlabelsresult->FetchRow())
|
||||||
{
|
{
|
||||||
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value,scale_id)
|
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value,scale_id)
|
||||||
VALUES ({$aQIDReplacements[$oldqid]},".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).",1)";
|
VALUES ({$aQIDReplacements[$oldqid]},".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).",1)";
|
||||||
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert answer (lid2)<br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert answer (lid2)<br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Do answers
|
//Do answers
|
||||||
@@ -701,12 +701,12 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
$oldquestion['newtype']=$questiontemp['type'];
|
$oldquestion['newtype']=$questiontemp['type'];
|
||||||
$oldquestion['gid']=$questiontemp['gid'];
|
$oldquestion['gid']=$questiontemp['gid'];
|
||||||
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='L' || $oldquestion['newtype']=='O' || $oldquestion['newtype']=='!'))
|
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='L' || $oldquestion['newtype']=='O' || $oldquestion['newtype']=='!'))
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
$insertdata['qid']=$newqid;
|
$insertdata['qid']=$newqid;
|
||||||
$insertdata['language']=$answerrowdata['language'];
|
$insertdata['language']=$answerrowdata['language'];
|
||||||
$insertdata['defaultvalue']=$answerrowdata['answer'];
|
$insertdata['defaultvalue']=$answerrowdata['answer'];
|
||||||
$query=$connect->GetInsertSQL($dbprefix.'defaultvalues',$insertdata);
|
$query=$connect->GetInsertSQL($dbprefix.'defaultvalues',$insertdata);
|
||||||
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -720,52 +720,52 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
$questionrowdata=array();
|
$questionrowdata=array();
|
||||||
if (isset($aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']])){
|
if (isset($aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']])){
|
||||||
$questionrowdata['qid']=$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']];
|
$questionrowdata['qid']=$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']];
|
||||||
}
|
}
|
||||||
$questionrowdata['parent_qid']=$answerrowdata['qid'];;
|
$questionrowdata['parent_qid']=$answerrowdata['qid'];;
|
||||||
$questionrowdata['sid']=$newsid;
|
$questionrowdata['sid']=$newsid;
|
||||||
$questionrowdata['gid']=$oldquestion['gid'];
|
$questionrowdata['gid']=$oldquestion['gid'];
|
||||||
$questionrowdata['title']=$answerrowdata['code'];
|
$questionrowdata['title']=$answerrowdata['code'];
|
||||||
$questionrowdata['question']=$answerrowdata['answer'];
|
$questionrowdata['question']=$answerrowdata['answer'];
|
||||||
$questionrowdata['question_order']=$answerrowdata['sortorder'];
|
$questionrowdata['question_order']=$answerrowdata['sortorder'];
|
||||||
$questionrowdata['language']=$answerrowdata['language'];
|
$questionrowdata['language']=$answerrowdata['language'];
|
||||||
$questionrowdata['type']=$oldquestion['newtype'];
|
$questionrowdata['type']=$oldquestion['newtype'];
|
||||||
|
|
||||||
$tablename=$dbprefix.'questions';
|
$tablename=$dbprefix.'questions';
|
||||||
$query=$connect->GetInsertSQL($tablename,$questionrowdata);
|
$query=$connect->GetInsertSQL($tablename,$questionrowdata);
|
||||||
if (isset($questionrowdata['qid'])) db_switchIDInsert('questions',true);
|
if (isset($questionrowdata['qid'])) db_switchIDInsert('questions',true);
|
||||||
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert subquestion <br />{$query}<br />".$connect->ErrorMsg());
|
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert subquestion <br />{$query}<br />".$connect->ErrorMsg());
|
||||||
if (!isset($questionrowdata['qid']))
|
if (!isset($questionrowdata['qid']))
|
||||||
{
|
{
|
||||||
$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
db_switchIDInsert('questions',false);
|
db_switchIDInsert('questions',false);
|
||||||
}
|
}
|
||||||
$results['subquestions']++;
|
$results['subquestions']++;
|
||||||
// also convert default values subquestions for multiple choice
|
// also convert default values subquestions for multiple choice
|
||||||
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='M' || $oldquestion['newtype']=='P'))
|
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='M' || $oldquestion['newtype']=='P'))
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
$insertdata['qid']=$newqid;
|
$insertdata['qid']=$newqid;
|
||||||
$insertdata['sqid']=$aSQIDReplacements[$answerrowdata['code']];
|
$insertdata['sqid']=$aSQIDReplacements[$answerrowdata['code']];
|
||||||
$insertdata['language']=$answerrowdata['language'];
|
$insertdata['language']=$answerrowdata['language'];
|
||||||
$insertdata['defaultvalue']='Y';
|
$insertdata['defaultvalue']='Y';
|
||||||
$tablename=$dbprefix.'defaultvalues';
|
$tablename=$dbprefix.'defaultvalues';
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else // insert answers
|
else // insert answers
|
||||||
{
|
{
|
||||||
unset($answerrowdata['default_value']);
|
unset($answerrowdata['default_value']);
|
||||||
$tablename=$dbprefix.'answers';
|
$tablename=$dbprefix.'answers';
|
||||||
$query=$connect->GetInsertSQL($tablename,$answerrowdata);
|
$query=$connect->GetInsertSQL($tablename,$answerrowdata);
|
||||||
$ares = $connect->Execute($query) or safe_die ("Error: Failed to insert answer<br />{$query}<br />\n".$connect->ErrorMsg());
|
$ares = $connect->Execute($query) or safe_die ("Error: Failed to insert answer<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['answers']++;
|
$results['answers']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ANSWERS is DONE
|
// ANSWERS is DONE
|
||||||
@@ -784,7 +784,7 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
|
|
||||||
$results['question_attributes']=0;
|
$results['question_attributes']=0;
|
||||||
// Finally the question attributes - it is called just once and only if there was a question
|
// Finally the question attributes - it is called just once and only if there was a question
|
||||||
if (isset($question_attributesarray) && $question_attributesarray)
|
if (isset($question_attributesarray) && $question_attributesarray)
|
||||||
{//ONLY DO THIS IF THERE ARE QUESTION_ATTRIBUES
|
{//ONLY DO THIS IF THERE ARE QUESTION_ATTRIBUES
|
||||||
$fieldorders=convertCSVRowToArray($question_attributesarray[0],',','"');
|
$fieldorders=convertCSVRowToArray($question_attributesarray[0],',','"');
|
||||||
unset($question_attributesarray[0]);
|
unset($question_attributesarray[0]);
|
||||||
@@ -863,17 +863,20 @@ function CSVImportGroup($sFullFilepath, $newsid)
|
|||||||
$results['conditions']++;
|
$results['conditions']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($newsid);
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($newsid);
|
||||||
|
|
||||||
$results['groups']=1;
|
$results['groups']=1;
|
||||||
$results['newgid']=$newgid;
|
$results['newgid']=$newgid;
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function imports a LimeSurvey .lsg question group XML file
|
* This function imports a LimeSurvey .lsg question group XML file
|
||||||
*
|
*
|
||||||
* @param mixed $sFullFilepath The full filepath of the uploaded file
|
* @param mixed $sFullFilepath The full filepath of the uploaded file
|
||||||
* @param mixed $newsid The new survey id - the group will always be added after the last group in the survey
|
* @param mixed $newsid The new survey id - the group will always be added after the last group in the survey
|
||||||
*/
|
*/
|
||||||
function XMLImportGroup($sFullFilepath, $newsid)
|
function XMLImportGroup($sFullFilepath, $newsid)
|
||||||
{
|
{
|
||||||
@@ -883,28 +886,28 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
$sBaseLanguage = GetBaseLanguageFromSurveyID($newsid);
|
$sBaseLanguage = GetBaseLanguageFromSurveyID($newsid);
|
||||||
$aLanguagesSupported[]=$sBaseLanguage; // adds the base language to the list of supported languages
|
$aLanguagesSupported[]=$sBaseLanguage; // adds the base language to the list of supported languages
|
||||||
$aLanguagesSupported=array_merge($aLanguagesSupported,GetAdditionalLanguagesFromSurveyID($newsid));
|
$aLanguagesSupported=array_merge($aLanguagesSupported,GetAdditionalLanguagesFromSurveyID($newsid));
|
||||||
|
|
||||||
$xml = @simplexml_load_file($sFullFilepath);
|
$xml = @simplexml_load_file($sFullFilepath);
|
||||||
if ($xml==false || $xml->LimeSurveyDocType!='Group') safe_die('This is not a valid LimeSurvey group structure XML file.');
|
if ($xml==false || $xml->LimeSurveyDocType!='Group') safe_die('This is not a valid LimeSurvey group structure XML file.');
|
||||||
$dbversion = (int) $xml->DBVersion;
|
$dbversion = (float) $xml->DBVersion;
|
||||||
$aQIDReplacements=array();
|
$aQIDReplacements=array();
|
||||||
$results['defaultvalues']=0;
|
$results['defaultvalues']=0;
|
||||||
$results['answers']=0;
|
$results['answers']=0;
|
||||||
$results['question_attributes']=0;
|
$results['question_attributes']=0;
|
||||||
$results['subquestions']=0;
|
$results['subquestions']=0;
|
||||||
$results['conditions']=0;
|
$results['conditions']=0;
|
||||||
$results['groups']=0;
|
$results['groups']=0;
|
||||||
|
|
||||||
$importlanguages=array();
|
$importlanguages=array();
|
||||||
foreach ($xml->languages->language as $language)
|
foreach ($xml->languages->language as $language)
|
||||||
{
|
{
|
||||||
$importlanguages[]=(string)$language;
|
$importlanguages[]=(string)$language;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($sBaseLanguage,$importlanguages))
|
if (!in_array($sBaseLanguage,$importlanguages))
|
||||||
{
|
{
|
||||||
$results['fatalerror'] = $clang->gT("The languages of the imported group file must at least include the base language of this survey.");
|
$results['fatalerror'] = $clang->gT("The languages of the imported group file must at least include the base language of this survey.");
|
||||||
return;
|
return $results;
|
||||||
}
|
}
|
||||||
// First get an overview of fieldnames - it's not useful for the moment but might be with newer versions
|
// First get an overview of fieldnames - it's not useful for the moment but might be with newer versions
|
||||||
/*
|
/*
|
||||||
@@ -913,14 +916,14 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
{
|
{
|
||||||
$fieldnames[]=(string)$fieldname;
|
$fieldnames[]=(string)$fieldname;
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
|
|
||||||
// Import group table ===================================================================================
|
// Import group table ===================================================================================
|
||||||
|
|
||||||
$tablename=$dbprefix.'groups';
|
$tablename=$dbprefix.'groups';
|
||||||
|
|
||||||
$newgrouporder=$connect->GetOne("SELECT MAX(group_order) AS maxqo FROM ".db_table_name('groups')." WHERE sid=$newsid");
|
$newgrouporder=$connect->GetOne("SELECT MAX(group_order) AS maxqo FROM ".db_table_name('groups')." WHERE sid=$newsid");
|
||||||
if (is_null($newgrouporder))
|
if (is_null($newgrouporder))
|
||||||
{
|
{
|
||||||
$newgrouporder=0;
|
$newgrouporder=0;
|
||||||
}
|
}
|
||||||
@@ -929,7 +932,7 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
}
|
}
|
||||||
foreach ($xml->groups->rows->row as $row)
|
foreach ($xml->groups->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -942,16 +945,16 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
// now translate any links
|
// now translate any links
|
||||||
$insertdata['group_name']=translink('survey', $oldsid, $newsid, $insertdata['group_name']);
|
$insertdata['group_name']=translink('survey', $oldsid, $newsid, $insertdata['group_name']);
|
||||||
$insertdata['description']=translink('survey', $oldsid, $newsid, $insertdata['description']);
|
$insertdata['description']=translink('survey', $oldsid, $newsid, $insertdata['description']);
|
||||||
// Insert the new question
|
// Insert the new question
|
||||||
if (isset($aGIDReplacements[$oldgid]))
|
if (isset($aGIDReplacements[$oldgid]))
|
||||||
{
|
{
|
||||||
$insertdata['gid']=$aGIDReplacements[$oldgid];
|
$insertdata['gid']=$aGIDReplacements[$oldgid];
|
||||||
db_switchIDInsert('groups',true);
|
db_switchIDInsert('groups',true);
|
||||||
}
|
}
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['groups']++;
|
$results['groups']++;
|
||||||
|
|
||||||
if (!isset($aGIDReplacements[$oldgid]))
|
if (!isset($aGIDReplacements[$oldgid]))
|
||||||
{
|
{
|
||||||
$newgid=$connect->Insert_ID($tablename,"gid"); // save this for later
|
$newgid=$connect->Insert_ID($tablename,"gid"); // save this for later
|
||||||
@@ -962,58 +965,61 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
db_switchIDInsert('groups',false);
|
db_switchIDInsert('groups',false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Import questions table ===================================================================================
|
// Import questions table ===================================================================================
|
||||||
|
|
||||||
// We have to run the question table data two times - first to find all main questions
|
// We have to run the question table data two times - first to find all main questions
|
||||||
// then for subquestions (because we need to determine the new qids for the main questions first)
|
// then for subquestions (because we need to determine the new qids for the main questions first)
|
||||||
$tablename=$dbprefix.'questions';
|
$tablename=$dbprefix.'questions';
|
||||||
$results['questions']=0;
|
$results['questions']=0;
|
||||||
foreach ($xml->questions->rows->row as $row)
|
if (isset($xml->questions))
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
foreach ($xml->questions->rows->row as $row)
|
||||||
foreach ($row as $key=>$value)
|
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata=array();
|
||||||
}
|
foreach ($row as $key=>$value)
|
||||||
$oldsid=$insertdata['sid'];
|
{
|
||||||
$insertdata['sid']=$newsid;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
if (!isset($aGIDReplacements[$insertdata['gid']]) || trim($insertdata['title'])=='') continue; // Skip questions with invalid group id
|
}
|
||||||
$insertdata['gid']=$aGIDReplacements[$insertdata['gid']];
|
$oldsid=$insertdata['sid'];
|
||||||
$oldqid=$insertdata['qid']; unset($insertdata['qid']); // save the old qid
|
$insertdata['sid']=$newsid;
|
||||||
|
if (!isset($aGIDReplacements[$insertdata['gid']]) || trim($insertdata['title'])=='') continue; // Skip questions with invalid group id
|
||||||
|
$insertdata['gid']=$aGIDReplacements[$insertdata['gid']];
|
||||||
|
$oldqid=$insertdata['qid']; unset($insertdata['qid']); // save the old qid
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$insertdata['title']=translink('survey', $oldsid, $newsid, $insertdata['title']);
|
$insertdata['title']=translink('survey', $oldsid, $newsid, $insertdata['title']);
|
||||||
$insertdata['question']=translink('survey', $oldsid, $newsid, $insertdata['question']);
|
$insertdata['question']=translink('survey', $oldsid, $newsid, $insertdata['question']);
|
||||||
$insertdata['help']=translink('survey', $oldsid, $newsid, $insertdata['help']);
|
$insertdata['help']=translink('survey', $oldsid, $newsid, $insertdata['help']);
|
||||||
// Insert the new question
|
// Insert the new question
|
||||||
if (isset($aQIDReplacements[$oldqid]))
|
if (isset($aQIDReplacements[$oldqid]))
|
||||||
{
|
{
|
||||||
$insertdata['qid']=$aQIDReplacements[$oldqid];
|
$insertdata['qid']=$aQIDReplacements[$oldqid];
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
}
|
}
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
if (!isset($aQIDReplacements[$oldqid]))
|
if (!isset($aQIDReplacements[$oldqid]))
|
||||||
{
|
{
|
||||||
$newqid=$connect->Insert_ID($tablename,"qid"); // save this for later
|
$newqid=$connect->Insert_ID($tablename,"qid"); // save this for later
|
||||||
$aQIDReplacements[$oldqid]=$newqid; // add old and new qid to the mapping array
|
$aQIDReplacements[$oldqid]=$newqid; // add old and new qid to the mapping array
|
||||||
$results['questions']++;
|
$results['questions']++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
db_switchIDInsert('questions',false);
|
db_switchIDInsert('questions',false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Import subquestions --------------------------------------------------------------
|
// Import subquestions --------------------------------------------------------------
|
||||||
if (isset($xml->subquestions))
|
if (isset($xml->subquestions))
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach ($xml->subquestions->rows->row as $row)
|
foreach ($xml->subquestions->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -1028,18 +1034,18 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
// now translate any links
|
// now translate any links
|
||||||
$insertdata['title']=translink('survey', $oldsid, $newsid, $insertdata['title']);
|
$insertdata['title']=translink('survey', $oldsid, $newsid, $insertdata['title']);
|
||||||
$insertdata['question']=translink('survey', $oldsid, $newsid, $insertdata['question']);
|
$insertdata['question']=translink('survey', $oldsid, $newsid, $insertdata['question']);
|
||||||
$insertdata['help']=translink('survey', $oldsid, $newsid, $insertdata['help']);
|
$insertdata['help']=(isset($insertdata['help']) ? translink('survey', $oldsid, $newsid, $insertdata['help']) : '');
|
||||||
if (isset($aQIDReplacements[$oldsqid])){
|
if (isset($aQIDReplacements[$oldsqid])){
|
||||||
$insertdata['qid']=$aQIDReplacements[$oldsqid];
|
$insertdata['qid']=$aQIDReplacements[$oldsqid];
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$newsqid=$connect->Insert_ID($tablename,"qid"); // save this for later
|
$newsqid=$connect->Insert_ID($tablename,"qid"); // save this for later
|
||||||
if (!isset($insertdata['qid']))
|
if (!isset($insertdata['qid']))
|
||||||
{
|
{
|
||||||
$aQIDReplacements[$oldsqid]=$newsqid; // add old and new qid to the mapping array
|
$aQIDReplacements[$oldsqid]=$newsqid; // add old and new qid to the mapping array
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1054,33 +1060,33 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
if(isset($xml->answers))
|
if(isset($xml->answers))
|
||||||
{
|
{
|
||||||
$tablename=$dbprefix.'answers';
|
$tablename=$dbprefix.'answers';
|
||||||
|
|
||||||
foreach ($xml->answers->rows->row as $row)
|
foreach ($xml->answers->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
}
|
}
|
||||||
if (!isset($aQIDReplacements[(int)$insertdata['qid']])) continue; // Skip questions with invalid group id
|
if (!isset($aQIDReplacements[(int)$insertdata['qid']])) continue; // Skip questions with invalid group id
|
||||||
|
|
||||||
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the parent_qid
|
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the parent_qid
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['answers']++;
|
$results['answers']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Import questionattributes --------------------------------------------------------------
|
// Import questionattributes --------------------------------------------------------------
|
||||||
if(isset($xml->question_attributes))
|
if(isset($xml->question_attributes))
|
||||||
{
|
{
|
||||||
$tablename=$dbprefix.'question_attributes';
|
$tablename=$dbprefix.'question_attributes';
|
||||||
|
|
||||||
foreach ($xml->question_attributes->rows->row as $row)
|
foreach ($xml->question_attributes->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -1090,44 +1096,51 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the parent_qid
|
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the parent_qid
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['question_attributes']++;
|
$results['question_attributes']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Import defaultvalues --------------------------------------------------------------
|
// Import defaultvalues --------------------------------------------------------------
|
||||||
if(isset($xml->defaultvalues))
|
if(isset($xml->defaultvalues))
|
||||||
{
|
{
|
||||||
$tablename=$dbprefix.'defaultvalues';
|
$tablename=$dbprefix.'defaultvalues';
|
||||||
|
|
||||||
$results['defaultvalues']=0;
|
$results['defaultvalues']=0;
|
||||||
foreach ($xml->defaultvalues->rows->row as $row)
|
foreach ($xml->defaultvalues->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
}
|
}
|
||||||
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the qid
|
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the qid
|
||||||
$insertdata['sqid']=$aQIDReplacements[(int)$insertdata['sqid']]; // remap the subqeustion id
|
if (!isset($aQIDReplacements[(int)$insertdata['sqid']]) || is_null($aQIDReplacements[(int)$insertdata['sqid']]))
|
||||||
|
{
|
||||||
|
$insertdata['sqid'] = 0; // defaults for non-array types
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$insertdata['sqid']=$aQIDReplacements[(int)$insertdata['sqid']]; // remap the subqeustion id
|
||||||
|
}
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />\$query<br />\n".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />". $query. "<br />\n".$connect->ErrorMsg());
|
||||||
$results['defaultvalues']++;
|
$results['defaultvalues']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Import conditions --------------------------------------------------------------
|
// Import conditions --------------------------------------------------------------
|
||||||
if(isset($xml->conditions))
|
if(isset($xml->conditions))
|
||||||
{
|
{
|
||||||
$tablename=$dbprefix.'conditions';
|
$tablename=$dbprefix.'conditions';
|
||||||
|
|
||||||
foreach ($xml->conditions->rows->row as $row)
|
foreach ($xml->conditions->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -1165,16 +1178,18 @@ function XMLImportGroup($sFullFilepath, $newsid)
|
|||||||
if (trim($insertdata["method"])=='')
|
if (trim($insertdata["method"])=='')
|
||||||
{
|
{
|
||||||
$insertdata["method"]='==';
|
$insertdata["method"]='==';
|
||||||
}
|
}
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />\$query<br />\n".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />\$query<br />\n".$connect->ErrorMsg());
|
||||||
$results['conditions']++;
|
$results['conditions']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::RevertUpgradeConditionsToRelevance($newsid);
|
||||||
|
LimeExpressionManager::UpgradeConditionsToRelevance($newsid);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$results['newgid']=$newgid;
|
$results['newgid']=$newgid;
|
||||||
$results['labelsets']=0;
|
$results['labelsets']=0;
|
||||||
$results['labels']=0;
|
$results['labels']=0;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: importlabel.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: importlabel.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Ensure script is not run directly, avoid path disclosure
|
//Ensure script is not run directly, avoid path disclosure
|
||||||
@@ -57,39 +57,38 @@ elseif (strtolower($sExtension)=='lsl')
|
|||||||
$importlabeloutput .= "<input type='submit' value='".$clang->gT("Return to label set administration")."' onclick=\"window.open('$scriptname?action=labels', '_self')\" />\n";
|
$importlabeloutput .= "<input type='submit' value='".$clang->gT("Return to label set administration")."' onclick=\"window.open('$scriptname?action=labels', '_self')\" />\n";
|
||||||
$importlabeloutput .= "</div><br />\n";
|
$importlabeloutput .= "</div><br />\n";
|
||||||
}
|
}
|
||||||
unlink($sFullFilepath);
|
unlink($sFullFilepath);
|
||||||
|
|
||||||
if (isset($aImportResults))
|
if (isset($aImportResults))
|
||||||
{
|
{
|
||||||
if (count($aImportResults['warnings'])>0)
|
if (isset($aImportResults['fatalerror']))
|
||||||
{
|
|
||||||
$importlabeloutput .= "<br />\n<div class='warningheader'>".$clang->gT("Warnings")."</div><ul>\n";
|
|
||||||
foreach ($aImportResults['warnings'] as $warning)
|
|
||||||
{
|
{
|
||||||
$importlabeloutput .= '<li>'.$warning.'</li>';
|
$importlabeloutput .= "<br />\n<div class='warningheader'>".$clang->gT("Error")."</div>
|
||||||
}
|
<p>{$aImportResults['fatalerror']}<br>";
|
||||||
$importlabeloutput .= "</ul>\n";
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (count($aImportResults['warnings'])>0)
|
||||||
|
{
|
||||||
|
$importlabeloutput .= "<br />\n<div class='warningheader'>".$clang->gT("Warnings")."</div><ul>\n";
|
||||||
|
foreach ($aImportResults['warnings'] as $warning)
|
||||||
|
{
|
||||||
|
$importlabeloutput .= '<li>'.$warning.'</li>';
|
||||||
|
}
|
||||||
|
$importlabeloutput .= "</ul>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$importlabeloutput .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br />\n";
|
||||||
|
$importlabeloutput .= "<strong><u>".$clang->gT("Label set import summary")."</u></strong><br />\n";
|
||||||
|
$importlabeloutput .= "<ul style=\"text-align:left;\">\n\t<li>".$clang->gT("Label sets").": {$aImportResults['labelsets']}</li>\n";
|
||||||
|
$importlabeloutput .= "\t<li>".$clang->gT("Labels").": {$aImportResults['labels']}</li></ul>\n";
|
||||||
|
$importlabeloutput .= "<p><strong>".$clang->gT("Import of label set(s) is completed.")."</strong><br /><br />\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
$importlabeloutput .= "<input type='submit' value='".$clang->gT("Return to label set administration")."' onclick=\"window.open('$scriptname?action=labels', '_self')\" />\n";
|
||||||
|
$importlabeloutput .= "</p></div><br />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$importlabeloutput .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br />\n";
|
|
||||||
$importlabeloutput .= "<strong><u>".$clang->gT("Label set import summary")."</u></strong><br />\n";
|
|
||||||
$importlabeloutput .= "<ul style=\"text-align:left;\">\n\t<li>".$clang->gT("Label sets").": {$aImportResults['labelsets']}</li>\n";
|
|
||||||
$importlabeloutput .= "\t<li>".$clang->gT("Labels").": {$aImportResults['labels']}</li></ul>\n";
|
|
||||||
$importlabeloutput .= "<p><strong>".$clang->gT("Import of label set(s) is completed.")."</strong><br /><br />\n";
|
|
||||||
$importlabeloutput .= "<input type='submit' value='".$clang->gT("Return to label set administration")."' onclick=\"window.open('$scriptname?action=labels', '_self')\" />\n";
|
|
||||||
$importlabeloutput .= "</div><br />\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$importlabeloutput .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br />\n";
|
|
||||||
$importlabeloutput .= "<strong><u>".$clang->gT("Label set import summary")."</u></strong><br />\n";
|
|
||||||
$importlabeloutput .= "<ul style=\"text-align:left;\">\n\t<li>".$clang->gT("Label sets").": {$aImportResults['labelsets']}</li>\n";
|
|
||||||
$importlabeloutput .= "\t<li>".$clang->gT("Labels").": {$aImportResults['labels']}</li></ul>\n";
|
|
||||||
$importlabeloutput .= "<p><strong>".$clang->gT("Import of label set(s) is completed.")."</strong><br /><br />\n";
|
|
||||||
$importlabeloutput .= "<input type='submit' value='".$clang->gT("Return to label set administration")."' onclick=\"window.open('$scriptname?action=labels', '_self')\" />\n";
|
|
||||||
$importlabeloutput .= "</div><br />\n";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// IF WE GOT THIS FAR, THEN THE FILE HAS BEEN UPLOADED SUCCESFULLY
|
// IF WE GOT THIS FAR, THEN THE FILE HAS BEEN UPLOADED SUCCESFULLY
|
||||||
function CSVImportLabelset($sFullFilepath, $options)
|
function CSVImportLabelset($sFullFilepath, $options)
|
||||||
@@ -110,7 +109,8 @@ function CSVImportLabelset($sFullFilepath, $options)
|
|||||||
fclose($handle);
|
fclose($handle);
|
||||||
if (substr($bigarray[0], 0, 27) != "# LimeSurvey Label Set Dump" && substr($bigarray[0], 0, 28) != "# PHPSurveyor Label Set Dump")
|
if (substr($bigarray[0], 0, 27) != "# LimeSurvey Label Set Dump" && substr($bigarray[0], 0, 28) != "# PHPSurveyor Label Set Dump")
|
||||||
{
|
{
|
||||||
return $results['fatalerror']=$clang->gT("This file is not a LimeSurvey label set file. Import failed.");
|
$results['fatalerror']=$clang->gT("This file is not a LimeSurvey label set file. Import failed.");
|
||||||
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i=0; $i<9; $i++) //skipping the first lines that are not needed
|
for ($i=0; $i<9; $i++) //skipping the first lines that are not needed
|
||||||
@@ -178,7 +178,7 @@ function CSVImportLabelset($sFullFilepath, $options)
|
|||||||
$newvalues=array_map(array(&$connect, "qstr"),$newvalues); // quote everything accordingly
|
$newvalues=array_map(array(&$connect, "qstr"),$newvalues); // quote everything accordingly
|
||||||
$lsainsert = "insert INTO {$dbprefix}labelsets (".implode(',',array_keys($labelsetrowdata)).") VALUES (".implode(',',$newvalues).")"; //handle db prefix
|
$lsainsert = "insert INTO {$dbprefix}labelsets (".implode(',',array_keys($labelsetrowdata)).") VALUES (".implode(',',$newvalues).")"; //handle db prefix
|
||||||
$lsiresult=$connect->Execute($lsainsert);
|
$lsiresult=$connect->Execute($lsainsert);
|
||||||
$results['labelsets']++;
|
$results['labelsets']++;
|
||||||
|
|
||||||
// Get the new insert id for the labels inside this labelset
|
// Get the new insert id for the labels inside this labelset
|
||||||
$newlid=$connect->Insert_ID("{$dbprefix}labelsets",'lid');
|
$newlid=$connect->Insert_ID("{$dbprefix}labelsets",'lid');
|
||||||
@@ -193,7 +193,7 @@ function CSVImportLabelset($sFullFilepath, $options)
|
|||||||
// Combine into one array with keys and values since its easier to handle
|
// Combine into one array with keys and values since its easier to handle
|
||||||
$labelrowdata=array_combine($lfieldorders,$lfieldcontents);
|
$labelrowdata=array_combine($lfieldorders,$lfieldcontents);
|
||||||
$labellid=$labelrowdata['lid'];
|
$labellid=$labelrowdata['lid'];
|
||||||
|
|
||||||
if ($labellid == $oldlid) {
|
if ($labellid == $oldlid) {
|
||||||
$labelrowdata['lid']=$newlid;
|
$labelrowdata['lid']=$newlid;
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ function CSVImportLabelset($sFullFilepath, $options)
|
|||||||
$result=$connect->Execute($query) or safe_die("Couldn't delete labelset<br />$query<br />".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die("Couldn't delete labelset<br />$query<br />".$connect->ErrorMsg());
|
||||||
$newlid=$lsmatch;
|
$newlid=$lsmatch;
|
||||||
$results['warnings'][]=$clang->gT("Label set was not imported because the same label set already exists.")." ".sprintf($clang->gT("Existing LID: %s"),$newlid);
|
$results['warnings'][]=$clang->gT("Label set was not imported because the same label set already exists.")." ".sprintf($clang->gT("Existing LID: %s"),$newlid);
|
||||||
|
|
||||||
}
|
}
|
||||||
//END CHECK FOR DUPLICATES
|
//END CHECK FOR DUPLICATES
|
||||||
}
|
}
|
||||||
@@ -265,23 +265,23 @@ function CSVImportLabelset($sFullFilepath, $options)
|
|||||||
function XMLImportLabelsets($sFullFilepath, $options)
|
function XMLImportLabelsets($sFullFilepath, $options)
|
||||||
{
|
{
|
||||||
global $connect, $dbprefix, $clang;
|
global $connect, $dbprefix, $clang;
|
||||||
|
|
||||||
$xml = simplexml_load_file($sFullFilepath);
|
$xml = simplexml_load_file($sFullFilepath);
|
||||||
if ($xml->LimeSurveyDocType!='Label set') safe_die('This is not a valid LimeSurvey label set structure XML file.');
|
if ($xml->LimeSurveyDocType!='Label set') safe_die('This is not a valid LimeSurvey label set structure XML file.');
|
||||||
$dbversion = (int) $xml->DBVersion;
|
$dbversion = (float) $xml->DBVersion;
|
||||||
$csarray=buildLabelSetCheckSumArray();
|
$csarray=buildLabelSetCheckSumArray();
|
||||||
$aLSIDReplacements=array();
|
$aLSIDReplacements=array();
|
||||||
$results['labelsets']=0;
|
$results['labelsets']=0;
|
||||||
$results['labels']=0;
|
$results['labels']=0;
|
||||||
$results['warnings']=array();
|
$results['warnings']=array();
|
||||||
|
|
||||||
|
|
||||||
// Import labels table ===================================================================================
|
// Import labels table ===================================================================================
|
||||||
|
|
||||||
$tablename=$dbprefix.'labelsets';
|
$tablename=$dbprefix.'labelsets';
|
||||||
foreach ($xml->labelsets->rows->row as $row)
|
foreach ($xml->labelsets->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -289,32 +289,33 @@ function XMLImportLabelsets($sFullFilepath, $options)
|
|||||||
$oldlsid=$insertdata['lid'];
|
$oldlsid=$insertdata['lid'];
|
||||||
unset($insertdata['lid']); // save the old qid
|
unset($insertdata['lid']); // save the old qid
|
||||||
|
|
||||||
// Insert the new question
|
// Insert the new question
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['labelsets']++;
|
$results['labelsets']++;
|
||||||
|
|
||||||
$newlsid=$connect->Insert_ID($tablename,"lid"); // save this for later
|
$newlsid=$connect->Insert_ID($tablename,"lid"); // save this for later
|
||||||
$aLSIDReplacements[$oldlsid]=$newlsid; // add old and new lsid to the mapping array
|
$aLSIDReplacements[$oldlsid]=$newlsid; // add old and new lsid to the mapping array
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Import labels table ===================================================================================
|
// Import labels table ===================================================================================
|
||||||
|
|
||||||
$tablename=$dbprefix.'labels';
|
$tablename=$dbprefix.'labels';
|
||||||
|
if (isset($xml->labels->rows->row))
|
||||||
foreach ($xml->labels->rows->row as $row)
|
foreach ($xml->labels->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
}
|
}
|
||||||
$insertdata['lid']=$aLSIDReplacements[$insertdata['lid']];
|
$insertdata['lid']=$aLSIDReplacements[$insertdata['lid']];
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['labels']++;
|
$results['labels']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK FOR DUPLICATE LABELSETS
|
//CHECK FOR DUPLICATE LABELSETS
|
||||||
|
|
||||||
if (isset($_POST['checkforduplicates']))
|
if (isset($_POST['checkforduplicates']))
|
||||||
@@ -356,12 +357,12 @@ function XMLImportLabelsets($sFullFilepath, $options)
|
|||||||
$results['labelsets']--;
|
$results['labelsets']--;
|
||||||
$newlid=$lsmatch;
|
$newlid=$lsmatch;
|
||||||
$results['warnings'][]=$clang->gT("Label set was not imported because the same label set already exists.")." ".sprintf($clang->gT("Existing LID: %s"),$newlid);
|
$results['warnings'][]=$clang->gT("Label set was not imported because the same label set already exists.")." ".sprintf($clang->gT("Existing LID: %s"),$newlid);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//END CHECK FOR DUPLICATES
|
//END CHECK FOR DUPLICATES
|
||||||
}
|
}
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Closing PHP tag intentionall left out
|
// Closing PHP tag intentionall left out
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: importoldresponses.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: importoldresponses.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ if (!$subaction == "import")
|
|||||||
<div class='header ui-widget-header'>
|
<div class='header ui-widget-header'>
|
||||||
".$clang->gT("Import responses from a deactivated survey table")."
|
".$clang->gT("Import responses from a deactivated survey table")."
|
||||||
</div>
|
</div>
|
||||||
<form id='personalsettings' method='post'>
|
<form id='personalsettings' method='post'>
|
||||||
<ul>
|
<ul>
|
||||||
<li><label for='spansurveyid'>".$clang->gT("Target survey ID:")."</label>
|
<li><label for='spansurveyid'>".$clang->gT("Target survey ID:")."</label>
|
||||||
<span id='spansurveyid'> $surveyid<input type='hidden' value='$surveyid' name='sid'></span>
|
<span id='spansurveyid'> $surveyid<input type='hidden' value='$surveyid' name='sid'></span>
|
||||||
@@ -89,9 +89,9 @@ elseif (isset($surveyid) && $surveyid && isset($oldtable))
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$aFieldsOldTable=array_values($connect->MetaColumnNames($oldtable, true));
|
$aFieldsOldTable=array_values($connect->MetaColumnNames($oldtable, true));
|
||||||
$aFieldsNewTable=array_values($connect->MetaColumnNames($activetable, true));
|
$aFieldsNewTable=array_values($connect->MetaColumnNames($activetable, true));
|
||||||
|
|
||||||
// Only import fields where the fieldnames are matching
|
// Only import fields where the fieldnames are matching
|
||||||
$aValidFields=array_intersect($aFieldsOldTable,$aFieldsNewTable);
|
$aValidFields=array_intersect($aFieldsOldTable,$aFieldsNewTable);
|
||||||
|
|
||||||
@@ -113,17 +113,17 @@ elseif (isset($surveyid) && $surveyid && isset($oldtable))
|
|||||||
$aSRIDConversions[$iOldID]=$connect->Insert_Id($activetable,"id");
|
$aSRIDConversions[$iOldID]=$connect->Insert_Id($activetable,"id");
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['flashmessage'] = sprintf($clang->gT("%s old response(s) were successfully imported."),$iRecordCount);
|
$_SESSION['flashmessage'] = sprintf($clang->gT("%s old response(s) were successfully imported."),$iRecordCount);
|
||||||
|
|
||||||
$sOldTimingsTable=substr($oldtable,0,strrpos($oldtable,'_')).'_timings'.substr($oldtable,strrpos($oldtable,'_'));
|
$sOldTimingsTable=substr($oldtable,0,strrpos($oldtable,'_')).'_timings'.substr($oldtable,strrpos($oldtable,'_'));
|
||||||
$sNewTimingsTable=db_table_name_nq("survey_{$surveyid}_timings");
|
$sNewTimingsTable=db_table_name_nq("survey_{$surveyid}_timings");
|
||||||
if (tableExists(sStripDBPrefix($sOldTimingsTable)) && tableExists(sStripDBPrefix($sNewTimingsTable)) && returnglobal('importtimings')=='Y')
|
if (tableExists(sStripDBPrefix($sOldTimingsTable)) && tableExists(sStripDBPrefix($sNewTimingsTable)) && returnglobal('importtimings')=='Y')
|
||||||
{
|
{
|
||||||
// Import timings
|
// Import timings
|
||||||
$aFieldsOldTimingTable=array_values($connect->MetaColumnNames($sOldTimingsTable, true));
|
$aFieldsOldTimingTable=array_values($connect->MetaColumnNames($sOldTimingsTable, true));
|
||||||
$aFieldsNewTimingTable=array_values($connect->MetaColumnNames($sNewTimingsTable, true));
|
$aFieldsNewTimingTable=array_values($connect->MetaColumnNames($sNewTimingsTable, true));
|
||||||
$aValidTimingFields=array_intersect($aFieldsOldTimingTable,$aFieldsNewTimingTable);
|
$aValidTimingFields=array_intersect($aFieldsOldTimingTable,$aFieldsNewTimingTable);
|
||||||
|
|
||||||
$queryOldValues = "SELECT ".implode(", ",$aValidTimingFields)." FROM {$sOldTimingsTable} ";
|
$queryOldValues = "SELECT ".implode(", ",$aValidTimingFields)." FROM {$sOldTimingsTable} ";
|
||||||
$resultOldValues = db_execute_assoc($queryOldValues) or safe_die("Error:<br />$queryOldValues<br />".$connect->ErrorMsg());
|
$resultOldValues = db_execute_assoc($queryOldValues) or safe_die("Error:<br />$queryOldValues<br />".$connect->ErrorMsg());
|
||||||
$iRecordCountT=$resultOldValues->RecordCount();
|
$iRecordCountT=$resultOldValues->RecordCount();
|
||||||
@@ -132,12 +132,12 @@ elseif (isset($surveyid) && $surveyid && isset($oldtable))
|
|||||||
{
|
{
|
||||||
if (isset($aSRIDConversions[$row['id']]))
|
if (isset($aSRIDConversions[$row['id']]))
|
||||||
{
|
{
|
||||||
$row['id']=$aSRIDConversions[$row['id']];
|
$row['id']=$aSRIDConversions[$row['id']];
|
||||||
}
|
}
|
||||||
$sInsertSQL="INSERT into {$sNewTimingsTable} (".implode(",",array_map("db_quote_id",array_keys($row))).") VALUES (".implode(",",array_map("db_quoteall",array_values($row))).")";
|
$sInsertSQL="INSERT into {$sNewTimingsTable} (".implode(",",array_map("db_quote_id",array_keys($row))).") VALUES (".implode(",",array_map("db_quoteall",array_values($row))).")";
|
||||||
$result = $connect->Execute($sInsertSQL) or safe_die("Error:<br />$sInsertSQL<br />".$connect->ErrorMsg());
|
$result = $connect->Execute($sInsertSQL) or safe_die("Error:<br />$sInsertSQL<br />".$connect->ErrorMsg());
|
||||||
}
|
}
|
||||||
$_SESSION['flashmessage'] = sprintf($clang->gT("%s old response(s) and according timings were successfully imported."),$iRecordCount,$iRecordCountT);
|
$_SESSION['flashmessage'] = sprintf($clang->gT("%s old response(s) and according timings were successfully imported."),$iRecordCount,$iRecordCountT);
|
||||||
}
|
}
|
||||||
$importoldresponsesoutput = browsemenubar($clang->gT("Quick statistics"));
|
$importoldresponsesoutput = browsemenubar($clang->gT("Quick statistics"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: importquestion.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: importquestion.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Ensure script is not run directly, avoid path disclosure
|
//Ensure script is not run directly, avoid path disclosure
|
||||||
@@ -21,7 +21,7 @@ $importquestion .= "<div class='messagebox ui-corner-all'>\n";
|
|||||||
|
|
||||||
$sFullFilepath = $tempdir . DIRECTORY_SEPARATOR . $_FILES['the_file']['name'];
|
$sFullFilepath = $tempdir . DIRECTORY_SEPARATOR . $_FILES['the_file']['name'];
|
||||||
$aPathInfo = pathinfo($sFullFilepath);
|
$aPathInfo = pathinfo($sFullFilepath);
|
||||||
$sExtension = $aPathInfo['extension'];
|
$sExtension = $aPathInfo['extension'];
|
||||||
|
|
||||||
if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $sFullFilepath))
|
if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $sFullFilepath))
|
||||||
{
|
{
|
||||||
@@ -105,7 +105,7 @@ unlink($sFullFilepath);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function imports an old-school question file (*.csv,*.sql)
|
* This function imports an old-school question file (*.csv,*.sql)
|
||||||
*
|
*
|
||||||
* @param mixed $sFullFilepath Full file patch to the import file
|
* @param mixed $sFullFilepath Full file patch to the import file
|
||||||
* @param mixed $newsid Survey ID to which the question is attached
|
* @param mixed $newsid Survey ID to which the question is attached
|
||||||
* @param mixed $newgid Group ID top which the question is attached
|
* @param mixed $newgid Group ID top which the question is attached
|
||||||
@@ -115,10 +115,10 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
global $dbprefix, $connect, $clang;
|
global $dbprefix, $connect, $clang;
|
||||||
$aLIDReplacements=array();
|
$aLIDReplacements=array();
|
||||||
$aQIDReplacements=array(); // this array will have the "new qid" for the questions, the key will be the "old qid"
|
$aQIDReplacements=array(); // this array will have the "new qid" for the questions, the key will be the "old qid"
|
||||||
$aSQIDReplacements=array();
|
$aSQIDReplacements=array();
|
||||||
$results['labelsets']=0;
|
$results['labelsets']=0;
|
||||||
$results['labels']=0;
|
$results['labels']=0;
|
||||||
|
|
||||||
$handle = fopen($sFullFilepath, "r");
|
$handle = fopen($sFullFilepath, "r");
|
||||||
while (!feof($handle))
|
while (!feof($handle))
|
||||||
{
|
{
|
||||||
@@ -141,7 +141,7 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$results['fatalerror'] = $clang->gT("This file is not a LimeSurvey question file. Import failed.");
|
$results['fatalerror'] = $clang->gT("This file is not a LimeSurvey question file. Import failed.");
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int)$importversion<112)
|
if ((int)$importversion<112)
|
||||||
{
|
{
|
||||||
$results['fatalerror'] = $clang->gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
|
$results['fatalerror'] = $clang->gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
|
||||||
@@ -270,7 +270,7 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
|
|
||||||
|
|
||||||
// Let's check that imported objects support at least the survey's baselang
|
// Let's check that imported objects support at least the survey's baselang
|
||||||
|
|
||||||
if (isset($questionarray))
|
if (isset($questionarray))
|
||||||
{
|
{
|
||||||
$langfieldnum = array_search("language", $questionfieldnames);
|
$langfieldnum = array_search("language", $questionfieldnames);
|
||||||
@@ -294,9 +294,9 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
{
|
{
|
||||||
$results['fatalerror']=$clang->gT("You can't import answers which doesn't support at least the survey base language.");
|
$results['fatalerror']=$clang->gT("You can't import answers which doesn't support at least the survey base language.");
|
||||||
return $results;
|
return $results;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($countlabelsets > 0)
|
if ($countlabelsets > 0)
|
||||||
@@ -374,7 +374,7 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$query2 = "SELECT code, title, sortorder, language, assessment_value
|
$query2 = "SELECT code, title, sortorder, language, assessment_value
|
||||||
FROM {$dbprefix}labels
|
FROM {$dbprefix}labels
|
||||||
WHERE lid=".$newlid."
|
WHERE lid=".$newlid."
|
||||||
ORDER BY language, sortorder, code";
|
ORDER BY language, sortorder, code";
|
||||||
$result2 = db_execute_num($query2) or safe_die("Died querying labelset $lid<br />$query2<br />".$connect->ErrorMsg());
|
$result2 = db_execute_num($query2) or safe_die("Died querying labelset $lid<br />$query2<br />".$connect->ErrorMsg());
|
||||||
while($row2=$result2->FetchRow())
|
while($row2=$result2->FetchRow())
|
||||||
{
|
{
|
||||||
@@ -423,16 +423,16 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
{
|
{
|
||||||
$newquestionorder=0;
|
$newquestionorder=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$newquestionorder++;
|
$newquestionorder++;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($questionarray as $qa)
|
foreach ($questionarray as $qa)
|
||||||
{
|
{
|
||||||
$qacfieldcontents=convertCSVRowToArray($qa,',','"');
|
$qacfieldcontents=convertCSVRowToArray($qa,',','"');
|
||||||
$questionrowdata=array_combine($questionfieldnames,$qacfieldcontents);
|
$questionrowdata=array_combine($questionfieldnames,$qacfieldcontents);
|
||||||
|
|
||||||
// Skip not supported languages
|
// Skip not supported languages
|
||||||
if (!in_array($questionrowdata['language'],$aLanguagesSupported))
|
if (!in_array($questionrowdata['language'],$aLanguagesSupported))
|
||||||
continue;
|
continue;
|
||||||
@@ -467,7 +467,7 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$oldquestion['lid2']=(int)$questionrowdata['lid1'];
|
$oldquestion['lid2']=(int)$questionrowdata['lid1'];
|
||||||
}
|
}
|
||||||
$oldquestion['oldtype']=$questionrowdata['type'];
|
$oldquestion['oldtype']=$questionrowdata['type'];
|
||||||
|
|
||||||
// Unset label set IDs and convert question types
|
// Unset label set IDs and convert question types
|
||||||
unset($questionrowdata['lid']);
|
unset($questionrowdata['lid']);
|
||||||
unset($questionrowdata['lid1']);
|
unset($questionrowdata['lid1']);
|
||||||
@@ -478,16 +478,16 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
elseif ($questionrowdata['type']=='Z')
|
elseif ($questionrowdata['type']=='Z')
|
||||||
{
|
{
|
||||||
$questionrowdata['type']='L';
|
$questionrowdata['type']='L';
|
||||||
}
|
}
|
||||||
$oldquestion['newtype']=$questionrowdata['type'];
|
$oldquestion['newtype']=$questionrowdata['type'];
|
||||||
|
|
||||||
$questionrowdata=array_map('convertCsvreturn2return', $questionrowdata);
|
$questionrowdata=array_map('convertCsvreturn2return', $questionrowdata);
|
||||||
|
|
||||||
// translate internal links
|
// translate internal links
|
||||||
$questionrowdata['title']=translink('survey', $oldsid, $newsid, $questionrowdata['title']);
|
$questionrowdata['title']=translink('survey', $oldsid, $newsid, $questionrowdata['title']);
|
||||||
$questionrowdata['question']=translink('survey', $oldsid, $newsid, $questionrowdata['question']);
|
$questionrowdata['question']=translink('survey', $oldsid, $newsid, $questionrowdata['question']);
|
||||||
$questionrowdata['help']=translink('survey', $oldsid, $newsid, $questionrowdata['help']);
|
$questionrowdata['help']=translink('survey', $oldsid, $newsid, $questionrowdata['help']);
|
||||||
|
|
||||||
$newvalues=array_values($questionrowdata);
|
$newvalues=array_values($questionrowdata);
|
||||||
$newvalues=array_map(array(&$connect, "qstr"),$newvalues); // quote everything accordingly
|
$newvalues=array_map(array(&$connect, "qstr"),$newvalues); // quote everything accordingly
|
||||||
$qinsert = "INSERT INTO {$dbprefix}questions (".implode(',',array_keys($questionrowdata)).") VALUES (".implode(',',$newvalues).")";
|
$qinsert = "INSERT INTO {$dbprefix}questions (".implode(',',array_keys($questionrowdata)).") VALUES (".implode(',',$newvalues).")";
|
||||||
@@ -502,13 +502,13 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
{
|
{
|
||||||
db_switchIDInsert('questions',false);
|
db_switchIDInsert('questions',false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$qtypes = getqtypelist("" ,"array");
|
$qtypes = getqtypelist("" ,"array");
|
||||||
$results['answers']=0;
|
$results['answers']=0;
|
||||||
$results['subquestions']=0;
|
$results['subquestions']=0;
|
||||||
|
|
||||||
|
|
||||||
// Now we will fix up old label sets where they are used as answers
|
// Now we will fix up old label sets where they are used as answers
|
||||||
if ((isset($oldquestion['lid1']) || isset($oldquestion['lid2'])) && ($qtypes[$oldquestion['newtype']]['answerscales']>0 || $qtypes[$oldquestion['newtype']]['subquestions']>1))
|
if ((isset($oldquestion['lid1']) || isset($oldquestion['lid2'])) && ($qtypes[$oldquestion['newtype']]['answerscales']>0 || $qtypes[$oldquestion['newtype']]['subquestions']>1))
|
||||||
{
|
{
|
||||||
@@ -517,13 +517,13 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
while($labelrow=$oldlabelsresult->FetchRow())
|
while($labelrow=$oldlabelsresult->FetchRow())
|
||||||
{
|
{
|
||||||
if (in_array($labelrow['language'],$aLanguagesSupported)){
|
if (in_array($labelrow['language'],$aLanguagesSupported)){
|
||||||
|
|
||||||
if ($qtypes[$oldquestion['newtype']]['subquestions']<2)
|
if ($qtypes[$oldquestion['newtype']]['subquestions']<2)
|
||||||
{
|
{
|
||||||
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value,scale_id)
|
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value,scale_id)
|
||||||
VALUES ($newqid,".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).",0)";
|
VALUES ($newqid,".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).",0)";
|
||||||
$qres = $connect->Execute($qinsert) or safe_die ("Error: Failed to insert answer <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($qinsert) or safe_die ("Error: Failed to insert answer <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
||||||
$results['answers']++;
|
$results['answers']++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -531,28 +531,28 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$fieldname='qid,';
|
$fieldname='qid,';
|
||||||
$data=$aSQIDReplacements[$labelrow['code']].',';
|
$data=$aSQIDReplacements[$labelrow['code']].',';
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$fieldname='' ;
|
$fieldname='' ;
|
||||||
$data='';
|
$data='';
|
||||||
}
|
}
|
||||||
|
|
||||||
$qinsert = "insert INTO ".db_table_name('questions')." ($fieldname sid,gid,parent_qid,title,question,question_order,language,scale_id,type)
|
$qinsert = "insert INTO ".db_table_name('questions')." ($fieldname sid,gid,parent_qid,title,question,question_order,language,scale_id,type)
|
||||||
VALUES ($data $newsid,$newgid,$newqid,".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",1,".db_quoteall($oldquestion['newtype']).")";
|
VALUES ($data $newsid,$newgid,$newqid,".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",1,".db_quoteall($oldquestion['newtype']).")";
|
||||||
$qres = $connect->Execute($qinsert) or safe_die ("Error: Failed to insert subquestion <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($qinsert) or safe_die ("Error: Failed to insert subquestion <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
||||||
if ($fieldname=='')
|
if ($fieldname=='')
|
||||||
{
|
{
|
||||||
$aSQIDReplacements[$labelrow['code']]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
$aSQIDReplacements[$labelrow['code']]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
db_switchIDInsert('questions',false);
|
db_switchIDInsert('questions',false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($oldquestion['lid2']) && $qtypes[$oldquestion['newtype']]['answerscales']>1)
|
if (isset($oldquestion['lid2']) && $qtypes[$oldquestion['newtype']]['answerscales']>1)
|
||||||
{
|
{
|
||||||
$query="select * from ".db_table_name('labels')." where lid={$aLIDReplacements[$oldquestion['lid2']]}";
|
$query="select * from ".db_table_name('labels')." where lid={$aLIDReplacements[$oldquestion['lid2']]}";
|
||||||
@@ -561,17 +561,17 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
{
|
{
|
||||||
if (in_array($labelrow['language'],$aLanguagesSupported)){
|
if (in_array($labelrow['language'],$aLanguagesSupported)){
|
||||||
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value,scale_id)
|
$qinsert = "insert INTO ".db_table_name('answers')." (qid,code,answer,sortorder,language,assessment_value,scale_id)
|
||||||
VALUES ($newqid,".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).",1)";
|
VALUES ($newqid,".db_quoteall($labelrow['code']).",".db_quoteall($labelrow['title']).",".db_quoteall($labelrow['sortorder']).",".db_quoteall($labelrow['language']).",".db_quoteall($labelrow['assessment_value']).",1)";
|
||||||
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert answer <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($qinsert) or safe_die ($clang->gT("Error").": Failed to insert answer <br />\n$qinsert<br />\n".$connect->ErrorMsg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Do answers
|
//Do answers
|
||||||
if (isset($answerarray) && $answerarray)
|
if (isset($answerarray) && $answerarray)
|
||||||
{
|
{
|
||||||
foreach ($answerarray as $aa)
|
foreach ($answerarray as $aa)
|
||||||
{
|
{
|
||||||
$answerfieldcontents=convertCSVRowToArray($aa,',','"');
|
$answerfieldcontents=convertCSVRowToArray($aa,',','"');
|
||||||
$answerrowdata=array_combine($answerfieldnames,$answerfieldcontents);
|
$answerrowdata=array_combine($answerfieldnames,$answerfieldcontents);
|
||||||
@@ -581,7 +581,7 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
}
|
}
|
||||||
// Skip not supported languages
|
// Skip not supported languages
|
||||||
if (!in_array($answerrowdata['language'],$aLanguagesSupported))
|
if (!in_array($answerrowdata['language'],$aLanguagesSupported))
|
||||||
continue;
|
continue;
|
||||||
$code=$answerrowdata["code"];
|
$code=$answerrowdata["code"];
|
||||||
$thisqid=$answerrowdata["qid"];
|
$thisqid=$answerrowdata["qid"];
|
||||||
$answerrowdata["qid"]=$newqid;
|
$answerrowdata["qid"]=$newqid;
|
||||||
@@ -594,14 +594,14 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
|
|
||||||
// Convert default values for single select questions
|
// Convert default values for single select questions
|
||||||
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='L' || $oldquestion['newtype']=='O' || $oldquestion['newtype']=='!'))
|
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='L' || $oldquestion['newtype']=='O' || $oldquestion['newtype']=='!'))
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
$insertdata['qid']=$newqid;
|
$insertdata['qid']=$newqid;
|
||||||
$insertdata['language']=$answerrowdata['language'];
|
$insertdata['language']=$answerrowdata['language'];
|
||||||
$insertdata['defaultvalue']=$answerrowdata['answer'];
|
$insertdata['defaultvalue']=$answerrowdata['answer'];
|
||||||
$query=$connect->GetInsertSQL($dbprefix.'defaultvalues',$insertdata);
|
$query=$connect->GetInsertSQL($dbprefix.'defaultvalues',$insertdata);
|
||||||
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
|
|
||||||
}
|
}
|
||||||
// translate internal links
|
// translate internal links
|
||||||
$answerrowdata['answer']=translink('survey', $oldsid, $newsid, $answerrowdata['answer']);
|
$answerrowdata['answer']=translink('survey', $oldsid, $newsid, $answerrowdata['answer']);
|
||||||
@@ -614,7 +614,7 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
if (isset($aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']])){
|
if (isset($aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']])){
|
||||||
$questionrowdata['qid']=$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']];
|
$questionrowdata['qid']=$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']];
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
}
|
}
|
||||||
$questionrowdata['parent_qid']=$answerrowdata['qid'];
|
$questionrowdata['parent_qid']=$answerrowdata['qid'];
|
||||||
$questionrowdata['sid']=$newsid;
|
$questionrowdata['sid']=$newsid;
|
||||||
$questionrowdata['gid']=$newgid;
|
$questionrowdata['gid']=$newgid;
|
||||||
@@ -623,13 +623,13 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$questionrowdata['question_order']=$answerrowdata['sortorder'];
|
$questionrowdata['question_order']=$answerrowdata['sortorder'];
|
||||||
$questionrowdata['language']=$answerrowdata['language'];
|
$questionrowdata['language']=$answerrowdata['language'];
|
||||||
$questionrowdata['type']=$oldquestion['newtype'];
|
$questionrowdata['type']=$oldquestion['newtype'];
|
||||||
|
|
||||||
$tablename=$dbprefix.'questions';
|
$tablename=$dbprefix.'questions';
|
||||||
$query=$connect->GetInsertSQL($tablename,$questionrowdata);
|
$query=$connect->GetInsertSQL($tablename,$questionrowdata);
|
||||||
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert question <br />{$query}<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert question <br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
if (!isset($questionrowdata['qid']))
|
if (!isset($questionrowdata['qid']))
|
||||||
{
|
{
|
||||||
$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
$aSQIDReplacements[$answerrowdata['code'].$answerrowdata['qid']]=$connect->Insert_ID("{$dbprefix}questions","qid");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -638,32 +638,32 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$results['subquestions']++;
|
$results['subquestions']++;
|
||||||
// also convert default values subquestions for multiple choice
|
// also convert default values subquestions for multiple choice
|
||||||
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='M' || $oldquestion['newtype']=='P'))
|
if ($answerrowdata['default_value']=='Y' && ($oldquestion['newtype']=='M' || $oldquestion['newtype']=='P'))
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
$insertdata['qid']=$newqid;
|
$insertdata['qid']=$newqid;
|
||||||
$insertdata['sqid']=$aSQIDReplacements[$answerrowdata['code']];
|
$insertdata['sqid']=$aSQIDReplacements[$answerrowdata['code']];
|
||||||
$insertdata['language']=$answerrowdata['language'];
|
$insertdata['language']=$answerrowdata['language'];
|
||||||
$insertdata['defaultvalue']='Y';
|
$insertdata['defaultvalue']='Y';
|
||||||
$tablename=$dbprefix.'defaultvalues';
|
$tablename=$dbprefix.'defaultvalues';
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
$qres = $connect->Execute($query) or safe_die ("Error: Failed to insert defaultvalue <br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else // insert answers
|
else // insert answers
|
||||||
{
|
{
|
||||||
unset($answerrowdata['default_value']);
|
unset($answerrowdata['default_value']);
|
||||||
$tablename=$dbprefix.'answers';
|
$tablename=$dbprefix.'answers';
|
||||||
$query=$connect->GetInsertSQL($tablename,$answerrowdata);
|
$query=$connect->GetInsertSQL($tablename,$answerrowdata);
|
||||||
$ares = $connect->Execute($query) or safe_die ("Error: Failed to insert answer<br />{$query}<br />\n".$connect->ErrorMsg());
|
$ares = $connect->Execute($query) or safe_die ("Error: Failed to insert answer<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['answers']++;
|
$results['answers']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$results['question_attributes']=0;
|
$results['question_attributes']=0;
|
||||||
// Finally the question attributes - it is called just once and only if there was a question
|
// Finally the question attributes - it is called just once and only if there was a question
|
||||||
if (isset($question_attributesarray) && $question_attributesarray)
|
if (isset($question_attributesarray) && $question_attributesarray)
|
||||||
{//ONLY DO THIS IF THERE ARE QUESTION_ATTRIBUES
|
{//ONLY DO THIS IF THERE ARE QUESTION_ATTRIBUES
|
||||||
$fieldorders =convertCSVRowToArray($question_attributesarray[0],',','"');
|
$fieldorders =convertCSVRowToArray($question_attributesarray[0],',','"');
|
||||||
unset($question_attributesarray[0]);
|
unset($question_attributesarray[0]);
|
||||||
@@ -677,24 +677,26 @@ function CSVImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$qainsert=$connect->GetInsertSQL($tablename,$qarowdata);
|
$qainsert=$connect->GetInsertSQL($tablename,$qarowdata);
|
||||||
$result=$connect->Execute($qainsert) or safe_die ("Couldn't insert question_attribute<br />$qainsert<br />".$connect->ErrorMsg());
|
$result=$connect->Execute($qainsert) or safe_die ("Couldn't insert question_attribute<br />$qainsert<br />".$connect->ErrorMsg());
|
||||||
$results['question_attributes']++;
|
$results['question_attributes']++;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
LimeExpressionManager::SetDirtyFlag(); // so refreshes syntax highlighting
|
||||||
|
|
||||||
$results['newqid']=$newqid;
|
$results['newqid']=$newqid;
|
||||||
$results['questions']=1;
|
$results['questions']=1;
|
||||||
$results['newqid']=$newqid;
|
$results['newqid']=$newqid;
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function imports a LimeSurvey .lsq question XML file
|
* This function imports a LimeSurvey .lsq question XML file
|
||||||
*
|
*
|
||||||
* @param mixed $sFullFilepath The full filepath of the uploaded file
|
* @param mixed $sFullFilepath The full filepath of the uploaded file
|
||||||
* @param mixed $newsid The new survey id
|
* @param mixed $newsid The new survey id
|
||||||
* @param mixed $newgid The new question group id -the question will always be added after the last question in the group
|
* @param mixed $newgid The new question group id -the question will always be added after the last question in the group
|
||||||
*/
|
*/
|
||||||
function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
||||||
@@ -705,22 +707,22 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$sBaseLanguage = GetBaseLanguageFromSurveyID($newsid);
|
$sBaseLanguage = GetBaseLanguageFromSurveyID($newsid);
|
||||||
$aLanguagesSupported[]=$sBaseLanguage; // adds the base language to the list of supported languages
|
$aLanguagesSupported[]=$sBaseLanguage; // adds the base language to the list of supported languages
|
||||||
$aLanguagesSupported=array_merge($aLanguagesSupported,GetAdditionalLanguagesFromSurveyID($newsid));
|
$aLanguagesSupported=array_merge($aLanguagesSupported,GetAdditionalLanguagesFromSurveyID($newsid));
|
||||||
|
|
||||||
$xml = simplexml_load_file($sFullFilepath);
|
$xml = simplexml_load_file($sFullFilepath);
|
||||||
if ($xml->LimeSurveyDocType!='Question') safe_die('This is not a valid LimeSurvey question structure XML file.');
|
if ($xml->LimeSurveyDocType!='Question') safe_die('This is not a valid LimeSurvey question structure XML file.');
|
||||||
$dbversion = (int) $xml->DBVersion;
|
$dbversion = (float) $xml->DBVersion;
|
||||||
$aQIDReplacements=array();
|
$aQIDReplacements=array();
|
||||||
$aSQIDReplacements=array(0=>0);
|
$aSQIDReplacements=array(0=>0);
|
||||||
$results['defaultvalues']=0;
|
$results['defaultvalues']=0;
|
||||||
$results['answers']=0;
|
$results['answers']=0;
|
||||||
$results['question_attributes']=0;
|
$results['question_attributes']=0;
|
||||||
$results['subquestions']=0;
|
$results['subquestions']=0;
|
||||||
|
|
||||||
$importlanguages=array();
|
$importlanguages=array();
|
||||||
foreach ($xml->languages->language as $language)
|
foreach ($xml->languages->language as $language)
|
||||||
{
|
{
|
||||||
$importlanguages[]=(string)$language;
|
$importlanguages[]=(string)$language;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($sBaseLanguage,$importlanguages))
|
if (!in_array($sBaseLanguage,$importlanguages))
|
||||||
{
|
{
|
||||||
@@ -734,8 +736,8 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
{
|
{
|
||||||
$fieldnames[]=(string)$fieldname;
|
$fieldnames[]=(string)$fieldname;
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
|
|
||||||
// Import questions table ===================================================================================
|
// Import questions table ===================================================================================
|
||||||
|
|
||||||
// We have to run the question table data two times - first to find all main questions
|
// We have to run the question table data two times - first to find all main questions
|
||||||
@@ -751,7 +753,7 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
}
|
}
|
||||||
foreach ($xml->questions->rows->row as $row)
|
foreach ($xml->questions->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -766,13 +768,13 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$insertdata['title']=translink('survey', $oldsid, $newsid, $insertdata['title']);
|
$insertdata['title']=translink('survey', $oldsid, $newsid, $insertdata['title']);
|
||||||
$insertdata['question']=translink('survey', $oldsid, $newsid, $insertdata['question']);
|
$insertdata['question']=translink('survey', $oldsid, $newsid, $insertdata['question']);
|
||||||
$insertdata['help']=translink('survey', $oldsid, $newsid, $insertdata['help']);
|
$insertdata['help']=translink('survey', $oldsid, $newsid, $insertdata['help']);
|
||||||
// Insert the new question
|
// Insert the new question
|
||||||
if (isset($aQIDReplacements[$oldqid]))
|
if (isset($aQIDReplacements[$oldqid]))
|
||||||
{
|
{
|
||||||
$insertdata['qid']=$aQIDReplacements[$oldqid];
|
$insertdata['qid']=$aQIDReplacements[$oldqid];
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
}
|
}
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
if (!isset($aQIDReplacements[$oldqid]))
|
if (!isset($aQIDReplacements[$oldqid]))
|
||||||
{
|
{
|
||||||
@@ -788,10 +790,10 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
// Import subquestions --------------------------------------------------------------
|
// Import subquestions --------------------------------------------------------------
|
||||||
if (isset($xml->subquestions))
|
if (isset($xml->subquestions))
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach ($xml->subquestions->rows->row as $row)
|
foreach ($xml->subquestions->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -809,13 +811,13 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$insertdata['qid']=$aQIDReplacements[$oldsqid];
|
$insertdata['qid']=$aQIDReplacements[$oldsqid];
|
||||||
db_switchIDInsert('questions',true);
|
db_switchIDInsert('questions',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result = $connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$newsqid=$connect->Insert_ID($tablename,"qid"); // save this for later
|
$newsqid=$connect->Insert_ID($tablename,"qid"); // save this for later
|
||||||
if (!isset($insertdata['qid']))
|
if (!isset($insertdata['qid']))
|
||||||
{
|
{
|
||||||
$aQIDReplacements[$oldsqid]=$newsqid; // add old and new qid to the mapping array
|
$aQIDReplacements[$oldsqid]=$newsqid; // add old and new qid to the mapping array
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -828,10 +830,10 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
if(isset($xml->answers))
|
if(isset($xml->answers))
|
||||||
{
|
{
|
||||||
$tablename=$dbprefix.'answers';
|
$tablename=$dbprefix.'answers';
|
||||||
|
|
||||||
foreach ($xml->answers->rows->row as $row)
|
foreach ($xml->answers->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -839,21 +841,21 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the parent_qid
|
$insertdata['qid']=$aQIDReplacements[(int)$insertdata['qid']]; // remap the parent_qid
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['answers']++;
|
$results['answers']++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Import questionattributes --------------------------------------------------------------
|
// Import questionattributes --------------------------------------------------------------
|
||||||
if(isset($xml->question_attributes))
|
if(isset($xml->question_attributes))
|
||||||
{
|
{
|
||||||
$tablename=$dbprefix.'question_attributes';
|
$tablename=$dbprefix.'question_attributes';
|
||||||
|
|
||||||
foreach ($xml->question_attributes->rows->row as $row)
|
foreach ($xml->question_attributes->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -862,22 +864,22 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$insertdata['qid']=$aQIDReplacements[(integer)$insertdata['qid']]; // remap the parent_qid
|
$insertdata['qid']=$aQIDReplacements[(integer)$insertdata['qid']]; // remap the parent_qid
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />{$query}<br />\n".$connect->ErrorMsg());
|
||||||
$results['question_attributes']++;
|
$results['question_attributes']++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Import defaultvalues --------------------------------------------------------------
|
// Import defaultvalues --------------------------------------------------------------
|
||||||
if(isset($xml->defaultvalues))
|
if(isset($xml->defaultvalues))
|
||||||
{
|
{
|
||||||
$tablename=$dbprefix.'defaultvalues';
|
$tablename=$dbprefix.'defaultvalues';
|
||||||
|
|
||||||
$results['defaultvalues']=0;
|
$results['defaultvalues']=0;
|
||||||
foreach ($xml->defaultvalues->rows->row as $row)
|
foreach ($xml->defaultvalues->rows->row as $row)
|
||||||
{
|
{
|
||||||
$insertdata=array();
|
$insertdata=array();
|
||||||
foreach ($row as $key=>$value)
|
foreach ($row as $key=>$value)
|
||||||
{
|
{
|
||||||
$insertdata[(string)$key]=(string)$value;
|
$insertdata[(string)$key]=(string)$value;
|
||||||
@@ -886,12 +888,14 @@ function XMLImportQuestion($sFullFilepath, $newsid, $newgid)
|
|||||||
$insertdata['sqid']=$aSQIDReplacements[(int)$insertdata['sqid']]; // remap the subquestion id
|
$insertdata['sqid']=$aSQIDReplacements[(int)$insertdata['sqid']]; // remap the subquestion id
|
||||||
|
|
||||||
// now translate any links
|
// now translate any links
|
||||||
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
$query=$connect->GetInsertSQL($tablename,$insertdata);
|
||||||
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />\$query<br />\n".$connect->ErrorMsg());
|
$result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data<br />\$query<br />\n".$connect->ErrorMsg());
|
||||||
$results['defaultvalues']++;
|
$results['defaultvalues']++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LimeExpressionManager::SetDirtyFlag(); // so refreshes syntax highlighting
|
||||||
|
|
||||||
$results['newqid']=$newqid;
|
$results['newqid']=$newqid;
|
||||||
$results['questions']=1;
|
$results['questions']=1;
|
||||||
$results['labelsets']=0;
|
$results['labelsets']=0;
|
||||||
|
|||||||
@@ -10,15 +10,13 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: importsurvey.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: importsurvey.php 11607 2011-12-06 23:19:52Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Ensure script is not run directly, avoid path disclosure
|
//Ensure script is not run directly, avoid path disclosure
|
||||||
//importsurvey.php should be called from cmdline_importsurvey.php or http_importsurvey.php, they set the $importingfrom variable
|
//importsurvey.php should be called from cmdline_importsurvey.php or http_importsurvey.php, they set the $importingfrom variable
|
||||||
if ((!isset($importingfrom) && !isset($copyfunction)) || isset($_REQUEST['importingfrom']))
|
if (!isset($dbprefix) || isset($_REQUEST['dbprefix'])) {safe_die("Cannot run this script directly");}
|
||||||
{
|
|
||||||
die("Cannot run this script directly");
|
|
||||||
}
|
|
||||||
require_once('import_functions.php');
|
require_once('import_functions.php');
|
||||||
|
|
||||||
if (!isset($copyfunction))
|
if (!isset($copyfunction))
|
||||||
@@ -27,8 +25,8 @@ if (!isset($copyfunction))
|
|||||||
$aPathInfo = pathinfo($sFullFilepath);
|
$aPathInfo = pathinfo($sFullFilepath);
|
||||||
$sExtension = $aPathInfo['extension'];
|
$sExtension = $aPathInfo['extension'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$bImportFailed=false;
|
$bImportFailed=false;
|
||||||
if (isset($sExtension) && strtolower($sExtension)=='csv')
|
if (isset($sExtension) && strtolower($sExtension)=='csv')
|
||||||
{
|
{
|
||||||
$aImportResults=CSVImportSurvey($sFullFilepath);
|
$aImportResults=CSVImportSurvey($sFullFilepath);
|
||||||
@@ -46,18 +44,18 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create old fieldnames
|
// Create old fieldnames
|
||||||
|
|
||||||
|
|
||||||
if ((!$bImportFailed && isset($importingfrom) && $importingfrom == "http") || isset($copyfunction))
|
if ((!$bImportFailed && isset($importingfrom) && $importingfrom == "http") || isset($copyfunction))
|
||||||
{
|
{
|
||||||
$importsurvey .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br /><br />\n";
|
$importsurvey .= "<br />\n<div class='successheader'>".$clang->gT("Success")."</div><br /><br />\n";
|
||||||
if (isset($copyfunction))
|
if (isset($copyfunction))
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong><u>".$clang->gT("Survey copy summary")."</u></strong><br />\n";
|
$importsurvey .= "<strong><u>".$clang->gT("Survey copy summary")."</u></strong><br />\n";
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong><u>".$clang->gT("Survey import summary")."</u></strong><br />\n";
|
$importsurvey .= "<strong><u>".$clang->gT("Survey import summary")."</u></strong><br />\n";
|
||||||
}
|
}
|
||||||
$importsurvey .= "<ul style=\"text-align:left;\">\n\t<li>".$clang->gT("Surveys").": {$aImportResults['surveys']}</li>\n";
|
$importsurvey .= "<ul style=\"text-align:left;\">\n\t<li>".$clang->gT("Surveys").": {$aImportResults['surveys']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Languages").": {$aImportResults['languages']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Languages").": {$aImportResults['languages']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Question groups").": {$aImportResults['groups']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Question groups").": {$aImportResults['groups']}</li>\n";
|
||||||
@@ -65,15 +63,15 @@ if ((!$bImportFailed && isset($importingfrom) && $importingfrom == "http") || is
|
|||||||
$importsurvey .= "\t<li>".$clang->gT("Answers").": {$aImportResults['answers']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Answers").": {$aImportResults['answers']}</li>\n";
|
||||||
if (isset($aImportResults['subquestions']))
|
if (isset($aImportResults['subquestions']))
|
||||||
{
|
{
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Subquestions").": {$aImportResults['subquestions']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Subquestions").": {$aImportResults['subquestions']}</li>\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['defaultvalues']))
|
if (isset($aImportResults['defaultvalues']))
|
||||||
{
|
{
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Default answers").": {$aImportResults['defaultvalues']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Default answers").": {$aImportResults['defaultvalues']}</li>\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['conditions']))
|
if (isset($aImportResults['conditions']))
|
||||||
{
|
{
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Conditions").": {$aImportResults['conditions']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Conditions").": {$aImportResults['conditions']}</li>\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['labelsets']))
|
if (isset($aImportResults['labelsets']))
|
||||||
{
|
{
|
||||||
@@ -86,7 +84,7 @@ if ((!$bImportFailed && isset($importingfrom) && $importingfrom == "http") || is
|
|||||||
$importsurvey .= "\t<li>".$clang->gT("Question attributes").": {$aImportResults['question_attributes']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Question attributes").": {$aImportResults['question_attributes']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Assessments").": {$aImportResults['assessments']}</li>\n";
|
$importsurvey .= "\t<li>".$clang->gT("Assessments").": {$aImportResults['assessments']}</li>\n";
|
||||||
$importsurvey .= "\t<li>".$clang->gT("Quotas").": {$aImportResults['quota']} ({$aImportResults['quotamembers']} ".$clang->gT("quota members")." ".$clang->gT("and")." {$aImportResults['quotals']} ".$clang->gT("quota language settings").")</li>\n</ul><br />\n";
|
$importsurvey .= "\t<li>".$clang->gT("Quotas").": {$aImportResults['quota']} ({$aImportResults['quotamembers']} ".$clang->gT("quota members")." ".$clang->gT("and")." {$aImportResults['quotals']} ".$clang->gT("quota language settings").")</li>\n</ul><br />\n";
|
||||||
if (count($aImportResults['importwarnings'])>0)
|
if (count($aImportResults['importwarnings'])>0)
|
||||||
{
|
{
|
||||||
$importsurvey .= "<div class='warningheader'>".$clang->gT("Warnings").":</div><ul style=\"text-align:left;\">";
|
$importsurvey .= "<div class='warningheader'>".$clang->gT("Warnings").":</div><ul style=\"text-align:left;\">";
|
||||||
foreach ($aImportResults['importwarnings'] as $warning)
|
foreach ($aImportResults['importwarnings'] as $warning)
|
||||||
@@ -98,23 +96,23 @@ if ((!$bImportFailed && isset($importingfrom) && $importingfrom == "http") || is
|
|||||||
if (isset($copyfunction))
|
if (isset($copyfunction))
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong>".$clang->gT("Copy of survey is completed.")."</strong><br />\n"
|
$importsurvey .= "<strong>".$clang->gT("Copy of survey is completed.")."</strong><br />\n"
|
||||||
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$importsurvey .= "<strong>".$clang->gT("Import of Survey is completed.")."</strong><br />\n"
|
$importsurvey .= "<strong>".$clang->gT("Import of Survey is completed.")."</strong><br />\n"
|
||||||
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
. "<a href='$scriptname?sid={$aImportResults['newsid']}'>".$clang->gT("Go to survey")."</a><br />\n";
|
||||||
}
|
}
|
||||||
$importsurvey .= "</div><br />\n";
|
$importsurvey .= "</div><br />\n";
|
||||||
if (!isset($copyfunction))
|
if (!isset($copyfunction))
|
||||||
{
|
{
|
||||||
unlink($sFullFilepath);
|
unlink($sFullFilepath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (isset($bImportFailed) && $bImportFailed==true)
|
elseif (isset($bImportFailed) && $bImportFailed==true)
|
||||||
{
|
{
|
||||||
echo "\n".$clang->gT("Error")."\n\n";
|
echo "\n".$clang->gT("Error")."\n\n";
|
||||||
echo $clang->gT("Import failed. You specified an invalid file.")."\n";
|
echo $clang->gT("Import failed. You specified an invalid file.")."\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -130,15 +128,15 @@ else
|
|||||||
echo $clang->gT("Answers").": {$aImportResults['answers']}\n";
|
echo $clang->gT("Answers").": {$aImportResults['answers']}\n";
|
||||||
if (isset($aImportResults['subquestions']))
|
if (isset($aImportResults['subquestions']))
|
||||||
{
|
{
|
||||||
echo $clang->gT("Subquestions").": {$aImportResults['subquestions']}\n";
|
echo $clang->gT("Subquestions").": {$aImportResults['subquestions']}\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['defaultvalues']))
|
if (isset($aImportResults['defaultvalues']))
|
||||||
{
|
{
|
||||||
echo $clang->gT("Default answers").": {$aImportResults['defaultvalues']}\n";
|
echo $clang->gT("Default answers").": {$aImportResults['defaultvalues']}\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['conditions']))
|
if (isset($aImportResults['conditions']))
|
||||||
{
|
{
|
||||||
echo $clang->gT("Conditions").": {$aImportResults['conditions']}\n";
|
echo $clang->gT("Conditions").": {$aImportResults['conditions']}\n";
|
||||||
}
|
}
|
||||||
if (isset($aImportResults['labelsets']))
|
if (isset($aImportResults['labelsets']))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: integritycheck.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: integritycheck.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
|
|||||||
while ($aRow=$aResult->FetchRow())
|
while ($aRow=$aResult->FetchRow())
|
||||||
{
|
{
|
||||||
$tablename=substr($aRow[0],strlen($dbprefix));
|
$tablename=substr($aRow[0],strlen($dbprefix));
|
||||||
if ($tablename=='survey_permissions') continue;
|
if ($tablename=='survey_permissions' || $tablename=='survey_links') continue;
|
||||||
$iSurveyID=substr($tablename,strpos($tablename,'_')+1);
|
$iSurveyID=substr($tablename,strpos($tablename,'_')+1);
|
||||||
$qquery="SELECT sid FROM {$dbprefix}surveys WHERE sid='{$iSurveyID}'";
|
$qquery="SELECT sid FROM {$dbprefix}surveys WHERE sid='{$iSurveyID}'";
|
||||||
$qresult=$connect->Execute($qquery) or safe_die ("Couldn't check questions table for qids<br />$qquery<br />".$connect->ErrorMsg());
|
$qresult=$connect->Execute($qquery) or safe_die ("Couldn't check questions table for qids<br />$qquery<br />".$connect->ErrorMsg());
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: iterate_survey.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: iterate_survey.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Set completed answers to the incomplete state and reset the tokens to 'not used' so that
|
* Set completed answers to the incomplete state and reset the tokens to 'not used' so that
|
||||||
@@ -54,13 +54,12 @@ if ($subaction=='unfinalizeanswers')
|
|||||||
$updateqr = "UPDATE $surveytable SET submitdate=NULL, lastpage=NULL;\n";
|
$updateqr = "UPDATE $surveytable SET submitdate=NULL, lastpage=NULL;\n";
|
||||||
$updateres = $connect->Execute($updateqr) or safe_die("UnFinilize answers failed:<br />\n" . $connect->ErrorMsg() . "<br />$updateqr");
|
$updateres = $connect->Execute($updateqr) or safe_die("UnFinilize answers failed:<br />\n" . $connect->ErrorMsg() . "<br />$updateqr");
|
||||||
// Finally, reset the token completed and sent status
|
// Finally, reset the token completed and sent status
|
||||||
$updateqr="UPDATE ".db_table_name("tokens_$surveyid")." SET sent='N', remindersent='N', remindercount=0, completed='N', usesleft=1";
|
$updateqr="UPDATE ".db_table_name("tokens_$surveyid")." SET sent='N', remindersent='N', remindercount=0, completed='N', usesleft=1 where usesleft=0";
|
||||||
$updateres=$connect->Execute($updateqr) or safe_die ("Couldn't reset token completed state<br />$updateqr<br />".$connect->ErrorMsg());
|
$updateres=$connect->Execute($updateqr) or safe_die ("Couldn't reset token completed state<br />$updateqr<br />".$connect->ErrorMsg());
|
||||||
$iteratesurveyoutput .= "<br />\n";
|
$iteratesurveyoutput .= "<br />\n";
|
||||||
$iteratesurveyoutput .= "<div class='header ui-widget-header'>".$clang->gT("Iterate survey")."</div>\n";
|
$iteratesurveyoutput .= "<div class='header ui-widget-header'>".$clang->gT("Iterate survey")."</div>\n";
|
||||||
$iteratesurveyoutput .= "<p style='width:100%;'>\n"
|
$iteratesurveyoutput .= "<p>\n"
|
||||||
. "<font class='successtitle'>".$clang->gT("Success")."</font><br />\n"
|
. "<font class='successtitle'>".$clang->gT("Success")."</font><br />\n"
|
||||||
. $clang->gT("Answers and tokens have been re-opened.")."<br />\n"
|
. $clang->gT("Answers and tokens have been re-opened.")."<br />\n"
|
||||||
. "</p>\n"
|
. "</p>\n";
|
||||||
. "<table><tr><td>";
|
|
||||||
}
|
}
|
||||||
|
|||||||
+158
-284
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: labels.php 10934 2011-09-02 22:12:07Z c_schmitz $
|
* $Id: labels.php 11675 2011-12-18 02:27:59Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
include_once("login_check.php"); //Login Check dies also if the script is started directly
|
||||||
@@ -40,7 +40,7 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
//DO DATABASE UPDATESTUFF
|
//DO DATABASE UPDATESTUFF
|
||||||
if ($action == "updateset") {updateset($lid);}
|
if ($action == "updateset") {updateset($lid);}
|
||||||
if ($action == "insertlabelset") {$lid=insertlabelset();}
|
if ($action == "insertlabelset") {$lid=insertlabelset();}
|
||||||
if ($action == "modlabelsetanswers") {modlabelsetanswers($lid);}
|
if (($action == "modlabelsetanswers")||($action == "ajaxmodlabelsetanswers")) {modlabelsetanswers($lid);}
|
||||||
if ($action == "deletelabelset") {if (deletelabelset($lid)) {$lid=0;}}
|
if ($action == "deletelabelset") {if (deletelabelset($lid)) {$lid=0;}}
|
||||||
if ($action == "importlabels")
|
if ($action == "importlabels")
|
||||||
{
|
{
|
||||||
@@ -155,7 +155,7 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
."<input type='image' src='$imageurl/close.gif' align='right' "
|
."<input type='image' src='$imageurl/close.gif' align='right' "
|
||||||
."onclick=\"window.open('admin.php?action=labels&lid=$lid', '_self')\" />\n";
|
."onclick=\"window.open('admin.php?action=labels&lid=$lid', '_self')\" />\n";
|
||||||
if ($action == "newlabelset") {$labelsoutput.= $clang->gT("Create or import new label set(s)"); $langids=$_SESSION['adminlang']; $tabitem=$clang->gT("Create New Label Set");}
|
if ($action == "newlabelset") {$labelsoutput.= $clang->gT("Create or import new label set(s)"); $langids=$_SESSION['adminlang']; $tabitem=$clang->gT("Create New Label Set");}
|
||||||
else {$labelsoutput.= $clang->gT("Edit label set"); $tabitem=$clang->gT("Edit label set");}
|
else {$labelsoutput.= $clang->gT("Edit Label Set"); $tabitem=$clang->gT("Edit label set");}
|
||||||
$langidsarray=explode(" ",trim($langids)); //Make an array of it
|
$langidsarray=explode(" ",trim($langids)); //Make an array of it
|
||||||
$labelsoutput.= "\n\t</div>\n";
|
$labelsoutput.= "\n\t</div>\n";
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
"<img src='$imageurl/dumplabel.png' alt='".$clang->gT("Export this label set")."' align='left' /></a>"
|
"<img src='$imageurl/dumplabel.png' alt='".$clang->gT("Export this label set")."' align='left' /></a>"
|
||||||
."\t</div>\n"
|
."\t</div>\n"
|
||||||
."\t<div class='menubar-right'>\n"
|
."\t<div class='menubar-right'>\n"
|
||||||
."\t<input type='image' src='$imageurl/close.gif' title='".$clang->gT("Close")."'"
|
."\t<input type='image' src='$imageurl/close.gif' title='".$clang->gT("Close Window")."'"
|
||||||
."onclick=\"window.open('admin.php?action=labels', '_self')\" />\n"
|
."onclick=\"window.open('admin.php?action=labels', '_self')\" />\n"
|
||||||
."\t</div>\n"
|
."\t</div>\n"
|
||||||
."\t</div>\n"
|
."\t</div>\n"
|
||||||
@@ -283,6 +283,7 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
|
|
||||||
//LABEL ANSWERS - SHOW THE MASK FOR EDITING THE LABELS
|
//LABEL ANSWERS - SHOW THE MASK FOR EDITING THE LABELS
|
||||||
|
|
||||||
|
$js_admin_includes[]='scripts/updateset.js';
|
||||||
|
|
||||||
$qulabelset = "SELECT * FROM ".db_table_name('labelsets')." WHERE lid=$lid";
|
$qulabelset = "SELECT * FROM ".db_table_name('labelsets')." WHERE lid=$lid";
|
||||||
$rslabelset = db_execute_assoc($qulabelset) or safe_die($connect->ErrorMsg());
|
$rslabelset = db_execute_assoc($qulabelset) or safe_die($connect->ErrorMsg());
|
||||||
@@ -296,9 +297,9 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
$msorow=$maxresult->FetchRow();
|
$msorow=$maxresult->FetchRow();
|
||||||
$maxsortorder=$msorow['maxsortorder']+1;
|
$maxsortorder=$msorow['maxsortorder']+1;
|
||||||
|
|
||||||
// KP
|
// labels table
|
||||||
$labelsoutput.= "\t<div class='header ui-widget-header'>".$clang->gT("Labels")."\t</div>\n";
|
$labelsoutput.= "\t<div class='header ui-widget-header'>".$clang->gT("Labels")."\t</div>\n";
|
||||||
$labelsoutput.= "<form method='post' action='admin.php' onsubmit=\"return codeCheck('code_',$maxsortorder,'".$clang->gT("Error: You are trying to use duplicate label codes.",'js')."','".$clang->gT("Error: 'other' is a reserved keyword.",'js')."');\">\n"
|
$labelsoutput.= "<form method='post' id='mainform' action='admin.php' onsubmit=\"return codeCheck('code_',$maxsortorder,'".$clang->gT("Error: You are trying to use duplicate label codes.",'js')."','".$clang->gT("Error: 'other' is a reserved keyword.",'js')."');\">\n"
|
||||||
."<input type='hidden' name='sortorder' value='{$row['sortorder']}' />\n"
|
."<input type='hidden' name='sortorder' value='{$row['sortorder']}' />\n"
|
||||||
."<input type='hidden' name='lid' value='$lid' />\n"
|
."<input type='hidden' name='lid' value='$lid' />\n"
|
||||||
."<input type='hidden' name='action' value='modlabelsetanswers' />\n";
|
."<input type='hidden' name='action' value='modlabelsetanswers' />\n";
|
||||||
@@ -312,145 +313,82 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
$result = db_execute_assoc($query) or safe_die($connect->ErrorMsg());
|
$result = db_execute_assoc($query) or safe_die($connect->ErrorMsg());
|
||||||
$labelcount = $result->RecordCount();
|
$labelcount = $result->RecordCount();
|
||||||
$tab_title[$i] = getLanguageNameFromCode($lslanguage,false);
|
$tab_title[$i] = getLanguageNameFromCode($lslanguage,false);
|
||||||
$tab_content[$i] = "<table class='answertable' align='center'>\n"
|
|
||||||
."<thead align='center'>"
|
$tab_content[$i] = "
|
||||||
."<tr>\n"
|
<input type='hidden' class='lslanguage' value='{$lslanguage}'>
|
||||||
."\t<th align='right' class='settingcaption'>\n"
|
<table class='answertable' align='center'>
|
||||||
.$clang->gT("Code")
|
<thead align='center'>
|
||||||
."\t</th>\n";
|
<tr>";
|
||||||
$tab_content[$i].="<th align='right' class='settingcaption'>".$clang->gT("Assessment value").'</th>';
|
|
||||||
$tab_content[$i].="\t<th class='settingcaption'>\n"
|
if ($first)
|
||||||
.$clang->gT("Title")
|
$tab_content[$i] .= "<th> </th>";
|
||||||
."\t</th>\n"
|
|
||||||
."\t<th align='center' class='settingcaption'>\n"
|
$tab_content[$i] .= "<th class='settingcaption'>{$clang->gT("Code")}</th>
|
||||||
.$clang->gT("Action")
|
<th class='settingcaption'>{$clang->gT("Assessment value")}</th>
|
||||||
."\t</th>\n"
|
<th class='settingcaption'>{$clang->gT("Title")}</th>";
|
||||||
."\t<th align='center' class='settingcaption'>\n"
|
|
||||||
.$clang->gT("Order")
|
if ($first)
|
||||||
."\t</th>\n"
|
$tab_content[$i] .= "<th class='settingcaption'>{$clang->gT("Action")}</th>";
|
||||||
."</tr></thead>"
|
|
||||||
."<tbody align='center'>";
|
$tab_content[$i] .= "</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody align='center'>
|
||||||
|
";
|
||||||
|
|
||||||
$alternate=false;
|
$alternate=false;
|
||||||
while ($row=$result->FetchRow())
|
while ($row=$result->FetchRow())
|
||||||
{
|
{
|
||||||
$sortorderids=$sortorderids.' '.$row['language'].'_'.$row['sortorder'];
|
$sortorderids=$sortorderids.' '.$row['language'].'_'.$row['sortorder'];
|
||||||
if ($first) {$codeids=$codeids.' '.$row['sortorder'];}
|
if ($first) {$codeids=$codeids.' '.$row['sortorder'];}
|
||||||
$tab_content[$i].= "<tr style='white-space: nowrap;' ";
|
|
||||||
|
$tab_content[$i].= "<tr style='white-space: nowrap;' name='{$row['sortorder']}'";
|
||||||
|
|
||||||
if ($alternate==true)
|
if ($alternate==true)
|
||||||
{
|
$tab_content[$i].=' class = "highlight" ';
|
||||||
$tab_content[$i].=' class="highlight" ';
|
|
||||||
$alternate=false;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
$alternate=true;
|
$alternate=true;
|
||||||
}
|
|
||||||
$tab_content[$i].="><td align='right'>\n";
|
|
||||||
|
|
||||||
|
$tab_content[$i] .= ">";
|
||||||
if (!$first)
|
if (!$first)
|
||||||
{
|
$tab_content[$i].= "<td>{$row['code']}</td><td>{$row['assessment_value']}</td>";
|
||||||
$tab_content[$i].= "\t{$row['code']}";
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
$tab_content[$i].= "
|
||||||
$tab_content[$i].= "\t<input type='hidden' name='oldcode_{$row['sortorder']}' value=\"{$row['code']}\" />\n";
|
<td><img src='$imageurl/handle.png' /></td>
|
||||||
$tab_content[$i].= "\t<input type='text' id='code_{$row['sortorder']}' name='code_{$row['sortorder']}' maxlength='5' size='5' value=\"{$row['code']}\" onkeypress=\"if(event.keyCode!=13) {return goodchars(event,'1234567890abcdefghijklmnopqrstuvwxyz');}; return catchenter(event,'saveallbtn_$lslanguage');\" />\n";
|
<td>
|
||||||
}
|
<input type='hidden' class='hiddencode' value='{$row['code']}' />
|
||||||
|
<input type='text' class='codeval'id='code_{$row['sortorder']}' name='code_{$row['sortorder']}' maxlength='5'
|
||||||
|
size='6' value='{$row['code']}'/>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<input type='text' class='assessmentval' id='assessmentvalue_{$row['sortorder']}' style='text-align: right;' name='assessmentvalue_{$row['sortorder']}' maxlength='5' size='6' value='{$row['assessment_value']}' />
|
||||||
|
</td>
|
||||||
|
";
|
||||||
|
|
||||||
|
$tab_content[$i].= "
|
||||||
|
<td>
|
||||||
|
<input type='text' name='title_{$row['language']}_{$row['sortorder']}' maxlength='3000' size='80' value=\"".html_escape($row['title'])."\" />"
|
||||||
|
.getEditor("editlabel", "title_{$row['language']}_{$row['sortorder']}", "[".$clang->gT("Label:", "js")."](".$row['language'].")",'','','',$action)
|
||||||
|
."</td>";
|
||||||
|
|
||||||
|
if ($first)
|
||||||
|
$tab_content[$i] .= "
|
||||||
|
<td style='text-align:center;'>
|
||||||
|
<img src='$imageurl/addanswer.png' class='btnaddanswer' /><img src='$imageurl/deleteanswer.png' class='btndelanswer' />
|
||||||
|
</td>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
$tab_content[$i].= "\t</td>\n"
|
|
||||||
."\t<td style='text-align:center;'>\n";
|
|
||||||
if ($first)
|
|
||||||
{
|
|
||||||
$tab_content[$i].= "\t<input type='text' id='assessmentvalue_{$row['sortorder']}' style='text-align: right;' name='assessmentvalue_{$row['sortorder']}' maxlength='5' size='5' value=\"{$row['assessment_value']}\" "
|
|
||||||
." onkeypress=\"if(event.keyCode==13) {if (event && event.preventDefault) event.preventDefault(); document.getElementById('saveallbtn_$lslanguage').click(); return false;} return goodchars(event,'1234567890-')\" />";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$tab_content[$i].= $row['assessment_value'];
|
|
||||||
|
|
||||||
}
|
|
||||||
$tab_content[$i].= "\t</td>\n"
|
|
||||||
."\t<td>\n"
|
|
||||||
."\t<input type='text' name='title_{$row['language']}_{$row['sortorder']}' maxlength='3000' size='75' value=\"".html_escape($row['title'])."\" onkeypress=\"return catchenter(event,'saveallbtn_$lslanguage');\"/>\n"
|
|
||||||
. getEditor("editlabel", "title_{$row['language']}_{$row['sortorder']}", "[".$clang->gT("Label:", "js")."](".$row['language'].")",'','','',$action)
|
|
||||||
."\t</td>\n"
|
|
||||||
."\t<td style='text-align:center;'>\n";
|
|
||||||
$tab_content[$i].= "\t<input type='submit' name='method' value='".$clang->gT("Del")."' onclick=\"this.form.sortorder.value='{$row['sortorder']}'\" />\n";
|
|
||||||
|
|
||||||
$tab_content[$i].= "\t</td>\n"
|
|
||||||
."\t<td>\n";
|
|
||||||
if ($position > 0)
|
|
||||||
{
|
|
||||||
$tab_content[$i].= "\t<input type='submit' name='method' value='".$clang->gT("Up")."' onclick=\"this.form.sortorder.value='{$row['sortorder']}'\" />\n";
|
|
||||||
};
|
|
||||||
if ($position < $labelcount-1)
|
|
||||||
{
|
|
||||||
// Fill the sortorder hiddenfield so we know what field is moved down
|
|
||||||
$tab_content[$i].= "\t<input type='submit' name='method' value='".$clang->gT("Dn")."' onclick=\"this.form.sortorder.value='{$row['sortorder']}'\" />\n";
|
|
||||||
}
|
|
||||||
$tab_content[$i].= "\t</td></tr>\n";
|
|
||||||
$position++;
|
$position++;
|
||||||
}
|
}
|
||||||
if ($labelcount>0)
|
|
||||||
{
|
|
||||||
$tab_content[$i].= "\t<tr><td colspan='5'><center><input type='submit' name='method' value='".$clang->gT("Save Changes")."' id='saveallbtn_$lslanguage' />"
|
|
||||||
."</center></td></tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$position=sprintf("%05d", $position);
|
$tab_content[$i] .= "</tbody></table>";
|
||||||
if (!isset($_SESSION['nextlabelcode'])) $_SESSION['nextlabelcode']='';
|
|
||||||
if ($first)
|
$tab_content[$i] .= "<button class='btnquickadd' id='btnquickadd' type='button'>".$clang->gT('Quick add...')."</button>";
|
||||||
{ $tab_content[$i].= "<tr><td><br /></td></tr><tr><td align='right'>"
|
|
||||||
."<input type='hidden' name='sortorderids' value='$sortorderids' />\n"
|
$tab_content[$i].= "<p><input type='submit' name='method' value='".$clang->gT("Save Changes")."' id='saveallbtn_$lslanguage' /></p>";
|
||||||
."<input type='hidden' name='codeids' value='$codeids' />\n"
|
|
||||||
."<strong>".$clang->gT("New label").":</strong> <input type='text' maxlength='5' name='insertcode' size='6' value='".$_SESSION['nextlabelcode']."' id='code_$maxsortorder' onkeypress=\"if(event.keyCode!=13) {return goodchars(event,'1234567890abcdefghijklmnopqrstuvwxyz');}; return catchenter(event,'addnewlabelbtn');\" />\n"
|
|
||||||
."\t</td>\n"
|
|
||||||
."<td style='text-align:center;'>"
|
|
||||||
."<input style='text-align:right;' type='text' maxlength='5' name='insertassessmentvalue' size='6' id='insertassessmentvalue' value='0' "
|
|
||||||
."onkeypress=\"if(event.keyCode==13) {if (event && event.preventDefault) event.preventDefault(); document.getElementById('addnewlabelbtn').click(); return false;} return goodchars(event,'1234567890-')\" />"
|
|
||||||
."\t</td>\n"
|
|
||||||
."\t<td>\n"
|
|
||||||
."\t<input type='text' maxlength='3000' name='inserttitle' size='75' onkeypress=\"return catchenter(event,'addnewlabelbtn');\"/>\n"
|
|
||||||
. getEditor("addlabel", "inserttitle", "[".$clang->gT("Label:", "js")."](".$lslanguage.")",'','','',$action)
|
|
||||||
."\t</td>\n"
|
|
||||||
."\t<td colspan='2'>\n"
|
|
||||||
."\t<input type='submit' name='method' value='".$clang->gT("Add new label")."' id='addnewlabelbtn' />\n"
|
|
||||||
."<script type='text/javascript'>\n"
|
|
||||||
."<!--\n"
|
|
||||||
."document.getElementById('code_$maxsortorder').focus();\n"
|
|
||||||
."function catchenter(evt, btnid)\n"
|
|
||||||
."{\n"
|
|
||||||
."\tvar mykey = window.event ? evt.keyCode : evt.which;\n"
|
|
||||||
."\tif (mykey == 13)\n"
|
|
||||||
."\t{\n"
|
|
||||||
."\t\tvar mybtn = document.getElementById(btnid);\n"
|
|
||||||
."\t\tmybtn.click();\n"
|
|
||||||
."\t\treturn false;\n"
|
|
||||||
."\t}\n"
|
|
||||||
."\treturn true;\n"
|
|
||||||
."}\n"
|
|
||||||
."//-->\n"
|
|
||||||
."</script>\n"
|
|
||||||
."\t</td>\n"
|
|
||||||
."</tr>\n";
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$tab_content[$i].= "<tr>\n"
|
|
||||||
."\t<td colspan='4' align='center'>\n"
|
|
||||||
."<span style='font-color:green; font-size:8px; font-weight:bold; font-style: italic;'>"
|
|
||||||
.$clang->gT("Note: Inserting new labels must be done on the first language tab.")."</span>\n"
|
|
||||||
."\t</td>\n"
|
|
||||||
."</tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($_SESSION['nextlabelcode']);
|
|
||||||
$first=false;
|
$first=false;
|
||||||
$tab_content[$i].="</tbody></table>\n";
|
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@@ -466,6 +404,8 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
$labelsoutput .= "<div id='neweditlblset$i'>$eachcontent</div>";
|
$labelsoutput .= "<div id='neweditlblset$i'>$eachcontent</div>";
|
||||||
}
|
}
|
||||||
$labelsoutput .="</form>";
|
$labelsoutput .="</form>";
|
||||||
|
|
||||||
|
|
||||||
$disabledIfNoResources = '';
|
$disabledIfNoResources = '';
|
||||||
if (hasResources($lid,'label') === false)
|
if (hasResources($lid,'label') === false)
|
||||||
{
|
{
|
||||||
@@ -495,6 +435,14 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL
|
|||||||
|
|
||||||
$labelsoutput .= "</div>";
|
$labelsoutput .= "</div>";
|
||||||
|
|
||||||
|
$labelsoutput .= "<div id='quickadd' name='{$clang->gT('Quick add')}'style='display:none;'><div style='float:left;'>
|
||||||
|
<label for='quickadd'>".$clang->gT('Enter your labels:')."</label>
|
||||||
|
<br /><textarea id='quickaddarea' class='tipme' title='".$clang->gT('Enter one label per line. You can provide a code by separating code and label text with a semikolon or tab. For multilingual surveys you add the translation(s) on the same line separated with a semikolon or tab.')."' rows='30' style='width:570px;'></textarea>
|
||||||
|
<br /><button id='btnqareplace' type='button'>".$clang->gT('Replace')."</button>
|
||||||
|
<button id='btnqainsert' type='button'>".$clang->gT('Add')."</button>
|
||||||
|
<button id='btnqacancel' type='button'>".$clang->gT('Cancel')."</button></div>
|
||||||
|
</div> ";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -638,174 +586,100 @@ function insertlabelset()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function modlabelsetanswers($lid)
|
function modlabelsetanswers($lid)
|
||||||
{
|
{
|
||||||
|
|
||||||
global $dbprefix, $connect, $clang, $labelsoutput, $databasetype, $filterxsshtml,$postsortorder;
|
global $dbprefix, $connect, $clang, $labelsoutput, $databasetype, $filterxsshtml,$postsortorder;
|
||||||
|
$ajax = false;
|
||||||
$qulabelset = "SELECT * FROM ".db_table_name('labelsets')." WHERE lid='$lid'";
|
if (isset($_POST['ajax']) && $_POST['ajax'] == "1"){
|
||||||
$rslabelset = db_execute_assoc($qulabelset) or safe_die($connect->ErrorMsg());
|
$ajax = true;
|
||||||
$rwlabelset=$rslabelset->FetchRow();
|
}
|
||||||
$lslanguages=explode(" ", trim($rwlabelset['languages']));
|
|
||||||
|
|
||||||
if (!isset($_POST['method'])) {
|
if (!isset($_POST['method'])) {
|
||||||
$_POST['method'] = $clang->gT("Save");
|
$_POST['method'] = $clang->gT("Save");
|
||||||
}
|
}
|
||||||
switch($_POST['method'])
|
|
||||||
|
$sPostData=html_entity_decode($_POST['dataToSend'], ENT_QUOTES, "UTF-8");
|
||||||
|
$sPostData=str_replace("\t", '', $sPostData);
|
||||||
|
if (get_magic_quotes_gpc())
|
||||||
{
|
{
|
||||||
case $clang->gT("Add new label", "unescaped"):
|
$data = json_decode(stripslashes($sPostData));
|
||||||
if (isset($_POST['insertcode']) && $_POST['insertcode']!='')
|
|
||||||
{
|
|
||||||
$_SESSION['nextlabelcode']=getNextCode($_POST['insertcode']);
|
|
||||||
$_POST['insertcode'] = db_quoteall($_POST['insertcode'],true);
|
|
||||||
// check that the code doesn't exist yet
|
|
||||||
$query = "SELECT code FROM ".db_table_name('labels')." WHERE lid='$lid' AND code=".$_POST['insertcode'];
|
|
||||||
$result = $connect->Execute($query);
|
|
||||||
$codeoccurences=$result->RecordCount();
|
|
||||||
if ($codeoccurences == 0)
|
|
||||||
{
|
|
||||||
$query = "select max(sortorder) as maxorder from ".db_table_name('labels')." where lid='$lid'";
|
|
||||||
$result = $connect->Execute($query);
|
|
||||||
$newsortorder=sprintf("%05d", $result->fields['maxorder']+1);
|
|
||||||
if ($filterxsshtml)
|
|
||||||
{
|
|
||||||
require_once("../classes/inputfilter/class.inputfilter_clean.php");
|
|
||||||
$myFilter = new InputFilter('','',1,1,1);
|
|
||||||
$_POST['inserttitle']=$myFilter->process($_POST['inserttitle']);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$_POST['inserttitle'] = html_entity_decode($_POST['inserttitle'], ENT_QUOTES, "UTF-8");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix bug with FCKEditor saving strange BR types
|
|
||||||
$_POST['inserttitle']=fix_FCKeditor_text($_POST['inserttitle']);
|
|
||||||
|
|
||||||
$_POST['inserttitle'] = db_quoteall($_POST['inserttitle'],true);
|
|
||||||
$_POST['insertassessmentvalue']=(int)$_POST['insertassessmentvalue'];
|
|
||||||
foreach ($lslanguages as $lslanguage)
|
|
||||||
{
|
|
||||||
db_switchIDInsert('labels',true);
|
|
||||||
$query = "INSERT INTO ".db_table_name('labels')." (lid, code, title, sortorder,language, assessment_value) VALUES ($lid, {$_POST['insertcode']}, {$_POST['inserttitle']}, '$newsortorder','$lslanguage',{$_POST['insertassessmentvalue']})";
|
|
||||||
if (!$result = $connect->Execute($query))
|
|
||||||
{
|
|
||||||
$labelsoutput.= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Failed to insert label", "js")." - ".$query." - ".$connect->ErrorMsg()."\")\n //-->\n</script>\n";
|
|
||||||
}
|
|
||||||
db_switchIDInsert('labels',false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$labelsoutput.= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("This label code is already used in this labelset. Please choose another code or rename the existing one.", "js")."\")\n //-->\n</script>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Save all labels with one button
|
|
||||||
case $clang->gT("Save Changes", "unescaped"):
|
|
||||||
//Determine autoids by evaluating the hidden field
|
|
||||||
$sortorderids=explode(' ', trim($_POST['sortorderids']));
|
|
||||||
$codeids=explode(' ', trim($_POST['codeids']));
|
|
||||||
$count=0;
|
|
||||||
|
|
||||||
// Quote each code_codeid first
|
|
||||||
foreach ($codeids as $codeid)
|
|
||||||
{
|
|
||||||
$_POST['code_'.$codeid] = db_quoteall($_POST['code_'.$codeid],true);
|
|
||||||
if (isset($_POST['oldcode_'.$codeid])) $_POST['oldcode_'.$codeid] = db_quoteall($_POST['oldcode_'.$codeid],true);
|
|
||||||
// Get the code values to check for duplicates
|
|
||||||
$codevalues[] = $_POST['code_'.$codeid];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check that there is no code duplicate
|
|
||||||
if (count(array_unique($codevalues)) == count($codevalues))
|
|
||||||
{
|
|
||||||
if ($filterxsshtml)
|
|
||||||
{
|
|
||||||
require_once("../classes/inputfilter/class.inputfilter_clean.php");
|
|
||||||
$myFilter = new InputFilter('','',1,1,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($sortorderids as $sortorderid)
|
|
||||||
{
|
|
||||||
$orderid=substr($sortorderid,strrpos($sortorderid,'_')+1,20);
|
|
||||||
foreach ($lslanguages as $langid)
|
|
||||||
{
|
|
||||||
$sortorderid = $langid . '_' . $orderid;
|
|
||||||
if ($filterxsshtml)
|
|
||||||
{
|
|
||||||
$_POST['title_'.$sortorderid]=$myFilter->process($_POST['title_'.$sortorderid]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$_POST['title_'.$sortorderid] = html_entity_decode($_POST['title_'.$sortorderid], ENT_QUOTES, "UTF-8");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Fix bug with FCKEditor saving strange BR types
|
|
||||||
$_POST['title_'.$sortorderid]=fix_FCKeditor_text($_POST['title_'.$sortorderid]);
|
|
||||||
$_POST['title_'.$sortorderid] = db_quoteall($_POST['title_'.$sortorderid],true);
|
|
||||||
|
|
||||||
$query = "UPDATE ".db_table_name('labels')." SET code=".$_POST['code_'.$codeids[$count]].", title={$_POST['title_'.$sortorderid]}, assessment_value={$_POST['assessmentvalue_'.$codeids[$count]]} WHERE lid=$lid AND sortorder=$orderid AND language='$langid'";
|
|
||||||
|
|
||||||
if (!$result = $connect->Execute($query))
|
|
||||||
// if update didn't work we assume the label does not exist and insert it
|
|
||||||
{
|
|
||||||
|
|
||||||
$query = "insert into ".db_table_name('labels')." (code,title,lid,sortorder,language) VALUES (".$_POST['code_'.$codeids[$count]].", {$_POST['title_'.$sortorderid]}, $lid , $orderid , '$langid')";
|
|
||||||
if (!$result = $connect->Execute($query))
|
|
||||||
{
|
|
||||||
$labelsoutput.= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Failed to update label","js")." - ".$query." - ".$connect->ErrorMsg()."\")\n //-->\n</script>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$count++;
|
|
||||||
if ($count>count($codeids)-1) {$count=0;}
|
|
||||||
}
|
|
||||||
fixorder($lid);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$labelsoutput.= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Can't update labels because you are using duplicated codes","js")."\")\n //-->\n</script>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Pressing the Up button
|
|
||||||
case $clang->gT("Up", "unescaped"):
|
|
||||||
$newsortorder=$postsortorder-1;
|
|
||||||
$oldsortorder=$postsortorder;
|
|
||||||
$cdquery = "UPDATE ".db_table_name('labels')." SET sortorder=-1 WHERE lid=$lid AND sortorder=$newsortorder";
|
|
||||||
$cdresult=$connect->Execute($cdquery) or safe_die($connect->ErrorMsg());
|
|
||||||
$cdquery = "UPDATE ".db_table_name('labels')." SET sortorder=$newsortorder WHERE lid=$lid AND sortorder=$oldsortorder";
|
|
||||||
$cdresult=$connect->Execute($cdquery) or safe_die($connect->ErrorMsg());
|
|
||||||
$cdquery = "UPDATE ".db_table_name('labels')." SET sortorder='$oldsortorder' WHERE lid=$lid AND sortorder=-1";
|
|
||||||
$cdresult=$connect->Execute($cdquery) or safe_die($connect->ErrorMsg());
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Pressing the Down button
|
|
||||||
case $clang->gT("Dn", "unescaped"):
|
|
||||||
$newsortorder=$postsortorder+1;
|
|
||||||
$oldsortorder=$postsortorder;
|
|
||||||
$cdquery = "UPDATE ".db_table_name('labels')." SET sortorder=-1 WHERE lid=$lid AND sortorder='$newsortorder'";
|
|
||||||
$cdresult=$connect->Execute($cdquery) or safe_die($connect->ErrorMsg());
|
|
||||||
$cdquery = "UPDATE ".db_table_name('labels')." SET sortorder='$newsortorder' WHERE lid=$lid AND sortorder=$oldsortorder";
|
|
||||||
$cdresult=$connect->Execute($cdquery) or safe_die($connect->ErrorMsg());
|
|
||||||
$cdquery = "UPDATE ".db_table_name('labels')." SET sortorder=$oldsortorder WHERE lid=$lid AND sortorder=-1";
|
|
||||||
$cdresult=$connect->Execute($cdquery) or safe_die($connect->ErrorMsg());
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Delete Button
|
|
||||||
case $clang->gT("Del", "unescaped"):
|
|
||||||
$query = "DELETE FROM ".db_table_name('labels')." WHERE lid=$lid AND sortorder='{$postsortorder}'";
|
|
||||||
if (!$result = $connect->Execute($query))
|
|
||||||
{
|
|
||||||
$labelsoutput.= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Failed to delete label","js")." - ".$query." - ".$connect->ErrorMsg()."\")\n //-->\n</script>\n";
|
|
||||||
}
|
|
||||||
fixorder($lid);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$data = json_decode($sPostData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($ajax){
|
||||||
|
$lid = insertlabelset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (count(array_unique($data->{'codelist'})) == count($data->{'codelist'}))
|
||||||
|
{
|
||||||
|
if ($filterxsshtml)
|
||||||
|
{
|
||||||
|
require_once("../classes/inputfilter/class.inputfilter_clean.php");
|
||||||
|
$myFilter = new InputFilter('','',1,1,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = "DELETE FROM ".db_table_name('labels')." WHERE lid = {$lid}";
|
||||||
|
|
||||||
|
$result = db_execute_assoc($query) or safe_die($connect->ErrorMsg());
|
||||||
|
|
||||||
|
foreach($data->{'codelist'} as $index=>$codeid){
|
||||||
|
|
||||||
|
$codeObj = $data->$codeid;
|
||||||
|
|
||||||
|
|
||||||
|
$actualcode = db_quoteall($codeObj->{'code'},true);
|
||||||
|
$codeid = db_quoteall($codeid,true);
|
||||||
|
|
||||||
|
$assessmentvalue = (int)($codeObj->{'assessmentvalue'});
|
||||||
|
|
||||||
|
foreach($data->{'langs'} as $lang){
|
||||||
|
|
||||||
|
$strTemp = 'text_'.$lang;
|
||||||
|
$title = $codeObj->$strTemp;
|
||||||
|
|
||||||
|
if ($filterxsshtml)
|
||||||
|
$title=$myFilter->process($title);
|
||||||
|
else
|
||||||
|
$title = html_entity_decode($title, ENT_QUOTES, "UTF-8");
|
||||||
|
|
||||||
|
|
||||||
|
// Fix bug with FCKEditor saving strange BR types
|
||||||
|
$title =fix_FCKeditor_text($title);
|
||||||
|
$title = db_quoteall($title,true);
|
||||||
|
|
||||||
|
|
||||||
|
$sort_order = db_quoteall($index);
|
||||||
|
$lang = db_quoteall($lang);
|
||||||
|
$title = trim($title, "'");
|
||||||
|
|
||||||
|
if (get_magic_quotes_gpc())
|
||||||
|
{
|
||||||
|
$title = str_replace("'","\'",$title);
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = "INSERT INTO ".db_table_name('labels')." (lid,code,title,sortorder, assessment_value, language)
|
||||||
|
VALUES({$lid},{$actualcode},'".$title."',{$sort_order},{$assessmentvalue},{$lang})";
|
||||||
|
|
||||||
|
$result = db_execute_assoc($query) or safe_die($connect->ErrorMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['flashmessage']=$clang->gT("Labels sucessfully updated");
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$labelsoutput.= "<script type=\"text/javascript\">\n<!--\n alert(\"".$clang->gT("Can't update labels because you are using duplicated codes","js")."\")\n //-->\n</script>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ajax){ die(); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: listcolumn.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: listcolumn.php 11664 2011-12-16 05:19:42Z tmswhite $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("login_check.php");
|
include_once("login_check.php");
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* other free or open source software licenses.
|
* other free or open source software licenses.
|
||||||
* See COPYRIGHT.php for copyright notices and details.
|
* See COPYRIGHT.php for copyright notices and details.
|
||||||
*
|
*
|
||||||
* $Id: login_check.php 10925 2011-09-02 14:12:02Z c_schmitz $
|
* $Id: login_check.php 12211 2012-01-26 17:02:27Z shnoulle $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ if(isset($_GET['user']) && isset($_GET['onepass']))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//check if user exists in DB
|
//check if user exists in DB
|
||||||
$query = "SELECT uid, users_name, password, one_time_pw, dateformat, full_name, htmleditormode FROM ".db_table_name('users')." WHERE users_name=".$connect->qstr($user);
|
$query = "SELECT uid, users_name, password, one_time_pw, dateformat, full_name, htmleditormode, questionselectormode, templateeditormode FROM ".db_table_name('users')." WHERE users_name=".$connect->qstr($user);
|
||||||
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; //Checked
|
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; //Checked
|
||||||
$result = $connect->SelectLimit($query, 1) or safe_die ($query."<br />".$connect->ErrorMsg());
|
$result = $connect->SelectLimit($query, 1) or safe_die ($query."<br />".$connect->ErrorMsg());
|
||||||
if(!$result)
|
if(!$result)
|
||||||
@@ -101,6 +101,8 @@ if(isset($_GET['user']) && isset($_GET['onepass']))
|
|||||||
$_SESSION['loginID'] = $srow['uid'];
|
$_SESSION['loginID'] = $srow['uid'];
|
||||||
$_SESSION['dateformat'] = $srow['dateformat'];
|
$_SESSION['dateformat'] = $srow['dateformat'];
|
||||||
$_SESSION['htmleditormode'] = $srow['htmleditormode'];
|
$_SESSION['htmleditormode'] = $srow['htmleditormode'];
|
||||||
|
$_SESSION['questionselectormode'] = $srow['questionselectormode'];
|
||||||
|
$_SESSION['templateeditormode'] = $srow['templateeditormode'];
|
||||||
$_SESSION['full_name'] = $srow['full_name'];
|
$_SESSION['full_name'] = $srow['full_name'];
|
||||||
GetSessionUserRights($_SESSION['loginID']);
|
GetSessionUserRights($_SESSION['loginID']);
|
||||||
|
|
||||||
@@ -181,7 +183,7 @@ if(!isset($_SESSION['loginID']) && $action != "forgotpass" && ($action != "logou
|
|||||||
|
|
||||||
|
|
||||||
//include("database.php");
|
//include("database.php");
|
||||||
$sIp = $_SERVER['REMOTE_ADDR'];
|
$sIp = getIPAddress();
|
||||||
$query = "SELECT * FROM ".db_table_name('failed_login_attempts'). " WHERE ip='$sIp';";
|
$query = "SELECT * FROM ".db_table_name('failed_login_attempts'). " WHERE ip='$sIp';";
|
||||||
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
|
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
|
||||||
$result = $connect->query($query) or safe_die ($query."<br />".$connect->ErrorMsg());
|
$result = $connect->query($query) or safe_die ($query."<br />".$connect->ErrorMsg());
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user