<?php
/* Smarty version 3.1.33, created on 2022-01-28 14:46:49
  from '/home/recursosspa/public_html/testlink/gui/templates/plan/planEdit.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_61f401d9d1a812_63667042',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'de8b4aa2810ae9fde49eb133366d27d1e258acee' => 
    array (
      0 => '/home/recursosspa/public_html/testlink/gui/templates/plan/planEdit.tpl',
      1 => 1643038956,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:inc_head.tpl' => 1,
    'file:inc_del_onclick.tpl' => 1,
    'file:inc_update.tpl' => 1,
    'file:error_icon.tpl' => 1,
    'file:attachments.inc.tpl' => 1,
  ),
),false)) {
function content_61f401d9d1a812_63667042 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/home/recursosspa/public_html/testlink/vendor/smarty/smarty/libs/plugins/modifier.replace.php','function'=>'smarty_modifier_replace',),));
?>

<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('var'=>"labels",'s'=>"warning,warning_empty_tp_name,testplan_title_edit,public,api_key,
             testplan_th_name,testplan_th_notes,testplan_question_create_tp_from,
             opt_no,testplan_th_active,btn_testplan_create,btn_upd,cancel,
             show_event_history,testplan_txt_notes"),$_smarty_tpl ) );?>




<?php $_smarty_tpl->_subTemplateRender("file:inc_head.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('openHead'=>"yes",'jsValidate'=>"yes",'editorType'=>$_smarty_tpl->tpl_vars['gui']->value->editorType), 0, false);
$_smarty_tpl->_subTemplateRender("file:inc_del_onclick.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
echo '<script'; ?>
 type="text/javascript">
var alert_box_title = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_empty_tp_name = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_empty_tp_name'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";

function validateForm(f)
{
  var cf_designTime = document.getElementById('custom_field_container');
  if (isWhitespace(f.testplan_name.value))
  {
      alert_message(alert_box_title,warning_empty_tp_name);
      selectField(f, 'testplan_name');
      return false;
  }
  
  /* Validation of a limited type of custom fields */
  if (cf_designTime)
  {
    var cfields_container = cf_designTime.getElementsByTagName('input');
    var cfieldsChecks = validateCustomFields(cfields_container);
    if(!cfieldsChecks.status_ok)
    {
        var warning_msg = cfMessages[cfieldsChecks.msg_id];
        alert_message(alert_box_title,warning_msg.replace(/%s/, cfieldsChecks.cfield_label));
        return false;
    }
  
    /* Text area needs a special access */
    cfields_container = cf_designTime.getElementsByTagName('textarea');
    cfieldsChecks = validateCustomFields(cfields_container);
    if(!cfieldsChecks.status_ok)
    {
        var warning_msg = cfMessages[cfieldsChecks.msg_id];
        alert_message(alert_box_title,warning_msg.replace(/%s/, cfieldsChecks.cfield_label));
        return false;
    }
  }
  return true;
}

/**
 * manage_copy_ctrls
 *
 */
function manage_copy_ctrls(container_id,display_control_value,hide_value)
{
 o_container=document.getElementById(container_id);

 if( display_control_value == hide_value )
 {
   o_container.style.display='none';
 }
 else
 {
    o_container.style.display='';
 }
}

/**
 * Be Carefull this TRUST on existence of $gui->delAttachmentURL
 */
function jsCallDeleteFile(btn, text, o_id)
{ 
  var my_action='';
  if( btn == 'yes' )
  {
    my_action='<?php echo $_smarty_tpl->tpl_vars['gui']->value->delAttachmentURL;?>
'+o_id;
    window.location=my_action;
  }
}        
<?php echo '</script'; ?>
>

</head>

<body>
<?php $_smarty_tpl->_assignInScope('cfg_section', smarty_modifier_replace(call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'basename' ][ 0 ], array( basename($_smarty_tpl->source->filepath) )),".tpl",''));
$_smarty_tpl->smarty->ext->configLoad->_loadConfigFile($_smarty_tpl, "input_dimensions.conf", $_smarty_tpl->tpl_vars['cfg_section']->value, 0);
?>

