urls in javascripts

This commit is contained in:
Emmanuel Viennet 2021-06-21 18:46:35 +02:00
parent 70eab84330
commit f177e777a9
9 changed files with 373 additions and 369 deletions

View File

@ -28,7 +28,7 @@ function ajaxFunction(mod, etudid, dat) {
document.getElementById("AjaxDiv").innerHTML = ajaxRequest.responseText; document.getElementById("AjaxDiv").innerHTML = ajaxRequest.responseText;
} }
} }
ajaxRequest.open("POST", "doSignaleAbsenceGrSemestre", true); ajaxRequest.open("POST", SCO_URL + "Absences/doSignaleAbsenceGrSemestre", true);
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
var oSelectOne = $("#abs_form")[0].elements["moduleimpl_id"]; var oSelectOne = $("#abs_form")[0].elements["moduleimpl_id"];
var index = oSelectOne.selectedIndex; var index = oSelectOne.selectedIndex;

View File

@ -1,8 +1,9 @@
function _partition_set_attr(partition_id, attr_name, attr_value) { function _partition_set_attr(partition_id, attr_name, attr_value) {
$.post('partition_set_attr', $.post(SCO_URL + '/partition_set_attr',
{ 'partition_id' : partition_id, {
'partition_id': partition_id,
'attr': attr_name, 'attr': attr_name,
'value': attr_value 'value': attr_value
}, },

View File

@ -9,7 +9,7 @@ $().ready(function(){
function update_ue_list() { function update_ue_list() {
var ue_id = $("#tf_ue_id")[0].value; var ue_id = $("#tf_ue_id")[0].value;
var ue_code = $("#tf_ue_code")[0].value; var ue_code = $("#tf_ue_code")[0].value;
var query = "ue_sharing_code?ue_code=" + ue_code +"&hide_ue_id=" + ue_id + "&ue_id=" + ue_id; var query = SCO_URL + "/Notes/ue_sharing_code?ue_code=" + ue_code + "&hide_ue_id=" + ue_id + "&ue_id=" + ue_id;
$.get(query, '', function (data) { $.get(query, '', function (data) {
$("#ue_list_code").html(data); $("#ue_list_code").html(data);
}); });

View File

@ -15,13 +15,13 @@ function display_itemsuivis(active) {
if (!readonly) { if (!readonly) {
$('#adddebouchelink').off("click").click(function (e) { $('#adddebouchelink').off("click").click(function (e) {
e.preventDefault(); e.preventDefault();
$.post( "itemsuivi_create", { etudid: etudid, format:'json' } ).done( item_insert_new ); $.post(SCO_URL + "itemsuivi_create", { etudid: etudid, format: 'json' }).done(item_insert_new);
return false; return false;
}); });
} }
// add existing items // add existing items
$.get( 'itemsuivi_list_etud', { etudid: etudid, format: 'json' }, function(L) { $.get(SCO_URL + "/itemsuivi_list_etud", { etudid: etudid, format: 'json' }, function (L) {
for (var i in L) { for (var i in L) {
item_insert(L[i]['itemsuivi_id'], L[i]['item_date'], L[i]['situation'], L[i]['tags'], readonly); item_insert(L[i]['itemsuivi_id'], L[i]['item_date'], L[i]['situation'], L[i]['tags'], readonly);
} }
@ -71,12 +71,12 @@ function item_nodes(itemsuivi_id, item_date, situation, tags, readonly) {
dp.blur(function (e) { dp.blur(function (e) {
var date = this.value; var date = this.value;
// console.log('selected text: ' + date); // console.log('selected text: ' + date);
$.post( "itemsuivi_set_date", { item_date: date, itemsuivi_id: itemsuivi_id } ); $.post(SCO_URL + "/itemsuivi_set_date", { item_date: date, itemsuivi_id: itemsuivi_id });
}); });
dp.datepicker({ dp.datepicker({
onSelect: function (date, instance) { onSelect: function (date, instance) {
// console.log('selected: ' + date + 'for itemsuivi_id ' + itemsuivi_id); // console.log('selected: ' + date + 'for itemsuivi_id ' + itemsuivi_id);
$.post( "itemsuivi_set_date", { item_date: date, itemsuivi_id: itemsuivi_id } ); $.post(SCO_URL + "/itemsuivi_set_date", { item_date: date, itemsuivi_id: itemsuivi_id });
}, },
showOn: 'button', showOn: 'button',
buttonImage: '/ScoDoc/static/icons/calendar_img.png', buttonImage: '/ScoDoc/static/icons/calendar_img.png',
@ -131,7 +131,7 @@ function Date2DMY(date) {
} }
function itemsuivi_suppress(itemsuivi_id) { function itemsuivi_suppress(itemsuivi_id) {
$.post( "itemsuivi_suppress", { itemsuivi_id: itemsuivi_id } ); $.post(SCO_URL + "/itemsuivi_suppress", { itemsuivi_id: itemsuivi_id });
// Clear items and rebuild: // Clear items and rebuild:
$("ul.listdebouches li.itemsuivi").remove(); $("ul.listdebouches li.itemsuivi").remove();
display_itemsuivis(0); display_itemsuivis(0);

View File

@ -19,7 +19,7 @@ function loadGroupes() {
$("#gmsg")[0].innerHTML = 'Chargement des groupes en cours...'; $("#gmsg")[0].innerHTML = 'Chargement des groupes en cours...';
var partition_id = document.formGroup.partition_id.value; var partition_id = document.formGroup.partition_id.value;
$.get('XMLgetGroupsInPartition', { partition_id : partition_id } ) $.get(SCO_URL + 'XMLgetGroupsInPartition', { partition_id: partition_id })
.done( .done(
function (data) { function (data) {
var nodes = data.getElementsByTagName('group'); var nodes = data.getElementsByTagName('group');
@ -349,7 +349,7 @@ function handleError( msg ) {
} }
function submitGroups() { function submitGroups() {
var url = 'setGroups'; var url = SCO_URL + '/setGroups';
// build post request body: groupname \n etudid; ... // build post request body: groupname \n etudid; ...
var groupsLists = ''; var groupsLists = '';
var groupsToCreate = ''; var groupsToCreate = '';
@ -402,7 +402,7 @@ function GotoAnother() {
if (groups_unsaved) { if (groups_unsaved) {
alert("Enregistrez ou annulez vos changement avant !"); alert("Enregistrez ou annulez vos changement avant !");
} else } else
document.location='affectGroups?partition_id='+document.formGroup.other_partition_id.value; document.location = SCO_URL + '/affectGroups?partition_id=' + document.formGroup.other_partition_id.value;
} }

View File

@ -33,18 +33,21 @@ function get_notes_and_draw(formsemestre_id, etudid) {
'moy' : 16 }, 'moy' : 16 },
]; ];
*/ */
var query = "formsemestre_bulletinetud?formsemestre_id=" + formsemestre_id + "&etudid=" + etudid + "&format=json&version=selectedevals&force_publishing=1" var query = SCO_URL + "/Notes/formsemestre_bulletinetud?formsemestre_id=" + formsemestre_id + "&etudid=" + etudid + "&format=json&version=selectedevals&force_publishing=1"
$.get(query, '', function (bul) { $.get(query, '', function (bul) {
var notes = []; var notes = [];
bul.ue.forEach( bul.ue.forEach(
function (ue, i, ues) { function (ue, i, ues) {
ue['module'].forEach(function (m, i) { ue['module'].forEach(function (m, i) {
notes.push( { 'code': m['code'], notes.push({
'code': m['code'],
'titre': m['titre'], 'titre': m['titre'],
'note': m['note']['value'], 'note': m['note']['value'],
'moy':m['note']['moy'] } ); 'moy': m['note']['moy']
}); } ); });
});
});
draw_radar(notes); draw_radar(notes);
}); });
} }

View File

@ -41,7 +41,7 @@ function save_note(elem, v, etudid) {
var evaluation_id = $("#formnotes_evaluation_id").attr("value"); var evaluation_id = $("#formnotes_evaluation_id").attr("value");
var formsemestre_id = $("#formnotes_formsemestre_id").attr("value"); var formsemestre_id = $("#formnotes_formsemestre_id").attr("value");
$('#sco_msg').html("en cours...").show(); $('#sco_msg').html("en cours...").show();
$.post( 'save_note', $.post(SCO_URL + 'Notes/save_note',
{ {
'etudid': etudid, 'etudid': etudid,
'evaluation_id': evaluation_id, 'evaluation_id': evaluation_id,

View File

@ -5,7 +5,7 @@ $().ready(function(){
for (var i = 0; i < spans.size(); i++) { for (var i = 0; i < spans.size(); i++) {
var sp = spans[i]; var sp = spans[i];
var etudid = sp.id; var etudid = sp.id;
$(sp).load('etud_photo_html?etudid='+etudid); $(sp).load(SCO_URL + "/etud_photo_html?etudid=" + etudid);
} }
}); });

View File

@ -23,7 +23,7 @@ function update_ue_validations() {
var ue_id = $("#tf_ue_id")[0].value; var ue_id = $("#tf_ue_id")[0].value;
var formsemestre_id = $("#tf_formsemestre_id")[0].value; var formsemestre_id = $("#tf_formsemestre_id")[0].value;
if (ue_id) { if (ue_id) {
var query = "get_etud_ue_cap_html?ue_id="+ue_id+"&etudid="+etudid+"&formsemestre_id="+formsemestre_id; var query = SCO_URL + "/Notes/get_etud_ue_cap_html?ue_id=" + ue_id + "&etudid=" + etudid + "&formsemestre_id=" + formsemestre_id;
$.get(query, '', function (data) { $.get(query, '', function (data) {
$("#ue_list_etud_validations").html(data); $("#ue_list_etud_validations").html(data);
}); });