diff --git a/.gitignore b/.gitignore
index 58f7151b6..5ae53173a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,7 +14,7 @@ application/cache/*
application/config/database.php
application/config/email.php
*.bak
-logs
+logs/*.php
cache
backup/*
system.old
diff --git a/api-documentation/catalog-admin/ddi-schema.json b/api-documentation/catalog-admin/ddi-schema.json
index a0cf59f51..f99ff1751 100644
--- a/api-documentation/catalog-admin/ddi-schema.json
+++ b/api-documentation/catalog-admin/ddi-schema.json
@@ -534,10 +534,14 @@
"title":"Keyword",
"type":"string"
},
+ "vocab":{
+ "title":"Vocabulary",
+ "type":"string"
+ },
"uri":{
"title":"uri",
"type":"string"
- }
+ }
}
}
},
diff --git a/api-documentation/catalog-admin/image-schema.json b/api-documentation/catalog-admin/image-schema.json
index 4f5d80648..863b5a338 100644
--- a/api-documentation/catalog-admin/image-schema.json
+++ b/api-documentation/catalog-admin/image-schema.json
@@ -81,34 +81,89 @@
}
},
"image_description":{
- "allOf": [{
- "$ref": "../schemas/iptc-pmd-schema.json"
- }]
- },
- "files": {
- "type": "array",
- "title": "Files",
- "description": "Files",
- "items":{
- "type":"object",
- "properties":{
- "file_uri": {
- "title": "File name",
- "description":"File name or URL",
- "type": "string"
- },
- "format": {
- "title": "File format",
- "description": "The file format, physical medium, or dimensions of the resource.",
- "type": "string"
- },
- "note": {
- "title": "Notes",
- "type": "string"
+ "type": "object",
+ "properties": {
+ "iptc": {
+ "allOf": [{ "$ref": "../schemas/iptc-pmd-schema.json" }]
+ },
+ "license": {
+ "type": "array",
+ "title": "License",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "License",
+ "type": "string"
+ },
+ "uri": {
+ "title": "URI",
+ "type": "string"
+ }
+ }
}
},
- "required": ["file_uri"]
+ "album": {
+ "type": "array",
+ "title": "Album",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name of album",
+ "type": "string"
+ },
+ "description": {
+ "title": "Description",
+ "type": "string"
+ },
+ "owner": {
+ "title": "Owner",
+ "type": "string"
+ },
+ "uri": {
+ "title": "URI",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "files": {
+ "type": "array",
+ "title": "Files",
+ "description": "Files",
+ "items":{
+ "type":"object",
+ "properties":{
+ "file_uri": {
+ "title": "File name",
+ "description":"File name or URL",
+ "type": "string"
+ },
+ "format": {
+ "title": "File format",
+ "description": "The file format, physical medium, or dimensions of the resource.",
+ "type": "string"
+ },
+ "note": {
+ "title": "Notes",
+ "type": "string"
+ },
+ "show": {
+ "title": "Show file (images only)",
+ "description": "Show the image file on the page",
+ "type": "boolean"
+ }
+ },
+ "required": ["file_uri"]
+ }
+ }
}
}
- }
+ },
+ "additional": {
+ "type": "object",
+ "description": "Additional metadata",
+ "properties": {}
+ }
}
\ No newline at end of file
diff --git a/api-documentation/catalog-admin/script-schema.json b/api-documentation/catalog-admin/script-schema.json
index ae0c43a08..f693199d0 100644
--- a/api-documentation/catalog-admin/script-schema.json
+++ b/api-documentation/catalog-admin/script-schema.json
@@ -11,34 +11,19 @@
"title": "Collection ID that owns the script",
"description": "Abbreviation for the collection that owns the script"
},
-
- "access_policy": {
- "type": "string",
- "title": "Data access policy",
- "description": "Data access policy for attached microdata resources",
- "enum": [
- "direct",
- "open",
- "public",
- "licensed",
- "remote",
- "na"
- ],
- "default": "na"
- },
- "data_remote_url": {
- "type": "string",
- "title": "Data website URL",
- "description": "Link to the website where the data is available, this is only needed if `access_policy` is set to `remote`.",
- "default": ""
- },
"published": {
"type": "integer",
"title": "Status",
"description": "Status of the script - 0=draft, 1=published",
"default": 0
},
+ "overwrite": {
+ "type": "string",
+ "description": "Overwrite document if already exists?",
+ "enum":["yes","no"],
+ "default": "no"
+ },
"doc_desc": {
"type": "object",
@@ -147,18 +132,42 @@
},
"production_date": {
- "type": "string",
"title":"Date of production (YYYY-MM-DD)",
- "description": "Date when the project (dissemination-ready version) was implemented"
- },
- "geographic_coverage": {
- "title": "Geographic coverage",
- "description": "Information on the geographic areas (if any) covered by the scripts/project. This may be a list of countries, regions, etc",
+ "description": "Date when the project (dissemination-ready version) was implemented",
"type": "array",
"items": {
"type": "string"
}
},
+
+ "geographic_units": {
+ "title": "Geographic locations",
+ "description": "List of geographic units (regions, countries, states, provinces, etc.) for which data are available in the database.",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Location name",
+ "description": "Name of the geographic unit e.g. 'World', 'Africa', 'Afghanistan'",
+ "type": "string"
+ },
+ "code": {
+ "title": "Location code",
+ "description": "Code of the geographic unit (for countries, preferred = ISO3 code)",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "description": "Type of geographic unit e.g. country, state, region, province etc",
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ }
+ },
"authoring_entity": {
"type": "array",
"title": "Authoring entity",
@@ -194,9 +203,9 @@
]
}
},
- "contributor": {
+ "contributors": {
"type": "array",
- "title": "Contributor(s)",
+ "title": "Contributors",
"description": "The person, corporate body, or agency who contributed to the project.",
"items": {
"type": "object",
@@ -233,10 +242,10 @@
]
}
},
- "curator": {
+ "curators": {
"type": "array",
- "title": "Contributor(s)",
- "description": "The person, corporate body, or agency who contributed to the project.",
+ "title": "Curators",
+ "description": "The person, corporate body, or agency who curated to the project.",
"items": {
"type": "object",
"properties": {
@@ -276,23 +285,144 @@
"type": "string",
"title": "Abstract"
},
- "output_type": {
- "type": "string",
- "title":"Output type",
- "description": "Type of output of the script/research project. Example: `On-line interactive data visualization`, `Working paper`"
+
+ "keywords":{
+ "title":"Keywords",
+ "type":"array",
+ "items":{
+ "type":"object",
+ "properties":{
+ "name":{
+ "title":"Name",
+ "type":"string"
+ },
+ "vocabulary":{
+ "title":"Vocabulary name",
+ "type":"string"
+ },
+ "uri":{
+ "title":"Vocabulary URI",
+ "type":"string"
+ }
+ }
+ }
},
- "publication_url": {
- "type": "string",
- "title":"Publication URL",
- "description": "Link to the publication (output) to which the scripts are related. This will for example be the URL of a PDF working paper."
+
+ "themes":{
+ "title":"Themes",
+ "type":"array",
+ "items":{
+ "type":"object",
+ "properties":{
+ "name":{
+ "title":"Name",
+ "type":"string"
+ },
+ "vocabulary":{
+ "title":"Vocabulary name",
+ "type":"string"
+ },
+ "uri":{
+ "title":"Vocabulary URI",
+ "type":"string"
+ }
+ }
+ }
},
- "doi": {
- "type": "string",
- "title":"DOI",
- "description": "DOI handle"
+
+ "topics": {
+ "type": "array",
+ "title": "Topics",
+ "description": "Topics covered by the table (ideally, the list of topics will be a controlled vocabulary)",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Unique Identifier",
+ "type": "string"
+ },
+ "name": {
+ "title": "Topic",
+ "type": "string"
+ },
+ "parent_id": {
+ "title": "Parent topic Identifier",
+ "description":"For subtopics, provide the ID of the parent topic",
+ "type": "string"
+ },
+ "vocabulary": {
+ "title": "Vocabulary",
+ "description": "Name of the controlled vocabulary, if the topic is from a taxonomy.",
+ "type": "string"
+ },
+ "uri": {
+ "title": "Vocabulary URI",
+ "description": "Link to the controlled vocabulary web page, if the topic is from a taxonomy.",
+ "type": "string"
+ }
+ },
+ "required": [
+ "id","name"
+ ]
+ }
+ },
+
+ "disciplines": {
+ "type": "array",
+ "title": "Disciplines",
+ "description": "Disciplines e.g. `Social sciences, economics`, `Natural sciences, biology`",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Discipline title or name",
+ "type": "string"
+ },
+ "vocabulary": {
+ "title": "Vocabulary",
+ "description": "Vocabulary",
+ "type": "string"
+ },
+ "uri": {
+ "title": "URI",
+ "description": "Website link",
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ }
+ },
+
+ "output_types":{
+ "title":"Output types",
+ "description": "Type of outputs of the script/research project. Example: `On-line interactive data visualization`, `Working paper`",
+ "type":"array",
+ "items":{
+ "type":"object",
+ "properties":{
+ "type":{
+ "title":"Type",
+ "type":"string"
+ },
+ "description":{
+ "title":"Description",
+ "type":"string"
+ },
+ "uri":{
+ "title":"URI",
+ "type":"string"
+ },
+ "doi":{
+ "title":"DOI",
+ "type":"string"
+ }
+ }
+ }
},
- "repository_url": {
+ "repository_uri": {
"type": "array",
"title": "Source code repository",
"description": "Source code repository",
@@ -318,59 +448,64 @@
"name"
]
}
- },
+ },
+
"project_website": {
- "type": "string",
- "description": "Project website link"
+ "title":"Project website",
+ "description": "Project website link",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
+
"version_statement": {
"type": "object",
"title": "Version Statement",
"description": "Version Statement",
- "_ddi_xpath":"stdyDscr/citation/verStmt",
"properties": {
"version": {
"title": "Version",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/version"
+ "type": "string"
},
"version_date": {
"title": "Version Date",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/version/@date"
+ "type": "string"
},
"version_resp": {
"title": "Version Responsibility Statement",
"description":"The organization or person responsible for the version of the work",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/verResp"
+ "type": "string"
},
"version_notes": {
"title": "Version Notes",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/notes"
+ "type": "string"
}
}
},
"language": {
- "type": "object",
+ "type": "array",
"title": "Language",
"description": "Documentation language e.g. English, French, etc.",
- "properties": {
- "name": {
- "title": "Name",
- "type": "string"
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "code": {
+ "title": "Code",
+ "type": "string"
+ }
},
- "code": {
- "title": "Code",
- "type": "string"
- }
- },
- "required": [
- "name"
- ]
+ "required": [
+ "name"
+ ]
+ }
},
+
"methods": {
"type": "array",
"title":"Methods or algorithms applied",
@@ -440,36 +575,32 @@
"license": {
- "type": "object",
- "title": "License",
- "description": "License",
+ "type": "array",
+ "title": "License",
+ "items": {
+ "type": "object",
"properties": {
"name": {
- "title": "Name",
+ "title": "License",
"type": "string"
},
- "URI": {
+ "uri": {
"title": "URI",
"type": "string"
}
- },
- "required": [
- "name"
- ]
+ }
+ }
},
-
-
-
- "pub_research": {
+ "review_process": {
"type": "array",
- "title": "Published research",
- "description": "Published research",
+ "title": "Review process",
+ "description": "Review process",
"items": {
"type": "object",
"properties": {
- "submit_date": {
+ "submission_date": {
"title": "Date submitted",
"type": "string"
},
@@ -481,63 +612,18 @@
"title": "Review status",
"type": "string"
},
- "review_date": {
- "title": "Review status",
- "type": "string"
- },
- "approval_date": {
- "title": "Approval date",
- "type": "string"
- },
"approval_authority": {
"title": "Approval authority",
"type": "string"
},
- "pub_date": {
- "title": "Date published",
+ "approval_date": {
+ "title": "Date of approval",
"type": "string"
}
}
- },
- "required": [
- "name"
- ]
+ }
},
-
-
- "data_included": {
- "type": "boolean",
- "description": "Is data included with the script?"
- },
- "data_url": {
- "type": "string",
- "description": "Link to an external website where data is available"
- },
- "contact": {
- "type": "array",
- "title": "Contact",
- "description": "Contact",
- "items": {
- "type": "object",
- "properties": {
- "name": {
- "title": "Name",
- "type": "string"
- },
- "affiliation": {
- "title": "Affiliation",
- "type": "string"
- },
- "URI": {
- "title": "URI",
- "type": "string"
- }
- }
- },
- "required": [
- "name"
- ]
- },
+
"disclaimer": {
"title": "Disclaimer",
"type": "string"
@@ -548,13 +634,13 @@
},
"citation_requirement": {
"type": "string",
- "description": "Citation requirements"
+ "description": "Citation requirements"
},
- "data_desc": {
+ "datasets": {
"type": "array",
- "title": "Data description",
- "description": "Contributors",
+ "title": "Datasets",
+ "description": "Datasets used by script",
"items": {
"type": "object",
"properties": {
@@ -574,8 +660,9 @@
"title": "Data access policy",
"type": "string"
},
- "URI": {
- "title": "URL",
+ "uri": {
+ "title": "URI",
+ "description": "Link to the website",
"type": "string"
}
}
@@ -583,48 +670,9 @@
"required": [
"name"
]
- },
-
- "review_process": {
- "type": "array",
- "title": "Project Review Process",
- "description": "Project review process that led to the publishing of the scripts",
- "items": {
- "type": "object",
- "properties": {
- "submit_date": {
- "title": "Submission date",
- "type": "string"
- },
- "reviewer": {
- "title": "Reviewer name",
- "type": "string"
- },
- "status": {
- "title": "Status of review",
- "type": "string"
- },
- "review_date": {
- "title": "Date of review",
- "type": "string"
- },
- "approval_date": {
- "title": "Date of final approval",
- "type": "string"
- },
- "authority": {
- "title": "Authority",
- "description":"Identification of the person or organization having formally approved the scripts/project after comlpetion of the review process",
- "type": "string"
- }
- }
- },
- "required": [
- "reviewer"
- ]
- },
+ },
- "sponsor": {
+ "sponsors": {
"type": "array",
"title": "Sponsor / Funding agency",
"description": "The source(s) of funds for production of the work. If different funding agencies sponsored different stages of the production process, use the 'role' attribute to distinguish them.",
@@ -642,6 +690,10 @@
"role": {
"title": "Role",
"type": "string"
+ },
+ "grant_no":{
+ "title": "Grant number",
+ "type": "string"
}
}
},
@@ -649,6 +701,7 @@
"name"
]
},
+
"acknowledgements": {
"type": "array",
"title": "Other Identifications /Acknowledgments",
@@ -732,10 +785,10 @@
},
- "script_files": {
+ "scripts": {
"type": "array",
"title": "Script files",
- "description": "Script files",
+ "description": "Description of each script file",
"items": {
"type": "object",
"properties": {
diff --git a/api-documentation/catalog-admin/swagger.yaml b/api-documentation/catalog-admin/swagger.yaml
index aa9623c83..737ca91bf 100644
--- a/api-documentation/catalog-admin/swagger.yaml
+++ b/api-documentation/catalog-admin/swagger.yaml
@@ -844,6 +844,31 @@ paths:
description: successful operation
security:
- ApiKeyAuth: []
+ /datasets/strip_ddi/{IDNo}/{options}:
+ put:
+ tags:
+ - Survey
+ summary: Strip DDI elements
+ description: Remove metadata from the DDI file
+ operationId: stripDDI
+ parameters:
+ - in: "path"
+ name: IDNo
+ type: string
+ description: "Dataset IDNo"
+ - in: "path"
+ name: options
+ type: string
+ description: Options for removing metadata elements. Valid options are `summary_stats`, `variables`, `keep_basic`
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ '200':
+ description: successful operation
+ security:
+ - ApiKeyAuth: []
/datasets/update_id/{datasetIDNo}/{newId}:
put:
tags:
diff --git a/application/config/config.php b/application/config/config.php
index 6148a3ced..0461531ca 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -231,7 +231,7 @@
| your log files will fill up very fast.
|
*/
-$config['log_threshold'] = 1;
+$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
diff --git a/application/controllers/Auth.php b/application/controllers/Auth.php
index 326538f5a..6035f8aa3 100644
--- a/application/controllers/Auth.php
+++ b/application/controllers/Auth.php
@@ -5,6 +5,7 @@ function __construct()
{
parent::__construct($skip_auth=TRUE);
+ $this->load->library('Nada_csrf');
$this->load->library('ion_auth');
$this->load->library('session');
$this->load->library('form_validation');
@@ -18,7 +19,6 @@ function __construct()
$this->lang->load('general');
$this->lang->load('users');
- $this->load->model('token_model');
$this->load->driver('captcha_lib');
//$this->output->enable_profiler(TRUE);
@@ -70,25 +70,8 @@ function profile()
function edit_profile()
{
$this->disable_page_cache();
-
- //check if user is logged in
$this->_is_logged_in();
-
- //log
- $this->db_logger->write_log('profile-edit');
-
- //create a form token
- if ($this->input->post("form_token"))
- {
- //use the one in the postback
- $this->form_token=$this->input->post("form_token");
- }
- else
- {
- //create a new token
- $this->form_token=$this->token_model->create_token();
- }
-
+ $csrf=$this->nada_csrf->generate_token();
//currently logged in user
$data['user']= $this->ion_auth->get_user($this->session->userdata('user_id'));
@@ -109,14 +92,10 @@ function edit_profile()
'country' => $this->input->post('country'),
);
$this->ion_auth->update_user($data['user']->id,$update_data);
-
- //delete the token so form can't be re-submitted
- $this->token_model->remove_token($this->input->post('form_token'));
-
$this->session->set_flashdata('message', t("profile_updated"));
redirect("auth/profile", 'refresh');
}
-
+ $data['csrf']=$csrf;
$content=$this->load->view('auth/profile_edit',$data,TRUE);
$this->template->write('title', t('edit_profile'),true);
@@ -124,6 +103,8 @@ function edit_profile()
$this->template->render();
}
+
+
/**
* checks if a user is logged in, otherwise redirects to the login page
*
@@ -243,39 +224,17 @@ function login()
function logout()
{
$this->disable_page_cache();
-
$this->data['title'] = t("logout");
-
- //log
- $this->db_logger->write_log('logout');
-
- //log the user out
$logout = $this->ion_auth->logout();
-
- //redirect them back to the page they came from
redirect('', 'refresh');
- }
+ }
+
//change password
function change_password()
{
$this->disable_page_cache();
-
- //log
- $this->db_logger->write_log('change-pass');
-
- //create a form token
- if ($this->input->post("form_token"))
- {
- //use the one in the postback
- $this->form_token=$this->input->post("form_token");
- }
- else
- {
- //create a new token
- $this->form_token=$this->token_model->create_token();
- }
-
+ $csrf=$this->nada_csrf->generate_token();
$use_complex_password=$this->config->item("require_complex_password");
$this->form_validation->set_rules('old', t('old_password'), 'required|max_length[20]|xss_clean');
@@ -285,11 +244,11 @@ function change_password()
if (!$this->ion_auth->logged_in()) {
redirect('auth/login', 'refresh');
- }
+ }
+
$user = $this->ion_auth->get_user($this->session->userdata('user_id'));
- if ($this->form_validation->run() == false) //display the form
- {
+ if ($this->form_validation->run() == false){
//set the flash data error message if there is one
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
@@ -310,25 +269,18 @@ function change_password()
'type' => 'hidden',
'value' => $user->id,
);
-
- //render
+ $this->data['csrf']=$csrf;
$output=$this->load->view('auth/change_password', $this->data,TRUE);
$this->template->write('content', $output,true);
$this->template->write('title', t('change_password'),true);
$this->template->render();
-
}
- else
- {
+ else{
$identity = $this->session->userdata($this->config->item('identity'));
-
$change = $this->ion_auth->change_password($identity, $this->input->post('old'), $this->input->post('new'));
- //delete the token so form can't be re-submitted
- $this->token_model->remove_token($this->input->post('form_token'));
-
- if ($change) { //if the password was successfully changed
+ if ($change) {
$this->session->set_flashdata('message', t('password_changed_success'));
$this->logout();
}
@@ -339,6 +291,8 @@ function change_password()
}
}
+
+
//forgot password
function forgot_password()
{
@@ -450,24 +404,12 @@ function create_user()
//create a new user
function _create_user()
- {
- $this->data['title'] = t("register");
- $content=NULL;
-
- //create a form token
- if ($this->input->post("form_token"))
- {
- //use the one in the postback
- $this->form_token=$this->input->post("form_token");
- }
- else
- {
- //create a new token
- $this->form_token=$this->token_model->create_token();
- }
-
- $use_complex_password=$this->config->item("require_complex_password");
+ {
+ $this->data['title'] = t("register");
+ $content=NULL;
+ $use_complex_password=$this->config->item("require_complex_password");
+ $csrf=$this->nada_csrf->generate_token();
//validate form input
$this->form_validation->set_rules('first_name', t('first_name'), 'trim|required|xss_clean|max_length[50]');
@@ -478,8 +420,9 @@ function _create_user()
$this->form_validation->set_rules('country', t('country'), 'trim|xss_clean|max_length[150]|callback_country_valid');
$this->form_validation->set_rules('password', t('password'), 'required|min_length['.$this->config->item('min_password_length').']|max_length['.$this->config->item('max_password_length').']|matches[password_confirm]|is_complex_password['.$use_complex_password.']');
$this->form_validation->set_rules('password_confirm', t('password_confirmation'), 'required');
- $this->form_validation->set_rules('form_token', 'FORM TOKEN', 'trim|callback_validate_token');
- $this->form_validation->set_rules($this->captcha_lib->get_question_field(), t('captcha'), 'trim|required|max_length[15]|callback_validate_captcha');
+ //$this->form_validation->set_rules('form_token', 'FORM TOKEN', 'trim|callback_validate_token');
+ $this->form_validation->set_rules('csrf_token', 'CSRF TOKEN', 'trim|callback_validate_token');
+ $this->form_validation->set_rules($this->captcha_lib->get_question_field(), t('captcha'), 'trim|required|callback_validate_captcha');
if ($this->form_validation->run() === TRUE)
{
@@ -499,14 +442,7 @@ function _create_user()
'email'=>$email,
'identity'=>$username
);
-
- //register the user
$this->ion_auth->register($username,$password,$email,$additional_data);
-
- //delete the token so form can't be re-submitted
- $this->token_model->remove_token($this->input->post('form_token'));
-
- //show the success message
$content=$this->load->view('auth/create_user_confirm',NULL,TRUE);
//notify admins
@@ -556,15 +492,18 @@ function _create_user()
'type' => 'password',
'value' => $this->form_validation->set_value('password_confirm'),
);
- $content=$this->load->view('auth/create_user', $this->data,TRUE);
+ $this->data['csrf']=$csrf;
+ $content=$this->load->view('auth/create_user', $this->data,TRUE);
}
- //render final output
- $this->template->write('content', $content,true);
- $this->template->write('title', $this->data['title'],true);
- $this->template->render();
+
+ //render final output
+ $this->template->write('content', $content,true);
+ $this->template->write('title', $this->data['title'],true);
+ $this->template->render();
}
+
/**
*
* validate captcha
@@ -574,8 +513,7 @@ function validate_captcha()
{
$output=$this->captcha_lib->check_answer();
- if ($output===FALSE)
- {
+ if ($output===FALSE){
$this->form_validation->set_message('validate_captcha', t('invalid_captcha'));
}
@@ -584,18 +522,17 @@ function validate_captcha()
/**
*
- * validate form token. avoids duplicate entries
+ * validate CSRF token
*
*/
- function validate_token($str)
- {
- $exists=$this->token_model->token_exists($str);
-
- if ($exists===FALSE)
+ function validate_token()
+ {
+ if (!$this->nada_csrf->validate_token())
{
$this->form_validation->set_message('validate_token', t('form_already_saved'));
return FALSE;
}
+
return TRUE;
}
diff --git a/application/controllers/Catalog.php b/application/controllers/Catalog.php
index 799223277..80915d2b0 100644
--- a/application/controllers/Catalog.php
+++ b/application/controllers/Catalog.php
@@ -265,7 +265,7 @@ function _search()
$offset= ($search_options->page-1)*$this->limit;
//allowed fields for sort_by and sort_order
- $allowed_fields = array('proddate','titl','labl','nation','popularity','rank');
+ $allowed_fields = array('proddate','title','labl','nation','popularity','rank');
$allowed_order=array('asc','desc');
//set default sort options, if passed values are not valid
@@ -856,12 +856,12 @@ function export($format='print')
if ($output['search_type']=='variable')
{
$rows=$output['rows'];
- $cols=explode(",",'uid,name,labl,vid,titl,nation');
+ $cols=explode(",",'uid,name,labl,vid,title,nation');
}
else
{
$rows=$output['surveys']['rows'];
- $cols=explode(",",'id,idno,titl,nation,authenty,year_start,year_end,created,changed');
+ $cols=explode(",",'id,idno,title,nation,authoring_entity,year_start,year_end,created,changed');
}
//var_dump($output['surveys']);exit;
diff --git a/application/controllers/admin/Reports.php b/application/controllers/admin/Reports.php
index 0309de57e..4fe8b06f6 100644
--- a/application/controllers/admin/Reports.php
+++ b/application/controllers/admin/Reports.php
@@ -241,7 +241,7 @@ function _export_to_csv($rows,$filename)
header("Cache-Control: public");
header("Content-Description: File Transfer");
- session_cache_limiter("must-revalidate");
+ //session_cache_limiter("must-revalidate");
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="'.$filename.'"');
diff --git a/application/controllers/admin/Repositories.php b/application/controllers/admin/Repositories.php
index 75e1dfeab..3f12afad2 100644
--- a/application/controllers/admin/Repositories.php
+++ b/application/controllers/admin/Repositories.php
@@ -3,6 +3,7 @@ class Repositories extends MY_Controller {
var $errors='';
var $search_fields=array('username','email','status');
+ var $uploaded_thumbnail_path='';
function __construct()
@@ -30,21 +31,9 @@ function __construct()
//list repositories
function index()
- {
- //get array of db rows
+ {
$result['rows']=$this->_search();
-
- /*$result['rows']=$this->repository_model->get_repositories($published=FALSE, $system=FALSE);//
- $repo_sections=$this->repository_model->get_repository_sections();
-
- foreach($repo_sections as $section)
- {
- $result['sections'][$section['id']]=$section['title'];
- }*/
-
- //load the contents of the page into a variable
- $content=$this->load->view('repositories/index-default', $result,true);
-
+ $content=$this->load->view('repositories/index-default', $result,true);
$this->template->write('content', $content,true);
$this->template->write('title', t('repositories_management'),true);
$this->template->render();
@@ -114,7 +103,7 @@ function _search()
*/
function add()
{
- $this->edit();
+ $this->edit();
}
//process thumbnail uploads
@@ -129,16 +118,15 @@ private function process_file_uploads($file_name)
$this->load->library('upload', $config);
$output=array();
- if ( ! $this->upload->do_upload($file_name))
- {
+ if ( ! $this->upload->do_upload($file_name)){
$error = array('error' => $this->upload->display_errors());
$output=array(
'status'=>'error',
- 'data'=>$error
+ 'data'=>$error,
+ 'upload_path'=>$config['upload_path']
);
}
- else
- {
+ else{
$data = array('upload_data' => $this->upload->data());
$output=array(
'status' =>'success',
@@ -149,7 +137,38 @@ private function process_file_uploads($file_name)
return $output;
}
-
+ /**
+ *
+ *
+ * Callback for collection thumbnail uploads
+ *
+ */
+ function _thumbnail_upload()
+ {
+ if(!empty($_FILES['thumbnail_file']['name'])) {
+ $thumbnail_storage=$this->config->item('collection_image_path', 'collections');
+
+ if(!file_exists($thumbnail_storage)){
+ $error=t('thumbnail_upload_folder_not_set').': '.$thumbnail_storage;
+ $this->form_validation->set_message('_thumbnail_upload',$error);
+ return false;
+ }
+
+ $fileupload_output=$this->process_file_uploads('thumbnail_file');
+
+ if($fileupload_output['status']=='success'){
+ $this->uploaded_thumbnail_path=$fileupload_output['file_name'];
+ }
+ else{
+ $error=t('thumbnail_upload_failed').': '. $fileupload_output['data']['error'];
+ $this->form_validation->set_message('_thumbnail_upload', $error);
+ return false;
+ }
+ }
+ return true;
+ }
+
+
/**
* Edit repo
*
@@ -159,9 +178,8 @@ function edit($id=NULL)
{
$this->load->helper('security');
- if (!is_numeric($id) && $id!==NULL)
- {
- show_error('Invalid id provided');exit;
+ if (!is_numeric($id) && $id!==NULL){
+ show_error('Invalid ID provided');exit;
}
//set validation rules
@@ -173,13 +191,12 @@ function edit($id=NULL)
$this->form_validation->set_rules('thumbnail', t('thumbnail'), 'xss_clean|trim|required');
$this->form_validation->set_rules('section', t('section'), 'xss_clean|trim|max_length[3]|is_natural');
$this->form_validation->set_rules('published', t('published'), 'xss_clean|trim|max_length[1]|is_natural');
+ $this->form_validation->set_rules('thumbnailfile', 'thumbnail_upload', 'callback__thumbnail_upload');
- if (is_numeric($id))
- {
+ if (is_numeric($id)){
$this->page_title=t('edit_repository');
}
- else
- {
+ else{
$this->page_title=t('create_repository');
}
@@ -202,112 +219,83 @@ function edit($id=NULL)
);
//process form
- if ($this->form_validation->run() == TRUE)
- {
+ if ($this->form_validation->run() == TRUE){
$options=array(
- 'group_da_public'=>0,
- 'group_da_licensed'=>0
- );
- $post_arr=$_POST;
+ 'group_da_public'=>0,
+ 'group_da_licensed'=>0
+ );
+ $post_arr=$_POST;
- //read post values to pass to db
- foreach($post_arr as $key=>$value)
- {
- $options[$key]=$this->input->post($key);
- }
-
- //sanitize description html
- $options['long_text']=$this->sanitize_html_input($options['long_text']);
+ //read post values to pass to db
+ foreach($post_arr as $key=>$value){
+ $options[$key]=$this->input->post($key);
+ }
- /*echo '
';
- echo '';
- die();*/
+ //sanitize description html
+ $options['long_text']=$this->sanitize_html_input($options['long_text']);
- //process thumbnail file uploads
- if(!empty($_FILES['thumbnail_file']['name']))
- {
- $fileupload_output=$this->process_file_uploads('thumbnail_file');
-
- if($fileupload_output['status']=='success')
- {
- //update thumbnail path
- $options['thumbnail']=$fileupload_output['file_name'];
- }
- }
+ //process thumbnail file uploads
+ if(!empty($_FILES['thumbnail_file']['name']) && !empty($this->uploaded_thumbnail_path) ){
+ $options['thumbnail']=$this->uploaded_thumbnail_path;
+ }
- if ($id==NULL)
- {
- $db_result=$this->repository_model->insert($options);
- }
- else
- {
- //update db
- $db_result=$this->repository_model->update($id,$options);
- }
+ if ($id==NULL){
+ $db_result=$this->repository_model->insert($options);
+ }
+ else{
+ //update db
+ $db_result=$this->repository_model->update($id,$options);
+ }
- if ($db_result===TRUE)
- {
- if (isset($options['ispublished']) && is_numeric($id))
- {
- //update collection studies status
- $this->publish($id,$options['ispublished']);
- }
-
- //update successful
- $this->session->set_flashdata('message', t('form_update_success'));
-
- //redirect back to the list
- if (!$id) {
- redirect("admin/repositories", "refresh");
- }
- else{
- redirect("admin/repositories/edit/" . $id, "refresh");
- }
- }
- else
- {
- //update failed
- $this->form_validation->set_error(t('form_update_fail'));
- }
+ if ($db_result===TRUE){
+ /*if (isset($options['ispublished']) && is_numeric($id)){
+ //update collection studies status
+ $this->publish($id,$options['ispublished']);
+ }*/
+
+ //update successful
+ $this->session->set_flashdata('message', t('form_update_success'));
+ redirect("admin/repositories", "refresh");
+ }
+ else{
+ //update failed
+ $this->form_validation->set_error(t('form_update_fail'));
+ }
}
else //first time page is loaded or validation failed
{
- if ($id!=NULL)
- {
- $row=$this->repository_model->select_single($id);
-
- if(!$row)
- {
- show_error('ID was not found');
- }
-
- $this->row_data=$row;
-
- //validate and clean up thumbnails
- $default_thumb=$this->config->item('collection_default_thumb', 'collections');
- $thumb_ext=explode(".",basename($this->row_data['thumbnail']));
-
- $thumb_ext=$thumb_ext[count($thumb_ext)-1];
-
- if (!in_array($thumb_ext,array('png','gif','jpg'))){
- $this->row_data['thumbnail']=$default_thumb;
- }
+ if ($id!=NULL){
+ $row=$this->repository_model->select_single($id);
+
+ if(!$row){
+ show_error('ID was not found');
+ }
+
+ $this->row_data=$row;
+
+ //validate and clean up thumbnails
+ $default_thumb=$this->config->item('collection_default_thumb', 'collections');
+ $thumb_ext=explode(".",basename($this->row_data['thumbnail']));
+
+ $thumb_ext=$thumb_ext[count($thumb_ext)-1];
+
+ if (!in_array($thumb_ext,array('png','gif','jpg'))){
+ $this->row_data['thumbnail']=$default_thumb;
}
- }
+ }
+ }
//textboxes
$fields=array('repositoryid','title','url','organization','country','thumbnail','weight');
- foreach($fields as $field)
- {
- $this->data[$field]= array(
- 'name' => $field,
- 'id' => $field,
- 'type' => 'text',
- 'class' => 'form-control',
- 'value' => $this->form_validation->set_value($field,$this->row_data[$field]));
+ foreach($fields as $field){
+ $this->data[$field]= array(
+ 'name' => $field,
+ 'id' => $field,
+ 'type' => 'text',
+ 'class' => 'form-control',
+ 'value' => $this->form_validation->set_value($field,$this->row_data[$field])
+ );
}
$this->data['type']=$this->form_validation->set_value('type',$this->row_data['type']);
@@ -319,17 +307,13 @@ function edit($id=NULL)
//$this->data['group_da_licensed']=$this->form_validation->set_value('group_da_licensed',$this->row_data['group_da_licensed']);
$this->data['section']=$this->form_validation->set_value('section',$this->row_data['section']);
- //show form
$content=$this->load->view('repositories/edit',NULL,true);
-
- //pass data to the site's template
$this->template->write('content', $content,true);
-
- //render final output
$this->template->render();
}
+
/**
*
* Validation HTML
diff --git a/application/controllers/api/Datasets.php b/application/controllers/api/Datasets.php
index bb1d26ed2..7336908ae 100644
--- a/application/controllers/api/Datasets.php
+++ b/application/controllers/api/Datasets.php
@@ -1136,37 +1136,10 @@ function reload_ddi_put($id=NULL,$partial=false)
throw new Exception("ID_MISSING");
}
- $this->load->model("Data_file_model");
- $this->load->library('DDI2_import');
-
- //get survey ddi file path by id
- $ddi_file=$this->Catalog_model->get_survey_ddi_path($id);
-
- if ($ddi_file===FALSE){
- throw new Exception("DDI_FILE_NOT_FOUND");
- }
-
- $dataset=$this->dataset_manager->get_row($id);
-
- $params=array(
- 'file_type'=>'survey',
- 'file_path'=>$ddi_file,
- 'user_id'=>$this->get_api_user_id(),
- 'repositoryid'=>$dataset['repositoryid'],
- 'overwrite'=>'yes',
- 'partial'=>$partial
- );
-
- $result=$this->ddi2_import->import($params,$id);
-
- //reset changed and created dates
- $update_options=array(
- 'changed'=>$dataset['changed'],
- 'created'=>$dataset['created'],
- 'repositoryid'=>$dataset['repositoryid']
- );
- $this->dataset_manager->update_options($id,$update_options);
+ $this->load->library('DDI_Utils');
+ $user_id=$this->get_api_user_id();
+ $result=$this->ddi_utils->reload_ddi($id, $user_id, $partial);
$output=array(
'status'=>'success',
@@ -1301,10 +1274,44 @@ function ddi2array_post()
'message'=>$e->getMessage()
);
$this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST);
- }
-
-
+ }
}
-
+
+
+ /**
+ *
+ * Strip metadata elements from the DDI
+ *
+ * @strip - 'summary_stats', 'variables', 'keep_basic'
+ *
+ **/
+ function strip_ddi_put($idno=NULL,$strip='')
+ {
+ $this->load->library("DDI_Utils");
+
+ try{
+ $sid=$this->get_sid_from_idno($idno);
+ $user_id=$this->get_api_user_id();
+ $result=$this->ddi_utils->strip_ddi($sid, $strip, $keep_original=true);
+
+ if($result){
+ $result=$this->ddi_utils->reload_ddi($sid, $user_id, $partial=false);
+ }
+
+ $output=array(
+ 'status'=>'success',
+ 'result'=>$result
+ );
+
+ $this->set_response($output, REST_Controller::HTTP_OK);
+ }
+ catch(Exception $e){
+ $error_output=array(
+ 'status'=>'failed',
+ 'message'=>$e->getMessage()
+ );
+ $this->set_response($error_output, REST_Controller::HTTP_BAD_REQUEST);
+ }
+ }
}
diff --git a/application/controllers/api/Utils.php b/application/controllers/api/Utils.php
new file mode 100644
index 000000000..b66268d29
--- /dev/null
+++ b/application/controllers/api/Utils.php
@@ -0,0 +1,102 @@
+load->helper("date");
+ }
+
+
+ /**
+ *
+ * Convert RDF to JSON
+ *
+ */
+ public function parse_rdf_post()
+ {
+ $this->load->library('RDF_Parser');
+
+ try {
+ $result=$this->upload_file('file');
+ $uploaded_path=$result['full_path'];
+ $rdf_contents=file_get_contents($uploaded_path);
+ $rdf_array=$this->rdf_parser->parse($rdf_contents);
+
+ if ($rdf_array===FALSE || $rdf_array==NULL){
+ throw new Exception("NO_ENTRIES_FOUND");
+ }
+
+ $rdf_fields=$this->rdf_parser->fields;
+ $rdf_fields['additional']='99';
+
+ $result=array();
+ foreach($rdf_array as $row){
+ $result[]=array_combine(array_keys($rdf_fields), $row);
+ }
+
+ @unlink($uploaded_path);
+
+ $output=array(
+ 'status'=>'success',
+ 'entries'=>$result
+ );
+
+ $this->set_response($output, REST_Controller::HTTP_OK);
+ }
+ catch(Exception $e){
+ $output=array(
+ 'status'=>'error',
+ 'message'=>$e->getMessage()
+ );
+ $this->set_response($output, REST_Controller::HTTP_BAD_REQUEST);
+ }
+
+
+ }
+
+
+ /**
+ *
+ *
+ * upload file to temp
+ *
+ * @file_field_name - name of POST file variable
+ *
+ **/
+ private function upload_file($file_field_name='file', $allowed_types=array('rdf','xml'))
+ {
+ $temp_upload_folder=get_catalog_root().'/tmp';
+
+ if (!file_exists($temp_upload_folder)){
+ @mkdir($temp_upload_folder);
+ }
+
+ if (!file_exists($temp_upload_folder)){
+ throw new Exception('DATAFILES-TEMP-FOLDER-NOT-SET');
+ }
+
+ //upload class configurations for RDF
+ $config['upload_path'] = $temp_upload_folder;
+ $config['overwrite'] = false;
+ $config['encrypt_name']=true;
+ $config['allowed_types'] = implode("|", $allowed_types);
+
+ $this->load->library('upload', $config);
+
+ //process uploaded rdf file
+ $upload_result=$this->upload->do_upload($file_field_name);
+
+ if (!$upload_result){
+ $error = $this->upload->display_errors();
+ throw new Exception("RDF_UPLOAD::".$error);
+ }
+
+ return $this->upload->data();
+ }
+
+
+}
diff --git a/application/controllers/utils/packager.php b/application/controllers/utils/packager.php
deleted file mode 100644
index 9ec63ebc1..000000000
--- a/application/controllers/utils/packager.php
+++ /dev/null
@@ -1,702 +0,0 @@
- ]
-* input: export package file name e.g. citations-12-11-12.json.xml
-* run: /index.php/utils/packager/import_citations/citations-12-11-12.json.xml
-*
-* It only imports citations that are linked to surveys found in the target catalog. It
-* searches for survey IDs in the survey alias table. For inserting/updating citations, it is
-* required that you add IHSN_ID field to the citation's table. It is safe to re-run the script as
-* it would not import duplicate citations when using IHSN_ID field.
-*
-* Requires a minor update to the CITATIONS_MODEL: add IHSN_ID field to update/insert functions
-*
-*
-* Dependency/Files:
-*
-* \models\citations_model.php
-* \models\packager_model.php
-* \controllers\utils\packager.php
-*
-*
-*
-*
-* ///////////////////////////////////////////////////////////////////////////////////////
-* SURVEY Packaging
-* ///////////////////////////////////////////////////////////////////////////////////////
-*
-* NOTE: script can take very long to finish, so only run from CLI
-*
-* Create Package [create]
-* It creates an individual package folder for each survey and create a .PKG package file
-* and copies DDI, RDF and resources listed in the RDF except microdata files.
-*
-* Output is stored in the backup/packages/[survey-folder]
-*
-* TODO: create a file to list available packages.
-*
-*
-* RESTORE Package
-* restore_study($package_file) restores a single survey package.
-*
-* TODO: Add survey aliases to the export/import options
-*
-**/
-class Packager extends MY_Controller {
-
- var $package_folder='';
- var $log_file='';
-
- public function __construct()
- {
- parent::__construct($skip_auth=TRUE);
- $this->load->model('Packager_model');
- $this->load->model('Catalog_model');
- $this->load->model('Citation_model');
- $this->template->set_template('admin');
-
- $this->lang->load("general");
- $this->lang->load("dashboard");
-
- //package folder
- $this->package_folder='backup/packages';
- $this->log_file=$this->package_folder.'/log-'.date("M-d-y").'.txt';
-
- $this->_write_log('====','===================================================');
- }
-
- function index()
- {
- $data['title']='Packager';
-
- //load the contents of the page into a variable
- $content="Studies packager";
-
- //set page title
- $this->template->write('title', 'data packager',true);
- $this->template->write('content', $content,true);
- $this->template->render();
- }
-
-
- //create package
- function create()
- {
- //check requiremnets
- //$this->_check_requirements();
-
- //get all surveys
- $surveys=$this->Packager_model->get_surveys();
- $surveys=$this->Packager_model->get_surveys_by_tags('ihsn');
-
- $output=array();
- $packages_list=array();
-
- //get resources for each survey
- foreach($surveys as $survey)
- {
- //get survey external resources
- //$resources=$this->Packager_model->get_resources($survey['id']);
-
- $survey_obj=(object)$survey;
- //$survey_obj->resources=$resources;
-
- $output[]=$survey_obj;
-
- $packages_list[]=unix_path($this->package_folder.'/'.md5($survey['surveyid']) );
- }
-
- //list of package files created
- file_put_contents($this->package_folder.'\package-list-'.date("m-d-y-His").'.txt',json_encode($packages_list));
-
- //package file
- $file_name='/package-'.date("m-d-y-His").'.pkg';
- $file_path=$this->package_folder.$file_name;
-
- //save package contents
- $result=@file_put_contents($file_path, json_encode($output));
-
- if (!$result)
- {
- show_error("FAILED_TO_WRITE_TO_PACAKE_FILE");
- }
-
- echo $file_name.' created successfully! ';
- echo count($output). ' studies were packaged';
-
- //package individual study + files
- foreach($surveys as $survey)
- {
- echo "packaging ".$survey['id']."\r\n";
- $this->package_study($survey['id'],FALSE);
- }
-
- }
-
-
- //package a single study
- function package_study($id=NULL,$overwrite=TRUE)
- {
- if (!is_numeric($id))
- {
- show_error("INVALID_STUDY");
- }
-
- /*
- Tasks
-
- 1. copy DDI
- 2. create RDF
- 3. copy files defined in RDF
- 4.
- */
-
- //get study info from db
- $study=$this->Packager_model->get_survey($id);
-
- if(!$study)
- {
- show_error("STUDY_NOT_FOUND");
- }
-
- set_time_limit(0);
-
- //get survey folder path
- $survey_folder=$this->Catalog_model->get_survey_path_full($id);
-
- //get study resources
- $study['resources']=$this->Packager_model->get_resources($id);
-
- //start packaging
-
- //check package folder is created
- $study_package_folder=unix_path($this->package_folder.'/'.md5($study['surveyid']) );
-
- //set package folder path in
- $study['package_path']=$study_package_folder;
-
- //try create folder
- @mkdir($study_package_folder);
-
- if (!file_exists($study_package_folder))
- {
- show_error("STUDY_PACKAGE_FOLDER_NOT_FOUND");
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////
- // 1) create package file
- ///////////////////////////////////////////////////////////////////////////////////////
- $result=@file_put_contents($study_package_folder.'/package.json',json_encode($study));
-
- if (!$result)
- {
- show_error("FAILED_TO_WRITE_PACKAGE_FILE ".$study_package_folder);
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////
- // 2) copy DDI
- ///////////////////////////////////////////////////////////////////////////////////////
- copy($this->Catalog_model->get_survey_ddi_path($id),unix_path($study_package_folder.'/'.$study['ddifilename']));
-
- $this->_write_log('info','ddi_copied::'.$study['ddifilename']);
-
- ///////////////////////////////////////////////////////////////////////////////////////
- // 3) copy external resources except microdata
- //////////////////////////////////////////////////////////////////////////////////////
-
- foreach($study['resources'] as $resource)
- {
- $found=false;
-
- //resource types to exclude from copying
- $ignore=array('[dat/micro]','[dat]');
-
- //check if resource is to be ignored
- foreach($ignore as $keyword)
- {
- if (stristr($resource['dctype'],$keyword)!='')
- {
- $found=true;
- }
- }
-
- //skip if from ignored list
- if ($found)
- {
- continue;
- }
-
- //full path to resource file
- $resource_path=unix_path($survey_folder.'/'.$resource['filename']);
- $destination_path=unix_path($study_package_folder.'/'.$resource['filename']);
-
- //copy resource files
- if (file_exists($resource_path) && !is_dir($resource_path))
- {
- //echo 'FOUND FILE'. $resource['filename'];
- set_time_limit(0);
-
- if (!$overwrite && file_exists($destination_path))
- {
- $this->_write_log('info','skipped_resource::'.$resource['filename']);
- continue;//skip file copy if overwrite is set to FALSE
- }
-
- copy($resource_path,$destination_path);
- $this->_write_log('error','copied_resource::'.$resource['filename']);
- }
- }
- }//end-func
-
-
-
- /**
- *
- * Restore a study from package
- **/
- function restore_study($package_file)
- {
- $data=@file_get_contents($package_file);
-
- if (!$data)
- {
- $this->_write_log('error','restore_study::PACKAGE_NOT_FOUND');
- return FALSE;
- }
-
- $study=json_decode($data);
-
- if (!$study)
- {
- $this->_write_log('error','restore_study::FAILED_TO_DECODE');
- return FALSE;
- }
-
- $this->_write_log('codebookid',$study->surveyid);
-
- //import DDI
- $ddi_import_result=$this->_import_ddi($study,$overwrite=TRUE);
-
- if (!$ddi_import_result)
- {
- $this->_write_log('error','restore_study::DDI_IMPORT_FAILED');
- return FALSE;
- }
-
-
- //Set Survey Options
- $options=array(
- 'link_da' =>$study->link_da,
- 'link_technical' =>$study->link_technical,
- 'link_study' =>$study->link_study,
- 'link_report' =>$study->link_report,
- 'formid' =>$study->formid,
- 'published' =>0//$study->published
- );
-
- //update survey
- $this->Packager_model->set_survey_options($study->surveyid,$options);
-
- //get internal survey id
- $id=$this->Packager_model->study_exists($study->surveyid);
-
- if (!$id)
- {
- echo 'SURVEY_ID_NOT_FOUND';
- $this->_write_log('error','restore_study::SURVEY_ID_NOT_FOUND');
- return FALSE;
- }
-
- $survey_folder=$this->Catalog_model->get_survey_path_full($id);
-
- //import Resources
-
- //but first remove any existing resources for the study
- $this->Packager_model->delete_resources($study->surveyid);
-
- //import resources
- $this->Packager_model->import_resources($study->surveyid,$study->resources);
- $this->_write_log('info','restore_study::imported resources');
-
-
- //copy Resource files
- foreach($study->resources as $resource)
- {
- $resource=(array)$resource;
-
- $resource_path=unix_path($study->package_path.'/'.$resource['filename']);
-
- if (file_exists($resource_path))
- {
- $copy=@copy($resource_path,unix_path($survey_folder.'/'.$resource['filename']));
- if ($copy)
- {
- $this->_write_log('copied',$resource['filename']);
- }
- else
- {
- $this->_write_log('copy-failed',$resource['filename']);
- }
- }
- }
-
- }
-
-
- function restore_study_test()
- {
- $path='backup/packages/669f1985dddea5d2818e825031d3727a/package.json';
-
- $this->_write_log('import', $path);
- $this->restore_study($path);
- }
-
- function restore_all_studies()
- {
- $path='backup/packages/package-list-12-19-12-141955.txt';
- $content=file_get_contents($path);
- $packages=json_decode($content);
-
- $k=0;
- foreach($packages as $package)
- {
- $k++;
-
- if ($k>=5)
- {
- break;
- }
-
- $this->_write_log('import', $package);
- $this->restore_study($package.'/package.json');
- }
- }
-
-
-
- /**
- *
- * import a DDI from package
- **/
- function _import_ddi($study,$overwrite=TRUE)
- {
- /**
- 1) if study already exists, update
- 2) if study not found, create new
-
- **/
-
- if ($overwrite==FALSE)
- {
- $id=$this->Packager_model->study_exists($study->surveyid);
-
- if ($id)
- {
- //skip import, study already exists
- $this->_write_log('import-skipped', 'Skipping, overwrite is set to FALSE and study exists');
- return FALSE;
- }
- }
-
- //load DDI Parser Library
- $this->load->library('DDI_Parser');
- $this->load->library('DDI_Import','','DDI_Import');
-
- $ddi_file=$study->package_path.'/'.$study->ddifilename;
-
- if (!file_exists($ddi_file))
- {
- show_error("DDI_NOT_FOUND".$ddi_file);
- }
-
- //set file for parsing
- $this->ddi_parser->ddi_file=$ddi_file;
-
- //only available for xml_reader
- $this->ddi_parser->use_xml_reader=TRUE;
-
- //validate DDI file
- if ($this->ddi_parser->validate()===false)
- {
- //log import error
- $error= t('invalid_ddi_file').' '.$ddi_file;
- $this->_write_log('error', $error);
- return FALSE;
- }
-
- //parse ddi to array
- $data=$this->ddi_parser->parse();
-
- //set the repository where the ddi will be uploaded to
- $this->DDI_Import->repository_identifier=$study->repositoryid;
-
- //import to db
- $result=$this->DDI_Import->import($data,$ddi_file,$overwrite);
-
- if (!$result)
- {
- $error=is_array($this->DDI_Import->errors) ? implode(" ",$this->DDI_Import->errors) : $this->DDI_Import->errors;
- $this->_write_log('ddi-import-failed',$error );
- }
-
- return $result;
- }
-
- function _write_log($type,$message)
- {
- $content=date('H:i:s')."\t$type\t$message\r\n";
- file_put_contents($this->log_file,$content,FILE_APPEND);
- }
-
-
-
- /**
- *
- * Export all citations to json format
- **/
- function export_citations()
- {
- $this->load->model('Citation_model');
-
- $output_file=$this->package_folder.'/citations-'.date("m-d-y").'.json.xml';
-
- //get all citations
- $citations=$this->Packager_model->get_citations_ID_array();
-
- //start output
- $created=@file_put_contents($output_file,''."\r\n".'');
-
- if (!$created)
- {
- show_error("OUTPUT_FILE_WRITE_ERROR");
- }
-
- $combine_row_count=50;
-
- $count=0;
- $output='';
- $k=0;
-
- //package each citation
- foreach($citations as $row)
- {
- $count++;
- $k++;
- set_time_limit(0);
- //get citation info
- $citation=$this->Citation_model->select_single($row['id']);
-
- //prepare for saving
- $output.=''."\r\n";
-
- if ($k>=$combine_row_count)
- {
- //save to output file
- file_put_contents($output_file,$output,FILE_APPEND);
-
- //reset
- $k=0;
- $output='';
-
- echo 'exported '. $count."\r\n";
- }
- }
-
- if ($output!='')
- {
- file_put_contents($output_file,$output,FILE_APPEND);
- }
-
- //end
- file_put_contents($output_file,'',FILE_APPEND);
-
- echo "$k records exported";
- }
-
- function import_citations($filename=NULL)
- {
-
- if (!$filename)
- {
- show_error("NO_FILE");
- }
-
- $input_file=APPPATH.'/../backup/packages/'.basename($filename);
-
- if (!file_exists($input_file))
- {
- show_error("NOT_FOUND");
- }
-
- //initialize the reader
- $reader = new XMLReader();
-
- //read the xml file
- if(!$reader->open($input_file))
- {
- show_error("FILE_READING_ERROR");
- return false;
- }
-
- //find citation elements
- while ($reader->read() )
- {
- if ($reader->nodeType == XMLReader::ELEMENT && $reader->localName == "citation")
- {
- $this->_import_single_citation($reader->readString());
- }
- }
- $reader->close();
- }
-
-
- /**
- *
- * Import a single citation from package
- **/
- private function _import_single_citation($citation)
- {
- $citation=json_decode($citation,TRUE);
- /*
- echo '
';
- var_dump($citation->related_surveys);
- exit;
- var_dump(json_decode($citation));
- echo '';
- exit;
- */
-
- if (!is_array($citation['related_surveys']) && count($citation['related_surveys'])<1)
- {
- //skip citations that are not attached to any surveys
- return FALSE;
- }
-
- $related_surveys=array();
-
- //find matching survey ID in databse
- foreach($citation['related_surveys'] as $related)
- {
- $survey_found=$this->Packager_model->get_survey_uid($related['surveyid']);
-
- if ($survey_found)
- {
- $related_surveys[]=$survey_found;
- }
- }
-
- if (count($related_surveys)==0)
- {
- //skip if the related survey is not found in the database
- return FALSE;
- }
-
- //insert/update citation and link to the surveys
- $citation_id=$this->Packager_model->update_citation($citation,$related_surveys);
-
- echo 'updated/inserted: '. $citation_id;
- echo ' ';
- }
-
-
- /**
- *
- * Return a list of all surveys from the catalog [published/unpublished]
- **/
- function export_survey_list()
- {
- //array of all surveys found in the catalog
- $surveys=$this->Packager_model->get_surveys();
-
- //array of all survey aliases
- $survey_aliases=$this->Packager_model->get_all_survey_aliases();
-
- echo '';
- }
-
-
- function compare_catalogs()
- {
- $form='
';
- var_dump($found);
- }
-
-}
-/* End of file packager.php */
-/* Location: ./controllers/utils/packager.php */
\ No newline at end of file
diff --git a/application/core/MY_Lang.php b/application/core/MY_Lang.php
new file mode 100644
index 000000000..8f41d9362
--- /dev/null
+++ b/application/core/MY_Lang.php
@@ -0,0 +1,141 @@
+load($value, $idiom, $return, $add_suffix, $alt_path);
+ }
+
+ return;
+ }
+
+ $langfile = str_replace('.php', '', $langfile);
+
+ if ($add_suffix === TRUE)
+ {
+ $langfile = preg_replace('/_lang$/', '', $langfile).'_lang';
+ }
+
+ $langfile .= '.php';
+
+ if (empty($idiom) OR ! preg_match('/^[a-z_-]+$/i', $idiom))
+ {
+ $config =& get_config();
+ $idiom = empty($config['language']) ? 'english' : $config['language'];
+ }
+
+ if ($return === FALSE && isset($this->is_loaded[$langfile]) && $this->is_loaded[$langfile] === $idiom)
+ {
+ return;
+ }
+
+ // Load the base file, so any others found can override it
+ $basepath = BASEPATH.'language/'.$idiom.'/'.$langfile;
+ if (($found = file_exists($basepath)) === TRUE)
+ {
+ include($basepath);
+ }
+
+ // Do we have an alternative path to look in?
+ if ($alt_path !== '')
+ {
+ $alt_path .= 'language/'.$idiom.'/'.$langfile;
+ if (file_exists($alt_path))
+ {
+ include($alt_path);
+ $found = TRUE;
+ }
+ }
+ else
+ {
+ foreach (get_instance()->load->get_package_paths(TRUE) as $package_path)
+ {
+ $package_path .= 'language/'.$idiom.'/'.$langfile;
+ if ($basepath !== $package_path && file_exists($package_path))
+ {
+ include($package_path);
+ $found = TRUE;
+ break;
+ }
+ }
+ }
+
+ if ($found !== TRUE)
+ {
+ //show_error('Unable to load the requested language file: language/'.$idiom.'/'.$langfile);
+ log_message('error', 'Unable to load the requested language file: language/'.$idiom.'/'.$langfile);
+ return TRUE;
+ }
+
+ if ( ! isset($lang) OR ! is_array($lang))
+ {
+ log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile);
+
+ if ($return === TRUE)
+ {
+ return array();
+ }
+ return;
+ }
+
+ if ($return === TRUE)
+ {
+ return $lang;
+ }
+
+ $this->is_loaded[$langfile] = $idiom;
+ $this->language = array_merge($this->language, $lang);
+
+ log_message('info', 'Language file loaded: language/'.$idiom.'/'.$langfile);
+ return TRUE;
+ }
+
+
+
+}
diff --git a/application/language/base/breadcrumbs_lang.php b/application/language/base/breadcrumbs_lang.php
index e4b332348..9ff4c559b 100644
--- a/application/language/base/breadcrumbs_lang.php
+++ b/application/language/base/breadcrumbs_lang.php
@@ -1,18 +1,17 @@
-Link or Unlink buttons to link or unlink studies.';
-$lang['copy_studies_to']='Copy studies to ';
-$lang['change_repo']='Switch';
-$lang['repositoryid']='Collection';
-$lang['copy_studies']='Copy studies';
-$lang['transfer_study_ownership']='Transfer study owner';
-$lang['transfer_ownership']='Transfer owner';
-$lang['msg_studies_to_transfer']='Studies that will be transferred';
-$lang['study_owned']='Owned study';
-$lang['study_linked']='Linked study';
-$lang['is_harvested_study']='Harvested study';
-$lang['select_publish_unpublish']='Select to publish/unpublish';
-$lang['publish']='Publish';
-$lang['series']='Series';
-$lang['data_access']='Data access';
-$lang['overwrite_if_exists']='Overwrite if already exists?';
-$lang['sort_by']='Sort results by:';
-$lang['surveyid']='SurveyID';
-$lang['no_related_citations_click_here_to_add']='There are no citations attached to this survey, to add related citations, click here.';
-$lang['max_upload_limit']='Max upload file size:';
-$lang['upload_ddi']='Add study';
-$lang['clear_filter']='Clear filter';
-$lang['countries']='Countries';
-$lang['titl']='Title';
-$lang['study_status']='Study status';
-$lang['all']='All';
-$lang['published']='Published';
-$lang['unpublished']='Unpublished';
-$lang['tags']='Tags';
-$lang['click_to_publish_unpublish']='Click to publish or unpublish';
-
-$lang['pdf_not_generated']='PDF not generated';
-$lang['pdf_uptodate']='PDF is up-to-date';
-$lang['pdf_outdated']='PDF is outdated';
-$lang['metadata_in_pdf']='Metadata in PDF';
-$lang['replace_ddi']='Replace DDI';
-$lang['delete_study']='Delete study';
-$lang['browse_metadata']='Browse metadata';
-$lang['generate_pdf']='Generate PDF';
-$lang['upload_rdf']='Upload RDF';
-$lang['link_resources']='Link resources';
-$lang['export_ddi']='Export DDI';
-$lang['export_rdf']='Export RDF';
-$lang['admin_notes']='Admin notes';
-$lang['reviewer_notes']='Reviewer notes';
-$lang['study_collections']='Display in other collections';
-$lang['study_aliases']='Study aliases';
-
-$lang['study_warnings']='Warnings!';
-$lang['warning_study_has_no_external_resources']='Study has no external resources attached';
-$lang['warning_study_has_no_microdata']='Study has no microdata attached';
-$lang['warning_study_has_no_questionnaire']='Study has no questionnaires attached';
-$lang['warning_study_has_pending_licensed_requests']='Study has pending licensed requests';
-$lang['warning_study_not_published']='Study is not published';
-$lang['warning_study_years_not_set']='Study data collection years are not set';
-$lang['warning_study_has_no_pdf_documentation']='Study metadata documentation in PDF is not generated';
-
-
-$lang['study_no_questionnaire']='Studies with no questionnaire';
-$lang['study_no_datafile']='Studies with no data';
-$lang['filter']='Filter';
-$lang['ID']='ID';
-$lang['collection']='Collection';
-$lang['modified_on']='Modified on';
-$lang['Published']='Published';
-$lang['Survey options']='Survey options';
-$lang['Tags']='Tags';
-$lang['Generate PDF']='Generate PDF';
-$lang['Status']='Status';
-
-$lang['batch_upload_files']='Upload files';
-$lang['clear_import_folder']='Clear import files';
-$lang['central_catalog_short_text']='a para describing central catalog';
-$lang['study_exists_in_other_collection']='Study already exists in collection [%s]. To update the study, you must switch to the collection and upload DDI.';
-
-$lang['type_admin']='Admin notes';
-$lang['type_reviewer']='Reviewer notes';
-$lang['type_public']='Public notes';
-$lang['select_note_type']='Select note type';
-$lang['admin_note']='Admin note';
-$lang['reviewer_note']='Reviewer note';
-$lang['public_note']='Public note';
-
-$lang['add_note']='Add Note';
-$lang['click_on_icon_to_remove_citation']='Click on the icon %s to remove citation';
-$lang['attach_citation']='Attach Citation';
-$lang['js_refreshing_page']='Refreshing page, please wait...';
-
-$lang['remove_from_collection']='Remove';
-$lang['remove_from_collection_description']='Remove this study from this collection.';
-$lang['studies_linked_count']='Studies linked from other collections';
-$lang['notes']='Notes';
-$lang['link_study']='Link';
-$lang['unlink_study']='Unlink';
-$lang['transfer']='Transfer';
-$lang['select_the_repository_from_the_list_below']='Select the collection from the list below to transfer ownership to another collection.';
-$lang['study_metadata_updated']='Study metadata has been refreshed!';
-$lang['refresh_ddi']='Refresh DDI';
-$lang['batch_refresh_ddi']='Batch refresh DDI';
-$lang['ddi_batch_refresh_title']='Batch refresh DDI';
-$lang['btn_refresh']='Refresh DDI';
-$lang['refresh_ddi_description']='Refresh DDI updates the database with the metadata from the DDI.';
-$lang['total_studies_found']='Total studies found';
-$lang['mark_as_featured']='Display as featured study?';
-$lang['msg_study_ownership_has_changed']='Study ownership changed!';
-$lang['replace_ddi_failed_duplicate_study_found']='The catalog contains another study with the same ID';
-$lang['show_selected_only']='Show selected only';
-
+$lang['msg_select_repository']="Select collection";
+$lang['repositories']="Collections";
+$lang['msg_copy_studies']="Click on the Link or Unlink buttons to link or unlink studies.";
+$lang['copy_studies_to']="Copy studies to ";
+$lang['change_repo']="Switch";
+$lang['repositoryid']="Collection";
+$lang['copy_studies']="Copy studies";
+$lang['transfer_study_ownership']="Transfer study owner";
+$lang['transfer_ownership']="Transfer owner";
+$lang['msg_studies_to_transfer']="Studies that will be transferred";
+$lang['study_owned']="Owned study";
+$lang['study_linked']="Linked study";
+$lang['is_harvested_study']="Harvested study";
+$lang['select_publish_unpublish']="Select to publish/unpublish";
+$lang['publish']="Publish";
+$lang['series']="Series";
+$lang['data_access']="Data access";
+$lang['overwrite_if_exists']="Overwrite if already exists?";
+$lang['sort_by']="Sort results by:";
+$lang['surveyid']="SurveyID";
+$lang['no_related_citations_click_here_to_add']="There are no citations attached to this survey, to add related citations, click here.";
+$lang['max_upload_limit']="Max upload file size:";
+$lang['upload_ddi']="Add study";
+$lang['clear_filter']="Clear filter";
+$lang['countries']="Countries";
+$lang['titl']="Title";
+$lang['study_status']="Study status";
+$lang['all']="All";
+$lang['published']="Published";
+$lang['unpublished']="Unpublished";
+$lang['tags']="Tags";
+$lang['click_to_publish_unpublish']="Click to publish or unpublish";
+$lang['pdf_not_generated']="PDF not generated";
+$lang['pdf_uptodate']="PDF is up-to-date";
+$lang['pdf_outdated']="PDF is outdated";
+$lang['metadata_in_pdf']="Metadata in PDF";
+$lang['replace_ddi']="Replace DDI";
+$lang['delete_study']="Delete study";
+$lang['generate_pdf']="Generate PDF";
+$lang['upload_rdf']="Upload RDF";
+$lang['link_resources']="Link resources";
+$lang['export_ddi']="Export DDI";
+$lang['export_rdf']="Export RDF";
+$lang['admin_notes']="Admin notes";
+$lang['reviewer_notes']="Reviewer notes";
+$lang['study_collections']="Display in other collections";
+$lang['study_aliases']="Study aliases";
+$lang['study_warnings']="Warnings!";
+$lang['warning_study_has_no_external_resources']="Study has no external resources attached";
+$lang['warning_study_has_no_microdata']="Study has no microdata attached";
+$lang['warning_study_has_no_questionnaire']="Study has no questionnaires attached";
+$lang['warning_study_has_pending_licensed_requests']="Study has pending licensed requests";
+$lang['warning_study_not_published']="Study is not published";
+$lang['warning_study_years_not_set']="Study data collection years are not set";
+$lang['warning_study_has_no_pdf_documentation']="Study metadata documentation in PDF is not generated";
+$lang['study_no_questionnaire']="Studies with no questionnaire";
+$lang['study_no_datafile']="Studies with no data";
+$lang['filter']="Filter";
+$lang['ID']="ID";
+$lang['collection']="Collection";
+$lang['modified_on']="Modified on";
+$lang['Published']="Published";
+$lang['Survey options']="Survey options";
+$lang['Tags']="Tags";
+$lang['Generate PDF']="Generate PDF";
+$lang['Status']="Status";
+$lang['batch_upload_files']="Upload files";
+$lang['clear_import_folder']="Clear import files";
+$lang['central_catalog_short_text']="a para describing central catalog";
+$lang['study_exists_in_other_collection']="Study already exists in collection [%s]. To update the study, you must switch to the collection and upload DDI.";
+$lang['type_admin']="Admin notes";
+$lang['type_reviewer']="Reviewer notes";
+$lang['type_public']="Public notes";
+$lang['select_note_type']="Select note type";
+$lang['admin_note']="Admin note";
+$lang['reviewer_note']="Reviewer note";
+$lang['public_note']="Public note";
+$lang['add_note']="Add Note";
+$lang['click_on_icon_to_remove_citation']="Click on the icon %s to remove citation";
+$lang['attach_citation']="Attach Citation";
+$lang['js_refreshing_page']="Refreshing page, please wait...";
+$lang['remove_from_collection']="Remove";
+$lang['remove_from_collection_description']="Remove this study from this collection.";
+$lang['studies_linked_count']="Studies linked from other collections";
+$lang['notes']="Notes";
+$lang['link_study']="Link";
+$lang['unlink_study']="Unlink";
+$lang['transfer']="Transfer";
+$lang['select_the_repository_from_the_list_below']="Select the collection from the list below to transfer ownership to another collection.";
+$lang['study_metadata_updated']="Study metadata has been refreshed!";
+$lang['refresh_ddi']="Refresh DDI";
+$lang['batch_refresh_ddi']="Batch refresh DDI";
+$lang['ddi_batch_refresh_title']="Batch refresh DDI";
+$lang['btn_refresh']="Refresh DDI";
+$lang['refresh_ddi_description']="Refresh DDI updates the database with the metadata from the DDI.";
+$lang['total_studies_found']="Total studies found";
+$lang['mark_as_featured']="Display as featured study?";
+$lang['msg_study_ownership_has_changed']="Study ownership changed!";
+$lang['replace_ddi_failed_duplicate_study_found']="The catalog contains another study with the same ID";
+$lang['show_selected_only']="Show selected only";
$lang['Data available from external repository']="Data available from external repository";
$lang['Data not available']="Data not available";
-
-/* End of file menu_lang.php */
-/* Location: ./system/language/urdu/menu_lang.php */
\ No newline at end of file
+$lang['error_no_collection_selected']="You have not selected a collection!";
+$lang['confirm_publish_records']="Confirm to publish study?";
+$lang['confirm_publish']="Publish?";
+$lang['attach_citations']="Attach citations";
+$lang['return_to_edit_page']="Return to edit page";
+$lang['attach_related_data']="Attach related";
+$lang['no_related_studies_click_here_to_add']="There are no related studies attached";
+$lang['relationship_type']="Relationship type";
+$lang['draft']="Draft";
+$lang['confirm_unpublish_records']="Are you sure you want to unpublish records?";
+$lang['confirm_unpublish']="Confirm unpublish";
+
+$lang['tab_overview']="Overview";
+$lang['tab_manage_files']="Files";
+$lang['tab_resources']="Resources";
+$lang['tab_citations']="Citations";
+$lang['tab_data_files']="Data files";
+$lang['tab_notes']="Notes";
+$lang['tab_related_data']="Related studies";
+
+
+
+/* End of file catalog_admin_lang.php */
+/* Location: ./application/language/english/catalog_admin_lang.php */
\ No newline at end of file
diff --git a/application/language/base/catalog_search_lang.php b/application/language/base/catalog_search_lang.php
index b097b2999..b00e9c5d8 100644
--- a/application/language/base/catalog_search_lang.php
+++ b/application/language/base/catalog_search_lang.php
@@ -1,4 +1,5 @@
config/email.php file.";
-
-
-
-
-/* End of file vocabularies_lang.php */
-/* Location: ./system/language/english/vocabularies_lang.php */
\ No newline at end of file
+config/email.php file.";
+$lang['test_email_configurations']="Test email configurations";
+
+
+/* End of file configurations_lang.php */
+/* Location: ./application/language/english/configurations_lang.php */
\ No newline at end of file
diff --git a/application/language/base/da_collection_lang.php b/application/language/base/da_collection_lang.php
index 1d0f2c3b8..db0a3290f 100644
--- a/application/language/base/da_collection_lang.php
+++ b/application/language/base/da_collection_lang.php
@@ -1,19 +1,19 @@
-%d cached files, click here to clear cache.";
-
-$lang['recent_studies'] = "Recently updated studies";
-$lang['logged_in_users'] = "Logged in";
-$lang['anonymous_users'] = "Anonymous users viewing the site";
-$lang['Maintenance'] = "Manage studies";
-$lang['Administrators'] = "Administrators";
-$lang['History'] = "History";
-$lang['Edit'] = "Edit collection";
-$lang['Collection'] = "Collection";
-$lang['collection_contains_n_studies'] = "Collection contains %d studies";
-$lang['catalog_contains_n_studies'] = "Catalog contains %d studies";
-$lang['studies_with_no_data_files'] = "PUF with no data files";
-$lang['studies_with_no_questionnaires'] = "with no questionnaires";
-$lang['owned'] = "Owned";
-$lang['linked'] = "Linked";
-$lang['published'] = "Published";
-$lang['unpublished'] = "Unpublished";
+$lang['dashboard']="Dashboard";
+$lang['nada_news_updates']="NADA News & Updates";
+$lang['users']="Users";
+$lang['database_backup']="Database Backup";
+$lang['cache_files']="Cache Files";
+$lang['report_bug']="Report Bug/Feature/Request";
+$lang['reporter_name']="Name";
+$lang['reporter_email']="Email";
+$lang['subject']="Subject";
+$lang['bug_request_description']="Provide detailed description of the bug/feature";
+$lang['submit']="Submit";
+$lang['user_active']="Active";
+$lang['user_disabled']="Disabled";
+$lang['user_inactive']="Inactive - never logged in";
+$lang['bug_report']="Report Bug or Request a feature";
+$lang['run_database_backup_script']="Run database backup script";
+$lang['no_cache_files_found']="No cache files were found";
+$lang['clear_cache_files']="You have %d cached files, click here to clear cache.";
+$lang['recent_studies']="Recently updated studies";
+$lang['logged_in_users']="Logged in";
+$lang['anonymous_users']="Anonymous users viewing the site";
+$lang['Maintenance']="Manage studies";
+$lang['Administrators']="Administrators";
+$lang['History']="History";
+$lang['Edit']="Edit collection";
+$lang['Collection']="Collection";
+$lang['collection_contains_n_studies']="Collection contains %d studies";
+$lang['catalog_contains_n_studies']="Catalog contains %d studies";
+$lang['studies_with_no_data_files']="PUF with no data files";
+$lang['studies_with_no_questionnaires']="with no questionnaires";
+$lang['owned']="Owned";
+$lang['linked']="Linked";
+$lang['published']="Published";
+$lang['unpublished']="Unpublished";
/* End of file dashboard_lang.php */
-/* Location: ./system/language/english/dashboard_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/dashboard_lang.php */
\ No newline at end of file
diff --git a/application/language/base/data_enclave_lang.php b/application/language/base/data_enclave_lang.php
index a531aab78..2c9ad4883 100644
--- a/application/language/base/data_enclave_lang.php
+++ b/application/language/base/data_enclave_lang.php
@@ -1,7 +1,7 @@
-The National Data Enclave (NDE) was established by the National Data Archive to
+$lang['data_enclave_access_request']="National Data Enclave Access Request";
+$lang['data_enclave_description']="
The National Data Enclave (NDE) was established by the National Data Archive to
allow researchers meeting certain qualifications, and under strict supervision, to
access confidential statistical micro data files. NDE provides a mechanism whereby
researchers can access detailed data files in a secure environment, without
@@ -12,9 +12,8 @@
NDE Operations
Researchers can access the data on-site, where they are provided with the data,
- computer equipment, software, office space, and NDE staff supervision.
';
-
-$lang['data_enclave_application_form_link'] = "Click here to download the Application form for access to data enclave";
+ computer equipment, software, office space, and NDE staff supervision.";
+$lang['data_enclave_application_form_link']="Click here to download the Application form for access to data enclave";
/* End of file data_enclave_lang.php */
-/* Location: ./system/language/english/data_enclave_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/data_enclave_lang.php */
\ No newline at end of file
diff --git a/application/language/base/ddi_fields_lang.php b/application/language/base/ddi_fields_lang.php
new file mode 100644
index 000000000..861aafdd5
--- /dev/null
+++ b/application/language/base/ddi_fields_lang.php
@@ -0,0 +1,290 @@
+%s variables, if the system can't generate the PDF, try excluding the 'Data Dictionary Description' option.";
-$lang['include_variable_toc'] = "Variable list";
-$lang['include_variable_desc'] = "Variable description";
-$lang['include_external_resources'] = "External resource";
-$lang['Report options'] = "Report options:";
-$lang['processing_pdf_report'] = "Generating PDF report, it may take few minutes or longer...";
-
-$lang['get_microdata'] = "Get Microdata";
-$lang['study_description'] = "Study Description";
-$lang['data_dictionary'] = "Data Description";
-$lang['related_materials'] = "Documentation";
-$lang['related_citations'] = "Related Publications";
-$lang['citations'] = "Citations";
-$lang['review_study'] = "Review";
-$lang['add_note'] = "Add note";
-$lang['no_reviewer_notes_found'] = "The study has no reviewer notes attached. To add a new note, use the 'Add note' link.";
-
-$lang['no_resources_attached'] = "Study has no external resources.";
-$lang['no_microdata_attached'] = "Study has no microdata available.";
-
-
-
-$lang['created_on'] = "Created on";
-$lang['last_modified'] = "Last modified";
-$lang['page_views'] = "Page views";
-$lang['downloads'] = "Downloads";
-$lang['documentation_in_pdf'] = "Documentation in PDF";
-$lang['download_rdf'] = "Download RDF";
-
-$lang['reviewer_notes'] = "Reviewer notes";
-$lang['js_refreshing_page'] = "Reloading page, please wait...";
-$lang['visit_data_catalog_at'] = "Visit our data catalog at";
-$lang['report_generated_on'] = "Report generated on";
-
-
-
-$lang['cover'] = "Cover";
-$lang['study_title'] = "Study Title";
-$lang['overview'] = "Overview";
-$lang['sampling'] = "Sampling";
-$lang['questionnaires'] = "Questionnaires";
-$lang['data_collection'] = "Data Collection";
-$lang['data_processing'] = "Data Processing";
-$lang['data_appraisal'] = "Data Appraisal";
-$lang['file_description'] = "File Description";
-$lang['variable_list'] = "Variable List";
-$lang['variable_description'] = "Variable Description";
-$lang['external_resources'] = "External Resources";
-
-$lang['report_lang'] = "Report language";
-$lang['external_resources'] = "External Resources";
-$lang['generate_pdf'] = "Generate PDF";
-
-$lang['Mean'] = "Mean";
-$lang['Standard deviation'] = "Standard deviation";
-$lang['search_data_dictionary'] = "Search data dictionary";
-$lang['Total variables(s)'] = "Total variables(s)";
-$lang['download_study_rdf'] = "Download study resource descriptions (e.g. reports, questionnaires, technical documents) in Dublin Core RDF format";
-$lang['download_study_ddi'] = "Download study metadata in DDI (XML) format";
-
-$lang['study_documentation_text'] = "Download the questionnaires, technical documents and reports that describe the survey process and the key results for this study.";
-$lang['study_description_text'] = "The section provides a detailed description of the study (i.e. the metadata). Topics covered relate to the survey methodology, sampling methods, data collection, funding, dates of collection, geographical coverage and the access policy for the data from this study. Download the metadata in a number of formats from the Export metadata link.";
-$lang['data_description_text'] = "This section provides detailed information on the unit-record data generated by this study. This includes a detailed description of the contents of each data file and all the variables within each file. Variables may contain the recorded results of a direct question asked, or be derived in some way. The number of variables and the number of data points (cases) are summarized for each variable.";
-$lang['related_publications_text'] = "The data from this study are used in the following publications:";
-
-
-
+$lang['request_microdata']="Request Microdata";
+$lang['download_metadata']="Metadata in XML";
+$lang['website_title']="Website title";
+$lang['study_title']="Study Title";
+$lang['publisher']="Publisher";
+$lang['website_url']="Website URL";
+$lang['study_contains_too_many_variables']="The study contains over %s variables, if the system can't generate the PDF, try excluding the 'Data Dictionary Description' option.";
+$lang['include_variable_toc']="Variable list";
+$lang['include_variable_desc']="Variable description";
+$lang['include_external_resources']="External resource";
+$lang['Report options']="Report options:";
+$lang['processing_pdf_report']="Generating PDF report, it may take few minutes or longer...";
+$lang['get_microdata']="Get Microdata";
+$lang['study_description']="Study Description";
+$lang['data_dictionary']="Data Description";
+$lang['related_materials']="Documentation";
+$lang['related_citations']="Related Publications";
+$lang['citations']="Citations";
+$lang['review_study']="Review";
+$lang['add_note']="Add note";
+$lang['no_reviewer_notes_found']="The study has no reviewer notes attached. To add a new note, use the 'Add note' link.";
+$lang['no_resources_attached']="Study has no external resources.";
+$lang['no_microdata_attached']="Study has no microdata available.";
+$lang['created_on']="Created on";
+$lang['last_modified']="Last modified";
+$lang['page_views']="Page views";
+$lang['downloads']="Downloads";
+$lang['documentation_in_pdf']="Documentation in PDF";
+$lang['download_rdf']="Download RDF";
+$lang['reviewer_notes']="Reviewer notes";
+$lang['js_refreshing_page']="Reloading page, please wait...";
+$lang['visit_data_catalog_at']="Visit our data catalog at";
+$lang['report_generated_on']="Report generated on";
+$lang['cover']="Cover";
+$lang['file_description']="File Description";
+$lang['variable_list']="Variable List";
+$lang['variable_description']="Variable Description";
+$lang['external_resources']="External Resources";
+$lang['report_lang']="Report language";
+$lang['generate_pdf']="Generate PDF";
+$lang['Mean']="Mean";
+$lang['Standard deviation']="Standard deviation";
+$lang['search_data_dictionary']="Search data dictionary";
+$lang['Total variables(s)']="Total variables(s)";
+$lang['download_study_rdf']="Download study resource descriptions (e.g. reports, questionnaires, technical documents) in Dublin Core RDF format";
+$lang['download_study_ddi']="Download study metadata in DDI (XML) format";
+$lang['study_documentation_text']="Download the questionnaires, technical documents and reports that describe the survey process and the key results for this study.";
+$lang['study_description_text']="The section provides a detailed description of the study (i.e. the metadata). Topics covered relate to the survey methodology, sampling methods, data collection, funding, dates of collection, geographical coverage and the access policy for the data from this study. Download the metadata in a number of formats from the Export metadata link.";
+$lang['data_description_text']="This section provides detailed information on the unit-record data generated by this study. This includes a detailed description of the contents of each data file and all the variables within each file. Variables may contain the recorded results of a direct question asked, or be derived in some way. The number of variables and the number of data points (cases) are summarized for each variable.";
+$lang['related_publications_text']="The data from this study are used in the following publications:";
+$lang['related_studies']="Related studies";
/* End of file ddibrowser_lang.php */
-/* Location: ./system/language/english/ddibrowser_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/ddibrowser_lang.php */
\ No newline at end of file
diff --git a/application/language/base/direct_access_terms_lang.php b/application/language/base/direct_access_terms_lang.php
index 9591e61a1..4a12c3b90 100644
--- a/application/language/base/direct_access_terms_lang.php
+++ b/application/language/base/direct_access_terms_lang.php
@@ -1,11 +1,7 @@
-
The data and other materials provided by the National Data Archive will not
be redistributed or sold to other individuals, institutions, or organizations
@@ -34,9 +30,8 @@
Archive will conform to widely-accepted standards of practice and legal
restrictions that are intended to protect the confidentiality of respondents.
";
-
-$lang['form_removed_and_not_available']='Form has been removed and is not longer available.';
-$lang['survey_data_files']='Survey Data Files';
+$lang['form_removed_and_not_available']="Form has been removed and is not longer available.";
+$lang['survey_data_files']="Survey Data Files";
/* End of file direct_access_terms_lang.php */
-/* Location: ./system/language/english/direct_access_terms_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/direct_access_terms_lang.php */
\ No newline at end of file
diff --git a/application/language/base/fields_document_lang.php b/application/language/base/fields_document_lang.php
new file mode 100644
index 000000000..e61cb008c
--- /dev/null
+++ b/application/language/base/fields_document_lang.php
@@ -0,0 +1,78 @@
+%s extension is not enabled. Edit php.ini file to enable extension.';
-
-$lang['folder_permissions'] = "Folder READ/WRITE/DELETE permissions";
-$lang['folder'] = "Folder";
-$lang['read_write'] = "Read/Write";
-$lang['delete'] = "Delete";
-
-$lang['server_information'] = "Server information";
-$lang['php_version'] = "PHP version";
-$lang['db_version'] = "DB version";
-$lang['connection_success'] = "connection was successful!";
-$lang['web_server'] = "Web server";
-$lang['database_error_cant_continue'] = "The database connection failed, Installer cannot continue until database settings are fixed.";
-
-$lang['other_php_settings'] = "Other PHP.INI Settings";
-$lang['setting'] = "Setting";
-$lang['value'] = "Value";
-$lang['recommended'] = "Recommended";
-$lang['enabled'] = "Enabled";
-$lang['disabled'] = "Disabled";
-
-$lang['install_database'] = "Install Database";
-$lang['create_user'] = "Create account";
-$lang['installer_title'] = "NADA Installer";
-$lang['time_zone_is_required'] = "See how to configure and select the right timezone";
-$lang['not_set'] = "Not set";
+$lang['create_admin_account']="Create administrator account";
+$lang['database_connection_failed']="Database connection failed. Check your database settings.";
+$lang['database_creation_failed']="Failed to create the database.";
+$lang['database_tables_created']="Database and Tables were created successfully!";
+$lang['return_to_site']="Click here to return to the site home page";
+$lang['page_not_found']="PAGE NOT FOUND";
+$lang['install_completed']="Installation completed!";
+$lang['install_completed_tasks_summary']="The application installation has completed, the summary of the tasks is below:";
+$lang['task']="Task";
+$lang['status']="Status";
+$lang['database']="Database";
+$lang['tables']="Tables";
+$lang['admin_account']="Admin account";
+$lang['click_here_to_launch_application']="Click here to launch the website!";
+$lang['optional']="(optional)";
+$lang['required_php_extensions']="Required PHP Extensions";
+$lang['extensions']="Extensions";
+$lang['enabled']="Enabled";
+$lang['extension_not_enabled']="%s extension is not enabled. Edit php.ini file to enable extension.";
+$lang['folder_permissions']="Folder READ/WRITE/DELETE permissions";
+$lang['folder']="Folder";
+$lang['read_write']="Read/Write";
+$lang['delete']="Delete";
+$lang['server_information']="Server information";
+$lang['php_version']="PHP version";
+$lang['db_version']="DB version";
+$lang['connection_success']="connection was successful!";
+$lang['web_server']="Web server";
+$lang['database_error_cant_continue']="The database connection failed, Installer cannot continue until database settings are fixed.";
+$lang['other_php_settings']="Other PHP.INI Settings";
+$lang['setting']="Setting";
+$lang['value']="Value";
+$lang['recommended']="Recommended";
+$lang['disabled']="Disabled";
+$lang['install_database']="Install Database";
+$lang['create_user']="Create account";
+$lang['installer_title']="NADA Installer";
+$lang['time_zone_is_required']="See how to configure and select the right timezone";
+$lang['not_set']="Not set";
/* End of file install_lang.php */
-/* Location: ./system/language/english/install_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/install_lang.php */
\ No newline at end of file
diff --git a/application/language/base/iso19139_fields_lang.php b/application/language/base/iso19139_fields_lang.php
new file mode 100644
index 000000000..37479bce8
--- /dev/null
+++ b/application/language/base/iso19139_fields_lang.php
@@ -0,0 +1,35 @@
+This form must be filled and submitted by the Lead Researcher. Lead Researcher refers to
+$lang['Line ministry/public administration']="Line ministry/public administration";
+$lang['University']="University";
+$lang['Research centre']="Research centre";
+$lang['Private company']="Private company";
+$lang['International organization']="International organization";
+$lang['Non-governmental agency (national)']="Non-governmental agency (national)";
+$lang['Non-governmental agency (international)']="Non-governmental agency (international)";
+$lang['Other']="Other";
+$lang['application_access_licensed_dataset']="Application for Access to a Licensed Dataset";
+$lang['required_fields']="Fields marked with * are mandatory.";
+$lang['info_kept_confidential']="The information provided on this page will be kept confidential and will be used for internal purposes only.";
+$lang['dataset_requested']="Dataset requested:";
+$lang['filled_lead_research']="
This form must be filled and submitted by the Lead Researcher. Lead Researcher refers to
the person who serves as the main point of contact for all communications involving this agreement. Access to licensed
datasets will only be granted when the Lead Researcher is an employee of a legally registered receiving agency
(university, company, research centre, national or international organization, etc.) on behalf of
@@ -28,38 +23,34 @@
who may decide to approve the request, to deny access to the data,
or to request additional information from the Lead Researcher. A signed copy of this request form may also be requested.
-
This request is submitted on behalf of:
';
-
-$lang['receiving_org']='Receiving Organization name:';
-$lang['rec_org_refers']='Receiving Organization refers to the organization/university/establishment which employs the Lead Researcher.';
-$lang['org_type']='Organization Type';
-$lang['other']='If other, specify:';
-$lang['post_add']='Postal address';
-$lang['telephone']='Telephone (with country code)';
-$lang['fax']='Fax (with country code)';
-$lang['intended_use']='Intended use of the data:';
-$lang['provide_short_desc']='Please provide a short description of your research project (project question, objectives, methods, expected outputs, partners)';
-$lang['expected_output']='List of expected output(s) and dissemination policy';
-$lang['expected_completion']='Expected completion date (DD-MM-YYYY) of the research project:';
-$lang['data_matching']='Data matching';
-$lang['merge_dataset']='Will you need to merge the dataset with other data?';
-$lang['other_data_merge']='If YES specify all other datasets that will need to be merged';
-$lang['research_team']='Research team members (other than the Lead Researcher)';
-$lang['provide_names']='Provide names, titles, and affiliations of any other members of the research team who will have access to the restricted data.';
-$lang['ident_needed']='Identification of data files and variables needed';
-
-$lang['da_website']='The Data Archive provides detailed metadata on its website, including a description of
+
This request is submitted on behalf of:
";
+$lang['receiving_org']="Receiving Organization name:";
+$lang['rec_org_refers']="Receiving Organization refers to the organization/university/establishment which employs the Lead Researcher.";
+$lang['org_type']="Organization Type";
+$lang['other']="If other, specify:";
+$lang['post_add']="Postal address";
+$lang['telephone']="Telephone (with country code)";
+$lang['fax']="Fax (with country code)";
+$lang['intended_use']="Intended use of the data:";
+$lang['provide_short_desc']="Please provide a short description of your research project (project question, objectives, methods, expected outputs, partners)";
+$lang['expected_output']="List of expected output(s) and dissemination policy";
+$lang['expected_completion']="Expected completion date (DD-MM-YYYY) of the research project:";
+$lang['data_matching']="Data matching";
+$lang['merge_dataset']="Will you need to merge the dataset with other data?";
+$lang['other_data_merge']="If YES specify all other datasets that will need to be merged";
+$lang['research_team']="Research team members (other than the Lead Researcher)";
+$lang['provide_names']="Provide names, titles, and affiliations of any other members of the research team who will have access to the restricted data.";
+$lang['ident_needed']="Identification of data files and variables needed";
+$lang['da_website']="The Data Archive provides detailed metadata on its website, including a description of
data files and variables for each dataset. Researchers who do not need access to the whole dataset may indicate
which subset of variables or cases they are interested in. As this reduces the disclosure risk, providing us
-with such information may increase the probability that the data will be provided.';
-
-$lang['this_request']='This request if submitted to access:';
-$lang['whole_dataset']='The whole dataset (all files, all cases)';
-$lang['subset_data']='A subset of variables and/or cases as described below (note that variables such as the sample weighting coefficients and records identifiers will always be included in subsets):';
-$lang['data_access_agreement']='Data access agreement';
-$lang['i_read_and_agree']='I have read and agree with the conditions';
-
-$lang['agreement_text']='
The representative of the Receiving Organization agrees to comply with the following conditions:
+with such information may increase the probability that the data will be provided.";
+$lang['this_request']="This request if submitted to access:";
+$lang['whole_dataset']="The whole dataset (all files, all cases)";
+$lang['subset_data']="A subset of variables and/or cases as described below (note that variables such as the sample weighting coefficients and records identifiers will always be included in subsets):";
+$lang['data_access_agreement']="Data access agreement";
+$lang['i_read_and_agree']="I have read and agree with the conditions";
+$lang['agreement_text']="
The representative of the Receiving Organization agrees to comply with the following conditions:
Access to the restricted data will be limited to the Lead Researcher and other members of the research team listed in this request.
Copies of the restricted data or any data created on the basis of the original data will not be copied or made available to anyone other than those mentioned in this Data Access Agreement, unless formally authorized by the Data Archive.
@@ -75,12 +66,13 @@
If there are any changes to the project specification, security arrangements, personnel or organization detailed in this application form, it is the responsibility of the Lead Researcher to seek the agreement of the Data Archive to these changes. Where there is a change to the employer organization of the Lead Researcher this will involve a new application being made and termination of the original project.
Breaches of the agreement will be taken seriously and the Data Archive will take action against those responsible for the lapse if willful or accidental. Failure to comply with the directions of the Data Archive will be deemed to be a major breach of the agreement and may involve recourse to legal proceedings. The Data Archive will maintain and share with partner data archives a register of those individuals and organizations which are responsible for breaching the terms of the Data Access Agreement and will impose sanctions on release of future data to these parties.
-';
+";
+$lang['success_request_submitted']="You have successfully submitted the request for data access. A confirmation email has been sent to your email address.";
+$lang['track_status_request']="To track the status of your request, visit";
+$lang['thank_you']="Thank you!";
+$lang['confirmation_application_for_licensed_dataset']="[confirmation] Application for Access to a Licensed Dataset";
+$lang['view_all_requests']="View all requests";
+$lang['open_in_new_window']="Open in new window";
-$lang['success_request_submitted']='You have successfully submitted the request for data access. A confirmation email has been sent to your email address.';
-$lang['track_status_request']='To track the status of your request, visit';
-$lang['thank_you']='Thank you!';
-$lang['confirmation_application_for_licensed_dataset']='[confirmation] Application for Access to a Licensed Dataset';
-$lang['view_all_requests']='View all requests';
-$lang['open_in_new_window']='Open in new window';
-?>
+/* End of file licensed_access_form_lang.php */
+/* Location: ./application/language/english/licensed_access_form_lang.php */
\ No newline at end of file
diff --git a/application/language/base/licensed_request_lang.php b/application/language/base/licensed_request_lang.php
index d79d8b77d..3be4260cc 100644
--- a/application/language/base/licensed_request_lang.php
+++ b/application/language/base/licensed_request_lang.php
@@ -1,156 +1,127 @@
-%s] has been reviewed. To view the review outcome, please visit:";
-//admin_notification_email
-$lang['user_has_requested_licensed'] = "The user %s has requested access to a licensed survey %s.";
-$lang['to_view_request_instructions'] = "To view the request, login to the NADA site administration and visit the 'Licensed survey requests' page.";
-//request_form_view
-$lang['received_licensed_request'] = "The %s has received your request for the licensed datafiles. We will notify you via email once your application has been reviewed.";
+%s] has been reviewed. To view the review outcome, please visit:";
+$lang['user_has_requested_licensed']="The user %s has requested access to a licensed survey %s.";
+$lang['to_view_request_instructions']="To view the request, login to the NADA site administration and visit the 'Licensed survey requests' page.";
+$lang['received_licensed_request']="The %s has received your request for the licensed datafiles. We will notify you via email once your application has been reviewed.";
$lang['to_view_request_status']="To view the status of your request, please visit:";
-$lang['for_further_information'] = "For further information, please contact us at";
-$lang['form_not_available'] = "Form has been removed and is no longer available.";
-$lang['view_all_requests'] = "View all requests";
-//request status codes
-$lang['APPROVED'] = "Approved";
-$lang['DENIED'] = "Denied";
-$lang['PENDING'] = "Pending";
-$lang['MOREINFO'] = "More information is required";
-$lang['CANCELLED'] = "Cancelled";
-
-$lang['reason_login_licensed_access'] = "To request access to licensed datasets, please login to the website to continue.";
-$lang['forward_lic_request'] = "Forward request";
-$lang['comments_history'] = "Comments history";
-$lang['view_comments_history'] = "View history";
-$lang['comment_by'] = "By";
-$lang['show_hide'] = "Show/Hide";
-$lang['comment'] = "Comment";
-$lang['communicate_history'] = "History";
-$lang['sent_by'] = "Sent by";
-$lang['forward_history'] = "History";
-$lang['data_restricted_use'] = "The data is provided only for the purpose described in the request form, to be able to use the data for any other purpose make a new access request.";
-$lang['data_request_for'] = "Data request";
-
-$lang['request_history'] = "View request history";
-$lang['study_notes'] = "View study notes";
-
-$lang['note_type'] = "Type";
-$lang['note'] = "Note";
-$lang['additional_info'] = "Additional information requested";
-$lang['request_additional_info_submitted'] = "Thank you for updating request. We will notify you via email once your application has been reviewed.";
-$lang['email_sent'] = "Your message has been sent!";
-$lang['provide_additonal_info_for_your_request'] = "Please use this box to provide additional information needed to process your data request.";
-
-$lang['click_on_a_lic_request_to_see_status_or_download_data'] = "Click on a request to view status or download data for approved requests.";
-$lang['make_new_lic_request'] = "Make new request";
-$lang['no_microdata_files_found'] = "No microdata files were found!";
-
-
-$lang['all_requests'] = "All requests";
-$lang['pending'] = "Pending";
-$lang['approved'] = "Approved";
-$lang['denied'] = "Denied";
-$lang['request_more_info'] = "Requested more info";
-$lang['cancelled'] = "Cancelled";
-
-$lang['study_data_files'] = "Microdata Files";
-$lang['study_resources'] = "Other Materials";
-$lang['datasets_requested'] = "Dataset(s) requested";
-$lang['request_title'] = "Request title";
-$lang['download_microdata_and_resources'] = "Download Microdata and other related materials";
-
-
+$lang['for_further_information']="For further information, please contact us at";
+$lang['form_not_available']="Form has been removed and is no longer available.";
+$lang['view_all_requests']="View all requests";
+$lang['APPROVED']="Approved";
+$lang['DENIED']="Denied";
+$lang['PENDING']="Pending";
+$lang['MOREINFO']="More information is required";
+$lang['CANCELLED']="Cancelled";
+$lang['reason_login_licensed_access']="To request access to licensed datasets, please login to the website to continue.";
+$lang['forward_lic_request']="Forward request";
+$lang['comments_history']="Comments history";
+$lang['view_comments_history']="View history";
+$lang['comment_by']="By";
+$lang['show_hide']="Show/Hide";
+$lang['comment']="Comment";
+$lang['communicate_history']="History";
+$lang['sent_by']="Sent by";
+$lang['forward_history']="History";
+$lang['data_restricted_use']="The data is provided only for the purpose described in the request form, to be able to use the data for any other purpose make a new access request.";
+$lang['data_request_for']="Data request";
+$lang['request_history']="View request history";
+$lang['study_notes']="View study notes";
+$lang['note_type']="Type";
+$lang['note']="Note";
+$lang['additional_info']="Additional information requested";
+$lang['request_additional_info_submitted']="Thank you for updating request. We will notify you via email once your application has been reviewed.";
+$lang['email_sent']="Your message has been sent!";
+$lang['provide_additonal_info_for_your_request']="Please use this box to provide additional information needed to process your data request.";
+$lang['click_on_a_lic_request_to_see_status_or_download_data']="Click on a request to view status or download data for approved requests.";
+$lang['make_new_lic_request']="Make new request";
+$lang['no_microdata_files_found']="No microdata files were found!";
+$lang['all_requests']="All requests";
+$lang['pending']="Pending";
+$lang['denied']="Denied";
+$lang['cancelled']="Cancelled";
+$lang['study_data_files']="Microdata Files";
+$lang['study_resources']="Other Materials";
+$lang['datasets_requested']="Dataset(s) requested";
+$lang['request_title']="Request title";
+$lang['download_microdata_and_resources']="Download Microdata and other related materials";
/* End of file licensed_request_lang.php */
-/* Location: ./system/language/english/licensed_request_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/licensed_request_lang.php */
\ No newline at end of file
diff --git a/application/language/base/menu_lang.php b/application/language/base/menu_lang.php
index b3c929648..5eeea274e 100644
--- a/application/language/base/menu_lang.php
+++ b/application/language/base/menu_lang.php
@@ -1,44 +1,46 @@
-
+
You are free to copy, distribute, adapt, display or include the data in other products for commercial and noncommercial purposes at no cost subject to certain limitations summarized below.
+
You must include attribution for the data you use in the manner indicated in the metadata included with the data.
+
You must not claim or imply that The World Bank endorses your use of the data by or use The World Bank's logo(s) or trademark(s) in conjunction with such use.
+
Other parties may have ownership interests in some of the materials contained on The World Bank Web site. For example,
+we maintain a list of some specific data within the Datasets that you may not redistribute or reuse without first contacting the original content provider,
+as well as information regarding how to contact the original content provider. Before incorporating any data in other products, please check the list: Terms of use: Restricted Data
+
The World Bank makes no warranties with respect to the data and you agree The World Bank shall not be liable to you in connection with your use of the data.
+
+
This is only a summary of the Terms of Use for Datasets Listed in The World Bank Data Catalogue. Please read the actual agreement that controls your use of the Datasets,
+which is available here: Terms of use for datasets. Also see
+World Bank Terms and Conditions.
";
+
+
+/* End of file open_data_lang.php */
+/* Location: ./application/language/english/open_data_lang.php */
\ No newline at end of file
diff --git a/application/language/base/permissions_lang.php b/application/language/base/permissions_lang.php
index bb919e7f7..a75dd4412 100644
--- a/application/language/base/permissions_lang.php
+++ b/application/language/base/permissions_lang.php
@@ -1,22 +1,22 @@
-
The data and other materials provided by the National Data Archive will not
be redistributed or sold to other individuals, institutions, or organizations
@@ -44,12 +41,12 @@
Archive will conform to widely-accepted standards of practice and legal
restrictions that are intended to protect the confidentiality of respondents.
";
+$lang['public_use_files']="Public Use Files";
+$lang['surveys_in_collection']="The collection [%s] contains the following surveys:";
+$lang['collection_data_files']="Public Use Files by Collection";
+$lang['collection_requested']="Collection access requested";
+$lang['public_use_data_access_by_collection_message']="You have been granted access to all public use studies in the collection. Please visit each study page to download the data files and other documentation.";
+$lang['public_use_data_access_by_collection']="Download data files";
-$lang['public_use_files'] = "Public Use Files";
-$lang['surveys_in_collection']='The collection [%s] contains the following surveys:';
-$lang['collection_data_files']='Public Use Files by Collection';
-$lang['collection_requested']='Collection access requested';
-$lang['public_use_data_access_by_collection_message']='You have been granted access to all public use studies in the collection. Please visit each study page to download the data files and other documentation.';
-$lang['public_use_data_access_by_collection']='Download data files';
/* End of file public_access_terms_lang.php */
-/* Location: ./system/language/english/public_access_terms_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/public_access_terms_lang.php */
\ No newline at end of file
diff --git a/application/language/base/public_request_lang.php b/application/language/base/public_request_lang.php
index 374d5ee35..beebec561 100644
--- a/application/language/base/public_request_lang.php
+++ b/application/language/base/public_request_lang.php
@@ -1,20 +1,17 @@
-
+
-
Operator
-
Meaning
+
Operator
+
Meaning
space
@@ -30,7 +31,7 @@
prepended (put at beginning).
-
""
+
""
Double quotes at the beginning and end of a phrase, matches
only rows that contain the complete phrase, as it was typed.
@@ -64,11 +65,11 @@
Employed, but exclude results for Kenya from the results.
-
Placing quotation marks "" around a search term
+
Placing quotation marks "" around a search term
will force the term to be evaluated as one term. For example: to limit
a search to study descriptions that contain the exact sequence of words
-health study in them one would type "Health
-Study"between quotation marks. Without the
+health study in them one would type "Health
+Study"between quotation marks. Without the
quotation marks the search would show all studies with health or study
in them. With the quotation marks only studies with the exact wording
in the sequence health study will be shown.
@@ -85,8 +86,7 @@
-';
-
+";
/* End of file search_help_lang.php */
-/* Location: ./system/language/english/search_help_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/search_help_lang.php */
\ No newline at end of file
diff --git a/application/language/base/site_menu_lang.php b/application/language/base/site_menu_lang.php
index 8d2347294..82c7e793e 100644
--- a/application/language/base/site_menu_lang.php
+++ b/application/language/base/site_menu_lang.php
@@ -1,30 +1,27 @@
-%s website. To complete your registration and activate your user account, please visit the following URL:";
-$lang['your_account_details'] = "You account details are";
-$lang['do_not_reply_to_this_email'] = "DO NOT REPLY TO THIS EMAIL";
-
-$lang['click_url_to_reset_password'] = "To reset your password, click on the link below or open the url in a web browser";
-$lang['request_password_ignore'] = "If you did not request password reset, ignore this message.";
-
-$lang['enter_email_to_reset_password'] = "Please enter your email address so we can send you an email to reset your password.";
-$lang['password_is_sent'] = "Your password has been reset and a new password is sent to your email address.";
-$lang['login_with_new_password'] = "Click here to login with your new password.";
-$lang['message_sent_to_your_email'] = "An email message has been sent to your email address, please check your inbox.";
-
-$lang['password_reset_to'] = "You password has been reset to %s. To login to the website, your account details are:";
-$lang['forgot_password_verification'] = "Forgotten Password Verification";
-$lang['account_activation'] = "Account activation";
-$lang['callback_country_invalid'] = "The Country field is required.";
-$lang['log_in'] = "Log in";
-$lang['site_login_privacy_terms'] = "Information you provide by registering or login to our catalog will be used in compliance with the terms of the NSO's Privacy Policy.";
-$lang['impersonate_user'] = "Impersonate as another user";
-$lang['impersonate_msg'] = "Select the account below to impersonate as";
-
-$lang['general_user_accounts'] = "General user accounts (no admin access)";
-$lang['general_user_accounts_description'] = "General site users with no access to site administration";
-
-$lang['edit_user_permissions'] = "Edit user permissions";
-
-$lang['site_admin_accounts'] = "Site administrators (full access)";
-$lang['site_admin_accounts_description'] = "Full control over all site sections";
-
-$lang['site_admin_limited_accounts'] = "Site administrators (limited access)";
-$lang['site_admin_limited_accounts_description'] = "Limit user access to the site administration and control permissions per collection for the user";
-
-$lang['user_site_level_permissions'] = "Site level permissions";
-
-$lang['assigned_user_groups'] = "Global user roles";
-$lang['manage_permissions'] = "Manage permissions";
-$lang['permissions_per_collection'] = "Permissions per collection";
-
+%s website. To complete your registration and activate your user account, please visit the following URL:";
+$lang['your_account_details']="You account details are";
+$lang['do_not_reply_to_this_email']="DO NOT REPLY TO THIS EMAIL";
+$lang['click_url_to_reset_password']="To reset your password, click on the link below or open the url in a web browser";
+$lang['request_password_ignore']="If you did not request password reset, ignore this message.";
+$lang['enter_email_to_reset_password']="Please enter your email address so we can send you an email to reset your password.";
+$lang['password_is_sent']="Your password has been reset and a new password is sent to your email address.";
+$lang['login_with_new_password']="Click here to login with your new password.";
+$lang['message_sent_to_your_email']="An email message has been sent to your email address, please check your inbox.";
+$lang['password_reset_to']="You password has been reset to %s. To login to the website, your account details are:";
+$lang['forgot_password_verification']="Forgotten Password Verification";
+$lang['account_activation']="Account activation";
+$lang['callback_country_invalid']="The Country field is required.";
+$lang['log_in']="Log in";
+$lang['site_login_privacy_terms']="Information you provide by registering or login to our catalog will be used in compliance with the terms of the NSO's Privacy Policy.";
+$lang['impersonate_user']="Impersonate as another user";
+$lang['impersonate_msg']="Select the account below to impersonate as";
+$lang['general_user_accounts']="General user accounts (no admin access)";
+$lang['general_user_accounts_description']="General site users with no access to site administration";
+$lang['edit_user_permissions']="Edit user permissions";
+$lang['site_admin_accounts']="Site administrators (full access)";
+$lang['site_admin_accounts_description']="Full control over all site sections";
+$lang['site_admin_limited_accounts']="Site administrators (limited access)";
+$lang['site_admin_limited_accounts_description']="Limit user access to the site administration and control permissions per collection for the user";
+$lang['user_site_level_permissions']="Site level permissions";
+$lang['assigned_user_groups']="Global user roles";
+$lang['manage_permissions']="Manage permissions";
+$lang['permissions_per_collection']="Permissions per collection";
/* End of file users_lang.php */
-/* Location: ./system/language/english/users_lang.php */
\ No newline at end of file
+/* Location: ./application/language/english/users_lang.php */
\ No newline at end of file
diff --git a/application/language/base/vocabularies_lang.php b/application/language/base/vocabularies_lang.php
index 7f3bca0db..e6312eea0 100644
--- a/application/language/base/vocabularies_lang.php
+++ b/application/language/base/vocabularies_lang.php
@@ -1,17 +1,16 @@
-CI->recaptcha->recaptcha_check_answer($this->CI->input->server('REMOTE_ADDR'),
- $this->CI->input->post('recaptcha_challenge_field'),
- $this->CI->input->post('recaptcha_response_field'),
- array(),
- false
- );
+ $response = $this->CI->recaptcha->recaptcha_check_answer(
+ $this->CI->input->server('REMOTE_ADDR'),
+ $this->CI->input->post($this->get_question_field()),
+ $debug=false
+ );
return $response['is_valid'];
}
public function get_question_field()
{
- return 'recaptcha_response_field';
+ return 'g-recaptcha-response';
}
}
diff --git a/application/libraries/DDI2_import.php b/application/libraries/DDI2_import.php
index f933abdc4..caa7206ad 100644
--- a/application/libraries/DDI2_import.php
+++ b/application/libraries/DDI2_import.php
@@ -105,15 +105,11 @@ public function import($params,$sid=null)
if(!$this->overwrite){
throw new Exception("SURVEY_ALREADY_EXISTS: ".$sid);
}
-
- //check if study is owned by the active repository
- $owner_repository=$this->ci->Catalog_model->get_study_owner($sid);
- if (!$owner_repository){
- $owner_repository='central';
- }
-
- $this->repositoryid=$owner_repository;
+ //load existing options
+ $dataset_row=$this->ci->dataset_manager->get_row($sid);
+ $this->repositoryid=$dataset_row['repositoryid'];
+ $this->formid=$dataset_row['formid'];
}
$repositoryid=$this->repositoryid;
@@ -459,6 +455,9 @@ function sanitize_filename($name)
private function import_variables($sid,$data_files, $variable_iterator)
{
+ //delete existing variables + variables metadata
+ $this->ci->Variable_model->remove_all_variables($sid);
+
if(!$data_files){
return 0;
}
@@ -467,9 +466,6 @@ private function import_variables($sid,$data_files, $variable_iterator)
return 0;
}
- //delete existing variables + variables metadata
- $this->ci->Variable_model->remove_all_variables($sid);
-
$batch_inserts=true; //enable or disable batch inserts
$batch_insert_size=200; //rows inserted at once
$batch_insert_count=0;
diff --git a/application/libraries/DDI_Utils.php b/application/libraries/DDI_Utils.php
new file mode 100644
index 000000000..a33f053ea
--- /dev/null
+++ b/application/libraries/DDI_Utils.php
@@ -0,0 +1,253 @@
+ci =& get_instance();
+ $this->ci->load->model("Catalog_model");
+ }
+
+
+
+ /**
+ *
+ * Strip metadata elements from the DDI
+ *
+ * @strip - 'summary_stats', 'variables', 'keep_basic'
+ *
+ **/
+ function strip_ddi($sid, $strip, $keep_original)
+ {
+ switch($strip){
+ case 'summary_stats':
+ return $this->strip_ddi_summary_stats($sid,$keep_original);
+ break;
+
+ case 'variables':
+ return $this->strip_ddi_variables($sid,$keep_original);
+ break;
+
+ case 'keep_basic':
+ return $this->strip_ddi_to_basic($sid,$keep_original);
+ break;
+ }
+
+ return false;
+ }
+
+ /**
+ *
+ *
+ * Strip summary stats from DDI
+ *
+ */
+ function strip_ddi_summary_stats($sid, $keep_original=true)
+ {
+ $xpath_array=array(
+ '//ddi:codeBook/ddi:dataDscr//ddi:sumStat'=>'sumStat'
+ );
+
+ return $this->strip_ddi_parts($sid,$xpath_array, $keep_original);
+ }
+
+
+
+ /**
+ *
+ *
+ * Strip data files and variables from DDI
+ *
+ */
+ function strip_ddi_variables($sid, $keep_original=true)
+ {
+ $xpath_array=array(
+ '//ddi:codeBook/ddi:dataDscr'=>'dataDscr',
+ '//ddi:codeBook/ddi:fileDscr'=>'fileDscr',
+ );
+
+ return $this->strip_ddi_parts($sid,$xpath_array, $keep_original);
+ }
+
+
+
+ /**
+ *
+ *
+ * Strip all elements except titlStmt
+ *
+ */
+ function strip_ddi_to_basic($sid, $keep_original=true)
+ {
+ //paths to trim
+ $xpath_array=array(
+ '//ddi:codeBook/ddi:docDscr'=>'docDscr',
+ //'//ddi:codeBook/ddi:stdyDscr'=>'stdyDscr',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:producer'=>'producer',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:fundAg'=>'sponsor',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:serStmt'=>'sername',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:geogCover'=>'geogCover',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:universe'=>'universe',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:method'=>'method',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:dataAccs'=>'dataAccs',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:distStmt'=>'distStmt',
+
+ '//ddi:codeBook/ddi:stdyDscr//ddi:verStmt'=>'verStmt',
+ '//ddi:codeBook/ddi:stdyDscr//ddi:subject'=>'subject',
+
+ '//ddi:codeBook/ddi:stdyDscr/ddi:stdyInfo/ddi:abstract'=>'abstract',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:stdyInfo/ddi:sumDscr/ddi:timePrd'=>'timePrd',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:stdyInfo/ddi:sumDscr/ddi:geogCover'=>'geogCover',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:stdyInfo/ddi:sumDscr/ddi:anlyUnit'=>'anlyUnit',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:stdyInfo/ddi:sumDscr/ddi:universe'=>'universe',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:stdyInfo/ddi:sumDscr/ddi:dataKind'=>'dataKind',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:stdyInfo/ddi:notes'=>'notes',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:dataCollector'=>'dataCollector',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:sampProc'=>'sampProc',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:deviat'=>'deviat',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:collMode'=>'collMode',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:resInstru'=>'resInstru',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:collSitu'=>'collSitu',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:actMin'=>'actMin',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:weight'=>'weight',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:dataColl/ddi:cleanOps'=>'cleanOps',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:notes'=>'notes',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:anlyInfo/ddi:respRate'=>'respRate',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:anlyInfo/ddi:EstSmpErr'=>'EstSmpErr',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:method/ddi:anlyInfo/ddi:dataAppr'=>'dataAppr',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:dataAccs/ddi:useStmt/ddi:confDec'=>'confDec',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:dataAccs/ddi:useStmt/ddi:contact'=>'contact',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:dataAccs/ddi:useStmt/ddi:citReq'=>'citReq',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:dataAccs/ddi:useStmt/ddi:conditions'=>'conditions',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:dataAccs/ddi:useStmt/ddi:disclaimer'=>'disclaimer',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:citation/ddi:prodStmt/ddi:copyright'=>'copyright',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:citation/ddi:prodStmt/ddi:fundAg'=>'fundAg',
+ '//ddi:codeBook/ddi:stdyDscr/ddi:citation/ddi:distStmt/ddi:contact'=>'contact',
+
+ '//ddi:codeBook/ddi:dataDscr'=>'dataDscr',
+ '//ddi:codeBook/ddi:fileDscr'=>'fileDscr',
+ '//ddi:codeBook/ddi:dataDscr//ddi:sumStat'=>'sumStat',
+ '//ddi:codeBook/ddi:otherMat'=>'otherMat',
+ );
+
+ return $this->strip_ddi_parts($sid,$xpath_array, $keep_original);
+ }
+
+
+ /**
+ *
+ * Strip elements from the DDI codebook
+ *
+ * @sid - Survey ID
+ * @xpath_array - array of xpaths to be removed
+ * @keep_original - make a copy of the original file?
+ *
+ *
+ */
+ function strip_ddi_parts($sid, $xpath_array=array(),$keep_original=true)
+ {
+ $ddi_file=$this->ci->Catalog_model->get_survey_ddi_path($sid);
+
+ if (!file_exists($ddi_file)){
+ throw new Exception("FILE_NOT_FOUND: ". $ddi_file);
+ }
+
+ if(!is_array($xpath_array) || !count($xpath_array)>0){
+ throw new Exception ("PARAM:XPATH_ARRAY_IS_EMPTY");
+ }
+
+ $doc = new DOMDocument;
+ $doc->load($ddi_file);
+
+ $xpath=new DOMXPath($doc);
+ $rootNamespace = $doc->lookupNamespaceUri($doc->namespaceURI);
+ $xpath->registerNamespace('ddi', $rootNamespace);
+
+ foreach($xpath_array as $xpath_key=>$value)
+ {
+ //find all matching nodes
+ $nodes = $xpath->query($xpath_key);
+
+ //replace all matching nodes
+ foreach($nodes as $node) {
+ //$result->parentNode->removeChild($result);
+ $replacement_element=$doc->createElement($value);
+ $node->parentNode->replaceChild($replacement_element, $node);
+ }
+ }
+
+ //make a copy of the original file
+ if ($keep_original==true){
+ $original_file=str_replace(".xml","-original.xml",$ddi_file);
+ //skip if backup file already exists
+ if(!file_exists($original_file)){
+ copy($ddi_file,$original_file);
+ };
+ }
+
+ file_put_contents($ddi_file,$doc->saveXML());
+ return $ddi_file;
+ }
+
+
+
+ /**
+ *
+ * Reload metadata from DDI
+ *
+ * Updates database with the metadata from DDI
+ *
+ * partial - if yes, only update study level metadata
+ *
+ **/
+ function reload_ddi($id=NULL,$user_id=null, $partial=false)
+ {
+ $this->ci->load->model("Catalog_model");
+ $this->ci->load->library('DDI2_import');
+ $this->ci->load->library('Dataset_manager');
+
+ //get survey ddi file path by id
+ $ddi_file=$this->ci->Catalog_model->get_survey_ddi_path($id);
+
+ if ($ddi_file===FALSE){
+ throw new Exception("DDI_FILE_NOT_FOUND: ".$ddi_file);
+ }
+
+ $dataset=$this->ci->dataset_manager->get_row($id);
+
+ $params=array(
+ 'file_type'=>'survey',
+ 'file_path'=>$ddi_file,
+ 'repositoryid'=>$dataset['repositoryid'],
+ 'overwrite'=>'yes',
+ 'user_id'=>$user_id,
+ 'partial'=>$partial
+ );
+
+ $result=$this->ci->ddi2_import->import($params,$id);
+
+ //reset changed and created dates
+ $update_options=array(
+ 'changed'=>$dataset['changed'],
+ 'created'=>$dataset['created'],
+ 'repositoryid'=>$dataset['repositoryid'],
+ //'link_da'=>$dataset['link_da'],
+ 'formid'=>$dataset['formid']
+ );
+
+ $this->ci->dataset_manager->update_options($id,$update_options);
+
+ //get updated info
+ $dataset=$this->ci->dataset_manager->get_row($id);
+
+ return $dataset;
+ }
+
+}
\ No newline at end of file
diff --git a/application/libraries/Metadata_parser/classes/DDI2Reader.php b/application/libraries/Metadata_parser/classes/DDI2Reader.php
index eef4dc5b9..4b54b8b34 100644
--- a/application/libraries/Metadata_parser/classes/DDI2Reader.php
+++ b/application/libraries/Metadata_parser/classes/DDI2Reader.php
@@ -351,8 +351,9 @@ function __construct($xml_file)
'label' => 'Keyword',
'type' => 'table',
'cols' => array(
- '.' => 'keyword',
- '@uri' => 'uri',
+ '.' => 'keyword',
+ '@vocab'=>'vocab',
+ '@uri' => 'uri'
)
);
diff --git a/application/libraries/Nada_csrf.php b/application/libraries/Nada_csrf.php
new file mode 100644
index 000000000..dcb14bb84
--- /dev/null
+++ b/application/libraries/Nada_csrf.php
@@ -0,0 +1,75 @@
+slimGuard = new \Slim\Csrf\Guard;
+ $this->slimGuard->validateStorage();
+ $this->ci =& get_instance();
+ }
+
+ function generate_token()
+ {
+ $this->slimGuard->generateToken();
+
+ $this->token_name_key = $this->slimGuard->getTokenNameKey();
+ $this->token_value_key = $this->slimGuard->getTokenValueKey();
+ $this->token_name = $this->slimGuard->getTokenName();
+ $this->token_value = $this->slimGuard->getTokenValue();
+
+ return [
+ 'keys' => [
+ 'name' => $this->token_name_key,
+ 'value' => $this->token_value_key
+ ],
+ 'name' => $this->token_name,
+ 'value' => $this->token_value
+ ];
+
+ }
+
+
+ function get_token_name()
+ {
+ return $this->token_name;
+ }
+
+ function get_token_name_key()
+ {
+ return $this->token_name_key;
+ }
+
+ function get_token_value_key()
+ {
+ return $this->token_value_key;
+ }
+
+ function get_token_value()
+ {
+ return $this->token_value;
+ }
+
+
+ function validate_token()
+ {
+ return $this->slimGuard->validateToken($this->ci->input->post($this->token_name_key), $this->ci->input->post($this->token_value_key));
+ }
+
+
+}
\ No newline at end of file
diff --git a/application/libraries/Recaptcha.php b/application/libraries/Recaptcha.php
index 6c34b91e1..162cb7b38 100644
--- a/application/libraries/Recaptcha.php
+++ b/application/libraries/Recaptcha.php
@@ -1,241 +1,73 @@
config->load("captcha");//load captcha configurations
+ $CI->config->load("captcha");//load captcha configurations
$this->recaptcha=config_item('recaptcha');
}
- /**
- * Gets the challenge HTML (javascript and non-javascript version).
- * This is called from the browser, and the resulting reCAPTCHA HTML widget
- * is embedded within the HTML form it was called from.
- * @param string $pubkey A public key for reCAPTCHA
- * @param string $error The error given by reCAPTCHA (optional, default is null)
- * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
- * @return string - The HTML to be embedded in the user's form.
+ /**
+ *
+ * Returns HTML/JS for embedding on the form
+ *
*/
- function recaptcha_get_html ($error = null, $use_ssl = false)
+ function recaptcha_get_html ()
{
- if ($this->recaptcha['publickey'] == null || $this->recaptcha['publickey'] == '') {
- die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create");
- }
-
- if ($use_ssl) {
- $server = $this->recaptcha['apisecureserver'];
- } else {
- $server = $this->recaptcha['apiserver'];
- }
-
- $errorpart = "";
- if ($error) {
- $errorpart = "&error=" . $error;
- }
- return '
-
-
- ';
+ if ($this->recaptcha['publickey'] == null || $this->recaptcha['publickey'] == '') {
+ die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create");
+ }
+
+ return '
+
+ ';
}
/**
- * Calls an HTTP POST function to verify if the user's guess was correct
- * @param string $privkey
- * @param string $remoteip
- * @param string $challenge
- * @param string $response
- * @param array $extra_params an array of extra variables to post to the server
- * @param boolean $debug if true this var, always return ReCaptchaResponse['is_valid']=true
- * @return ReCaptchaResponse
- */
- function recaptcha_check_answer ($remoteip, $challenge, $response, $extra_params = array(),$debug=false)
+ *
+ * validate Recaptcha on form submission
+ *
+ * @recaptcha_response = value of g-captcha-response
+ */
+ function recaptcha_check_answer ($remoteip, $recaptcha_response)
{
- if ($this->recaptcha['privatekey'] == null || $this->recaptcha['privatekey'] == '') {
- die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create");
- }
- if ($remoteip == null || $remoteip == '') {
- die ("For security reasons, you must pass the remote ip to reCAPTCHA");
- }
+ // If the form submission includes the "g-captcha-response" field
+ // Create an instance of the service using your secret
+ $recaptcha = new \ReCaptcha\ReCaptcha($this->recaptcha['privatekey']);
- //discard spam submissions
- if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
- $recaptcha_response = array(
- 'is_valid'=>false,
- 'error'=>'incorrect-captcha-sol'
- );
- return $recaptcha_response;
- }
+ // If file_get_contents() is locked down on your PHP installation to disallow
+ // its use with URLs, then you can use the alternative request method instead.
+ // This makes use of fsockopen() instead.
+ // $recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\SocketPost());
- $response = self::_recaptcha_http_post ($this->recaptcha['verifyserver'], "/recaptcha/api/verify",
- array (
- 'privatekey' => $this->recaptcha['privatekey'],
- 'remoteip' => $remoteip,
- 'challenge' => $challenge,
- 'response' => $response
- ) + $extra_params
- );
+ // Make the call to verify the response and also pass the user's IP address
+ $resp = $recaptcha->verify($recaptcha_response, $remoteip);
- $answers = explode ("\n", $response [1]);
- $recaptcha_response = array();
-
- if (trim ($answers [0]) == 'true') {
- $recaptcha_response['is_valid'] = true;
- }
- else {
- $recaptcha_response['is_valid'] = false;
- $recaptcha_response['error'] = $answers [1];
- }
- if($debug===TRUE){
+ $recaptcha_response = array();
+
+ if ($resp->isSuccess()){
$recaptcha_response['is_valid'] = true;
- }
- return $recaptcha_response;
-
+ }
+ else {
+ $recaptcha_response['is_valid'] = false;
+ $recaptcha_response['error'] = $resp->getErrorCodes();
+ }
+
+ return $recaptcha_response;
}
- /**
- * Submits an HTTP POST to a reCAPTCHA server
- * @param string $host
- * @param string $path
- * @param array $data
- * @param int port
- * @return array response
- */
- function _recaptcha_http_post($host, $path, $data, $port = 80) {
-
- $req = self::_recaptcha_qsencode ($data);
- $http_request = "POST $path HTTP/1.0\r\n";
- $http_request .= "Host: $host\r\n";
- $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
- $http_request .= "Content-Length: " . strlen($req) . "\r\n";
- $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
- $http_request .= "\r\n";
- $http_request .= $req;
-
- $response = '';
- if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
- die ('Could not open socket');
- }
-
- fwrite($fs, $http_request);
-
- while ( !feof($fs) )
- $response .= fgets($fs, 1160); // One TCP-IP packet
- fclose($fs);
- $response = explode("\r\n\r\n", $response, 2);
-
- return $response;
- }
- /**
- * Encodes the given data into a query string format
- * @param $data - array of string elements to be encoded
- * @return string - encoded request
- */
- function _recaptcha_qsencode ($data) {
- $req = "";
- foreach ( $data as $key => $value )
- $req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
-
- // Cut the last '&'
- $req=substr($req,0,strlen($req)-1);
- return $req;
- }
-
- /**
- * gets a URL where the user can sign up for reCAPTCHA. If your application
- * has a configuration page where you enter a key, you should provide a link
- * using this function.
- * @param string $domain The domain where the page is hosted
- * @param string $appname The name of your application
- */
- function recaptcha_get_signup_url ($domain = null, $appname = null) {
- return "https://www.google.com/recaptcha/admin/create?" . self::_recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
- }
-
- function _recaptcha_aes_pad($val) {
- $block_size = 16;
- $numpad = $block_size - (strlen ($val) % $block_size);
- return str_pad($val, strlen ($val) + $numpad, chr($numpad));
- }
- /* Mailhide related code */
-
- function _recaptcha_aes_encrypt($val,$ky) {
- if (! function_exists ("mcrypt_encrypt")) {
- die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
- }
- $mode=MCRYPT_MODE_CBC;
- $enc=MCRYPT_RIJNDAEL_128;
- $val=self::_recaptcha_aes_pad($val);
- return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
- }
-
-
- function _recaptcha_mailhide_urlbase64 ($x) {
- return strtr(base64_encode ($x), '+/', '-_');
- }
- /* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
- function recaptcha_mailhide_url($email) {
- if ($this->recaptcha['mailhide']['publickey'] == '' || $this->recaptcha['mailhide']['publickey'] == null || $this->recaptcha['mailhide']['privatekey'] == "" || $this->recaptcha['mailhide']['privatekey'] == null) {
- die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
- "you can do so at http://www.google.com/recaptcha/mailhide/apikey");
- }
-
-
- $ky = pack('H*', $this->recaptcha['mailhide']['privatekey']);
- $cryptmail = self::_recaptcha_aes_encrypt ($email, $ky);
-
- return "http://www.google.com/recaptcha/mailhide/d?k=" . $this->recaptcha['mailhide']['publickey'] . "&c=" . self::_recaptcha_mailhide_urlbase64 ($cryptmail);
- }
-
- /**
- * gets the parts of the email to expose to the user.
- * eg, given johndoe@example,com return ["john", "example.com"].
- * the email is then displayed as john...@example.com
- */
- function _recaptcha_mailhide_email_parts ($email) {
- $arr = preg_split("/@/", $email );
-
- if (strlen ($arr[0]) <= 4) {
- $arr[0] = substr ($arr[0], 0, 1);
- } else if (strlen ($arr[0]) <= 6) {
- $arr[0] = substr ($arr[0], 0, 3);
- } else {
- $arr[0] = substr ($arr[0], 0, 4);
- }
- return $arr;
- }
-
- /**
- * Gets html to display an email address given a public an private key.
- * to get a key, go to:
- *
- * http://www.google.com/recaptcha/mailhide/apikey
- */
- function recaptcha_mailhide_html($email) {
- $emailparts = self::_recaptcha_mailhide_email_parts ($email);
- $url = self::recaptcha_mailhide_url ($this->recaptcha['mailhide']['publickey'], $this->recaptcha['mailhide']['privatekey'], $email);
-
- return htmlentities($emailparts[0]) . "...@" . htmlentities ($emailparts [1]);
-
- }
}
\ No newline at end of file
diff --git a/application/models/Dataset_image_model.php b/application/models/Dataset_image_model.php
index 24559442f..69a0f6d32 100644
--- a/application/models/Dataset_image_model.php
+++ b/application/models/Dataset_image_model.php
@@ -88,17 +88,14 @@ function create_dataset($type,$options)
function get_core_fields($options)
{
$output=array();
- $output['title']=$this->get_array_nested_value($options,'image_description/photoVideoMetadataIPTC/headline');
- $output['idno']=$this->get_array_nested_value($options,'image_description/photoVideoMetadataIPTC/digitalImageGuid');
-
- //todo
- $output['nation']='';
-
- $output['abbreviation']=$this->get_array_nested_value($options,'table_description/title_statement/alternate_title');
- $creators=(array)$this->get_array_nested_value($options,'image_description/photoVideoMetadataIPTC/creatorNames');
+ $output['title']=$this->get_array_nested_value($options,'image_description/iptc/photoVideoMetadataIPTC/headline');
+ $output['idno']=$this->get_array_nested_value($options,'image_description/iptc/photoVideoMetadataIPTC/digitalImageGuid');
+ $output['nation']=$this->get_array_nested_value($options,'image_description/iptc/photoVideoMetadataIPTC/countryName');
+ $output['abbreviation']='';
+ $creators=(array)$this->get_array_nested_value($options,'image_description/iptc/photoVideoMetadataIPTC/creatorNames');
$output['authoring_entity']=implode(",", $creators);
- $date=explode("-",$this->get_array_nested_value($options,'image_description/photoVideoMetadataIPTC/dateCreated'));
+ $date=explode("-",$this->get_array_nested_value($options,'image_description/iptc/photoVideoMetadataIPTC/dateCreated'));
if(is_array($date)){
$output['year_start']=(int)$date[0];
diff --git a/application/models/Public_model.php b/application/models/Public_model.php
index 748f51a7d..06c7ad330 100644
--- a/application/models/Public_model.php
+++ b/application/models/Public_model.php
@@ -13,7 +13,7 @@ public function __construct()
*/
function select_single($request_id)
{
- $this->db->select('p.*,s.titl,s.surveyid,s.proddate, s.nation, u.username,u.email,m.first_name, m.last_name,m.company, m.phone,m.country',FALSE);
+ $this->db->select('p.*,s.title,s.idno,s.year_start, s.nation, u.username,u.email,m.first_name, m.last_name,m.company, m.phone,m.country',FALSE);
$this->db->join('surveys s', 's.id = p.surveyid');
$this->db->join('users u', 'u.id = p.userid','left');
$this->db->join('meta m', 'u.id = m.user_id','left');
@@ -38,7 +38,7 @@ function select_single($request_id)
**/
function get_all_public_use_surveys()
{
- $this->db->select('s.id,s.titl,s.nation,s.year_start,s.year_end');
+ $this->db->select('s.id,s.title,s.nation,s.year_start,s.year_end');
$this->db->join('forms', 's.formid = forms.formid','left');
$this->db->where('forms.model','public');
return $this->db->get('surveys s')->result_array();
@@ -50,7 +50,7 @@ function get_all_public_use_surveys()
**/
function get_surveys_by_collection($repositoryid)
{
- $this->db->select('s.id,s.titl,s.nation,s.year_start,s.year_end,forms.model');
+ $this->db->select('s.id,s.title,s.nation,s.year_start,s.year_end,forms.model');
$this->db->from('surveys s');
$this->db->join('survey_repos repos', 's.id = repos.sid','left');
$this->db->join('forms', 'forms.formid = s.formid','inner');
diff --git a/application/models/Reports_model.php b/application/models/Reports_model.php
index 73af19323..4f9d2bc67 100644
--- a/application/models/Reports_model.php
+++ b/application/models/Reports_model.php
@@ -34,8 +34,8 @@ function get_survey_summary($start, $end)
{
$sql='SELECT
s.id as id,
- s.surveyid as surveyid,
- s.titl as titl,
+ s.idno as idno,
+ s.title as title,
count(*) as visits
FROM sitelogs n
inner join surveys s on n. surveyid=s.id
@@ -46,7 +46,7 @@ function get_survey_summary($start, $end)
$sql.=' and (logtime between '.$start.' and '.$end.')';
}
- $sql.=' group by s.surveyid, s.titl, s.id';
+ $sql.=' group by s.idno, s.title, s.id';
$sql.= ' order by visits desc';
$query=$this->db->query($sql)->result_array();
@@ -58,11 +58,11 @@ function get_survey_detailed_all($start,$end)
{
$sql='SELECT
s.id as id,
- s.surveyid as survey,
- s.titl as title,
+ s.idno,
+ s.title as title,
n.section as section,
s.nation as country,
- s.proddate as year,
+ s.year_start as year,
count(*) as visits
FROM sitelogs n
inner join surveys s on n. surveyid=s.id
@@ -72,7 +72,7 @@ function get_survey_detailed_all($start,$end)
{
$sql.=' and (logtime between '.$start.' and '.$end.')';
}
- $sql.=' group by s.surveyid, s.id, s.titl, n.section';
+ $sql.=' group by s.idno, s.id, s.title, n.section';
return $this->db->query($sql)->result_array();
}
@@ -88,11 +88,11 @@ function get_survey_detailed($start,$end)
{
$sql='SELECT
s.id as id,
- s.surveyid as survey,
- s.titl as title,
+ s.idno as idno,
+ s.title as title,
n.section as section,
s.nation as country,
- s.proddate as year,
+ s.year_start as year,
count(*) as visits
FROM sitelogs n
inner join surveys s on n. surveyid=s.id
@@ -105,7 +105,7 @@ function get_survey_detailed($start,$end)
}
- $sql.=' group by s.surveyid, s.id, s.titl, n.section';
+ $sql.=' group by s.idno, s.id, s.title, n.section';
$rows=$this->db->query($sql)->result_array();
$result[]=$rows;
@@ -121,31 +121,7 @@ function get_survey_detailed($start,$end)
**/
function downloads_detailed($start=NULL,$end=NULL)
{
- /*
- #downloads detailed report
- select
- sitelogs.id,
- logtime,
- ip,
- sitelogs.surveyid,
- users.username,
- users.email,
- meta.company,
- meta.country,
- keyword as downloadid,
- surveys.titl as survey_title,
- resources.title as download_title,
- resources.filename as download_filename
-
- from sitelogs
- inner join surveys on surveys.id =sitelogs.surveyid
- inner join resources on resources.resource_id=sitelogs.keyword
- left join users on users.email = sitelogs.username
- left join meta on users.id=meta.id
-
- where sitelogs.section like '%download%';
- */
-
+
$sql='select
sitelogs.id,
logtime,
@@ -156,7 +132,7 @@ function downloads_detailed($start=NULL,$end=NULL)
meta.company,
meta.country,
keyword as downloadid,
- surveys.titl as survey_title,
+ surveys.title as survey_title,
resources.title as download_title,
resources.filename as download_filename,
forms.model as form_type
@@ -236,7 +212,7 @@ function public_requests($start=NULL,$end=NULL)
{
$sql='select
p.*,
- s.titl as survey_title,
+ s.title as survey_title,
u.username,
u.email,
meta.company,
@@ -311,7 +287,7 @@ function survey_summary_statistics()
{
$sql='select
s.id,
- titl,
+ title,
varcount,
dirpath,
s.formid,
diff --git a/application/models/Repository_model.php b/application/models/Repository_model.php
index 27beded51..3e16f3926 100644
--- a/application/models/Repository_model.php
+++ b/application/models/Repository_model.php
@@ -352,10 +352,10 @@ function get_repositories($published=FALSE, $system=TRUE,$exclude_central=TRUE)
$this->db->where("repositories.ispublished",1);
}
- if ($system==FALSE){
+ /*if ($system==FALSE){
//show system repositories
$this->db->where("repositories.type !=",2);
- }
+ }*/
$this->db->order_by('repository_sections.weight ASC, repositories.weight ASC, repositories.title');
$this->db->join('repository_sections', 'repository_sections.id= repositories.section','inner');
@@ -694,7 +694,7 @@ public function repo_survey_counts_by_data_access($repositoryid,$da_types=NULL)
**/
public function repo_survey_list($repositoryid,$data_access_types=NULL)
{
- $this->db->select('surveys.id,surveys.titl,surveys.nation,surveys.year_start,surveys.year_end,forms.model as da_model,surveys.created,surveys.changed');
+ $this->db->select('surveys.id,surveys.title,surveys.nation,surveys.year_start,surveys.year_end,forms.model as da_model,surveys.created,surveys.changed');
$this->db->join('survey_repos', 'surveys.id = survey_repos.sid','inner');
$this->db->join('forms', 'surveys.formid = forms.formid','left');
$this->db->where('survey_repos.repositoryid',$repositoryid);
diff --git a/application/schemas/ddi-schema.json b/application/schemas/ddi-schema.json
index a0cf59f51..f99ff1751 100644
--- a/application/schemas/ddi-schema.json
+++ b/application/schemas/ddi-schema.json
@@ -534,10 +534,14 @@
"title":"Keyword",
"type":"string"
},
+ "vocab":{
+ "title":"Vocabulary",
+ "type":"string"
+ },
"uri":{
"title":"uri",
"type":"string"
- }
+ }
}
}
},
diff --git a/application/schemas/image-schema.json b/application/schemas/image-schema.json
index 4f5d80648..863b5a338 100644
--- a/application/schemas/image-schema.json
+++ b/application/schemas/image-schema.json
@@ -81,34 +81,89 @@
}
},
"image_description":{
- "allOf": [{
- "$ref": "../schemas/iptc-pmd-schema.json"
- }]
- },
- "files": {
- "type": "array",
- "title": "Files",
- "description": "Files",
- "items":{
- "type":"object",
- "properties":{
- "file_uri": {
- "title": "File name",
- "description":"File name or URL",
- "type": "string"
- },
- "format": {
- "title": "File format",
- "description": "The file format, physical medium, or dimensions of the resource.",
- "type": "string"
- },
- "note": {
- "title": "Notes",
- "type": "string"
+ "type": "object",
+ "properties": {
+ "iptc": {
+ "allOf": [{ "$ref": "../schemas/iptc-pmd-schema.json" }]
+ },
+ "license": {
+ "type": "array",
+ "title": "License",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "License",
+ "type": "string"
+ },
+ "uri": {
+ "title": "URI",
+ "type": "string"
+ }
+ }
}
},
- "required": ["file_uri"]
+ "album": {
+ "type": "array",
+ "title": "Album",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name of album",
+ "type": "string"
+ },
+ "description": {
+ "title": "Description",
+ "type": "string"
+ },
+ "owner": {
+ "title": "Owner",
+ "type": "string"
+ },
+ "uri": {
+ "title": "URI",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "files": {
+ "type": "array",
+ "title": "Files",
+ "description": "Files",
+ "items":{
+ "type":"object",
+ "properties":{
+ "file_uri": {
+ "title": "File name",
+ "description":"File name or URL",
+ "type": "string"
+ },
+ "format": {
+ "title": "File format",
+ "description": "The file format, physical medium, or dimensions of the resource.",
+ "type": "string"
+ },
+ "note": {
+ "title": "Notes",
+ "type": "string"
+ },
+ "show": {
+ "title": "Show file (images only)",
+ "description": "Show the image file on the page",
+ "type": "boolean"
+ }
+ },
+ "required": ["file_uri"]
+ }
+ }
}
}
- }
+ },
+ "additional": {
+ "type": "object",
+ "description": "Additional metadata",
+ "properties": {}
+ }
}
\ No newline at end of file
diff --git a/application/schemas/script-schema.json b/application/schemas/script-schema.json
index ae0c43a08..f693199d0 100644
--- a/application/schemas/script-schema.json
+++ b/application/schemas/script-schema.json
@@ -11,34 +11,19 @@
"title": "Collection ID that owns the script",
"description": "Abbreviation for the collection that owns the script"
},
-
- "access_policy": {
- "type": "string",
- "title": "Data access policy",
- "description": "Data access policy for attached microdata resources",
- "enum": [
- "direct",
- "open",
- "public",
- "licensed",
- "remote",
- "na"
- ],
- "default": "na"
- },
- "data_remote_url": {
- "type": "string",
- "title": "Data website URL",
- "description": "Link to the website where the data is available, this is only needed if `access_policy` is set to `remote`.",
- "default": ""
- },
"published": {
"type": "integer",
"title": "Status",
"description": "Status of the script - 0=draft, 1=published",
"default": 0
},
+ "overwrite": {
+ "type": "string",
+ "description": "Overwrite document if already exists?",
+ "enum":["yes","no"],
+ "default": "no"
+ },
"doc_desc": {
"type": "object",
@@ -147,18 +132,42 @@
},
"production_date": {
- "type": "string",
"title":"Date of production (YYYY-MM-DD)",
- "description": "Date when the project (dissemination-ready version) was implemented"
- },
- "geographic_coverage": {
- "title": "Geographic coverage",
- "description": "Information on the geographic areas (if any) covered by the scripts/project. This may be a list of countries, regions, etc",
+ "description": "Date when the project (dissemination-ready version) was implemented",
"type": "array",
"items": {
"type": "string"
}
},
+
+ "geographic_units": {
+ "title": "Geographic locations",
+ "description": "List of geographic units (regions, countries, states, provinces, etc.) for which data are available in the database.",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Location name",
+ "description": "Name of the geographic unit e.g. 'World', 'Africa', 'Afghanistan'",
+ "type": "string"
+ },
+ "code": {
+ "title": "Location code",
+ "description": "Code of the geographic unit (for countries, preferred = ISO3 code)",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "description": "Type of geographic unit e.g. country, state, region, province etc",
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ }
+ },
"authoring_entity": {
"type": "array",
"title": "Authoring entity",
@@ -194,9 +203,9 @@
]
}
},
- "contributor": {
+ "contributors": {
"type": "array",
- "title": "Contributor(s)",
+ "title": "Contributors",
"description": "The person, corporate body, or agency who contributed to the project.",
"items": {
"type": "object",
@@ -233,10 +242,10 @@
]
}
},
- "curator": {
+ "curators": {
"type": "array",
- "title": "Contributor(s)",
- "description": "The person, corporate body, or agency who contributed to the project.",
+ "title": "Curators",
+ "description": "The person, corporate body, or agency who curated to the project.",
"items": {
"type": "object",
"properties": {
@@ -276,23 +285,144 @@
"type": "string",
"title": "Abstract"
},
- "output_type": {
- "type": "string",
- "title":"Output type",
- "description": "Type of output of the script/research project. Example: `On-line interactive data visualization`, `Working paper`"
+
+ "keywords":{
+ "title":"Keywords",
+ "type":"array",
+ "items":{
+ "type":"object",
+ "properties":{
+ "name":{
+ "title":"Name",
+ "type":"string"
+ },
+ "vocabulary":{
+ "title":"Vocabulary name",
+ "type":"string"
+ },
+ "uri":{
+ "title":"Vocabulary URI",
+ "type":"string"
+ }
+ }
+ }
},
- "publication_url": {
- "type": "string",
- "title":"Publication URL",
- "description": "Link to the publication (output) to which the scripts are related. This will for example be the URL of a PDF working paper."
+
+ "themes":{
+ "title":"Themes",
+ "type":"array",
+ "items":{
+ "type":"object",
+ "properties":{
+ "name":{
+ "title":"Name",
+ "type":"string"
+ },
+ "vocabulary":{
+ "title":"Vocabulary name",
+ "type":"string"
+ },
+ "uri":{
+ "title":"Vocabulary URI",
+ "type":"string"
+ }
+ }
+ }
},
- "doi": {
- "type": "string",
- "title":"DOI",
- "description": "DOI handle"
+
+ "topics": {
+ "type": "array",
+ "title": "Topics",
+ "description": "Topics covered by the table (ideally, the list of topics will be a controlled vocabulary)",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Unique Identifier",
+ "type": "string"
+ },
+ "name": {
+ "title": "Topic",
+ "type": "string"
+ },
+ "parent_id": {
+ "title": "Parent topic Identifier",
+ "description":"For subtopics, provide the ID of the parent topic",
+ "type": "string"
+ },
+ "vocabulary": {
+ "title": "Vocabulary",
+ "description": "Name of the controlled vocabulary, if the topic is from a taxonomy.",
+ "type": "string"
+ },
+ "uri": {
+ "title": "Vocabulary URI",
+ "description": "Link to the controlled vocabulary web page, if the topic is from a taxonomy.",
+ "type": "string"
+ }
+ },
+ "required": [
+ "id","name"
+ ]
+ }
+ },
+
+ "disciplines": {
+ "type": "array",
+ "title": "Disciplines",
+ "description": "Disciplines e.g. `Social sciences, economics`, `Natural sciences, biology`",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Discipline title or name",
+ "type": "string"
+ },
+ "vocabulary": {
+ "title": "Vocabulary",
+ "description": "Vocabulary",
+ "type": "string"
+ },
+ "uri": {
+ "title": "URI",
+ "description": "Website link",
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ }
+ },
+
+ "output_types":{
+ "title":"Output types",
+ "description": "Type of outputs of the script/research project. Example: `On-line interactive data visualization`, `Working paper`",
+ "type":"array",
+ "items":{
+ "type":"object",
+ "properties":{
+ "type":{
+ "title":"Type",
+ "type":"string"
+ },
+ "description":{
+ "title":"Description",
+ "type":"string"
+ },
+ "uri":{
+ "title":"URI",
+ "type":"string"
+ },
+ "doi":{
+ "title":"DOI",
+ "type":"string"
+ }
+ }
+ }
},
- "repository_url": {
+ "repository_uri": {
"type": "array",
"title": "Source code repository",
"description": "Source code repository",
@@ -318,59 +448,64 @@
"name"
]
}
- },
+ },
+
"project_website": {
- "type": "string",
- "description": "Project website link"
+ "title":"Project website",
+ "description": "Project website link",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
+
"version_statement": {
"type": "object",
"title": "Version Statement",
"description": "Version Statement",
- "_ddi_xpath":"stdyDscr/citation/verStmt",
"properties": {
"version": {
"title": "Version",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/version"
+ "type": "string"
},
"version_date": {
"title": "Version Date",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/version/@date"
+ "type": "string"
},
"version_resp": {
"title": "Version Responsibility Statement",
"description":"The organization or person responsible for the version of the work",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/verResp"
+ "type": "string"
},
"version_notes": {
"title": "Version Notes",
- "type": "string",
- "_ddi_xpath":"stdyDscr/citation/verStmt/notes"
+ "type": "string"
}
}
},
"language": {
- "type": "object",
+ "type": "array",
"title": "Language",
"description": "Documentation language e.g. English, French, etc.",
- "properties": {
- "name": {
- "title": "Name",
- "type": "string"
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "code": {
+ "title": "Code",
+ "type": "string"
+ }
},
- "code": {
- "title": "Code",
- "type": "string"
- }
- },
- "required": [
- "name"
- ]
+ "required": [
+ "name"
+ ]
+ }
},
+
"methods": {
"type": "array",
"title":"Methods or algorithms applied",
@@ -440,36 +575,32 @@
"license": {
- "type": "object",
- "title": "License",
- "description": "License",
+ "type": "array",
+ "title": "License",
+ "items": {
+ "type": "object",
"properties": {
"name": {
- "title": "Name",
+ "title": "License",
"type": "string"
},
- "URI": {
+ "uri": {
"title": "URI",
"type": "string"
}
- },
- "required": [
- "name"
- ]
+ }
+ }
},
-
-
-
- "pub_research": {
+ "review_process": {
"type": "array",
- "title": "Published research",
- "description": "Published research",
+ "title": "Review process",
+ "description": "Review process",
"items": {
"type": "object",
"properties": {
- "submit_date": {
+ "submission_date": {
"title": "Date submitted",
"type": "string"
},
@@ -481,63 +612,18 @@
"title": "Review status",
"type": "string"
},
- "review_date": {
- "title": "Review status",
- "type": "string"
- },
- "approval_date": {
- "title": "Approval date",
- "type": "string"
- },
"approval_authority": {
"title": "Approval authority",
"type": "string"
},
- "pub_date": {
- "title": "Date published",
+ "approval_date": {
+ "title": "Date of approval",
"type": "string"
}
}
- },
- "required": [
- "name"
- ]
+ }
},
-
-
- "data_included": {
- "type": "boolean",
- "description": "Is data included with the script?"
- },
- "data_url": {
- "type": "string",
- "description": "Link to an external website where data is available"
- },
- "contact": {
- "type": "array",
- "title": "Contact",
- "description": "Contact",
- "items": {
- "type": "object",
- "properties": {
- "name": {
- "title": "Name",
- "type": "string"
- },
- "affiliation": {
- "title": "Affiliation",
- "type": "string"
- },
- "URI": {
- "title": "URI",
- "type": "string"
- }
- }
- },
- "required": [
- "name"
- ]
- },
+
"disclaimer": {
"title": "Disclaimer",
"type": "string"
@@ -548,13 +634,13 @@
},
"citation_requirement": {
"type": "string",
- "description": "Citation requirements"
+ "description": "Citation requirements"
},
- "data_desc": {
+ "datasets": {
"type": "array",
- "title": "Data description",
- "description": "Contributors",
+ "title": "Datasets",
+ "description": "Datasets used by script",
"items": {
"type": "object",
"properties": {
@@ -574,8 +660,9 @@
"title": "Data access policy",
"type": "string"
},
- "URI": {
- "title": "URL",
+ "uri": {
+ "title": "URI",
+ "description": "Link to the website",
"type": "string"
}
}
@@ -583,48 +670,9 @@
"required": [
"name"
]
- },
-
- "review_process": {
- "type": "array",
- "title": "Project Review Process",
- "description": "Project review process that led to the publishing of the scripts",
- "items": {
- "type": "object",
- "properties": {
- "submit_date": {
- "title": "Submission date",
- "type": "string"
- },
- "reviewer": {
- "title": "Reviewer name",
- "type": "string"
- },
- "status": {
- "title": "Status of review",
- "type": "string"
- },
- "review_date": {
- "title": "Date of review",
- "type": "string"
- },
- "approval_date": {
- "title": "Date of final approval",
- "type": "string"
- },
- "authority": {
- "title": "Authority",
- "description":"Identification of the person or organization having formally approved the scripts/project after comlpetion of the review process",
- "type": "string"
- }
- }
- },
- "required": [
- "reviewer"
- ]
- },
+ },
- "sponsor": {
+ "sponsors": {
"type": "array",
"title": "Sponsor / Funding agency",
"description": "The source(s) of funds for production of the work. If different funding agencies sponsored different stages of the production process, use the 'role' attribute to distinguish them.",
@@ -642,6 +690,10 @@
"role": {
"title": "Role",
"type": "string"
+ },
+ "grant_no":{
+ "title": "Grant number",
+ "type": "string"
}
}
},
@@ -649,6 +701,7 @@
"name"
]
},
+
"acknowledgements": {
"type": "array",
"title": "Other Identifications /Acknowledgments",
@@ -732,10 +785,10 @@
},
- "script_files": {
+ "scripts": {
"type": "array",
"title": "Script files",
- "description": "Script files",
+ "description": "Description of each script file",
"items": {
"type": "object",
"properties": {
diff --git a/application/views/auth/change_password.php b/application/views/auth/change_password.php
index d70d2b87a..f559a0dd1 100644
--- a/application/views/auth/change_password.php
+++ b/application/views/auth/change_password.php
@@ -15,10 +15,12 @@