|
|
@ -43,7 +43,6 @@ $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/'); |
|
|
|
$htmlHeadXtra[] = ' |
|
|
|
$htmlHeadXtra[] = ' |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
function add_user_to_url(code, content) { |
|
|
|
function add_user_to_url(code, content) { |
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("course_to_add").value = ""; |
|
|
|
document.getElementById("course_to_add").value = ""; |
|
|
|
document.getElementById("ajax_list_courses").innerHTML = ""; |
|
|
|
document.getElementById("ajax_list_courses").innerHTML = ""; |
|
|
|
|
|
|
|
|
|
|
@ -55,7 +54,6 @@ function add_user_to_url(code, content) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function send() { |
|
|
|
function send() { |
|
|
|
|
|
|
|
|
|
|
|
if (document.formulaire.access_url_id.value!=0) { |
|
|
|
if (document.formulaire.access_url_id.value!=0) { |
|
|
|
document.formulaire.form_sent.value=0; |
|
|
|
document.formulaire.form_sent.value=0; |
|
|
|
document.formulaire.add_type.value=\'' . $add_type . '\'; |
|
|
|
document.formulaire.add_type.value=\'' . $add_type . '\'; |
|
|
@ -129,28 +127,57 @@ if ($ajax_search) { |
|
|
|
$noUserGroupList = $userGroup->getUserGroupNotInList(array_keys($userGroupList)); |
|
|
|
$noUserGroupList = $userGroup->getUserGroupNotInList(array_keys($userGroupList)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$link_add_type_unique = ['class' => 'disabled']; |
|
|
|
|
|
|
|
$link_add_type_multiple = []; |
|
|
|
|
|
|
|
|
|
|
|
if ($add_type == 'multiple') { |
|
|
|
if ($add_type == 'multiple') { |
|
|
|
$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
|
|
$link_add_type_unique = []; |
|
|
|
$link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
|
|
$link_add_type_multiple = ['class' => 'disabled']; |
|
|
|
} else { |
|
|
|
|
|
|
|
$link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
|
|
|
|
|
|
$link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$url_list = UrlManager::get_url_data(); |
|
|
|
|
|
|
|
?> |
|
|
|
?> |
|
|
|
<div style="text-align: left;"> |
|
|
|
<div class="btn-toolbar"> |
|
|
|
<?php echo $link_add_type_unique ?> | <?php echo $link_add_type_multiple ?> |
|
|
|
<div class="btn-group"> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
echo Display::toolbarButton( |
|
|
|
|
|
|
|
get_lang('SessionAddTypeUnique'), |
|
|
|
|
|
|
|
api_get_self() . '?' . http_build_query([ |
|
|
|
|
|
|
|
'add_type' => 'unique', |
|
|
|
|
|
|
|
'access_url_id' => $access_url_id |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
'file-o', |
|
|
|
|
|
|
|
'default', |
|
|
|
|
|
|
|
$link_add_type_unique |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
echo Display::toolbarButton( |
|
|
|
|
|
|
|
get_lang('SessionAddTypeMultiple'), |
|
|
|
|
|
|
|
api_get_self() . '?' . http_build_query([ |
|
|
|
|
|
|
|
'add_type' => 'multiple', |
|
|
|
|
|
|
|
'access_url_id' => $access_url_id |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
'files-o', |
|
|
|
|
|
|
|
'default', |
|
|
|
|
|
|
|
$link_add_type_multiple |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<br /><br /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
$url_list = UrlManager::get_url_data(); |
|
|
|
|
|
|
|
?> |
|
|
|
<form |
|
|
|
<form |
|
|
|
name="formulaire" |
|
|
|
name="formulaire" |
|
|
|
method="post" |
|
|
|
method="post" |
|
|
|
action="<?php echo api_get_self(); ?>"
|
|
|
|
action="<?php echo api_get_self(); ?>"
|
|
|
|
style="margin:0px;" <?php if ($ajax_search){ echo ' onsubmit="valide();"'; } ?> |
|
|
|
style="margin:0px;" <?php if ($ajax_search) { |
|
|
|
|
|
|
|
echo ' onsubmit="valide();"'; |
|
|
|
|
|
|
|
} ?> |
|
|
|
> |
|
|
|
> |
|
|
|
<?php echo get_lang('SelectUrl').' : '; ?> |
|
|
|
<div class="row"> |
|
|
|
<select name="access_url_id" onchange="javascript:send();"> |
|
|
|
<div class="col-xs-2"> |
|
|
|
|
|
|
|
<label for="access_url_id"><?php echo get_lang('SelectUrl') ?></label>
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-xs-5"> |
|
|
|
|
|
|
|
<select name="access_url_id" id="access_url_id" onchange="javascript:send();" class="form-control"> |
|
|
|
<option value="0">-- <?php echo get_lang('SelectUrl') ?> --</option>
|
|
|
|
<option value="0">-- <?php echo get_lang('SelectUrl') ?> --</option>
|
|
|
|
<?php |
|
|
|
<?php |
|
|
|
$url_selected = ''; |
|
|
|
$url_selected = ''; |
|
|
@ -163,106 +190,80 @@ $url_list = UrlManager::get_url_data(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if ($url_obj['active'] == 1) { ?> |
|
|
|
if ($url_obj['active'] == 1) { ?> |
|
|
|
<option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?> |
|
|
|
<option <?php echo $checked; ?> |
|
|
|
|
|
|
|
value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?> |
|
|
|
</option> |
|
|
|
</option> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
?> |
|
|
|
?> |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<br /><br /> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<input type="hidden" name="form_sent" value="1"/> |
|
|
|
<input type="hidden" name="form_sent" value="1"/> |
|
|
|
<input type="hidden" name="add_type" value="<?php echo $add_type ?>"/>
|
|
|
|
<input type="hidden" name="add_type" value="<?php echo $add_type ?>"/>
|
|
|
|
|
|
|
|
|
|
|
|
<?php |
|
|
|
<?php |
|
|
|
if (!empty($errorMsg)) { |
|
|
|
if (!empty($errorMsg)) { |
|
|
|
Display::display_normal_message($errorMsg); //main API |
|
|
|
Display::display_normal_message($errorMsg); //main API |
|
|
|
} |
|
|
|
} |
|
|
|
?> |
|
|
|
?> |
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<table border="0" cellpadding="5" cellspacing="0" width="100%"> |
|
|
|
<div class="col-sm-5"> |
|
|
|
<!-- Users --> |
|
|
|
<label for="<?php echo $ajax_search ? 'course_to_add' : 'origin_users' ?>"><?php echo get_lang('UserGroupListInPlatform') ?></label>
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<td align="center"><b><?php echo get_lang('UserGroupListInPlatform') ?> :</b>
|
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
|
|
<td></td> |
|
|
|
|
|
|
|
<td align="center"><b><?php printf(get_lang('UserGroupListInX'),$url_selected); ?></b></td>
|
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<td align="center"> |
|
|
|
|
|
|
|
<div id="content_source"> |
|
|
|
<div id="content_source"> |
|
|
|
<?php if ($ajax_search) { ?> |
|
|
|
<?php if ($ajax_search) { ?> |
|
|
|
<input type="text" id="course_to_add" onkeyup="xajax_searchUserGroupAjax(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" /> |
|
|
|
<input type="text" id="course_to_add" class="form-control" |
|
|
|
|
|
|
|
onkeyup="xajax_searchUserGroupAjax(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)"/> |
|
|
|
<div id="ajax_list_courses"></div> |
|
|
|
<div id="ajax_list_courses"></div> |
|
|
|
<?php } else { ?> |
|
|
|
<?php } else { ?> |
|
|
|
<select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> |
|
|
|
<select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" class="form-control"> |
|
|
|
<?php |
|
|
|
<?php foreach ($noUserGroupList as $noItem) { ?> |
|
|
|
foreach ($noUserGroupList as $noItem) { |
|
|
|
<option value="<?php echo $noItem['id']; ?>"><?php echo $noItem['name']; ?></option>
|
|
|
|
?> |
|
|
|
<?php } ?> |
|
|
|
<option value="<?php echo $noItem['id']; ?>">
|
|
|
|
|
|
|
|
<?php echo $noItem['name']; ?> |
|
|
|
|
|
|
|
</option> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<?php |
|
|
|
<?php } ?> |
|
|
|
} |
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</div> |
|
|
|
<td width="10%" valign="middle" align="center"> |
|
|
|
<div class="col-sm-2 text-center"> |
|
|
|
<?php |
|
|
|
<br><br><br><br> |
|
|
|
if ($ajax_search) { |
|
|
|
<?php if ($ajax_search) { ?> |
|
|
|
?> |
|
|
|
<button class="btn btn-default" type="button" |
|
|
|
<button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" > |
|
|
|
onclick="remove_item(document.getElementById('destination_users'))"> |
|
|
|
<em class="fa fa-arrow-left"></em> |
|
|
|
<em class="fa fa-arrow-left"></em> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<?php |
|
|
|
<?php } else { ?> |
|
|
|
} else { |
|
|
|
<button class="btn btn-default" type="button" |
|
|
|
?> |
|
|
|
onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))"> |
|
|
|
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" > |
|
|
|
|
|
|
|
<em class="fa fa-arrow-right"></em> |
|
|
|
<em class="fa fa-arrow-right"></em> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<br/><br/> |
|
|
|
<br/><br/> |
|
|
|
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" > |
|
|
|
<button class="btn btn-default" type="button" |
|
|
|
|
|
|
|
onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))"> |
|
|
|
<em class="fa fa-arrow-left"></em> |
|
|
|
<em class="fa fa-arrow-left"></em> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<?php |
|
|
|
<?php } ?> |
|
|
|
} |
|
|
|
</div> |
|
|
|
?> |
|
|
|
<div class="col-sm-5"> |
|
|
|
<br /><br /><br /><br /><br /><br /> |
|
|
|
<label for="destination_users"><?php printf(get_lang('UserGroupListInX'), $url_selected); ?></label>
|
|
|
|
</td> |
|
|
|
<select id="destination_users" name="course_list[]" multiple="multiple" size="15" class="form-control"> |
|
|
|
<td align="center"> |
|
|
|
<?php foreach ($userGroupList as $item) { ?> |
|
|
|
<select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;"> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
foreach($userGroupList as $item) { |
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
|
<option value="<?php echo $item['id']; ?>">
|
|
|
|
<option value="<?php echo $item['id']; ?>">
|
|
|
|
<?php echo $item['name']; ?> |
|
|
|
<?php echo $item['name']; ?> |
|
|
|
</option> |
|
|
|
</option> |
|
|
|
<?php |
|
|
|
<?php } ?> |
|
|
|
} |
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
|
</select> |
|
|
|
</select> |
|
|
|
</td> |
|
|
|
</div> |
|
|
|
</tr> |
|
|
|
</div> |
|
|
|
<tr> |
|
|
|
<div class="row"> |
|
|
|
<td colspan="3" align="center"> |
|
|
|
<div class="col-xs-12 text-center"> |
|
|
|
<br /> |
|
|
|
<button class="save btn btn-primary" onclick="valide()"> |
|
|
|
<?php |
|
|
|
<span class="fa fa-save fa-fw" aria-hidden="true"></span> |
|
|
|
if(isset($_GET['add'])) |
|
|
|
<?php echo isset($_GET['add']) ? get_lang('AddUserGroupToURL') : get_lang('EditUserGroupToURL') ?> |
|
|
|
echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>'; |
|
|
|
</button> |
|
|
|
else |
|
|
|
</div> |
|
|
|
echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>'; |
|
|
|
</div> |
|
|
|
?> |
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
</form> |
|
|
|
</form> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
|
|
function moveItem(origin, destination) { |
|
|
|
function moveItem(origin, destination) { |
|
|
|
for (var i = 0; i < origin.options.length; i++) { |
|
|
|
for (var i = 0; i < origin.options.length; i++) { |
|
|
|
if (origin.options[i].selected) { |
|
|
|
if (origin.options[i].selected) { |
|
|
@ -305,7 +306,6 @@ function valide(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function loadUsersInSelect(select) { |
|
|
|
function loadUsersInSelect(select) { |
|
|
|
|
|
|
|
|
|
|
|
var xhr_object = null; |
|
|
|
var xhr_object = null; |
|
|
|
|
|
|
|
|
|
|
|
if (window.XMLHttpRequest) // Firefox |
|
|
|
if (window.XMLHttpRequest) // Firefox |
|
|
|