public function createComponentHistoryGrid($name) { $gridControl = new Model\Mesour\EmptyGridControl($this, $name); $grid = $gridControl->grid; $source = new Mesour\DataGrid\Sources\ArrayGridSource($this->historyFacade->getHistoryTable()); $primaryKey = 'id'; $grid->setPrimaryKey($primaryKey); $grid->setSource($source); $grid->setDefaultOrder('id', 'DESC'); $grid->addText('type', ' '); $grid->addNumber('state', 'Stav'); $grid->addText('user', 'Uživatel'); $grid->addText('part', 'Součástka'); $grid->addNumber('position', 'Pozice'); $grid->addNumber('level', 'Patro'); $grid->addNumber('amount', 'Počet'); $grid->addDate('created', 'Čas')->setFormat('j.n.Y H:m:s'); return $gridControl->create(); }
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(); }
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(); }
public function createComponentSimpleGetPartsGrid($name) { $data = $this->partFacade->getSimpleGetPartsTable(); $gridControl = new Model\Mesour\EmptyGridControl($this, $name); $grid = $gridControl->grid; $source = new Mesour\DataGrid\Sources\ArrayGridSource($data); $primaryKey = 'socketId'; $grid->setSource($source); $grid->setPrimaryKey($primaryKey); $grid->addNumber('socketPosition', 'Pozice'); $grid->addText('partName', 'Název součástky'); $grid->addText('partType', 'Typ'); $grid->addText('available', 'Množství'); $grid->setDefaultOrder('socketPosition'); $filter = $grid->enableFilter(FALSE); $container = $grid->addContainer('Vybrat'); $emptyInput = new Model\Mesour\InputFieldColumn('emptyInput'); $container->addComponent($emptyInput, 'emptyInput'); return $gridControl->create(); }