<?php $_smarty_tpl->_assignInScope('planID', $_smarty_tpl->tpl_vars['gui']->value->tplan_id);
if (!isset($_smarty_tpl->tpl_vars['loadOnCancelURL']->value)) {?>
  <?php $_smarty_tpl->_assignInScope('loadOnCancelURL', '');
}?>

<h1 class="title"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['gui']->value->main_descr, ENT_QUOTES, 'UTF-8', true);?>
</h1>

<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('user_feedback'=>$_smarty_tpl->tpl_vars['gui']->value->user_feedback), 0, false);
?>
  <?php $_smarty_tpl->_assignInScope('form_action', 'create');?>
  <?php if ($_smarty_tpl->tpl_vars['gui']->value->tplan_id != 0) {?>
    <h2>
    <?php echo $_smarty_tpl->tpl_vars['labels']->value['testplan_title_edit'];?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['gui']->value->testplan_name, ENT_QUOTES, 'UTF-8', true);?>

    <?php $_smarty_tpl->_assignInScope('form_action', 'update');?>
    <?php if ($_smarty_tpl->tpl_vars['gui']->value->grants->mgt_view_events == "yes") {?>
      <img style="margin-left:5px;" class="clickable" src="<?php echo @constant('TL_THEME_IMG_DIR');?>
/question.gif" 
           onclick="showEventHistoryFor('<?php echo $_smarty_tpl->tpl_vars['gui']->value->tplan_id;?>
','testplans')" alt="<?php echo $_smarty_tpl->tpl_vars['labels']->value['show_event_history'];?>
" 
           title="<?php echo $_smarty_tpl->tpl_vars['labels']->value['show_event_history'];?>
"/>
    <?php }?>
    </h2>
  <?php }?>

  <form method="post" name="testplan_mgmt" id="testplan_mgmt"
        action="lib/plan/planEdit.php?action=<?php echo $_smarty_tpl->tpl_vars['form_action']->value;?>
"
        onSubmit="javascript:return validateForm(this);">
  <input type="hidden" id="tplan_id" name="tplan_id" value="<?php echo $_smarty_tpl->tpl_vars['gui']->value->tplan_id;?>
" />
  <table class="common" width="80%">

    <tr><th style="background:none;"><?php echo $_smarty_tpl->tpl_vars['labels']->value['testplan_th_name'];?>
</th>
      <td><input type="text" name="testplan_name"
                 size="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'TESTPLAN_NAME_SIZE');?>
"
                 maxlength="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'TESTPLAN_NAME_MAXLEN');?>
"
                 value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['gui']->value->testplan_name, ENT_QUOTES, 'UTF-8', true);?>
" required />
          <?php $_smarty_tpl->_subTemplateRender("file:error_icon.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('field'=>"testplan_name"), 0, false);
?>
      </td>
    </tr>
    <tr><th style="background:none;"><?php echo $_smarty_tpl->tpl_vars['labels']->value['testplan_th_notes'];?>
</th>
      <td ><?php echo $_smarty_tpl->tpl_vars['gui']->value->notes;?>
</td>
    </tr>
    <?php if ($_smarty_tpl->tpl_vars['gui']->value->tplan_id == 0) {?>
      <?php if ($_smarty_tpl->tpl_vars['gui']->value->tplans) {?>
        <tr><th style="background:none;"><?php echo $_smarty_tpl->tpl_vars['labels']->value['testplan_question_create_tp_from'];?>
</th>
        <td>
        <select name="copy_from_tplan_id"
                onchange="manage_copy_ctrls('copy_controls',this.value,'0')">
        <option value="0"><?php echo $_smarty_tpl->tpl_vars['labels']->value['opt_no'];?>
</option>
        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['gui']->value->tplans, 'testplan');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['testplan']->value) {
?>
          <option value="<?php echo $_smarty_tpl->tpl_vars['testplan']->value['id'];?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['testplan']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
</option>
        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
        </select>

            <div id="copy_controls" style="display:none;">
            <?php $_smarty_tpl->_assignInScope('this_template_dir', call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'dirname' ][ 0 ], array( basename($_smarty_tpl->source->filepath) )));?>
            <?php $_smarty_tpl->_subTemplateRender(((string)$_smarty_tpl->tpl_vars['this_template_dir']->value)."/inc_controls_planEdit.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, true);
?>
            </div>
        </td>
        </tr>
      <?php }?>
    <?php }?>
      <tr>
        <th style="background:none;"><?php echo $_smarty_tpl->tpl_vars['labels']->value['testplan_th_active'];?>
