mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
fix lp: 1527201
This commit is contained in:
@@ -90,13 +90,9 @@ if (isset($_POST['ed']))
|
|||||||
unset($_POST['ed']);
|
unset($_POST['ed']);
|
||||||
unset($_POST['sample_import_id']);
|
unset($_POST['sample_import_id']);
|
||||||
|
|
||||||
// print_r($_POST). "</br>"; //ïîñìîòðèì ÷åãî îòðàâëÿåòñÿ
|
|
||||||
|
|
||||||
if (isset($_POST['del']) && isset($_POST['type']) ) {
|
if (isset($_POST['del']) && isset($_POST['type']) ) {
|
||||||
$a = array(); $b = array(); $cert = array(); $a = $_POST['type'];
|
$a = array(); $b = array(); $cert = array(); $a = $_POST['type'];
|
||||||
|
|
||||||
//echo "<p> type before unset->>"; foreach($_POST['type'] as $key => $val) { echo ' | ', $key,' => ',$val,' | '; }; print "</p>";
|
|
||||||
|
|
||||||
foreach($_POST['del'] as $p) {
|
foreach($_POST['del'] as $p) {
|
||||||
unset ($_POST['type'][$p]);
|
unset ($_POST['type'][$p]);
|
||||||
$deleted[] = $p;
|
$deleted[] = $p;
|
||||||
@@ -110,7 +106,6 @@ if (isset($_POST['ed']))
|
|||||||
}
|
}
|
||||||
/* else { echo "<div class='alert alert-info'>", T_("You can delete string '$key'. "), "</div>"; } */
|
/* else { echo "<div class='alert alert-info'>", T_("You can delete string '$key'. "), "</div>"; } */
|
||||||
}
|
}
|
||||||
//echo "<p>del ->>"; foreach($_POST['del'] as $key => $val) { echo ' | ', $key,' => ',$val,' | '; }; print "</p>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['type'])){
|
if (isset($_POST['type'])){
|
||||||
@@ -136,7 +131,7 @@ if (isset($_POST['ed']))
|
|||||||
if ($eml < 2) {$ch4 = true;}
|
if ($eml < 2) {$ch4 = true;}
|
||||||
else { echo "<div class='alert alert-warning'>", T_("Too many e-mail fields. Please check selected types for E-mail."), "</div>"; }
|
else { echo "<div class='alert alert-warning'>", T_("Too many e-mail fields. Please check selected types for E-mail."), "</div>"; }
|
||||||
|
|
||||||
if ($ch1 && $ch2 && $ch3 && $ch4) */$typecheck = true; //echo $ch1,$ch2,$ch3,$ch4, "typecheck=",$typecheck, "</br>" ;
|
if ($ch1 && $ch2 && $ch3 && $ch4) */$typecheck = true;
|
||||||
|
|
||||||
if ($typecheck){
|
if ($typecheck){
|
||||||
|
|
||||||
@@ -178,11 +173,10 @@ if (isset($_POST['ed']))
|
|||||||
if (isset($_POST['var'])){
|
if (isset($_POST['var'])){
|
||||||
|
|
||||||
foreach($_POST['var'] as $p => $val)
|
foreach($_POST['var'] as $p => $val)
|
||||||
{// echo '| ',$p,' => ',$val,'+ ';
|
{
|
||||||
$v = str_replace(" ", "_", $val);
|
$val = str_replace(array(" ,",", ",","," "," "),"_", $val);
|
||||||
|
|
||||||
$sql = "UPDATE sample_import_var_restrict
|
$sql = "UPDATE sample_import_var_restrict
|
||||||
SET `var` = '$v'
|
SET `var` = '$val'
|
||||||
WHERE sample_import_id = $sample_import_id
|
WHERE sample_import_id = $sample_import_id
|
||||||
AND `var_id` = $p";
|
AND `var_id` = $p";
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
@@ -199,7 +193,7 @@ if (isset($_POST['ed']))
|
|||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
|
|
||||||
foreach($_POST['see'] as $p => $val)
|
foreach($_POST['see'] as $p => $val)
|
||||||
{// echo $p,' => ',$val,' + ';
|
{
|
||||||
$sql = "UPDATE sample_import_var_restrict
|
$sql = "UPDATE sample_import_var_restrict
|
||||||
SET `restrict` = 0
|
SET `restrict` = 0
|
||||||
WHERE sample_import_id = $sample_import_id
|
WHERE sample_import_id = $sample_import_id
|
||||||
@@ -300,7 +294,7 @@ if (isset($_GET['edit']) )
|
|||||||
$rd = $db->GetAll($sql);
|
$rd = $db->GetAll($sql);
|
||||||
|
|
||||||
$sql = "SELECT sir.var_id,
|
$sql = "SELECT sir.var_id,
|
||||||
CONCAT('<input type=\"text\" onInput=\"$(this).attr(\'name\',\'var[',sir.var_id,']\');\" value=\"' ,sir.var, '\" required class=\"form-control\" style=\"min-width: 300px;\" $dis />') as var,
|
CONCAT('<input type=\"text\" name=\"var[',sir.var_id,']\" value=\"' ,sir.var, '\" required class=\"form-control\" style=\"min-width: 300px;\" $dis />') as var,
|
||||||
CONCAT ('<select name=\"type[',sir.var_id,']\" class=\"form-control\" $dis >";
|
CONCAT ('<select name=\"type[',sir.var_id,']\" class=\"form-control\" $dis >";
|
||||||
foreach($rd as $r)
|
foreach($rd as $r)
|
||||||
{
|
{
|
||||||
@@ -356,7 +350,7 @@ if ($rs){
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
print "<div class='well text-danger col-sm-3'><p>" . T_("Select which fields from this sample to deidentify. </p> Deidentified fields will be permanently deleted from the sample.") . "</p></div>";
|
if($sd['enabled'] == 0) print "<div class='well text-danger col-sm-3'><p>" . T_("Select which fields from this sample to deidentify. </p> Deidentified fields will be permanently deleted from the sample.") . "</p></div>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -391,7 +385,6 @@ else
|
|||||||
$rs = $db->GetAll($sql);
|
$rs = $db->GetAll($sql);
|
||||||
if (!empty($rs)) {
|
if (!empty($rs)) {
|
||||||
$count = count($rs);
|
$count = count($rs);
|
||||||
//print_r($rs);
|
|
||||||
print "<div class='well text-danger col-sm-3'><p>" . T_("Fix this sample ") . "</p>";
|
print "<div class='well text-danger col-sm-3'><p>" . T_("Fix this sample ") . "</p>";
|
||||||
print "<p>" . $count . " var id's not match</p>";
|
print "<p>" . $count . " var id's not match</p>";
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ function display_table($data)
|
|||||||
|
|
||||||
foreach ($data as $key => $value)
|
foreach ($data as $key => $value)
|
||||||
{
|
{
|
||||||
$val = str_replace(" ", "_", $value);
|
$val = str_replace(array(" ,",", ",","," "," "),"_", $value);
|
||||||
$checked = "checked";
|
$checked = "checked";
|
||||||
if (empty($val)) $val = "samp_$row";
|
if (empty($val)) $val = "samp_$row";
|
||||||
|
|
||||||
@@ -219,19 +219,14 @@ function import_file($file, $description, $fields, $firstrow = 2)
|
|||||||
if (strncmp($key, "i_", 2) == 0)
|
if (strncmp($key, "i_", 2) == 0)
|
||||||
{
|
{
|
||||||
$selected_type[substr($key,2)] = $fields["t_" . substr($key,2)];
|
$selected_type[substr($key,2)] = $fields["t_" . substr($key,2)];
|
||||||
$selected_name[substr($key,2)] = $fields["n_" . substr($key,2)];
|
$selected_name[substr($key,2)] = str_replace(array(" ,",", ",","," "," "),"_", $fields["n_" . substr($key,2)]);
|
||||||
|
|
||||||
$restrict = 1;
|
|
||||||
|
|
||||||
//Set restrictions on columns
|
//Set restrictions on columns
|
||||||
if (isset($fields["a_" . substr($key,2)]))
|
if (isset($fields["a_" . substr($key,2)])) $restrict = 0; else $restrict = 1;
|
||||||
{
|
|
||||||
$restrict = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "INSERT INTO sample_import_var_restrict
|
$sql = "INSERT INTO sample_import_var_restrict
|
||||||
(`sample_import_id`,`var`,`type`,`restrict`)
|
(`sample_import_id`,`var`,`type`,`restrict`)
|
||||||
VALUES ($id,'" . $fields["n_" . substr($key,2)] . "','" . $fields["t_" . substr($key,2)] . "',$restrict)";
|
VALUES ($id,'" . $selected_name[substr($key,2)] . "','" . $selected_type[substr($key,2)] . "',$restrict)";
|
||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user