<?php
/**
 * The deploy view file of deploy module of ZenTaoPMS.
 *
 * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Yidong Wang <yidong@cnezsoft.com>
 * @package     deploy
 * @version     $Id$
 * @link        http://www.zentao.net
 */
namespace zin;

if($setReviewer) $reviewer = strpos($setReviewer, 'pending-') !== false ? substr($setReviewer, 8) : $setReviewer;
formPanel
(
    set::actions(array('submit' => array('text' => $lang->save, 'btnType' => 'submit', 'type' => 'primary'))),
    set::actionsClass('deploy-actions toolbar form-actions form-group no-label'),
    set::labelWidth('100px'),
    setID('deployForm'),
    $setReviewer ? formGroup
    (
        set::width('1/2'),
        set::label($lang->deploy->reviewer),
        set::required(true),
        set::name('setReviewer'),
        set::value($reviewer),
        set::control('picker'),
        set::items($users)
    ) : null,
    formGroup
    (
        set::width('full'),
        set::label($lang->deploy->deployResult),
        set::name('result'),
        set::required(true),
        set::value(isset($result->result) ? $result->result : 'pass'),
        set::control('radioListInline'),
        set::items($lang->deploy->reviewResultList)
    ),
    formGroup
    (
        set::width('1/2'),
        set::label($lang->deploy->deployedDate),
        set::required(true),
        set::name('createdDate'),
        set::value(helper::today()),
        set::control('datePicker'),
    ),
    formGroup
    (
        set::width('full'),
        set::label($lang->deploy->finalOpinion),
        set::name('opinion'),
        set::value(isset($result->opinion) ? $result->opinion : ''),
        set::control('editor'),
    )
);
