<?php
/**
 * The edit view file of leave module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      chujilu <chujilu@cnezsoft.com>
 * @package     leave
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../sys/common/view/header.modal.html.php';?>
<?php js::set('leaveID', $leave->id);?>
<?php js::set('daysTip', $lang->leave->daysTip);?>
<?php js::set('hoursTip', $lang->leave->hoursTip);?>
<?php js::set('workingHours', $config->attend->workingHours);?>
<form id='ajaxForm' method='post' action="<?php echo $this->createLink('oa.leave', 'edit', "id=$leave->id")?>">
  <table class='table table-form'>
    <?php if(!commonModel::hasPriv('oa.leave', 'browseReview')):?>
    <tr>
      <th class='w-60px'><?php echo $lang->leave->status;?></th>
      <td class='text-warning'><?php echo $lang->leave->statusList[$leave->status];?></td>
      <td class='w-10px'></td>
    </tr>
    <?php endif;?>
    <tr>
      <th class='w-60px'><?php echo $lang->leave->type?></th>
      <?php unset($lang->leave->typeList['home']);?>
      <td><?php echo html::radio('type', $lang->leave->typeList, $leave->type, "class=''")?></td>
      <td class='w-10px'></td>
    </tr>
    <tr id='annualBalanceTip' class='hidden'>
      <th class='w-60px'></th>
      <td>
        <div id='annualBalanceTipText' class='alert alert-warning no-margin'></div>
      </td>
      <td class='w-10px'></td>
    </tr>
    <tr>
      <th><?php echo $lang->leave->begin?></th>
      <td>
        <div class='input-group'>
          <span class='input-group-addon'><?php echo $lang->leave->date?></span>
          <?php echo html::input('begin', $leave->begin, "class='form-control form-date date-picker-down'")?>
          <span class='input-group-addon leave-time'><?php echo $lang->leave->time?></span>
          <?php echo html::input('start', $leave->start, "class='form-control leave-time form-time date-picker-down'")?>
        </div>
      </td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->leave->end?></th>
      <td>
        <div class='input-group'>
          <span class='input-group-addon'><?php echo $lang->leave->date?></span>
          <?php echo html::input('end', $leave->end, "class='form-control form-date date-picker-down'")?>
          <span class='input-group-addon leave-time'><?php echo $lang->leave->time?></span>
          <?php echo html::input('finish', $leave->finish, "class='form-control leave-time form-time date-picker-down'")?>
        </div>
      </td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->leave->hours?></th>
      <td>
        <div class='input-group'>
          <?php echo html::input('hours', $leave->hours, "class='form-control' readonly")?>
          <span id='hoursTip' class='input-group-addon'><?php echo $lang->leave->hoursTip?></span>
        </div>
      </td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->leave->desc?></th>
      <td><?php echo html::textarea('desc', $leave->desc, "class='form-control'")?></td>
      <td></td>
    </tr>
    <?php if(commonModel::hasPriv('file', 'upload')):?>
    <tr>
      <th><?php echo $lang->leave->files;?></th>
      <td><?php echo $this->fetch('file', 'buildForm');?></td>
    </tr>
    <?php endif;?>
    <tr>
      <th></th>
      <td class='form-actions'><?php echo html::submitButton();?></td>
      <td></td>
    </tr>
  </table>
</form>
<?php include '../../../sys/common/view/footer.modal.html.php';?>
