2017 © Pedro Peláez
 

yii2-extension yii2-gantt

Ganttchart for project-management

image

rottriges/yii2-gantt

Ganttchart for project-management

  • Tuesday, May 22, 2018
  • by rottriges
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-gantt-column

Yii2, (*1)

Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Gantt-Column widget for Yii Framework 2.0 grid extends the data column. It could be used for project management or other planings. The widget incorporates with Bootstrap 3.x., (*3)

ganttColumnScreenshot, (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Prerequisite

You must set the minimum-stability to dev in the composer.json file in your application root folder before installation of this extension., (*6)

Install

You can directly run, (*7)

$ php composer.phar require rottriges/yii2-gantt-column "1.0.*"

or you add the following to to the require section of your composer.json file., (*8)

"rottriges/yii2-gantt-column": "1.0.*"

Usage

Model with dataProvider:

namespace app\models;

use yii\data\ArrayDataProvider;

class GanttTest extends \yii\base\Model
{
  public function getDataProvider()
  {
      $testArray = [
        [
          'task' => 'Project planing',
          'type' => 'primary',
          'START_DATE' => '2020-10-19',
          'END_DATE' => '2020-11-07'
        ],
        [
          'task' => 'Production',
          'type' => 'danger',
          'START_DATE' => '2020-11-15',
          'END_DATE' => '2021-03-29'
        ],
        [
          'task' => 'Release',
          'type' => 'success',
          'START_DATE' => '2021-04-05',
          'END_DATE' => '2021-04-06'
        ],
      ];
     return new ArrayDataProvider([
          'allModels' => $testArray,
          'pagination' => [
              'pageSize' => 0,
          ],
        ]
      );
  }
}

View:

use yii\grid\GridView;

echo GridView::widget([
  'dataProvider' => $model->dataProvider,
  'columns' => [
    [
      'attribute' => 'gantChart'
      'class' => 'rottriges\ganttcolumn\GanttColumn',
      'ganttOptions' => [
        // start or endDateRange can either be a static date (Y-m-d)
        // or an offset in weeks to the current date (-2, 0, 5, ...)
        // 'dateRangeStart' => '2019-10-31',
        // 'dateRangeEnd' => '2020-10-01',
        'dateRangeStart' => -4,
        'dateRangeEnd' => 28,
        'startAttribute' => 'START_DATE',
        'endAttribute' => 'END_DATE',
        // progressBarType [string | closure] possible values
        // primary, info, warning or danger.
        'progressBarType' => function($model, $key, $index) {
          return $model['type'];
        }
        // progressBarColor [string | closure]
        // css color property
        // if color is set progressbar type will be overwritten
        'progressBarType' => function($model, $key, $index) {
          return $model['type'];
        }
      ]
    ],
  ],
]);

The Versions

22/05 2018

dev-master

9999999-dev https://github.com/rottriges/yii2-gantt

Ganttchart for project-management

  Sources   Download

BSD-3-Clause

extension yii2 gantt