<?php
/* Smarty version 3.1.33, created on 2025-10-17 07:47:51
  from 'C:\php5.6\htdocs\testlink-1.9.20\gui\templates\tl-classic\usermanagement\usersAssign.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_68f1d8871fa985_06872344',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'b9ccf74bd6b93c0ec55414cd9ed114bc6131b972' => 
    array (
      0 => 'C:\\php5.6\\htdocs\\testlink-1.9.20\\gui\\templates\\tl-classic\\usermanagement\\usersAssign.tpl',
      1 => 1579460696,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:inc_head.tpl' => 1,
    'file:inc_ext_js.tpl' => 1,
    'file:bootstrap.inc.tpl' => 1,
    'file:DataTables.inc.tpl' => 1,
    'file:usermanagement/menu.inc.tpl' => 1,
    'file:inc_update.tpl' => 1,
  ),
),false)) {
function content_68f1d8871fa985_06872344 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'C:\\php5.6\\htdocs\\testlink-1.9.20\\vendor\\smarty\\smarty\\libs\\plugins\\function.cycle.php','function'=>'smarty_function_cycle',),));
echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('var'=>"labels",'s'=>'TestProject,TestPlan,btn_change,title_user_mgmt,set_roles_to,show_only_authorized_users,
             warn_demo,User,btn_upd_user_data,btn_do,title_assign_roles'),$_smarty_tpl ) );?>


<?php $_smarty_tpl->_subTemplateRender("file:inc_head.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('jsValidate'=>"yes",'openHead'=>"yes",'enableTableSorting'=>"yes"), 0, false);
$_smarty_tpl->_subTemplateRender("file:inc_ext_js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('css_only'=>1), 0, false);
?>

<?php $_smarty_tpl->_subTemplateRender("file:bootstrap.inc.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<?php echo '<script'; ?>
 language="JavaScript" type="text/javascript">
/*
Set value for a group of combo (have same prefix).
MUST TO BE PLACED IN COMMON LIBRARY
*/
function set_combo_group(container_id,combo_id_prefix,value_to_assign)
{
  var container=document.getElementById(container_id);
	var all_comboboxes = container.getElementsByTagName('select');
	var input_element;
	var idx=0;

	for(idx = 0; idx < all_comboboxes.length; idx++)
	{
	  input_element=all_comboboxes[idx];
		if( input_element.type == "select-one" && 
		    input_element.id.indexOf(combo_id_prefix)==0 &&
		   !input_element.disabled)
		{
       input_element.value=value_to_assign;
		}	
	}
}
<?php echo '</script'; ?>
>

<?php echo '<script'; ?>
 type="text/javascript">
function toggleRowByClass(oid,className,displayCheckOn,displayCheckOff,displayValue)
{
  var trTags = document.getElementsByTagName("tr");
  var cbox = document.getElementById(oid);
  
  for( idx=0; idx < trTags.length; idx++ ) 
  {
    if( trTags[idx].className == className ) 
    {
      if( displayValue == undefined )
      {
        if( cbox.checked )
        {
          trTags[idx].style.display = displayCheckOn;
        }
        else
        {
          trTags[idx].style.display = displayCheckOff;
        }
      } 
      else
      {
        trTags[idx].style.display = displayValue;
      }
    }
  }

}
<?php echo '</script'; ?>
>

