Commit 4d9471df authored by Jerome Mariette's avatar Jerome Mariette
Browse files

download ok

parent 47eb5fea
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>nG6</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
......@@ -23,12 +23,12 @@ class tx_nG6_eid {
// First all project runs
$p_runs = $this->get_project_runs($id);
foreach($p_runs as $run_id => $run_values) {
$html .= '<li class="jstree-closed" id=\''.$run_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###', '###SPAN_DATE###', '###SPAN_NB_SEQ###', '###SPAN_SPECIES###'), array($run_values["name"], $run_values["date"], $run_values["nb_sequences"], $run_values["species"]), trim(t3lib_div::_GP('run_printing'))).'</a></li>';
$html .= '<li class="jstree-closed" name=\''.str_replace(array('###SPAN_NAME###', '###SPAN_DATE###'), array($run_values["name"], strftime('%d-%m-%y',$run_values["date"])), trim(t3lib_div::_GP('short_run_printing'))).'\' id=\''.$run_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###', '###SPAN_DATE###', '###SPAN_NB_SEQ###', '###SPAN_SPECIES###'), array($run_values["name"], strftime('%d-%m-%y',$run_values["date"]), $run_values["nb_sequences"], $run_values["species"]), trim(t3lib_div::_GP('run_printing'))).'</a></li>';
}
// Then all project analysis
$p_analysis = $this->get_project_analysis($id);
foreach($p_analysis as $analyse_id => $analyse_values) {
$html .= '<li id=\''.$analyse_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_printing'))).'</a></li>';
$html .= '<li name=\''.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_printing'))).'\' id=\''.$analyse_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_printing'))).'</a></li>';
}
print $html;
} else if ($type == 'run'){
......@@ -36,9 +36,9 @@ class tx_nG6_eid {
$r_analysis = $this->get_run_analysis($id);
$run_info = $this->get_run($id);
$html .= '<li id=\'data_'.$id.'\'> <a href=\'#\'>'.trim(t3lib_div::_GP("raw_data_label")).'</a></li>';
$html .= '<li name=\'run_'.$id.'_'.trim(t3lib_div::_GP("raw_data_label")).'\' id=\'data_'.$id.'\'> <a href=\'#\'>'.trim(t3lib_div::_GP("raw_data_label")).'</a></li>';
foreach($r_analysis as $analyse_id => $analyse_values) {
$html .= '<li id=\''.$analyse_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_printing'))).'</a></li>';
$html .= '<li name=\'run_'.$id.'_'.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_printing'))).'\' id=\''.$analyse_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_printing'))).'</a></li>';
}
print $html;
} else if ($type == 'download') {
......
......@@ -4,7 +4,7 @@ plugin.tx_nG6_pi1 {
recursive =
view =
results_at_a_time = 20
data = /tools/typoweb/ng6/fileadmin
data = /var/www/typoweb/ng6/fileadmin
}
plugin.tx_nG6_pi2 {
result_page_id = 6
......@@ -13,6 +13,6 @@ plugin.tx_nG6_pi3 {
redirection_page = 2
}
plugin.tx_nG6_pi5 {
temp = /var/www/typoweb/ng6/fileadmin/tmp
temp = /var/www/typoweb/ng6/fileadmin/temp
data = /var/www/typoweb/ng6/fileadmin
}
\ No newline at end of file
......@@ -95,6 +95,7 @@ class tx_nG6_pi5 extends tslib_pibase {
"data" : function (n) {
return {
raw_data_label : "'.$this->getFieldHeader('raw_data_label').'",
short_run_printing : "'.$this->getFieldHeader('run_short_description').'",
run_printing : "'.$this->getFieldHeader('run_description').'",
analyse_printing : "'.$this->getFieldHeader('analyse_description').'",
id : n.attr("id").split("_")[1],
......@@ -105,24 +106,61 @@ class tx_nG6_pi5 extends tslib_pibase {
},
"plugins" : [ "themes", "html_data", "ui", "checkbox" ]
}).bind("change_state.jstree", function(event, data) {
var nb_selected = 0;
$("#download_list").html("<ul>");
$(".jstree-checked > ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked").each(function(){
nb_selected += 1;
if ($(this).attr("id").split("_")[0] == "run") {
$("#download_list > ul").append("<li>"+$(this).attr("id")+"</li>");
//alert($(this).html());
} else if ($(this).attr("id").split("_")[0] == "analyse") {
$("#download_list > ul").append("<li>"+$(this).html()+"</li>");
//alert($(this).html());
var nb_selected = 0;
var runs_list = new Array();
var download_list = new Array();
$("#download_list").html("<ul>");
$(".jstree-checked > ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked").each(function(){
nb_selected += 1;
var tmp = $(this).attr("id").split("_");
if (tmp[0] == "run") {
runs_list.push($(this).attr("id"));
download_list[$(this).attr("id")] = $(this).attr("name") + " : <br /> '.$this->getFieldHeader('all').'";
} else if (tmp[0] == "analyse") {
var tmp2 = $(this).attr("name").split("_");
if (tmp2.length > 1) {
var is_in = false;
for (var i = 0; i < runs_list.length; i++){
if (tmp2[0]+"_"+tmp2[1] == runs_list[i]) {
is_in = true;
}
}
if (!is_in) {
if (tmp2[0]+"_"+tmp2[1] in download_list) {
download_list[tmp2[0]+"_"+tmp2[1]] += ", " + tmp2[2];
} else {
download_list[tmp2[0]+"_"+tmp2[1]] = $("#"+tmp2[0]+"_"+tmp2[1]).attr("name") + " : <br /> " + tmp2[2];
}
}
} else {
download_list[$(this).attr("id")] = $(this).attr("name");
}
} else if (tmp[0] == "data") {
var tmp2 = $(this).attr("name").split("_");
var is_in = false;
for (var i = 0; i < runs_list.length; i++){
if (tmp2[0]+"_"+tmp2[1] == runs_list[i]) {
is_in = true;
}
}
if (!is_in) {
if (tmp2[0]+"_"+tmp2[1] in download_list) {
download_list[tmp2[0]+"_"+tmp2[1]] += ", " + tmp2[2];
} else {
download_list[tmp2[0]+"_"+tmp2[1]] = $("#"+tmp2[0]+"_"+tmp2[1]).attr("name") + " : <br /> " + tmp2[2];
}
}
}
});
for (var key in download_list) {
$("#download_list > ul").append("<li><span>"+download_list[key]+"</span></li>");
}
if (nb_selected == 0) {
$("#download_btn").addClass("tx-nG6-pi5-download-disable");
$("#download_list > ul").append("<li><span>'.$this->getFieldHeader('download_list_no_select').'</span></li>");
} else {
$("#download_btn").removeClass("tx-nG6-pi5-download-disable");
}
});
if (nb_selected == 0) {
$("#download_btn").addClass("tx-nG6-pi5-download-disable");
$("#download_list > ul").append("<li>'.$this->getFieldHeader('download_list_no_select').'</li>");
} else {
$("#download_btn").removeClass("tx-nG6-pi5-download-disable");
}
});
$("#download_dialog").dialog({
autoOpen: false,
......@@ -168,12 +206,12 @@ class tx_nG6_pi5 extends tslib_pibase {
}
$html_tree .= "' />";
$content .= '<div '.$this->pi_classParam('download-builder-tree').'> <div '.$this->pi_classParam('download-builder-header').'> <h3> <img src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/img/download_builder.png" alt="" width="91" height="88" />'.$this->getFieldHeader('msg').'</h3></div> <div id="download_dialog" title=""></div>'.$html_tree;
$content .= '<div '.$this->pi_classParam('download-builder-tree').'> <div '.$this->pi_classParam('download-builder-header').'> <h3>'.$this->getFieldHeader('msg').'</h3></div> <div id="download_dialog" title=""></div>'.$html_tree;
$content .= '<div id="download_tree"></div></div>';
$content .= '<div '.$this->pi_classParam('download-builder').'> ';
$content .= '<div '.$this->pi_classParam('download-builder-group').'> <h2>'.$this->getFieldHeader('download_list_title').'<h2> <div id="download_list"> <ul><li>'.$this->getFieldHeader('download_list_no_select').'</li></ul></div></div>';
$content .= '<div '.$this->pi_classParam('download-builder-group').'> <h2>'.$this->getFieldHeader('download_list_title').'<h2> <div id="download_list"> <ul><li><span>'.$this->getFieldHeader('download_list_no_select').'</span></li></ul></div></div>';
$content .= '<div '.$this->pi_classParam('download-builder-group').'> <h2>'.$this->getFieldHeader('download_format_title').'</h2>';
$content .= '<input type="radio" name="format" value="tar.gz"> .tar.gz <br /><input type="radio" name="format" value="zip"> .zip</div>';
$content .= '<input type="radio" name="format" value="tar.gz" selected="selected"> .tar.gz</div>';
$content .= '<div '.$this->pi_classParam('download-builder-group').' style="border-bottom: 0;margin-top: 0;margin-bottom:0;padding-bottom:0;"> <input class="tx-nG6-pi5-download tx-nG6-pi5-download-disable" id="download_btn" type="button" value="'.$this->getFieldHeader('download_btn_label').'" /> </div> </div>';
return $content;
}
......
......@@ -9,29 +9,33 @@
<label index="listFieldHeader_download_btn_label">Download</label>
<label index="listFieldHeader_project_description">Project ###SPAN_NAME###</label>
<label index="listFieldHeader_run_description">Run ###SPAN_NAME### (###SPAN_SPECIES###) - (###SPAN_DATE###) produced ###SPAN_NB_SEQ### reads</label>
<label index="listFieldHeader_run_short_description">Run ###SPAN_NAME### (###SPAN_DATE###)</label>
<label index="listFieldHeader_analyse_description">Analyse ###SPAN_NAME###</label>
<label index="listFieldHeader_raw_data_label">Raw data</label>
<label index="listFieldHeader_download_dialog_title">Downloading</label>
<label index="listFieldHeader_download_dialog_msg">File creation in progress ...</label>
<label index="listFieldHeader_title">Download center</label>
<label index="listFieldHeader_msg">First select all data you want to download, then click on the download button.</label>
<label index="listFieldHeader_download_list_title">Download Files list :</label>
<label index="listFieldHeader_download_format_title">Download format :</label>
<label index="listFieldHeader_download_list_no_select">No file selected.</label>
<label index="listFieldHeader_download_list_title">Download Files list :</label>
<label index="listFieldHeader_download_format_title">Download format :</label>
<label index="listFieldHeader_download_list_no_select">No run neither any analyse selected.</label>
<label index="listFieldHeader_all">Raw data + all analyses</label>
</languageKey>
<languageKey index="fr" type="array">
<label index="listFieldHeader_download_btn_label">T&amp;eacute;l&amp;eacute;charger</label>
<label index="listFieldHeader_project_description">Projet ###SPAN_NAME###</label>
<label index="listFieldHeader_run_description">Run ###SPAN_NAME### (###SPAN_SPECIES###) - r&amp;eacute;alis&amp;eacute; le ###SPAN_DATE###, ###SPAN_NB_SEQ### lectures</label>
<label index="listFieldHeader_run_short_description">Run ###SPAN_NAME### (###SPAN_DATE###)</label>
<label index="listFieldHeader_analyse_description">Analyse ###SPAN_NAME###</label>
<label index="listFieldHeader_raw_data_label">Donn&amp;eacute;es brutes</label>
<label index="listFieldHeader_download_dialog_title">T&amp;eacute;l&amp;eacute;chargement</label>
<label index="listFieldHeader_download_dialog_msg">Cr&amp;eacute;ation en cours ...</label>
<label index="listFieldHeader_title">T&amp;eacute;l&amp;eacute;chargement de vos donn&amp;eacute;es</label>
<label index="listFieldHeader_msg">S&amp;eacute;lectionner les donn&amp;eacute;es que vous souhaitez t&amp;eacute;l&amp;eacute;charger puis cliquer sur le bouton de t&amp;eacute;l&amp;eacute;chargement.</label>
<label index="listFieldHeader_download_list_title">Liste des fichiers &amp;agrave; t&amp;eacute;l&amp;eacute;charger :</label>
<label index="listFieldHeader_download_format_title">Format :</label>
<label index="listFieldHeader_download_list_no_select">Aucun fichier s&amp;eacute;l&amp;eacute;ctionn&amp;eacute;.</label>
<label index="listFieldHeader_download_list_title">Liste des fichiers &amp;agrave; t&amp;eacute;l&amp;eacute;charger :</label>
<label index="listFieldHeader_download_format_title">Format :</label>
<label index="listFieldHeader_download_list_no_select">Aucun run ni analyse s&amp;eacute;l&amp;eacute;ctionn&amp;eacute;.</label>
<label index="listFieldHeader_all">Donn&amp;eacute;es brutes + toutes les analyses</label>
</languageKey>
</data>
</T3locallang>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment