<?php

use home\assets\CalendarAsset;
use yii\helpers\Url;
use home\modules\schedule\models\Schedule;
use yii\widgets\ActiveForm;
use common\assets\ZTreeAsset;
use qcbase\models\Auth;

/* @var $this \yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \home\modules\task\models\Category */


$this->title = '工作日程';

$assetUrl = $this->getAssetManager()->getBundle(CalendarAsset::className())->baseUrl;
$this->registerJsFile($assetUrl . '/js/list.tree.js', ['depends' => CalendarAsset::className()]);
?>
<!--container-->
<div class="container manage-project fix">
    <!--mainbody-->
    <div class="mainbody fix">
        <?= $this->render('@home/views/site/_left-menu') ?>
        <div class="manage-right">
            <div class="righttitle-bar">
                <span id="calendarTitle">工作日程</span>
                <span>
                    <input type="hidden" id="query_type" name="query_type" value="user_id"/>
                    <input type="hidden" id="query_value" name="query_value" value="0"/>
                </span>
                <div class="tab-right">
                    <button type="button" title="日历形式" class="btn btn-default btn-task btn-focus" onclick="javascript:window.location.href = '<?= Url::to([$this->context->id . '/index']) ?>'">
                        <i class="icon-calendar"></i>
                    </button>
                    <button type="button" title="列表形式" class="btn btn-default btn-task" onclick="javascript:window.location.href = '<?= Url::to([$this->context->id . '/list']) ?>'">
                        <i class="icon-list-ul"></i>
                    </button>
                </div>
            </div>

            <div class="fix" style="margin-top:10px;">
                <div class="mainleft-tree">
                    <div class="labellink fix"> <a href="<?= Url::to(['/schedule/schedule/index']) ?>" class="labelfocus" title="查看全部">人员</a>
                        <!--<a href="#" class="labelfocus">任务</a>-->
                    </div>
                    <div class="lefttree" >
                        <ul id="tree"  class="ztree"  ></ul>
                    </div>
                </div>

                <div class="mainright"  >
                    <!--<div class="calendar-bar">
                        <span id="blogtitle">工作日志</span>
                    </div>-->
                    <div id="info" style="display:none;"></div>
                    <div id="calendar" class="calendar-area" style="margin-top:10px"></div>
                    <div id='loading'><div class='loading'><img align='absmiddle' src='<?= $assetUrl ?>/images/load.gif'/></div></div>
                </div>
            </div>
        </div><!--manage-right-->
    </div><!--mainbody-->
</div><!--container-->
<script>
    var default_date = "<?= date('Y-m-d') ?>";
    var CSRF = "<?= Yii::$app->request->getCsrfToken() ?>";
    var clickUrl = "<?= Url::to(['/schedule/schedule/create']) ?>";
    var csrfToken = "<?= Yii::$app->request->getCsrfToken() ?>";
    var getDatasUrl = "<?= Url::to(['/schedule/schedule/get-schedules']) ?>";
    var getTreeDataUrl = "<?= Url::to(['/schedule/schedule/get-treedata', '_csrf' => Yii::$app->request->getCsrfToken()]) ?>";
    var limitDate = 1;//限制选择时间，今天之前
    var tipsMessage = '只可填写今天之前的日程！';//提示信息
</script>