当前位置: 首页>>代码示例>>PHP>>正文


PHP Project::getAssigneeOptions方法代码示例

本文整理汇总了PHP中app\models\Project::getAssigneeOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getAssigneeOptions方法的具体用法?PHP Project::getAssigneeOptions怎么用?PHP Project::getAssigneeOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Project的用法示例。


在下文中一共展示了Project::getAssigneeOptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionView

 public function actionView($id)
 {
     $model = $this->loadModel('app\\models\\Issue', $id);
     $this->view->params['appSettings'] = ['app_name' => $model->project->title];
     if (!\Yii::$app->user->can('viewProject', ['project' => $model->project]) || \Yii::$app->user->isGuest) {
         throw new ForbiddenHttpException('Access denied');
     }
     if (\Yii::$app->request->post('hasEditable') && !\Yii::$app->user->isGuest) {
         $post = \Yii::$app->request->post('Issue');
         if (isset($post['status_id'])) {
             $model->status_id = $post['status_id'];
             $output = StatusEnum::i()->getMap()[$post['status_id']];
             $this->sendMessage($model, ['subject' => \Yii::t('app', 'Issue Status Changed'), 'view' => 'changeStatus']);
         }
         if (isset($post['priority_id'])) {
             $model->priority_id = (int) $post['priority_id'];
             $output = PriorityEnum::i()->getMap()[$post['priority_id']];
         }
         if (isset($post['tracker_id'])) {
             $model->tracker_id = (int) $post['tracker_id'];
             $output = TrackerEnum::i()->getMap()[$post['tracker_id']];
         }
         if (isset($post['assignee_id'])) {
             if ($post['assignee_id']) {
                 $model->assignee_id = (int) $post['assignee_id'];
                 $output = \app\models\Project::getAssigneeOptions($model->project_id)[$post['assignee_id']];
                 $this->sendMessage($model);
             } else {
                 $model->assignee_id = null;
                 $output = '<i>(' . \Yii::t('app', 'not set') . ')</i>';
             }
         }
         if (isset($post['readiness_id'])) {
             $model->readiness_id = (int) $post['readiness_id'];
             $output = Issue::getReadinessOptions()[$post['readiness_id']];
         }
         if (isset($post['deadline'])) {
             $model->deadline = $post['deadline'];
             $output = $post['deadline'];
         }
         if ($model->save()) {
             $out = Json::encode(['output' => $output, 'message' => '']);
             echo $out;
             return;
         }
     }
     if ($post = \Yii::$app->request->post('IssueComment')) {
         $comment = new IssueComment();
         $comment->text = $post['text'];
         $comment->issue_id = $id;
         if ($comment->save()) {
             \Yii::$app->session->setFlash('success', \Yii::t('app', 'Comment successfully added.'));
         }
     }
     return $this->render('view', ['model' => $model]);
 }
开发者ID:mops1k,项目名称:yiimine,代码行数:56,代码来源:IssueController.php

示例2:

            <dd>
                <?php 
echo Editable::widget(['model' => $model, 'attribute' => 'tracker_id', 'header' => \Yii::t('app', 'Priority'), 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => TrackerEnum::i()->getMap(), 'options' => ['class' => 'form-control'], 'displayValue' => TrackerEnum::i()->getMap()[$model->tracker_id]]);
?>
            </dd>
        </dl>
    </div>
    <div class="col-sm-3">
        <dl class="dl-horizontal">
            <dt><?php 
echo \Yii::t('app', 'Assignee');
?>
</dt>
            <dd>
                <?php 
echo Editable::widget(['model' => $model, 'attribute' => 'assignee_id', 'header' => \Yii::t('app', 'Assignee'), 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => \app\models\Project::getAssigneeOptions($model->project_id), 'options' => ['class' => 'form-control', 'prompt' => ' - '], 'displayValue' => $model->assignee ? $model->assignee->getFullName() : '<i>(' . \Yii::t('app', 'not set') . ')</i>']);
?>
            </dd>
            <dt><?php 
echo \Yii::t('app', '% Done');
?>
</dt>
            <dd>
                <?php 