</th>
          <td>
            <input type="checkbox" name="active" <?php if ($_smarty_tpl->tpl_vars['gui']->value->is_active == 1) {?>  checked="checked" <?php }?> />
          </td>
      </tr>
      <tr>
        <th style="background:none;"><?php echo $_smarty_tpl->tpl_vars['labels']->value['public'];?>
</th>
          <td>
            <input type="checkbox" name="is_public" <?php if ($_smarty_tpl->tpl_vars['gui']->value->is_public == 1) {?> checked="checked" <?php }?> />
          </td>
      </tr>

      <?php if (isset($_smarty_tpl->tpl_vars['gui']->value->api_key) && $_smarty_tpl->tpl_vars['gui']->value->api_key != '') {?>
      <tr>
        <th style="background:none;"><?php echo $_smarty_tpl->tpl_vars['labels']->value['api_key'];?>
</th>
        <td><?php echo $_smarty_tpl->tpl_vars['gui']->value->api_key;?>
</td>
      </tr>
      <?php }?>



    <?php if ($_smarty_tpl->tpl_vars['gui']->value->cfields != '') {?>
    <tr>
      <td  colspan="2">
     <div id="custom_field_container" class="custom_field_container">
     <?php echo $_smarty_tpl->tpl_vars['gui']->value->cfields;?>

     </div>
      </td>
    </tr>
    <?php }?>
  </table>

  <div class="groupBtn">
    <?php if ($_smarty_tpl->tpl_vars['gui']->value->tplan_id == 0) {?>
      <input type="hidden" name="do_action" value="do_create" />
      <input type="submit" name="do_create" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['btn_testplan_create'];?>
"
             onclick="do_action.value='do_create'"/>
    <?php } else { ?>

      <input type="hidden" name="do_action" value="do_update" />
      <input type="submit" name="do_update" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['btn_upd'];?>
"
             onclick="do_action.value='do_update'"/>

    <?php }?>

    <input type="button" name="go_back" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['cancel'];?>
"
                         onclick="javascript: location.href=fRoot+'lib/plan/planView.php';" />

  </div>

  </form>
<?php if ($_smarty_tpl->tpl_vars['gui']->value->tplan_id != 0) {?>
  <?php $_smarty_tpl->_assignInScope('downloadOnly', true);?>
  <?php if ($_smarty_tpl->tpl_vars['gui']->value->grants->testplan_create == 'yes') {?>
    <?php $_smarty_tpl->_assignInScope('downloadOnly', false);?>
  <?php }?>
  <?php $_smarty_tpl->_subTemplateRender("file:attachments.inc.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('attach_id'=>$_smarty_tpl->tpl_vars['planID']->value,'attach_tableName'=>$_smarty_tpl->tpl_vars['gui']->value->attachmentTableName,'attach_attachmentInfos'=>$_smarty_tpl->tpl_vars['gui']->value->attachments[$_smarty_tpl->tpl_vars['planID']->value],'attach_downloadOnly'=>$_smarty_tpl->tpl_vars['downloadOnly']->value,'attach_loadOnCancelURL'=>$_smarty_tpl->tpl_vars['loadOnCancelURL']->value), 0, false);
}?>
             
<p><?php echo $_smarty_tpl->tpl_vars['labels']->value['testplan_txt_notes'];?>
</p>

</div>


</body>
</html><?php }
}