<?php if ($_smarty_tpl->tpl_vars['tlCfg']->value->gui->usersAssign->pagination->enabled) {?>
  <?php $_smarty_tpl->_assignInScope('ll', $_smarty_tpl->tpl_vars['tlCfg']->value->gui->usersAssign->pagination->length);?>
  <?php $_smarty_tpl->_subTemplateRender("file:DataTables.inc.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('DataTablesOID'=>"item_view",'DataTableslengthMenu'=>$_smarty_tpl->tpl_vars['ll']->value), 0, false);
}?>

</head>
<body>

<h1 class="title"><?php echo $_smarty_tpl->tpl_vars['gui']->value->main_title;?>
</h1>
<?php $_smarty_tpl->_assignInScope('umgmt', "lib/usermanagement");
$_smarty_tpl->_assignInScope('my_feature_name', '');?>

<?php $_smarty_tpl->_subTemplateRender("file:usermanagement/menu.inc.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
<div class="workBack">

<?php $_smarty_tpl->_subTemplateRender("file:inc_update.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('result'=>$_smarty_tpl->tpl_vars['result']->value,'item'=>((string)$_smarty_tpl->tpl_vars['gui']->value)."->featureType",'action'=>((string)$_smarty_tpl->tpl_vars['action']->value),'user_feedback'=>$_smarty_tpl->tpl_vars['gui']->value->user_feedback), 0, false);
?>


<?php if ($_smarty_tpl->tpl_vars['gui']->value->features != '') {?>
<form method="post" action="<?php echo $_smarty_tpl->tpl_vars['umgmt']->value;?>
/usersAssign.php"
	<?php if ($_smarty_tpl->tpl_vars['tlCfg']->value->demoMode) {?>
		onsubmit="alert('<?php echo $_smarty_tpl->tpl_vars['labels']->value['warn_demo'];?>
'); return false;"
	<?php }?>>
	<input type="hidden" name="featureID" value="<?php echo $_smarty_tpl->tpl_vars['gui']->value->featureID;?>
" />
	<input type="hidden" name="featureType" value="<?php echo $_smarty_tpl->tpl_vars['gui']->value->featureType;?>
" />

  <?php $_smarty_tpl->_assignInScope('styleLH', "padding: 0px 30px 10px 5px;");?>
  <div class="panel panel-default" style="background-color: #EAEAED;">
    <div class="panel-body">
		<table style="border:0;">
    	<?php if ($_smarty_tpl->tpl_vars['gui']->value->featureType == 'testproject') {?>
    		<tr>
          <td class="labelHolder" style="<?php echo $_smarty_tpl->tpl_vars['styleLH']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['labels']->value['TestProject'];
echo $_smarty_tpl->tpl_vars['gui']->value->accessTypeImg;?>
</td>
          <td>&nbsp;</td>
    	<?php } else { ?>
    		<tr>
          <td class="labelHolder" style="<?php echo $_smarty_tpl->tpl_vars['styleLH']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['labels']->value['TestProject'];
echo $_smarty_tpl->tpl_vars['gui']->value->tprojectAccessTypeImg;?>
</td>
          <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['gui']->value->tproject_name, ENT_QUOTES, 'UTF-8', true);?>
</td>
        </tr>
    		<tr>
				  <td class="labelHolder" style="<?php echo $_smarty_tpl->tpl_vars['styleLH']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['labels']->value['TestPlan'];
echo $_smarty_tpl->tpl_vars['gui']->value->accessTypeImg;?>

          </td>
    	<?php }?>

		    	<td>
            <select id="featureSel" onchange="changeFeature('<?php echo $_smarty_tpl->tpl_vars['gui']->value->featureType;?>
')">
		    	   <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['gui']->value->features, 'f');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['f']->value) {
?>
		    	     <option value="<?php echo $_smarty_tpl->tpl_vars['f']->value['id'];?>
" <?php if ($_smarty_tpl->tpl_vars['gui']->value->featureID == $_smarty_tpl->tpl_vars['f']->value['id']) {?> selected="selected" <?php }?>>
		    	     <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['f']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
</option>
		    	     <?php if ($_smarty_tpl->tpl_vars['gui']->value->featureID == $_smarty_tpl->tpl_vars['f']->value['id']) {?>
		    	        <?php $_smarty_tpl->_assignInScope('my_feature_name', $_smarty_tpl->tpl_vars['f']->value['name']);?>
		    	     <?php }?>
		    	   <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
		    	   </select>
		    	</td>
			<td>
          		  </td>
			</tr>
   		<tr>
   		<td class="labelHolder" style="<?php echo $_smarty_tpl->tpl_vars['styleLH']->value;?>
""><?php echo $_smarty_tpl->tpl_vars['labels']->value['set_roles_to'];?>
</td><?php if ($_smarty_tpl->tpl_vars['gui']->value->featureType == 'testproject') {?> <td>&nbsp;</td> <?php }?>
      <td>
        <select name="allUsersRole" id="allUsersRole">
		      <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['gui']->value->optRights, 'role', false, 'role_id');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['role_id']->value => $_smarty_tpl->tpl_vars['role']->value) {
?>
		        <option value="<?php echo $_smarty_tpl->tpl_vars['role_id']->value;?>
">
            <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['role']->value->getDisplayName(), ENT_QUOTES, 'UTF-8', true);?>

		        </option>
		      <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
			  </select>
      </td>
      <td>
          &nbsp;
					<input type="button" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['btn_do'];?>
