1
0
forked from ScoDoc/ScoDoc

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;
}
}
ajaxRequest.open("POST", "doSignaleAbsenceGrSemestre", true);
ajaxRequest.open("POST", SCO_URL + "Absences/doSignaleAbsenceGrSemestre", true);
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
var oSelectOne = $("#abs_form")[0].elements["moduleimpl_id"];
var index = oSelectOne.selectedIndex;

View File

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

View File

@ -9,7 +9,7 @@ $().ready(function(){
function update_ue_list() {
var ue_id = $("#tf_ue_id")[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) {
$("#ue_list_code").html(data);
});

View File

@ -15,13 +15,13 @@ function display_itemsuivis(active) {
if (!readonly) {
$('#adddebouchelink').off("click").click(function (e) {
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;
});
}
// 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) {
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) {
var date = this.value;
// 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({
onSelect: function (date, instance) {
// 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',
buttonImage: '/ScoDoc/static/icons/calendar_img.png',
@ -131,7 +131,7 @@ function Date2DMY(date) {
}
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:
$("ul.listdebouches li.itemsuivi").remove();
display_itemsuivis(0);

View File

@ -19,7 +19,7 @@ function loadGroupes() {
$("#gmsg")[0].innerHTML = 'Chargement des groupes en cours...';
var partition_id = document.formGroup.partition_id.value;
$.get('XMLgetGroupsInPartition', { partition_id : partition_id } )
$.get(SCO_URL + 'XMLgetGroupsInPartition', { partition_id: partition_id })
.done(
function (data) {
var nodes = data.getElementsByTagName('group');
@ -349,7 +349,7 @@ function handleError( msg ) {
}
function submitGroups() {
var url = 'setGroups';
var url = SCO_URL + '/setGroups';
// build post request body: groupname \n etudid; ...
var groupsLists = '';
var groupsToCreate = '';
@ -402,7 +402,7 @@ function GotoAnother() {
if (groups_unsaved) {
alert("Enregistrez ou annulez vos changement avant !");
} 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 },
];
*/
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) {
var notes = [];
bul.ue.forEach(
function (ue, i, ues) {
ue['module'].forEach(function (m, i) {
notes.push( { 'code': m['code'],
notes.push({
'code': m['code'],
'titre': m['titre'],
'note': m['note']['value'],
'moy':m['note']['moy'] } );
}); } );
'moy': m['note']['moy']
});
});
});
draw_radar(notes);
});
}

View File

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

View File

@ -5,7 +5,7 @@ $().ready(function(){
for (var i = 0; i < spans.size(); i++) {
var sp = spans[i];
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 formsemestre_id = $("#tf_formsemestre_id")[0].value;
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) {
$("#ue_list_etud_validations").html(data);
});