echo Editable::widget(['model' => $model, 'attribute' => 'readiness_id', 'header' => \Yii::t('app', '% Done'), 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => Issue::getReadinessOptions(), 'options' => ['class' => 'form-control'], 'displayValue' => Issue::getReadinessOptions()[$model->readiness_id]]);
?>
            </dd>
            <dt><?php 
echo \Yii::t('app', 'Deadline');
?>
</dt>
开发者ID:mops1k,项目名称:yiimine,代码行数:31,代码来源:view.php

示例3: function

}, 'editableOptions' => ['header' => \Yii::t('app', 'Status'), 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => StatusEnum::i()->getMap()]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'priority_id', 'filter' => PriorityEnum::i()->getMap(), 'value' => function ($data) {
    return PriorityEnum::i()->getMap()[$data->priority_id];
}, 'editableOptions' => ['header' => \Yii::t('app', 'Priority'), 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => PriorityEnum::i()->getMap()]], ['attribute' => 'subject', 'format' => 'raw', 'value' => function ($data) {
    $additionalLinks = '';
    $checkList = '';
    if ($data->creator_id == \Yii::$app->user->id || \Yii::$app->user->can('adminDashboard')) {
        $additionalLinks = '<span class="pull-right">' . Html::a('<i class="fa fa-edit"></i>', ['/issue/update', 'id' => $data->id]) . ' ';
        $additionalLinks .= Html::a('<i class="fa fa-trash"></i>', ['/issue/delete', 'id' => $data->id], ['class' => 'confirmLink']) . '</span>';
    }
    if ($data->checkLists) {
        $checkList = '<span class="label label-success" data-toggle="tooltip" title="' . \Yii::t('app', 'Checklist') . '">
                            <i class="fa fa-th-list"></i> ' . $data->offListItems . '/' . $data->checkListsCount . '</span>';
    }
    return Html::a($data->subject, ['/issue/view', 'id' => $data->id]) . ' ' . $checkList . $additionalLinks;
}], ['attribute' => 'creator_id', 'filter' => \app\models\Project::getAssigneeOptions($project->id), 'value' => function ($data) {
    return $data->author ? $data->author->getFullName() : '';
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'assignee_id', 'filter' => \app\models\Project::getAssigneeOptions($project->id), 'value' => function ($data) {
    return $data->assignee ? $data->assignee->getFullName() : '';
}, 'editableOptions' => ['header' => \Yii::t('app', 'Assignee'), 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => \app\models\Project::getAssigneeOptions($project->id), 'options' => ['prompt' => ' - ']]], ['attribute' => 'created_date', 'filter' => false]]]);
?>

</div>

<style>
    #w0-container > table > thead > tr:nth-child(1) > th:nth-child(2) {
        width: 50px;
    }
    #w0-container > table > thead > tr:nth-child(1) > th:nth-child(5) {
        width: 40%;
    }
</style>
开发者ID:mops1k,项目名称:yiimine,代码行数:31,代码来源:index.php

示例4:

            </div>

            <a href="#" class="checklist-add pull-right"><i class="fa fa-plus-circle"></i> <?php 
echo \Yii::t('app', 'Add Checklist Item');
?>
</a>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-sm-6">
        <?php 
echo $form->field($model, 'milestone_id')->dropDownList(app\models\Milestone::getOptions($project->id), ['prompt' => ' ']);
echo $form->field($model, 'status_id')->dropDownList(\app\components\enums\StatusEnum::i()->getMap());
echo $form->field($model, 'priority_id')->dropDownList(\app\components\enums\PriorityEnum::i()->getMap());
echo $form->field($model, 'assignee_id')->dropDownList(\app\models\Project::getAssigneeOptions($project->id), ['prompt' => ' ']);
?>
    </div>
    <div class="col-sm-6">
        <?php 
echo $form->field($model, 'deadline')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]);
echo $form->field($model, 'readiness_id')->dropDownList(\app\models\Issue::getReadinessOptions());
echo $form->field($model, 'image_array[]')->fileInput(['multiple' => ''])->hint(\Yii::t('app', 'Chose one or few files'));
if (!empty($model->photos)) {
    echo $this->render('_imageGrid', ['model' => $model]);
}
?>
    </div>
</div>

<?php 
开发者ID:mops1k,项目名称:yiimine,代码行数:31,代码来源:_form.php


注:本文中的app\models\Project::getAssigneeOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。