summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/cReport.js
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/script/cReport.js')
-rw-r--r--admin/survey/script/cReport.js87
1 files changed, 40 insertions, 47 deletions
diff --git a/admin/survey/script/cReport.js b/admin/survey/script/cReport.js
index 9159b6e..c421d23 100644
--- a/admin/survey/script/cReport.js
+++ b/admin/survey/script/cReport.js
@@ -7,8 +7,8 @@ function creport_init () {
// sortable za custom report
$('.report_element').live('mouseover', function (event) {
$('#custom_report_sortable').sortable({
- items: 'li',
- handle: '.report_element_title',
+ items: 'li.report_element_standard, li.report_element_break',
+ handle: '.report_element_head',
opacity: 0.8,
revert: true,
create:function(){
@@ -32,18 +32,23 @@ function creport_init () {
});
$(".report_element_separator").live({
+
mouseenter: function(){
- $(this).find('.add_element').stop().animate({opacity:1}, 500);
+ //if(!$(this).hasClass('last_separator')){
+ $(this).find('.add_element').stop().animate({opacity:1}, 500);
+ //}
},
mouseleave: function(){
- $(this).find('.add_element').stop().animate({opacity:0}, 500);
+ //if(!$(this).hasClass('last_separator')){
+ $(this).find('.add_element').stop().animate({opacity:0}, 500);
+ //}
}
});
// click report elementa
- $(".report_element_title").live("click", function(event) {
+ $(".report_element_head").live("click", function(event) {
- var element = $(this).parent().parent();
+ var element = $(this).parent();
var id = $(element).attr('id').substr(15);
expandCustomReportElement(id);
@@ -218,6 +223,7 @@ function addPBCustomReportElement(id) {
// zbrise element iz custom reporta
function deleteCustomReportElement(element_id) {
$('#anketa_custom_report').load('ajax.php?t=custom_report&a=delete_element', {anketa: srv_meta_anketa_id, expanded: global_expanded, element_id:element_id});
+ event.stopPropagation();
}
// razsirjanje elementa v custom reportu
@@ -260,6 +266,7 @@ function editCustomReportTTestVar(id) {
// kopiranje elementa v custom reportu
function copyCustomReportElement(id) {
$('#anketa_custom_report').load('ajax.php?t=custom_report&a=copy_element', {anketa: srv_meta_anketa_id, expanded: global_expanded, element_id:id});
+ event.stopPropagation();
}
function printCustomReportElement(ime, id){
@@ -280,6 +287,8 @@ function printCustomReportElement(ime, id){
newWin.focus();
newWin.document.close();
+
+ event.stopPropagation();
}
// alert za dodajanje vseh elementov istega tipa v custom report
@@ -340,28 +349,14 @@ function addCustomReportAllElements(type) {
* nastavi editor na contenteditable element za naslov
*/
function creport_load_editor (_this) {
-
- /*$(_this).css('display', 'none');
- var el = $(_this).parent().find('.creport_textarea');
-
- var el_id = el.attr('el_id');
-
- el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:99%">'+el.html()+'</textarea>'+
- '<span class="buttonwrapper" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_save_editor(\''+el_id+'\'); return false;"><span>'+lang['save']+'</span></a></span>');
- create_editor('report_element_texteditor_'+el_id);*/
-
-
-
$(_this).css('display', 'none');
var el = $(_this).parent().find('.creport_text_inline');
var el_id = el.attr('el_id');
-
-
- el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:99%">'+el.html()+'</textarea>'+
- '<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_save_editor(\''+el_id+'\'); return false;"><span>'+lang['save']+'</span></a></span>');
+ el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:100%">'+el.html()+'</textarea>'+
+ '<div class="button_holder below"><button class="medium blue" onclick="creport_save_editor(\''+el_id+'\'); return false;">'+lang['save']+'</button></div>');
create_editor('report_element_texteditor_'+el_id);
}
@@ -370,17 +365,7 @@ function creport_load_editor (_this) {
* shrani editor in nastavi nazaj contenteditable
*/
function creport_save_editor(el_id) {
-
- /*get_editor_close('report_element_texteditor_'+el_id);
-
- var el = $('#report_element_texteditor_'+el_id);
- var parent = el.parent();
-
- el.replaceWith('<textarea style="width:90%; height: 80px;" class="creport_textarea" el_id="'+el_id+'" id="report_element_text_'+el_id+'" onBlur="editCustomReportElement('+el_id+', text, this.value)">');
- parent.find('span.buttonwrapper').remove();
-
- editCustomReportElement(el_id, 'text', el.val());*/
-
+
get_editor_close('report_element_texteditor_'+el_id);
var el = $('#report_element_texteditor_'+el_id);
@@ -402,13 +387,14 @@ function doArchiveCReport() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
+
function submitArchiveCReport() {
+
//preverimo ali obstaja vsebina meansa
if ($("#custom_report_elements").html().length > 0 ) {
- //var content = $("#custom_report_elements").html();
var name = $("#newAnalysisArchiveName").val();
var note = $("#newAnalysisArchiveNote").val();
@@ -418,8 +404,9 @@ function submitArchiveCReport() {
$("#fullscreen").load('ajax.php?a=submitArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, name:name, note:note, access:access, duration:duration, durationType:durationType}, function() {
$("#fullscreen").show();
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -435,9 +422,9 @@ function createArchiveCReportBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -445,7 +432,7 @@ function createArchiveCReportBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
};
@@ -458,15 +445,11 @@ function showCReportPreview() {
recipe.document.write('<html><head><title>Predogled poro&#269;ila po meri</title>');
- recipe.document.write('<link rel="stylesheet" href="css/style_font.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_basic.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_main.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_new2.css">');
- recipe.document.write('<link rel="stylesheet" href="css/print.css">');
+ recipe.document.write('<link rel="stylesheet" href="minify/g=css">');
recipe.document.write('<link rel="stylesheet" href="css/style_print.css" media="print">');
-
+
recipe.document.write('<style>');
- recipe.document.write('.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}');
+ recipe.document.write('ul{margin: 16px; padding: 0; list-style-type: none;} li{margin:16px 0;} .container {margin-bottom:45px;} #navigationBottom {width: 100%; margin-bottom: 16px; padding-right: 16px;}');
recipe.document.write('</style>');
recipe.document.write('</head><body>');
@@ -516,6 +499,16 @@ function use_creport_profile() {
});
}
+// Preklopimo porocilo
+function change_creport_profile(profile_id, author) {
+
+ $.post('ajax.php?t=custom_report&a=use_creport_profile', {anketa:srv_meta_anketa_id, id:profile_id, author:author}, function(){
+ var srv_site_url = $("#srv_site_url").val();
+ srv_site_url += 'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=analysis&m=analysis_creport&expanded='+global_expanded;
+ window.location.href = srv_site_url;
+ });
+}
+
// popravljamo custom report profil
function creport_profile_action(action){