Example #1
0
 public function createComponentPartListGrid($name)
 {
     $gridControl = new Model\Mesour\EmptyGridControl($this, $name);
     $grid = $gridControl->grid;
     $source = new Mesour\DataGrid\Sources\ArrayGridSource($this->partFacade->getPartsTable());
     $primaryKey = 'id';
     $grid->setSource($source);
     $grid->setPrimaryKey($primaryKey);
     $grid->addText('name', 'Název');
     $grid->addNumber('width', 'Šířka');
     $grid->addNumber('length', 'Délka');
     $grid->addText('description', 'Popis');
     $link = new Mesour\Bridges\Nette\Link($this);
     $actions = $grid->addContainer('actions', '');
     $actions->addButton('assign')->setType('success')->setText('Přiřadit')->setAttribute('href', $link->create('Part:assign', array('partId' => '{' . $primaryKey . '}')));
     $actions->addButton('edit')->setType('primary')->setText('Upravit')->setAttribute('href', $link->create('Part:edit', array('partId' => '{' . $primaryKey . '}')));
     $actions->addButton('delete')->setType('danger')->setText('Smazat')->setAttribute('href', $link->create('Part:delete', array('partId' => '{' . $primaryKey . '}')));
     return $gridControl->create();
 }
Example #2
0
 public function createComponentQueueListGrid($name)
 {
     $gridControl = new Model\Mesour\EmptyGridControl($this, $name);
     $source = new Mesour\DataGrid\Sources\ArrayGridSource($this->queueFacade->getQueueTable());
     $grid = $gridControl->grid;
     $primaryKey = 'id';
     $grid->setPrimaryKey($primaryKey);
     $grid->setSource($source);
     $grid->addNumber('state', 'Stav');
     $grid->addText('user_username', 'Uživatel');
     $grid->addText('part_name', 'Součástka');
     $grid->addNumber('socket_position', 'Pozice');
     $grid->addNumber('socket_level', 'Patro');
     $grid->addNumber('amount', 'Počet');
     $grid->addDate('created', 'Vytvořeno')->setFormat('j.n.Y H:m:s');
     $link = new Mesour\Bridges\Nette\Link($this);
     $actions = $grid->addContainer('actions', ' ');
     $actions->addButton('delete')->setType('danger')->setText('Vymazat')->setAttribute('href', $link->create('Queue:delete', array('queueEntryId' => '{id}')));
     return $gridControl->create();
 }
Example #3
0
 protected function createUrl()
 {
     return $this->link->link($this->destination, $this->args, $this->presenterComponent);
 }