improve status user CT#602

skala
Carlos Vargas 16 years ago
parent 88f8065e9f
commit 4693374b80
  1. 16
      main/admin/user_add.php
  2. 30
      main/admin/user_edit.php

@ -54,11 +54,15 @@ function display_drh_list(){
document.getElementById("drh_list").style.display="block";
document.getElementById("id_platform_admin").style.display="none";
}
else if (document.getElementById("status_select").value=='.COURSEMANAGER.')
{
document.getElementById("drh_list").style.display="none";
document.getElementById("id_platform_admin").style.display="block";
}
else
{
document.getElementById("drh_list").style.display="none";
document.getElementById("id_platform_admin").style.display="block";
document.getElementById("drh_select").options[0].selected="selected";
document.getElementById("id_platform_admin").style.display="none";
}
}
@ -148,15 +152,15 @@ $form->addElement('select_language', 'language', get_lang('Language'));
//drh list (display only if student)
$display = ($_POST['status'] == STUDENT || !isset($_POST['status'])) ? 'block' : 'none';
/*
$form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
$drh_select = $form->addElement('select', 'hr_dept_id', get_lang('Drh'), array(), 'id="drh_select"');
/*$drh_select = $form->addElement('select', 'hr_dept_id', get_lang('Drh'), array(), 'id="drh_select"');
$drh_list = UserManager :: get_user_list(array('status' => DRH), api_sort_by_first_name() ? array('firstname', 'lastname') : array('lastname', 'firstname'));
if (count($drh_list) == 0) {
$drh_select->addOption('- '.get_lang('ThereIsNotStillAResponsible', '').' -', 0);
} else {
$drh_select->addOption('- '.get_lang('SelectAResponsible').' -', 0);
}
}*/
if (is_array($drh_list)) {
foreach ($drh_list as $drh) {
@ -164,7 +168,7 @@ if (is_array($drh_list)) {
}
}
$form->addElement('html', '</div>');
*/
// Platform admin

@ -35,22 +35,17 @@ function password_switch_radio_button(){
}
function display_drh_list(){
if(document.getElementById("status_select").value=='.STUDENT.')
if(document.getElementById("status_select").value=='.COURSEMANAGER.')
{
document.getElementById("drh_list").style.display="block";
document.getElementById("check_admin").style.display="none";
document.getElementById("id_platform_admin").style.display="block";
}
else if (document.getElementById("status_select").value=='.COURSEMANAGER.')
else if (document.getElementById("status_select").value=='.STUDENT.')
{
document.getElementById("drh_list").style.display="none";
document.getElementById("drh_select").options[0].selected="selected";
document.getElementById("check_admin").style.display="block";
document.getElementById("id_platform_admin").style.display="none";
}
else
{
document.getElementById("drh_list").style.display="none";
document.getElementById("drh_select").options[0].selected="selected";
document.getElementById("check_admin").style.display="none";
document.getElementById("id_platform_admin").style.display="none";
}
}
@ -210,17 +205,16 @@ $form->addElement('html', '</div>');
// Platform admin
// Only when changing another user!
if ($user_id != $_SESSION['_uid']) {
if ($user_id != $_user['user_id']) {
$group = array();
$group[] =& HTML_QuickForm::createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
$group[] =& HTML_QuickForm::createElement('radio', 'platform_admin', null, get_lang('No'), 0);
if ($user_data['status'] == 1) {
$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
} else {
$form->addElement('html', '<div id="check_admin" style="display:none">');
$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
$form->addElement('html', '</div>');
}
$user_data['status'] == 1 ? $display = 'block':$display = 'none';
$form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
$form->addElement('html', '</div>');
}
// Send email

Loading…
Cancel
Save