pritok312 / yii2-kanban-board
yii2 的看板模块
dev-master / 2.0.x-dev
2024-02-23 13:53 UTC
Requires
- php: >=5.6
- arogachev/yii2-sortable: ^0.1.6
- creocoder/yii2-nested-sets: ^0.9
- fortawesome/font-awesome: ^5.12.0
- kartik-v/yii2-widget-fileinput: ^1.0.9
- npm-asset/highlight.js: ^9.18.1
- npm-asset/swiper: ^6.3.5
- philippfrenzel/yii2fullcalendar: *
- rmrevin/yii2-fontawesome: ^3.4.0
- sandritsch91/yii2-widget-flatpickr: ^1.0.0
- simialbi/yii2-simialbi-base: >=0.10.2 <1.0 | ^1.0.0
- simialbi/yii2-summernote: ^1.2.1
- simialbi/yii2-widget-chart: ^0.7.0
- simialbi/yii2-widget-hideseek: ^1.0.0
- simialbi/yii2-widget-turbo: ^1.0.0
- simshaun/recurr: ^5.0.0
- yiisoft/yii2: ^2.0.20
- yiisoft/yii2-bootstrap4: ^2.0.4
Requires (Dev)
- ext-gd: *
- ext-mbstring: *
- codeception/module-asserts: ^2.0.1
- codeception/module-filesystem: ^2.0.1
- codeception/module-yii2: ^1.0
- simialbi/yii2-ticket: ~1.0@dev
- yiisoft/yii2-coding-standards: ~2.0
- yiisoft/yii2-symfonymailer: ^2.0.3
Suggests
- ext-gd: For autogeneration of visualisations
- ext-mbstring: For encoding conversion
This package is auto-updated.
Last update: 2024-09-23 15:05:20 UTC
README
资源
安装
安装此扩展的首选方法是使用 composer.
运行以下命令之一:
$ php composer.phar require --prefer-dist pritok312/yii2-kanban-board
或者添加以下内容到你的 composer.json 文件的 require 部分。
"pritok312/yii2-kanban-board": "^2.0.0"
使用
用法
为了使用此模块,你需要
设置模块
在你的 Yii 配置文件的模块部分配置该模块。
'modules' => [ 'kanban' => [ 'class' => 'simialbi\yii2\kanban\Module', //'statuses' => [], //'statusColors' => [], //'on boardCreated' => function ($event) {}, //[...] ] ]
参数
注意:如果你没有定义,将自动定义状态
Task::STATUS_NOT_BEGUN、Task::STATUS_DONE和TASK::STATUS_LATE。
事件
设置控制台配置并应用迁移
使用以下命令应用迁移: yii migrate --migration-namespaces='simialbi\yii2\kanban\migrations' 或配置你的控制台如下
[
'controllerMap' => [
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'migrationNamespaces' => [
'simialbi\yii2\kanban\migrations'
]
]
]
]
然后应用 yii migrate 命令。
创建身份
创建一个实现 simialbi\yii2\models\UserInterface 的身份类,例如。
<?php use yii\db\ActiveRecord; use simialbi\yii2\models\UserInterface; class User extends ActiveRecord implements UserInterface { /** * {@inheritDoc} */ public static function tableName() { return 'user'; } /** * {@inheritDoc} */ public static function findIdentity($id) { return static::findOne($id); } /** * {@inheritDoc} */ public static function findIdentityByAccessToken($token, $type = null) { return static::findOne(['access_token' => $token]); } /** * {@inheritDoc} */ public function getId() { return $this->id; } /** * {@inheritDoc} */ public function getAuthKey() { return $this->auth_key; } /** * {@inheritDoc} */ public function validateAuthKey($authKey) { return $this->getAuthKey() === $authKey; } /** * {@inheritDoc} */ public function getImage() { return $this->image; } /** * {@inheritDoc} */ public function getName() { return trim($this->first_name . ' ' . $this->last_name); } /** * {@inheritDoc} */ public function getEmail() { return $this->email; } /** * {@inheritDoc} */ public function getMobile() { return $this->mobile; } /** * {@inheritDoc} */ public static function findIdentities() { return static::find()->all(); } }
创建此类后,将其定义为你的应用程序配置中的身份类
'components' => [ 'user' => [ 'identityClass' => 'app\models\User' ] ]
配置 jQuery UI(可选)
如果你在应用程序的其他地方没有使用 jQuery UI,你可以通过只加载所需的脚本来减少加载量
'components' => [ 'assetManager' => [ 'bundles' => [ 'yii\jui\JuiAsset' => [ 'css' => [], 'js' => [ 'ui/data.js', 'ui/scroll-parent.js', 'ui/widget.js', 'ui/widgets/mouse.js', 'ui/widgets/sortable.js', ], 'publishOptions' => [ 'only' => [ 'ui/*', 'ui/widgets/*' ] ] ] ] ] ]
注意:如果你使用完整的 jQuery UI 包,此模块使用的 Bootstrap 提示会被 jui 提示覆盖
示例用法
现在你可以通过导航到 /kanban 来访问看板模块。
注意:某些操作只能由认证(登录)用户完成,如创建看板、桶等。
许可证
yii2-kanban 根据 MIT 许可证发布。有关详细信息,请参阅附带 LICENSE。