<?php
/* Smarty version 3.1.33, created on 2021-12-20 20:40:24
  from '/opt/lampp/htdocs/testlink/gui/templates/testcases/keywords.inc.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_61c0dc28e6c880_67976030',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'a88c85e18a2308f04275f018aff517a903cd3ba1' => 
    array (
      0 => '/opt/lampp/htdocs/testlink/gui/templates/testcases/keywords.inc.tpl',
      1 => 1636032773,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_61c0dc28e6c880_67976030 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/opt/lampp/htdocs/testlink/vendor/smarty/smarty/libs/plugins/modifier.replace.php','function'=>'smarty_modifier_replace',),1=>array('file'=>'/opt/lampp/htdocs/testlink/vendor/smarty/smarty/libs/plugins/function.html_options.php','function'=>'smarty_function_html_options',),));
?>

<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('var'=>'kw_labels','s'=>'btn_add,img_title_remove_keyword,warning,select_keywords'),$_smarty_tpl ) );?>



<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('s'=>'remove_kw_msgbox_msg','var'=>'remove_kw_msgbox_msg'),$_smarty_tpl ) );?>

<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('s'=>'remove_kw_msgbox_title','var'=>'remove_kw_msgbox_title'),$_smarty_tpl ) );?>


<?php echo '<script'; ?>
 type="text/javascript">
var alert_box_title = "<?php echo strtr($_smarty_tpl->tpl_vars['kw_labels']->value['warning'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var remove_kw_msgbox_msg = '<?php echo strtr($_smarty_tpl->tpl_vars['remove_kw_msgbox_msg']->value, array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
';
var remove_kw_msgbox_title = '<?php echo strtr($_smarty_tpl->tpl_vars['remove_kw_msgbox_title']->value, array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
';

/**
 * 
 *
 */
function keyword_remove_confirmation(item_id, tckw_link_id, keyword, title, msg, pFunction) 
{
  var my_msg = msg.replace('%i',keyword);
  var safe_title = title.escapeHTML();
  Ext.Msg.confirm(safe_title, my_msg,
                  function(btn, text) { 
                    pFunction(btn,text,item_id, tckw_link_id);
                  });
}


/**
 * 
 *
 */
function remove_keyword(btn, text, item_id, tckw_link_id) {
  var my_action = fRoot + 'lib/testcases/tcEdit.php?doAction=removeKeyword&tcase_id='
                     + item_id + '&tckw_link_id=' + tckw_link_id;
  if( btn == 'yes' ) {
    window.location=my_action;
  }
}

var pF_remove_keyword = remove_keyword;

<?php echo '</script'; ?>
>

<form method="post" id="kwf" name="kwf" action="<?php echo $_smarty_tpl->tpl_vars['basehref']->value;?>
lib/testcases/tcEdit.php">
  <input type="hidden" id="kwf_doAction" name="doAction" value="removeKeyword" />
  <input type="hidden" name="tcase_id" id="tcase_id" value="<?php echo $_smarty_tpl->tpl_vars['args_tcase_id']->value;?>
" />
  <input type="hidden" name="tcversion_id" id="tcversion_id" value="<?php echo $_smarty_tpl->tpl_vars['args_tcversion_id']->value;?>
" />

  <?php $_smarty_tpl->_assignInScope('kwView', smarty_modifier_replace($_smarty_tpl->tpl_vars['gsmarty_href_keywordsView']->value,'%s%',$_smarty_tpl->tpl_vars['gui']->value->tproject_id));?>

  <table cellpadding="0" cellspacing="0" style="font-size:100%;">
    <tr>
      <td width="35%" style="vertical-align:top;"><a href=<?php echo $_smarty_tpl->tpl_vars['kwView']->value;?>
><?php echo $_smarty_tpl->tpl_vars['tcView_viewer_labels']->value['keywords'];?>
</a>: &nbsp;
      </td>
            <td style="vertical-align:top;">
          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['args_keywords_map']->value, 'tckw_link_item');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['tckw_link_item']->value) {
?>
                <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tckw_link_item']->value['keyword'], ENT_QUOTES, 'UTF-8', true);?>

            <?php if ($_smarty_tpl->tpl_vars['args_edit_enabled']->value && $_smarty_tpl->tpl_vars['gui']->value->assign_keywords && $_smarty_tpl->tpl_vars['args_frozen_version']->value == "no") {?>
            <a href="javascript:keyword_remove_confirmation(<?php echo $_smarty_tpl->tpl_vars['gui']->value->tcase_id;?>
,
                     <?php echo $_smarty_tpl->tpl_vars['tckw_link_item']->value['tckw_link'];?>
,
                     '<?php echo strtr($_smarty_tpl->tpl_vars['tckw_link_item']->value['keyword'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
', 
                     remove_kw_msgbox_title, remove_kw_msgbox_msg, 
                     pF_remove_keyword);">
           <img src="<?php echo $_smarty_tpl->tpl_vars['tlImages']->value['delete'];?>
" title="<?php echo $_smarty_tpl->tpl_vars['kw_labels']->value['img_title_remove_keyword'];?>
"  style="border:none" /></a>
           <?php }?>
            <br />
                <?php
}
} else {
?>
                  <?php echo $_smarty_tpl->tpl_vars['tcView_viewer_labels']->value['none'];?>

            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
      </td>      
    </tr>
    <tr>
      <?php if ($_smarty_tpl->tpl_vars['args_edit_enabled']->value && null != $_smarty_tpl->tpl_vars['gui']->value->currentVersionFreeKeywords) {?> 
      <td>
       &nbsp;  
      <td>
        <select id="free_keywords" name="free_keywords[]"
          data-placeholder="<?php echo $_smarty_tpl->tpl_vars['kw_labels']->value['select_keywords'];?>
"
          class="chosen-add-keywords" multiple="multiple">
          <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['gui']->value->currentVersionFreeKeywords),$_smarty_tpl);?>

        </select>
        <input type="submit" value="<?php echo $_smarty_tpl->tpl_vars['kw_labels']->value['btn_add'];?>
"
          onclick="doAction.value='addKeyword'">
      </td>  

      <?php echo '<script'; ?>
>
      jQuery( document ).ready(
        function() { 
          jQuery(".chosen-add-keywords").chosen({ width: "75%", allow_single_deselect: true }); 
        }
      );
      <?php echo '</script'; ?>
>  
      <?php }?>
    </tr>
  </table>  
</form>
<?php }
}
