Replace Ajax "get" calls by "posts" since long URLs may be truncated... and sometimes URLs get longer than expected when some characters are urlencoded... (Trac #195)

SVN:trunk[628]
This commit is contained in:
Denis Flaven
2010-07-26 15:28:19 +00:00
parent b3594f5899
commit c9a573e39f
6 changed files with 19 additions and 19 deletions

View File

@@ -190,8 +190,8 @@ class DisplayBlock
$oPage->add("</div>\n");
$oPage->add('
<script language="javascript">
$.get("ajax.render.php?filter='.$sFilter.'&style='.$this->m_sStyle.'",
{ operation: "ajax" },
$.post("ajax.render.php?style='.$this->m_sStyle.'",
{ operation: "ajax", filter: "$sFilter" },
function(data){
$("#'.$sId.'").empty();
$("#'.$sId.'").append(data);
@@ -257,8 +257,8 @@ class DisplayBlock
$sHtml .= "</div>\n";
$sHtml .= '
<script language="javascript">
$.get("ajax.render.php?filter='.$sFilter.'&style='.$this->m_sStyle.'",
{ operation: "ajax", extra_params: "'.$sExtraParams.'" },
$.post("ajax.render.php?style='.$this->m_sStyle.'",
{ operation: "ajax", filter: "'.$sFilter.'", extra_params: "'.$sExtraParams.'" },
function(data){
$("#'.$sId.'").empty();
$("#'.$sId.'").append(data);

View File

@@ -132,7 +132,7 @@ class UILinksWizard
function AddObjects()
{
// TO DO: compute the list of objects already linked with the current Object
$.get( 'ajax.render.php', { 'operation': 'addObjects',
$.post( 'ajax.render.php', { 'operation': 'addObjects',
'class': '{$this->m_sClass}',
'linkageAttr': '{$this->m_sLinkageAttr}',
'linkedClass': '{$this->m_sLinkedClass}',
@@ -175,7 +175,7 @@ class UILinksWizard
theMap['operation'] = 'searchObjectsToAdd';
// Run the query and display the results
$.get( 'ajax.render.php', theMap,
$.post( 'ajax.render.php', theMap,
function(data)
{
$('#SearchResultsToAdd').html(data);
@@ -223,7 +223,7 @@ class UILinksWizard
theMap['operation'] = 'doAddObjects';
// Run the query and display the results
$.get( 'ajax.render.php', theMap,
$.post( 'ajax.render.php', theMap,
function(data)
{
//console.log('Data: ' + data);

View File

@@ -6,8 +6,8 @@ function ReloadTruncatedList(divId, sSerializedFilter, sExtraParams)
{
$('#'+divId).addClass('loading');
//$('#'+divId).blockUI();
$.get('ajax.render.php?filter='+sSerializedFilter+'&style=list',
{ operation: 'ajax', extra_params: sExtraParams },
$.post('ajax.render.php?style=list',
{ operation: 'ajax', filter: sSerializedFilter, extra_params: sExtraParams },
function(data){
$('#'+divId).empty();
$('#'+divId).append(data);
@@ -25,8 +25,8 @@ function ReloadBlock(divId, sStyle, sSerializedFilter, sExtraParams)
{
$('#'+divId).addClass('loading');
//$('#'+divId).blockUI();
$.get('ajax.render.php?filter='+sSerializedFilter+'&style='+sStyle,
{ operation: 'ajax', extra_params: sExtraParams },
$.post('ajax.render.php?style='+sStyle,
{ operation: 'ajax', filter: sSerializedFilter, extra_params: sExtraParams },
function(data){
$('#'+divId).empty();
$('#'+divId).append(data);
@@ -65,7 +65,7 @@ function ReloadSearchForm(divId, sClassName, sBaseClass)
bSubmitHookIsUsed = true;
}
$('#'+divId+' form').unbind('submit');
$.get('ajax.render.php',
$.post('ajax.render.php',
{ operation: 'search_form', className: sClassName, baseClass: sBaseClass, currentId: divId },
function(data){
$('#'+divId).empty();

View File

@@ -9,8 +9,8 @@ function UpdateObjectList(sClass, sId, sExtKeyToRemote)
aRelatedObjectIds[0] = 0;
}
var oql = "SELECT "+sClass+" AS c WHERE c.id IN (" + aRelatedObjectIds.join(", ") + ")";
$.get("ajax.render.php?filter=" + oql + "&style=list&encoding=oql",
{ operation: "ajax" },
$.post("ajax.render.php?style=list&encoding=oql",
{ operation: "ajax", filter: oql },
function(data){
$("#related_objects_"+sId).empty();
$("#related_objects_"+sId).append(data);
@@ -42,8 +42,8 @@ function ManageObjects(sTitle, sClass, sId, sExtKeyToRemote)
function Manage_LoadSelect(sSelectedId, sFilter)
{
$('#'+sSelectedId).addClass('loading');
$.get('ajax.render.php?filter=' + sFilter,
{ operation: 'combo_options' },
$.post('ajax.render.php',
{ operation: 'combo_options', filter: sFilter },
function(data){
$('#'+sSelectedId).empty();
$('#'+sSelectedId).append(data);

View File

@@ -102,8 +102,8 @@ function WizardHelper(sClass)
{
//console.log('data sent:', this.ToJSON());
//console.log('oWizard:', this);
$.get('ajax.render.php?json_obj=' + this.ToJSON(),
{ operation: 'wizard_helper' },
$.post('ajax.render.php',
{ operation: 'wizard_helper', json_obj: this.ToJSON() },
function(html){
$('body').append(html);
//console.log('data received:', oWizardHelper);

View File

@@ -1026,7 +1026,7 @@ function Welcome(iTopWebPage $oPage)
ajax_request = null;
}
ajax_request = $.get('ajax.csvimport.php',
ajax_request = $.post('ajax.csvimport.php',
{ operation: 'get_csv_template', class_name: sClassName },
function(data) {
$('#template').empty();