Commit 41991831 authored by Gerald Salin's avatar Gerald Salin
Browse files

#60 and #61 : update user information

parent 8f57f19e
...@@ -644,8 +644,10 @@ class tx_nG6_eid { ...@@ -644,8 +644,10 @@ class tx_nG6_eid {
$email = $user_infos['email']; $email = $user_infos['email'];
$first_name = $user_infos['first_name']; $first_name = $user_infos['first_name'];
$last_name = $user_infos['last_name']; $last_name = $user_infos['last_name'];
$username = $user_infos['username'];
$mail_title = "[NG6]Your user informations have been updated."; $mail_title = "[NG6]Your user informations have been updated.";
$mail_content = "Dear " . $first_name . " " . $last_name . ",\n\nSome of your personnal informations have been updated : \n\n"; $mail_content = "Dear " . $first_name . " " . $last_name . " (user name : ".$username."),\n\nSome of your personnal informations have been updated : \n\n";
if ($email != ''){ if ($email != ''){
foreach($updated as $key => $value){ foreach($updated as $key => $value){
......
...@@ -2831,7 +2831,7 @@ static function get_project_runs($project_id, $orderby='', $limit='') { ...@@ -2831,7 +2831,7 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
'right_id' => $res_row['right_id'], 'right_id' => $res_row['right_id'],
'cruser_id' => $res_row['cruser_id'], 'cruser_id' => $res_row['cruser_id'],
'cruser_name' => $cruser_infos['username'], 'cruser_name' => $cruser_infos['username'],
'updatable_password' => $res_row['tx_nG6_updatable_password'] 'updatable_password' => $res_row['updatable_password']
); );
} }
......
...@@ -387,16 +387,20 @@ $(function () { ...@@ -387,16 +387,20 @@ $(function () {
last_name = $.trim( $('#tr_user_' + user_id + ' td:eq(4)').text()), last_name = $.trim( $('#tr_user_' + user_id + ' td:eq(4)').text()),
email = $.trim( $('#tr_user_' + user_id + ' td:eq(6)').text()), email = $.trim( $('#tr_user_' + user_id + ' td:eq(6)').text()),
update_pwd=$("#chk_updatablepwd_" + user_id).val(); update_pwd=$("#chk_updatablepwd_" + user_id).val();
console.log("user_login " + user_login);
console.log("first_name " + first_name);
console.log("last_name " + last_name);
console.log("user_id " + user_id);
console.log("update_pwd " + update_pwd);
// get title laboratory and organism from ajax query // get title laboratory and organism from ajax query
$.ajax({ $.ajax({
url: "index.php?eID=tx_nG6&type=get_user_group&id=" + user_id , url: "index.php?eID=tx_nG6&type=get_user_group&id=" + user_id ,
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
update_user_call_back(data); update_user_call_back(data, first_name);
}, },
error : function (){ error : function (){
update_user_call_back({'title' : 'Laboratory', 'organism' : 'Organism', 'location' : "Location"}); update_user_call_back({'title' : 'Laboratory', 'organism' : 'Organism', 'location' : "Location",'first_name':first_name});
} }
}); });
...@@ -404,7 +408,7 @@ $(function () { ...@@ -404,7 +408,7 @@ $(function () {
var title = user_group_json.title, var title = user_group_json.title,
organism = user_group_json.organism, organism = user_group_json.organism,
location = user_group_json.location; location = user_group_json.location;
console.log("update_user_call_back first_name " + first_name);
$("#modal-label-tmpl").html("Update user <small>" + user_login + "</small>"); $("#modal-label-tmpl").html("Update user <small>" + user_login + "</small>");
var update_user_html = [ var update_user_html = [
'<div id="error_message" class="alert alert-danger">', '<div id="error_message" class="alert alert-danger">',
...@@ -415,19 +419,19 @@ $(function () { ...@@ -415,19 +419,19 @@ $(function () {
' <div class="form-group">', ' <div class="form-group">',
' <label class="col-sm-offset-2 col-sm-2 control-label">First name</label>', ' <label class="col-sm-offset-2 col-sm-2 control-label">First name</label>',
' <div class="col-sm-8">', ' <div class="col-sm-8">',
' <input type="text" id="first_name_val" class="form-control" name="first_name_val" placeholder="' + first_name + '"/>', ' <input type="text" id="first_name_val" class="form-control" name="first_name_val" value="' + first_name + '"/>',
' </div>', ' </div>',
' </div>', ' </div>',
' <div class="form-group">', ' <div class="form-group">',
' <label class="col-sm-offset-2 col-sm-2 control-label">Last name</label>', ' <label class="col-sm-offset-2 col-sm-2 control-label">Last name</label>',
' <div class="col-sm-8">', ' <div class="col-sm-8">',
' <input type="text" id="last_name_val" class="form-control" name="last_name_val" placeholder="' + last_name + '"/> ', ' <input type="text" id="last_name_val" class="form-control" name="last_name_val" value="' + last_name + '"/> ',
' </div>', ' </div>',
' </div>', ' </div>',
' <div class="form-group">', ' <div class="form-group">',
' <label class="col-sm-offset-2 col-sm-2 control-label">Email</label>', ' <label class="col-sm-offset-2 col-sm-2 control-label">Email</label>',
' <div class="col-sm-8">', ' <div class="col-sm-8">',
' <input type="text" id="email_val" class="form-control" name="email_val" placeholder="' + email + '"/>', ' <input type="text" id="email_val" class="form-control" name="email_val" value="' + email + '"/>',
' </div>', ' </div>',
' </div>', ' </div>',
' <div class="form-group" id="password-form">', ' <div class="form-group" id="password-form">',
...@@ -444,19 +448,19 @@ $(function () { ...@@ -444,19 +448,19 @@ $(function () {
' <div class="form-group">', ' <div class="form-group">',
' <label class="col-sm-offset-2 col-sm-2 control-label">Laboratory</label>', ' <label class="col-sm-offset-2 col-sm-2 control-label">Laboratory</label>',
' <div class="col-sm-8">', ' <div class="col-sm-8">',
' <input type="text" id="title_val" class="form-control group_typeahead" name="title_val" placeholder="' + title + '"/>', ' <input type="text" id="title_val" class="form-control group_typeahead" name="title_val" value="' + title + '"/>',
' </div>', ' </div>',
' </div>', ' </div>',
' <div class="form-group">', ' <div class="form-group">',
' <label class="col-sm-offset-2 col-sm-2 control-label">Organism</label>', ' <label class="col-sm-offset-2 col-sm-2 control-label">Organism</label>',
' <div class="col-sm-8">', ' <div class="col-sm-8">',
' <input type="text" id="organism_val" class="form-control group_typeahead" name="organism_val" placeholder="' + organism + '"/>', ' <input type="text" id="organism_val" class="form-control group_typeahead" name="organism_val" value="' + organism + '"/>',
' </div>', ' </div>',
' </div>', ' </div>',
' <div class="form-group">', ' <div class="form-group">',
' <label class="col-sm-offset-2 col-sm-2 control-label">Location</label>', ' <label class="col-sm-offset-2 col-sm-2 control-label">Location</label>',
' <div class="col-sm-8">', ' <div class="col-sm-8">',
' <input type="text" id="location_val" class="form-control group_typeahead" name="location_val" placeholder="' + location + '"/>', ' <input type="text" id="location_val" class="form-control group_typeahead" name="location_val" value="' + location + '"/>',
' </div>', ' </div>',
' </div>', ' </div>',
' <div class="checkbox col-sm-offset-4">', ' <div class="checkbox col-sm-offset-4">',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment