* @version $Id$
* @access public
* @license http://opensource.org/licenses/gpl-3.0.html
*/
// ////////// Check Inclusion de pages ////////////
if (!class_exists('auth')) {
include_once("../lib/lib_common.php");
ReloadIndex('admin');
}
// //////////
//////////// Check Droits utilisateur ////////////
if (!$l21auth->hasRight('dashboard')) ReloadIndex('admin');
////////////
include_once("../lib/input_helpers.php");
include_once(override('../level/display.php', THEME_ADMIN_PATH));
$levels = $sql_object->DBSelect(SQL_getLevelsList());
$sdi_object = new sdi;
$sdi = $sql_object->DBSelect(SQL_getListSdi("R", 0));
$sdi = add_root_level($sdi, 'sdii_level', 'level_root'); // we add extra field with level root
$finalities = $sql_object->DBSelect(SQL_getLevelsList(true));
$excludes = array('excel', 'csv', 'json', 'png');
$select_format = selectBox($lang['export']['format'], "format_report", strtolower($lang['export']['format']['pdf']), null, $excludes);
/**
* DEBUG_informations
* to access debug informations
* uncomment code and change the value
* of form action to post data
* on the same page
*/
/**
if (isset($_POST['valider'])) {
if (isset($_POST['graphic'])) $graphic = 1;
else $graphic = 'N';
if (isset($_POST['table_value'])) $table_value = $_POST['table_value'];
else $table_value = 'non';
if (isset($_POST['notpublished'])) $notpublished = $_POST['notpublished'];
else $notpublished = 'N';
if (isset($_POST['provider'])) $provider = $_POST['provider'];
else $provider = 'N';
if (isset($_POST['reglementation'])) $reglementation = $_POST['reglementation'];
else $reglementation = 'N';
if (isset($_POST['evaluation'])) $evaluation = $_POST['evaluation'];
else $evaluation = 'N';
if ($_POST['scale']=='det')
{
print_r($_POST['eachscale']);
}
else echo "scale ALL \n";
if ($_POST['sdi']=='det')
{
while (list(, $value) = each ($_POST['eachsdi'])) {
echo "sdi Valeur: $value \n";
}
}
else echo "sdi ALL \n";
$report_title = $_POST['title_report'];
$report_author = $_POST['author'];
$report_mail = $_POST['mail_author'];
$report_service = $_POST['service_author'];
$report_adress = $_POST['adresse_author'];
echo " " . $graphic;
echo " " . $table_value;
echo " " . $notpublished;
echo " " . $provider;
echo " " . $reglementation;
echo " " . $evaluation;
echo " " . $report_title;
echo " " . $report_author;
echo " " . $report_mail;
echo " " . $report_service;
echo " " . $report_adress;
echo " " . $_POST['scale'];
echo " " . $_POST['sdi'];
}
*/
if (!isset($_REQUEST['scale_id'])) {
$scale_id = 1;
} else {
$scale_id = $_REQUEST['scale_id'];
}
// Finalities filter
$finalities_filter = '
';
$finalities_filter .= '
'._t('report','select_by_finalities').' ';
$js = '';
foreach ($finalities as $finality) {
$finalities_filter .= '
'. formatText($finality['level_name'], '2HTML'). ' ';
$js .= "$('#filter-finality-".$finality['level_id']."').click(function() {
if($(this).hasClass('selected')) {
$('li.finality-".$finality['level_id']." > input:checkbox').prop('checked', false);
$(this).find('i').replaceWith('
');
$(this).removeClass('selected');
} else {
$('li.finality-".$finality['level_id']." > input:checkbox').prop('checked', true);
$(this).find('i').replaceWith('
');
$(this).addClass('selected');
}
return false;
});";
}
$finalities_filter .= '
';
footerAddInlineJS($js);
// Attached to dashboard filter
// Finalities filter
$attached_filter = '';
$attached_filter .= '
'._t('report','select_by_association').' ';
$attached_filter .= '
'. _t('report','indicator-attached'). ' ';
$attached_filter .= '
'. _t('report','indicator-not-attached'). '';
$attached_filter .= '
';
$js = "$('#filter-attached').click(function() {
if($(this).hasClass('selected')) {
$('li.attached-to-dashboard > input:checkbox').prop('checked', false);
$(this).find('i').replaceWith(' ');
$(this).removeClass('selected');
} else {
$('li.attached-to-dashboard > input:checkbox').prop('checked', true);
$(this).find('i').replaceWith(' ');
$(this).addClass('selected');
}
return false;
});
$('#filter-not-attached').click(function() {
if($(this).hasClass('selected')) {
$('li.not-attached-to-dashboard > input:checkbox').prop('checked', false);
$(this).find('i').replaceWith(' ');
$(this).removeClass('selected');
} else {
$('li.not-attached-to-dashboard > input:checkbox').prop('checked', true);
$(this).find('i').replaceWith(' ');
$(this).addClass('selected');
}
return false;
});
";
footerAddInlineJS($js);
$listing = "";
// affichage liste échelle
$resultscale = $sql_object->DBSelect($req_list_scale);
$listing .= "
" . _t('report','scale_choice') . " ";
$listing .= "\n";
$listing .= "\n";
$listing .= "
\n";
$listing .= "
\n";
$js = "$('#scale_all').click(function() {
$('#display_scale').slideUp();
});
$('#scale_det').click(function() {
$('#display_scale').slideDown();
});";
footerAddInlineJS($js);
// affichage liste indicateur en fonction des niveaux
$listing .= "
" . _t('report','sdi_choice') . " ";
$listing .= "\n";
$listing .= "\t
\n";
$listing .= "
\n";
$listing .= "\n";
$listing .= "
\n";
$listing .= "
" . _t('common', 'select') . " : ";
$listing .= $attached_filter;
$listing .= $finalities_filter;
$listing .= "\n";
$listing .= "
\n";
$listing .= "
\n";
$js = "$('#sdi_all').click(function() {
$('#display_sdi').slideUp();
});
$('#sdi_det').click(function() {
$('#display_sdi').slideDown();
});";
footerAddInlineJS($js);
// affichage liste infos
$listing .= "
" . _t('report','comp_choice') . " ";
$listing .= "\n";
$listing .= "\t
\n";
$listing .= "\t\n";
$listing .= "
" . _t('report','levels-as-chapters') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','first-level-description') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','empty-levels') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','graph_values') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','table_values') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','notpublished_values') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','provider_info') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','rules_info') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','eval_info') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','summary_info') . " \n";
$listing .= "\t \n";
$listing .= "\t\n";
$listing .= "
" . _t('report','publi_info') . " \n";
$listing .= "\t \n";
$listing .= "\t \n";
$listing .= "
\n";
// if there is as selection stoed in session
if(isset($_SESSION['indicator_export_ids'])) {
$js = ' var actives = '. json_encode($_SESSION["indicator_export_ids"]) . ';
$("#sdi_det").click();
$("input:checkbox[name=\'eachsdi[]\']").each(function() {
// if in array we check input
if($.inArray( $(this).val().toString(), actives) != -1) $(this).prop("checked", true);
})';
footerAddInlineJS($js);
}
?>