<?php

namespace Modules\Admin\Users;

class View_List extends \App\Mvc\View_Window_PaginatedListing_ListAbstract
{
	/**
	 * (non-PHPdoc)
	 * @see \App\Mvc\View_Window_PaginatedListing_ListAbstract::list_getThDetails()
	 */
	protected function list_getThDetails()
	{

		// NAME
		$columnName = \App\Mvc\View\Utils\Types\ListingColumn::create('lastName');
		$columnName->setSortable('ASC');

		// OFFICE
		$columnOffice = \App\Mvc\View\Utils\Types\ListingColumn::create('idOffice');
		$columnOffice->setType('officeLabel');

		// DEPARTMENT
		$columnDepartment = \App\Mvc\View\Utils\Types\ListingColumn::create('idDepartment');
		$columnDepartment->setType('departmentLabel');

		// JOB
		$columnJob = \App\Mvc\View\Utils\Types\ListingColumn::create('job');

		// TELEPHONE
		$columnTelephone = \App\Mvc\View\Utils\Types\ListingColumn::create('telephone');

		// EMAIL
		$columnEmail = \App\Mvc\View\Utils\Types\ListingColumn::create('email');

		// LAST LOGIN
		$columnLastLogin = \App\Mvc\View\Utils\Types\ListingColumn::create('lastClick')->setSortable('ASC');
		$columnLastLogin->setType('datetime');

		// ADD TIME
		$columnAddTime = \App\Mvc\View\Utils\Types\ListingColumn::create('addTime');
		$columnAddTime->setType('date');
		$columnAddTime->setSortable('ASC');

		// LAST LOGIN

		$columns = \App\Mvc\View\Utils\Types\ListingColumns::create();
		$columns->append($columnName);
		$columns->append($columnOffice);
		$columns->append($columnDepartment);
		$columns->append($columnJob);
		$columns->append($columnTelephone);
		$columns->append($columnEmail);
		$columns->append($columnLastLogin);
		$columns->append($columnAddTime);
		$columns->loadLabels($this->lang['index']['listCols']);
		$columns->loadSettings($this->input['listingParams']->getDynamicColumnsSettings());

		return $columns;
	}
}
