Remove old dialog box && update path to controllers in ajax call

update path to controllers
This commit is contained in:
Nicolas Le Goff
2012-10-09 19:45:51 +02:00
parent a61779ee5a
commit e8258acf15
6 changed files with 75 additions and 126 deletions

View File

@@ -779,45 +779,34 @@ function evt_print(basrec){
function evt_dwnl(lst) function evt_dwnl(lst)
{ {
var dialog_box = $('#dialog_dwnl'); if(typeof(lst) == 'undefined') {
var datas = "&SSTTID="+$('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value;
} else {
var datas = "&lst=" + lst;
}
dialog_box = $('#dialog_dwnl'); var dialog = p4.Dialog.Create({title: typeof(language) !== 'undefined' ? language['export']: ''});
dialog_box.empty().addClass('loading').dialog({ dialog.getDomElement().bind("dialogbeforeclose", function(event, ui) {
width:800,
height:600,
modal:true,
closeOnEscape : true,
resizable : false,
zIndex:10000,
overlay: {
backgroundColor: '#000',
opacity: 0.7
},
beforeclose:function(){
tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message'); tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message');
tinyMCE.execCommand('mceRemoveControl',true,'order_usage'); tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
} });
}).dialog('open');
if(typeof(lst) == 'undefined') $.post("/prod/export/multi-export/", datas, function(data) {
var datas = "&SSTTID="+$('#chutier_name')[0].options[$('#chutier_name')[0].selectedIndex].value;
else
var datas = "&lst=" + lst;
$.post("/include/multiexports.php", datas, function(data) { dialog.setContent(data);
$('.tabs', dialog.getDomElement()).tabs();
dialog_box.removeClass('loading').empty().append(data);
$('.tabs', dialog_box).tabs();
tinyMCE.execCommand('mceAddControl',true,'sendmail_message'); tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
tinyMCE.execCommand('mceAddControl',true,'order_usage'); tinyMCE.execCommand('mceAddControl',true,'order_usage');
$('.close_button', dialog_box).bind('click',function(){ $('.close_button', dialog.getDomElement()).bind('click',function(){
dialog_box.dialog('close').dialog('destroy'); dialog.Close();
});
return false;
}); });
return false;
});
} }
function profil(value) function profil(value)

View File

@@ -174,10 +174,9 @@ function print_notifications(page)
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/prod/prodFeedBack.php", url: "/user/notifications/",
dataType : 'json', dataType : 'json',
data: { data: {
action: "NOTIFICATIONS_FULL",
page:page page:page
}, },
error: function(data){ error: function(data){
@@ -252,9 +251,8 @@ function read_notifications()
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/prod/prodFeedBack.php", url: "/user/notifications/read/",
data: { data: {
action: "READ_NOTIFICATIONS",
notifications:notifications.join('_') notifications:notifications.join('_')
}, },
success: function(data){ success: function(data){
@@ -304,9 +302,8 @@ function setPref(name,value)
jQuery.data['pref_'+name] = $.ajax({ jQuery.data['pref_'+name] = $.ajax({
type: "POST", type: "POST",
url: "/prod/UserPreferences/save/", url: "/user/preferences/",
data: { data: {
action: "SAVEPREF",
prop:name, prop:name,
value:value value:value
}, },

View File

@@ -256,14 +256,12 @@ function getAnswerTrain(pos, tools, query,options_serial)
$('#PREVIEWCURRENTCONT').fadeOut('fast'); $('#PREVIEWCURRENTCONT').fadeOut('fast');
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/prod/prodFeedBack.php", url: "/prod/query/answer-train/",
dataType: 'json', dataType: 'json',
data: { data: {
action: "ANSWERTRAIN",
pos:pos, pos:pos,
options_serial:options_serial, options_serial:options_serial,
query:query query:query
}, },
success: function(data){ success: function(data){
setCurrent(data.current); setCurrent(data.current);
@@ -279,10 +277,9 @@ function getRegTrain(contId,pos,tools)
{ {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "./prodFeedBack.php", url: "/prod/query/reg-train/",
dataType: 'json', dataType: 'json',
data: { data: {
action: "REGTRAIN",
cont:contId, cont:contId,
pos:pos pos:pos
}, },

View File

@@ -2501,40 +2501,28 @@ function printThis(value)
function downloadThis(datas) function downloadThis(datas)
{ {
var dialog_box = $('#dialog_dwnl'); var dialog = p4.Dialog.Create({title: language['export']});
dialog_box = $('#dialog_dwnl'); dialog.getDomElement().bind("dialogbeforeclose", function(event, ui) {
dialog_box.empty().addClass('loading').dialog({
width:Math.min(bodySize.x - 30, 800),
height:Math.min(bodySize.y - 30, 600),
modal:true,
closeOnEscape : true,
resizable : false,
zIndex:1300,
overlay: {
backgroundColor: '#000',
opacity: 0.7
},
beforeclose:function(){
tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message'); tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message');
tinyMCE.execCommand('mceRemoveControl',true,'order_usage'); tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
} });
}).dialog('open');
$.post("/prod/multi-export/", datas, function(data) { $.post("/prod/export/multi-export/", datas, function(data) {
dialog.setContent(data);
$('.tabs', dialog.getDomElement()).tabs();
dialog_box.removeClass('loading').empty().append(data);
$('.tabs', dialog_box).tabs();
tinyMCE.execCommand('mceAddControl',true,'sendmail_message'); tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
tinyMCE.execCommand('mceAddControl',true,'order_usage'); tinyMCE.execCommand('mceAddControl',true,'order_usage');
$('.close_button', dialog_box).bind('click',function(){ $('.close_button', dialog.getDomElement()).bind('click',function(){
dialog_box.dialog('close').dialog('destroy'); dialog.Close();
});
return false;
}); });
return false;
});
} }

View File

@@ -477,39 +477,28 @@ function activate_notes(container)
function download(value) function download(value)
{ {
var dialog_box = $('#dialog_dwnl'); var dialog = p4.Dialog.Create({title: typeof(language) !== 'undefined' ? language['export']: ''});
dialog_box = $('#dialog_dwnl'); dialog.getDomElement().bind("dialogbeforeclose", function(event, ui) {
dialog_box.empty().addClass('loading').dialog({
width:800,
height:600,
modal:true,
closeOnEscape : false,
resizable : false,
overlay: {
backgroundColor: '#000',
opacity: 0.7
},
beforeclose:function(){
tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message'); tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message');
tinyMCE.execCommand('mceRemoveControl',true,'order_usage'); tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
} });
}).dialog('open');
$.post("/include/multiexports.php", "lst="+value, function(data) { $.post("/prod/export/multi-export/", "lst="+value, function(data) {
dialog.setContent(data);
$('.tabs', dialog.getDomElement()).tabs();
dialog_box.removeClass('loading').empty().append(data);
$('.tabs', dialog_box).tabs();
tinyMCE.execCommand('mceAddControl',true,'sendmail_message'); tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
tinyMCE.execCommand('mceAddControl',true,'order_usage'); tinyMCE.execCommand('mceAddControl',true,'order_usage');
$('.close_button', dialog_box).bind('click',function(){ $('.close_button', dialog.getDomElement()).bind('click',function(){
dialog_box.dialog('close').dialog('destroy'); dialog.Close();
});
return false;
}); });
return false;
});
} }

View File

@@ -1076,38 +1076,27 @@ function download_basket()
function download(value) function download(value)
{ {
var dialog_box = $('#dialog_dwnl'); var dialog = p4.Dialog.Create({title: typeof(language) !== 'undefined' ? language['export']: ''});
dialog_box = $('#dialog_dwnl'); dialog.getDomElement().bind("dialogbeforeclose", function(event, ui) {
dialog_box.empty().addClass('loading').dialog({
width:800,
height:600,
modal:true,
closeOnEscape : false,
resizable : false,
overlay: {
backgroundColor: '#000',
opacity: 0.7
},
beforeclose:function(){
tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message'); tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message');
tinyMCE.execCommand('mceRemoveControl',true,'order_usage'); tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
} });
}).dialog('open');
$.post("/include/multiexports.php", "lst="+value, function(data) { $.post("/prod/export/multi-export/", "lst="+value, function(data) {
dialog.setContent(data);
$('.tabs', dialog.getDomElement()).tabs();
dialog_box.removeClass('loading').empty().append(data);
$('.tabs', dialog_box).tabs();
tinyMCE.execCommand('mceAddControl',true,'sendmail_message'); tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
tinyMCE.execCommand('mceAddControl',true,'order_usage'); tinyMCE.execCommand('mceAddControl',true,'order_usage');
$('.close_button', dialog_box).bind('click',function(){ $('.close_button', dialog.getDomElement()).bind('click',function(){
dialog_box.dialog('close').dialog('destroy'); dialog.Close();
}); });
return false; return false;
}); });
} }