<?php
/**
 * The create lane view file of kanban module of ZDOO.
 *
 * @copyright   Copyright 2009-2020 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Gang Liu <liugang@easycorp.ltd>
 * @package     kanban
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../sys/common/view/header.modal.html.php';?>
<?php css::import($jsRoot . 'colorpicker/zui.colorpicker.min.css'); ?>
<?php js::import($jsRoot . 'colorpicker/zui.colorpicker.min.js'); ?>
<form id='splitColForm' method='post' action='<?php echo inlink('splitColumn', "columnID={$column->id}");?>'>
  <table class='table table-form' id='splitTable'>
    <?php for($index = 1; $index <= 2; $index ++):?>
    <tr class='child-column'>
      <th class="w-70px"><?php echo $lang->kanbancolumn->childName;?></th>
      <td>
        <div class='required required-wrapper'></div>
        <?php echo html::input("name[{$index}]", '', "id='name{$index}' class='form-control'");?>
      </td>
      <th><?php echo $lang->kanbancolumn->childColor;?></th>
      <td>
        <div class="input-group">
          <input type='text' readonly id='color<?php echo $index;?>' name="color[<?php echo $index;?>]" class='form-control' data-provide='colorpicker'  data-update-color="#color<?php echo $index;?>" data-wrapper='input-group-btn' data-pull-menu-right="true" data-optional='false' value='#272E33' data-colors='#272E33,#2B529C,#E48600,#D2323D,#229F24,#777,#D2691E,#008B8B,#2E8B57,#4169E1,#4B0082,#FA8072,#BA55D3,#2E8B57,#6B8E23'>
        </div>
      </td>
      <th class="w-140px"><?php echo $lang->kanban->WIP;?></th>
      <td class="w-160px">
        <div class='input-group'>
          <?php echo html::number("limit[{$index}]", '', "id='limit{$index}' min='1' class='form-control'" . ($column->limit ? '' : 'readonly'));?>
          <span class='input-group-addon'>
            <label class='checkbox-inline'>
              <input type='checkbox' <?php if(!$column->limit) echo 'checked';?> name='unlimited[<?php echo $index;?>]' id='unlimited<?php echo $index;?>' value='1' /> <?php echo $this->lang->kanban->unlimited;?>
            </label>
          </span>
        </div>
      </td>
      <td class='w-40px'>
        <a class='btn btn-sm btn-plus'><i class='icon-plus'></i></a>
      </td>
      <td class='w-40px'>
        <a class='btn btn-sm btn-close'><i class='icon-close'></i></a>
      </td>
    </tr>
    <?php endfor;?>
    <tr>
      <td class='form-actions text-center' colspan='6'>
        <?php echo html::submitButton();?>
        <?php echo html::commonButton($lang->cancel, 'btn', "data-dismiss='modal'");?>
      </td>
    </tr>
  </table>
</form>
<style>
.input-group .colorpicker {z-index: auto}
.colorpicker .dropdown-menu > li > a {font-family: zdooicon; border-radius: 14px}
.colorpicker .dropdown-menu > li > a.active:before {content: '\e952'}
</style>
<script type='text/template' id='childTpl'>
<tr class='child-column'>
  <th class="w-70px"><?php echo $lang->kanbancolumn->childName;?></th>
  <td><div class='required required-wrapper'></div> <?php echo html::input('name[key]', '', "id='namekey' class='form-control'");?></td>
  <th><?php echo $lang->kanbancolumn->childColor;?></th>
  <td>
    <div class="input-group">
      <input type='text' readonly id='colorkey' name="color[key]" class='form-control' data-provide='colorpicker'  data-update-color="#colorkey" data-wrapper='input-group-btn' data-pull-menu-right="true" data-optional='false' value='#272E33' data-colors='#272E33,#2B529C,#E48600,#D2323D,#229F24,#777,#D2691E,#008B8B,#2E8B57,#4169E1,#4B0082,#FA8072,#BA55D3,#2E8B57,#6B8E23'>
    </div>
  </td>
  <th class='w-140px'><?php echo $lang->kanban->WIP;?></th>
  <td class="w-160px">
    <div class='input-group'>
      <?php echo html::number('limit[key]', '', "id='limitkey' min='1' class='form-control'" . ($column->limit ? '' : 'readonly'));?>
      <span class='input-group-addon'>
        <label class='checkbox-inline'>
          <input type='checkbox' <?php if(!$column->limit) echo 'checked';?> name='unlimited[key]' id='unlimitedkey' value='1' /> <?php echo $this->lang->kanban->unlimited;?>
        </label>
      </span>
    </div>
  </td>
  <td class='w-40px'>
    <a class='btn btn-sm btn-plus'><i class='icon-plus'></i></a>
  </td>
  <td class='w-40px'>
    <a class='btn btn-sm btn-close'><i class='icon-close'></i></a>
  </td>
</tr>
</script>
<?php js::set('key', 3)?>
<?php include '../../../sys/common/view/footer.modal.html.php';?>