" 
					       onclick="javascript:set_combo_group('usersRoleTable','userRole_',
					                                           document.getElementById('allUsersRole').value);"/>
		  </td>
			</tr>

		</table>
    </div>
    </div>

    <div id="usersRoleTable">
	    <table class="common table table-bordered sortable" width="100%" id="item_view">
    	<tr>
    		<th><?php echo $_smarty_tpl->tpl_vars['tlImages']->value['sort_hint'];
echo $_smarty_tpl->tpl_vars['labels']->value['User'];?>
</th>
    		<?php $_smarty_tpl->_assignInScope('featureVerbose', $_smarty_tpl->tpl_vars['gui']->value->featureType);?>
    		<th><?php echo $_smarty_tpl->tpl_vars['tlImages']->value['sort_hint'];
echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('s'=>"th_roles_".((string)$_smarty_tpl->tpl_vars['featureVerbose']->value)),$_smarty_tpl ) );?>
 (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['my_feature_name']->value, ENT_QUOTES, 'UTF-8', true);?>
)</th>
    	</tr>
    	<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['gui']->value->users, 'user');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['user']->value) {
?>
    	    <?php $_smarty_tpl->_assignInScope('globalRoleName', $_smarty_tpl->tpl_vars['user']->value->globalRole->name);?>
    			<?php $_smarty_tpl->_assignInScope('uID', $_smarty_tpl->tpl_vars['user']->value->dbID);?>


                    <?php $_smarty_tpl->_assignInScope('effective_role_id', $_smarty_tpl->tpl_vars['gui']->value->userFeatureRoles[$_smarty_tpl->tpl_vars['uID']->value]['effective_role_id']);?>
          <?php if ($_smarty_tpl->tpl_vars['gui']->value->userFeatureRoles[$_smarty_tpl->tpl_vars['uID']->value]['is_inherited'] == 1) {?>
            <?php $_smarty_tpl->_assignInScope('ikx', $_smarty_tpl->tpl_vars['effective_role_id']->value);?>
          <?php } else { ?>
            <?php $_smarty_tpl->_assignInScope('ikx', $_smarty_tpl->tpl_vars['gui']->value->userFeatureRoles[$_smarty_tpl->tpl_vars['uID']->value]['uplayer_role_id']);?>
          <?php }?>
          <?php $_smarty_tpl->_assignInScope('inherited_role_name', $_smarty_tpl->tpl_vars['gui']->value->optRights[$_smarty_tpl->tpl_vars['ikx']->value]->name);?>

          <?php $_smarty_tpl->_assignInScope('user_row_class', '');?>
          <?php if ($_smarty_tpl->tpl_vars['effective_role_id']->value == @constant('TL_ROLES_NO_RIGHTS')) {?>
            <?php $_smarty_tpl->_assignInScope('user_row_class', 'class="not_authorized_user"');?>
          <?php }?>

    	<tr <?php echo $_smarty_tpl->tpl_vars['user_row_class']->value;?>
 bgcolor="<?php echo smarty_function_cycle(array('values'=>"#eeeeee,#d0d0d0"),$_smarty_tpl);?>
">
    		<td <?php if ($_smarty_tpl->tpl_vars['gui']->value->role_colour != '' && $_smarty_tpl->tpl_vars['gui']->value->role_colour[$_smarty_tpl->tpl_vars['globalRoleName']->value] != '') {?>  		
    		      style="background-color: <?php echo $_smarty_tpl->tpl_vars['gui']->value->role_colour[$_smarty_tpl->tpl_vars['globalRoleName']->value];?>
;" <?php }?>>
    		    <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user']->value->login, ENT_QUOTES, 'UTF-8', true);?>
 (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user']->value->firstName, ENT_QUOTES, 'UTF-8', true);?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user']->value->lastName, ENT_QUOTES, 'UTF-8', true);?>
) </td>
    		<td>
          <select name="userRole[<?php echo $_smarty_tpl->tpl_vars['uID']->value;?>
]" id="userRole_<?php echo $_smarty_tpl->tpl_vars['uID']->value;?>
"
            <?php if ($_smarty_tpl->tpl_vars['user']->value->globalRole->dbID == @constant('TL_ROLES_ADMIN')) {?>
             disabled="disabled"
            <?php }?>
          >
		      <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['gui']->value->optRights, 'role', false, 'role_id');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['role_id']->value => $_smarty_tpl->tpl_vars['role']->value) {
?>
            
            <?php $_smarty_tpl->_assignInScope('applySelected', '');?>
            <?php if (($_smarty_tpl->tpl_vars['gui']->value->userFeatureRoles[$_smarty_tpl->tpl_vars['uID']->value]['effective_role_id'] == $_smarty_tpl->tpl_vars['role_id']->value && $_smarty_tpl->tpl_vars['gui']->value->userFeatureRoles[$_smarty_tpl->tpl_vars['uID']->value]['is_inherited'] == 0) || ($_smarty_tpl->tpl_vars['role_id']->value == @constant('TL_ROLES_INHERITED') && $_smarty_tpl->tpl_vars['gui']->value->userFeatureRoles[$_smarty_tpl->tpl_vars['uID']->value]['is_inherited'] == 1)) {?>
                <?php $_smarty_tpl->_assignInScope('applySelected', ' selected="selected" ');?> 
            <?php }?>

            /* For system consistency we need to remove admin role from selection */
            <?php $_smarty_tpl->_assignInScope('removeRole', 0);?>
            <?php if ($_smarty_tpl->tpl_vars['role_id']->value == @constant('TL_ROLES_ADMIN') && $_smarty_tpl->tpl_vars['applySelected']->value == '') {?>
                <?php $_smarty_tpl->_assignInScope('removeRole', 1);?>
            <?php }?>             
  
            <?php if (!$_smarty_tpl->tpl_vars['removeRole']->value) {?>
              <option value="<?php echo $_smarty_tpl->tpl_vars['role_id']->value;?>
" <?php echo $_smarty_tpl->tpl_vars['applySelected']->value;?>
>
                  <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['role']->value->getDisplayName(), ENT_QUOTES, 'UTF-8', true);?>

                  <?php if ($_smarty_tpl->tpl_vars['role_id']->value == @constant('TL_ROLES_INHERITED')) {?>
                    <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['inherited_role_name']->value, ENT_QUOTES, 'UTF-8', true);?>
 
                  <?php }?>
  		        </option>
            <?php }?>

		      <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
			</select>
          <?php if ($_smarty_tpl->tpl_vars['user']->value->globalRole->dbID == @constant('TL_ROLES_ADMIN')) {?>
            <?php echo $_smarty_tpl->tpl_vars['gui']->value->hintImg;?>
 
          <?php }?>
			</td>
    	</tr>
    	<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
    	</table>
   </div> 	
   	
   	
   	<div class="groupBtn">	
    	<?php if ($_smarty_tpl->tpl_vars['tlCfg']->value->demoMode) {?>
			<?php echo $_smarty_tpl->tpl_vars['labels']->value['warn_demo'];?>

		<?php } else { ?>	
    		<input type="submit" name="do_update" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['btn_upd_user_data'];?>
" />
		<?php }?>
	</div>
  </form>
<?php }?> </div>
</body>
</html>
<?php }
}
