1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

Improved status selection

This commit is contained in:
Hillel Coren 2016-11-18 15:31:43 +02:00
parent fce46114bc
commit 23c098014a
52 changed files with 193726 additions and 166 deletions

View File

@ -244,9 +244,13 @@ class AccountController extends BaseController
* @param $visible
* @return mixed
*/
public function setTrashVisible($entityType, $visible)
public function setEntityFilter($entityType, $filter = '')
{
Session::put("show_trash:{$entityType}", $visible == 'true');
if ($filter == 'true') {
$filter = '';
}
Session::put("entity_filter:{$entityType}", $filter);
return RESULT_SUCCESS;
}

View File

@ -45,7 +45,7 @@ class ClientController extends BaseController
'entityType' => ENTITY_CLIENT,
'title' => trans('texts.clients'),
'sortCol' => '4',
'statuses' => Utils::trans(Client::$statuses),
'statuses' => Client::getStatuses(),
'columns' => Utils::trans([
'checkbox',
'client',

View File

@ -58,6 +58,7 @@ class InvoiceController extends BaseController
'title' => trans('texts.invoices'),
'entityType' => ENTITY_INVOICE,
'sortCol' => '3',
'statuses' => Invoice::getStatuses(),
'columns' => Utils::trans([
'checkbox',
'invoice_number',

View File

@ -53,6 +53,7 @@ class ProductController extends BaseController
return View::make('list', [
'entityType' => ENTITY_PRODUCT,
'title' => trans('texts.products'),
'statuses' => Product::getStatuses(),
'sortCol' => '4',
'columns' => Utils::trans($columns),
]);

View File

@ -125,7 +125,7 @@ if (Utils::isReseller()) {
Route::group(['middleware' => 'auth:user'], function() {
Route::get('dashboard', 'DashboardController@index');
Route::get('dashboard_chart_data/{group_by}/{start_date}/{end_date}/{currency_id}/{include_expenses}', 'DashboardController@chartData');
Route::get('view_archive/{entity_type}/{visible}', 'AccountController@setTrashVisible');
Route::get('set_entity_filter/{entity_type}/{filter?}', 'AccountController@setEntityFilter');
Route::get('hide_message', 'HomeController@hideMessage');
Route::get('force_inline_pdf', 'UserController@forcePDFJS');
Route::get('account/get_search_data', ['as' => 'get_search_data', 'uses' => 'AccountController@getSearchData']);
@ -531,6 +531,7 @@ if (!defined('CONTACT_EMAIL')) {
define('INVOICE_STATUS_APPROVED', 4);
define('INVOICE_STATUS_PARTIAL', 5);
define('INVOICE_STATUS_PAID', 6);
define('INVOICE_STATUS_OVERDUE', 7);
define('PAYMENT_STATUS_PENDING', 1);
define('PAYMENT_STATUS_VOIDED', 2);
@ -539,6 +540,15 @@ if (!defined('CONTACT_EMAIL')) {
define('PAYMENT_STATUS_PARTIALLY_REFUNDED', 5);
define('PAYMENT_STATUS_REFUNDED', 6);
define('TASK_STATUS_LOGGED', 1);
define('TASK_STATUS_RUNNING', 2);
define('TASK_STATUS_INVOICED', 3);
define('TASK_STATUS_PAID', 4);
define('EXPENSE_STATUS_LOGGED', 1);
define('EXPENSE_STATUS_INVOICED', 2);
define('EXPENSE_STATUS_PAID', 3);
define('CUSTOM_DESIGN', 11);
define('FREQUENCY_WEEKLY', 1);

View File

@ -193,6 +193,10 @@ class EntityModel extends Eloquent
*/
public static function getClassName($entityType)
{
if ($entityType == ENTITY_QUOTE || $entityType == ENTITY_RECURRING_INVOICE) {
$entityType = ENTITY_INVOICE;
}
return 'App\\Models\\' . ucwords(Utils::toCamelCase($entityType));
}
@ -290,4 +294,15 @@ class EntityModel extends Eloquent
return false;
}
public static function getStatuses($entityType = false)
{
$data = [];
foreach (static::$statuses as $status) {
$data[$status] = trans("texts.{$status}");
}
return $data;
}
}

View File

@ -211,6 +211,17 @@ class Expense extends EntityModel
{
return Utils::calculateTaxes($this->amount, $this->tax_rate1, $this->tax_rate2);
}
public static function getStatuses($entityType = false)
{
$statuses = parent::getStatuses($entityType);
$statuses[EXPENSE_STATUS_LOGGED] = trans('texts.logged');
$statuses[EXPENSE_STATUS_INVOICED] = trans('texts.invoiced');
$statuses[EXPENSE_STATUS_PAID] = trans('texts.paid');
return $statuses;
}
}
Expense::creating(function ($expense) {

View File

@ -48,4 +48,12 @@ class ExpenseCategory extends EntityModel
return "/expense_categories/{$this->public_id}/edit";
}
public static function getStatuses($entityType = false)
{
$statuses = parent::getStatuses($entityType);
unset($statuses[STATUS_DELETED]);
return $statuses;
}
}

View File

@ -1249,6 +1249,31 @@ class Invoice extends EntityModel implements BalanceAffecting
return $recurInvoice->auto_bill == AUTO_BILL_ALWAYS || ($recurInvoice->auto_bill != AUTO_BILL_OFF && $recurInvoice->client_enable_auto_bill);
}
public static function getStatuses($entityType = false)
{
$statuses = parent::getStatuses($entityType);
if ($entityType == ENTITY_RECURRING_INVOICE) {
return $statuses;
}
foreach (\Cache::get('invoiceStatus') as $status) {
if ($entityType == ENTITY_QUOTE) {
if (in_array($status->id, [INVOICE_STATUS_PAID, INVOICE_STATUS_PARTIAL])) {
continue;
}
}
$statuses[$status->id] = trans('texts.status_' . strtolower($status->name));
}
if ($entityType == ENTITY_INVOICE) {
$statuses[INVOICE_STATUS_OVERDUE] = trans('texts.overdue');
}
return $statuses;
}
}
Invoice::creating(function ($invoice) {

View File

@ -87,4 +87,13 @@ class Product extends EntityModel
{
return $this->belongsTo('App\Models\TaxRate');
}
public static function getStatuses($entityType = false)
{
$statuses = parent::getStatuses($entityType);
unset($statuses[STATUS_DELETED]);
return $statuses;
}
}

View File

@ -195,6 +195,19 @@ class Task extends EntityModel
return $query;
}
public static function getStatuses($entityType = false)
{
$statuses = parent::getStatuses($entityType);
$statuses[TASK_STATUS_LOGGED] = trans('texts.logged');
$statuses[TASK_STATUS_RUNNING] = trans('texts.running');
$statuses[TASK_STATUS_INVOICED] = trans('texts.invoiced');
$statuses[TASK_STATUS_PAID] = trans('texts.paid');
return $statuses;
}
}

View File

@ -15,10 +15,6 @@ class AccountGatewayRepository extends BaseRepository
->join('gateways', 'gateways.id', '=', 'account_gateways.gateway_id')
->where('account_gateways.account_id', '=', $accountId);
if (!\Session::get('show_trash:gateway')) {
$query->where('account_gateways.deleted_at', '=', null);
}
return $query->select('account_gateways.id', 'account_gateways.public_id', 'gateways.name', 'account_gateways.deleted_at', 'account_gateways.gateway_id');
}
}

View File

@ -1,5 +1,7 @@
<?php namespace App\Ninja\Repositories;
use Utils;
/**
* Class BaseRepository
*/
@ -113,4 +115,30 @@ class BaseRepository
{
return $this->getInstance()->scope($ids)->withTrashed()->get();
}
protected function applyFilters($query, $entityType, $table = false)
{
$table = Utils::pluralizeEntityType($table ?: $entityType);
if ($filters = explode(',', session('entity_filter:' . $entityType, STATUS_ACTIVE))) {
$query->where(function ($query) use ($filters, $table) {
$query->whereNull($table . '.id');
if (in_array(STATUS_ACTIVE, $filters)) {
$query->orWhereNull($table . '.deleted_at');
}
if (in_array(STATUS_ARCHIVED, $filters)) {
$query->orWhereNotNull($table . '.deleted_at');
if ( ! in_array(STATUS_DELETED, $filters) && ! in_array($table, ['products', 'expense_categories', 'users'])) {
$query->where($table . '.is_deleted', '=', 0);
}
}
if (in_array(STATUS_DELETED, $filters)) {
$query->orWhere($table . '.is_deleted', '=', 1);
}
});
}
return $query;
}
}

View File

@ -49,9 +49,7 @@ class ClientRepository extends BaseRepository
'clients.user_id'
);
if (!\Session::get('show_trash:client')) {
$query->where('clients.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_CLIENT);
if ($filter) {
$query->where(function ($query) use ($filter) {

View File

@ -45,9 +45,7 @@ class CreditRepository extends BaseRepository
$query->where('clients.public_id', '=', $clientPublicId);
}
if (!\Session::get('show_trash:credit')) {
$query->where('credits.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_CREDIT);
if ($filter) {
$query->where(function ($query) use ($filter) {

View File

@ -28,9 +28,7 @@ class ExpenseCategoryRepository extends BaseRepository
'expense_categories.deleted_at'
);
if (!\Session::get('show_trash:expense_category')) {
$query->where('expense_categories.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_EXPENSE_CATEGORY);
if ($filter) {
$query->where(function ($query) use ($filter) {

View File

@ -94,10 +94,25 @@ class ExpenseRepository extends BaseRepository
'clients.country_id as client_country_id'
);
$showTrashed = \Session::get('show_trash:expense');
$this->applyFilters($query, ENTITY_EXPENSE);
if (!$showTrashed) {
$query->where('expenses.deleted_at', '=', null);
if ($statuses = explode(',', session('entity_filter:' . ENTITY_EXPENSE))) {
$query->where(function ($query) use ($statuses) {
if (in_array(EXPENSE_STATUS_LOGGED, $statuses)) {
$query->orWhere('expenses.invoice_id', '=', 0)
->orWhereNull('expenses.invoice_id');
}
if (in_array(EXPENSE_STATUS_INVOICED, $statuses)) {
$query->orWhere('expenses.invoice_id', '>', 0);
if ( ! in_array(EXPENSE_STATUS_PAID, $statuses)) {
$query->where('invoices.balance', '>', 0);
}
}
if (in_array(EXPENSE_STATUS_PAID, $statuses)) {
$query->orWhere('invoices.balance', '=', 0)
->where('expenses.invoice_id', '>', 0);
}
});
}
if ($filter) {

View File

@ -76,8 +76,23 @@ class InvoiceRepository extends BaseRepository
'invoices.user_id'
);
if (!\Session::get('show_trash:'.$entityType)) {
$query->where('invoices.deleted_at', '=', null);
$this->applyFilters($query, $entityType, ENTITY_INVOICE);
if ($statuses = explode(',', session('entity_filter:' . $entityType))) {
$query->where(function ($query) use ($statuses) {
foreach ($statuses as $status) {
if (in_array($status, \App\Models\EntityModel::$statuses)) {
continue;
}
$query->orWhere('invoice_status_id', '=', $status);
}
if (in_array(INVOICE_STATUS_OVERDUE, $statuses)) {
$query->orWhere(function ($query) use ($statuses) {
$query->where('invoices.balance', '>', 0)
->where('invoices.due_date', '<', date('Y-m-d'));
});
}
});
}
if ($clientPublicId) {
@ -133,9 +148,7 @@ class InvoiceRepository extends BaseRepository
$query->where('clients.public_id', '=', $clientPublicId);
}
if (!\Session::get('show_trash:recurring_invoice')) {
$query->where('invoices.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_RECURRING_INVOICE, ENTITY_INVOICE);
if ($filter) {
$query->where(function ($query) use ($filter) {

View File

@ -63,9 +63,7 @@ class PaymentRepository extends BaseRepository
'payment_statuses.name as payment_status_name'
);
if (!\Session::get('show_trash:payment')) {
$query->where('payments.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_PAYMENT);
if ($clientPublicId) {
$query->where('clients.public_id', '=', $clientPublicId);

View File

@ -42,9 +42,7 @@ class ProductRepository extends BaseRepository
});
}
if (!\Session::get('show_trash:product')) {
$query->where('products.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_PRODUCT);
return $query;
}

View File

@ -51,8 +51,27 @@ class TaskRepository extends BaseRepository
$query->where('clients.public_id', '=', $clientPublicId);
}
if (!Session::get('show_trash:task')) {
$query->where('tasks.deleted_at', '=', null);
$this->applyFilters($query, ENTITY_TASK);
if ($statuses = explode(',', session('entity_filter:' . ENTITY_TASK))) {
$query->where(function ($query) use ($statuses) {
if (in_array(TASK_STATUS_LOGGED, $statuses)) {
$query->orWhere('tasks.invoice_id', '=', 0)
->orWhereNull('tasks.invoice_id');
}
if (in_array(TASK_STATUS_RUNNING, $statuses)) {
$query->orWhere('tasks.is_running', '=', 1);
}
if (in_array(TASK_STATUS_INVOICED, $statuses)) {
$query->orWhere('tasks.invoice_id', '>', 0);
if ( ! in_array(TASK_STATUS_PAID, $statuses)) {
$query->where('invoices.balance', '>', 0);
}
}
if (in_array(TASK_STATUS_PAID, $statuses)) {
$query->orWhere('invoices.balance', '=', 0);
}
});
}
if ($filter) {

View File

@ -16,10 +16,6 @@ class TokenRepository extends BaseRepository
$query = DB::table('account_tokens')
->where('account_tokens.user_id', '=', $userId);
if (!Session::get('show_trash:token')) {
$query->where('account_tokens.deleted_at', '=', null);
}
return $query->select('account_tokens.public_id', 'account_tokens.name', 'account_tokens.token', 'account_tokens.public_id', 'account_tokens.deleted_at');
}
}

View File

@ -16,9 +16,7 @@ class UserRepository extends BaseRepository
$query = DB::table('users')
->where('users.account_id', '=', $accountId);
if (!Session::get('show_trash:user')) {
$query->where('users.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_USER);
$query->select('users.public_id', 'users.first_name', 'users.last_name', 'users.email', 'users.confirmed', 'users.public_id', 'users.deleted_at', 'users.is_admin', 'users.permissions');

View File

@ -45,9 +45,7 @@ class VendorRepository extends BaseRepository
'vendors.user_id'
);
if (!\Session::get('show_trash:vendor')) {
$query->where('vendors.deleted_at', '=', null);
}
$this->applyFilters($query, ENTITY_VENDOR);
if ($filter) {
$query->where(function ($query) use ($filter) {

View File

@ -85,7 +85,8 @@ elixir(function(mix) {
], 'public/js/daterangepicker.min.js');
mix.scripts([
bowerDir + '/select2/dist/js/select2.js'
bowerDir + '/select2/dist/js/select2.js',
'resources/assets/js/maximize-select2-height.js',
], 'public/js/select2.min.js');
mix.scripts([

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

13519
public/css/built.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

486
public/css/select2.css vendored Normal file
View File

@ -0,0 +1,486 @@
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle; }
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-selection--single .select2-selection__clear {
position: relative; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: inline-block;
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-search--inline {
float: left; }
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0; }
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051; }
.select2-results {
display: block; }
.select2-results__options {
list-style: none;
margin: 0;
padding: 0; }
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
.select2-results__option[aria-selected] {
cursor: pointer; }
.select2-container--open .select2-dropdown {
left: 0; }
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-search--dropdown {
display: block;
padding: 4px; }
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-search--dropdown.select2-search--hide {
display: none; }
.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0); }
.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important; }
.select2-container--default .select2-selection--single {
background-color: #fff;
border: 1px solid #aaa;
border-radius: 4px; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left; }
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa; }
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield; }
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--default .select2-results__option[role=group] {
padding: 0; }
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; }
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white; }
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 4px;
outline: 0;
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px; }
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
border-left: 1px solid #aaa;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
border-right: 1px solid #aaa;
border-radius: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
left: 1px;
right: auto; }
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
background: transparent;
border: none; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;
outline: 0; }
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0; }
.select2-container--classic .select2-search--inline .select2-search__field {
outline: 0;
box-shadow: none; }
.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }
.select2-container--classic .select2-dropdown--above {
border-bottom: none; }
.select2-container--classic .select2-dropdown--below {
border-top: none; }
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--classic .select2-results__option[role=group] {
padding: 0; }
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb; }
/*# sourceMappingURL=select2.css.map */

File diff suppressed because one or more lines are too long

10530
public/js/Chart.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

9559
public/js/d3.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5880
public/js/select2.min.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -334,6 +334,15 @@ border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.dt-right,
.dt-left {
margin-top: 16px;
}
.pagination>ul {
margin: 0px;
}
/* hide table sorting indicators */
table.table thead .sorting { background: url('') no-repeat center right; }

View File

@ -0,0 +1,152 @@
// maximize-select2-height v1.0.2
// (c) Panorama Education 2015
// MIT License
// https://github.com/panorama-ed/maximize-select2-height
// This jQuery/Select2 plugin expands a Select2 dropdown to take up as much
// height as possible given its position on the page and the current viewport
// size. The plugin correctly handles:
// - Dynamic window resizing.
// - The effects of scroll bars on the viewport.
// - Select2 rendering dropdowns both upwards and downwards.
// NOTE: The original <select> element that is $().select2()'d *must* have a
// unique ID for this code to work. (Ex: <select id="my-unique-id"></select>)
(function ($) {
"use strict";
// We can find these elements now, since the properties we check on them are
// all via methods that are recalculated each time.
var $window = $(window);
var $document = $(document);
// @param {Object} options The options object passed in when this plugin is
// initialized
// @param {Boolean} dropdownDownwards True iff the dropdown is rendered
// downwards (Select2 sometimes renders the options upwards to better fit on
// a page)
// @return {Object} The options passed in, combined with defaults. Keys are:
// - cushion: The number of pixels between the edge of the dropdown and the
// edge of the viewable window. [Default: 10, except when a
// horizontal scroll bar would interfere, in which case it's 30.]
// NOTE: If a value is passed in, no adjustments for possible
// scroll bars are made.
var settings = function (options, dropdownDownwards) {
return $.extend({
cushion: (
dropdownDownwards && $document.width() > $window.width()
) ? 30 : 10
}, options);
};
// @param {String} id The DOM element ID for the original <select> node
// @param {jQuery object} $select2Results The DOM element with class
// "select2-results"
// @param {jQuery object} $grandparent The grandparent object of the
// $select2Results object
// @param {Object} options The options object passed in when this plugin is
// initialized
// @param {Boolean} dropdownDownwards True iff the dropdown is rendered
// downwards (Select2 sometimes renders the options upwards to better fit on
// a page)
// @return {Number} the maximum height of the Select2 results box to display
var computeMaxHeight = function (
id, $select2Results, $grandparent, options, dropdownDownwards
) {
var height;
var resultsBoxMiscellaniaHeight;
var widgetBoxOffset;
if (dropdownDownwards) {
// When the dropdown appears downwards, the formula is:
// visible window size
// + out-of-window pixels we've scrolled past
// - size of content (including offscreen content) above results box
// ------------------------------------------
// total height available to us
// innerHeight is more accurate across browsers than $(window).height().
height = window.innerHeight +
$window.scrollTop() -
$select2Results.offset().top;
} else {
// When the dropdown appears upwards, the formula is:
// vertical position of the widget (clickable) dropdown box
// - out-of-window pixels we've scrolled past
// - height of the search box and other content above the actual results
// but in the results box
// ------------------------------------------
// total height available to us
// Compute the global vertical offset of the widget box (the one with the
// downward arrow that the user clicks on to expose options).
widgetBoxOffset = $("#select2-" + id + "-container").
parent().parent().parent().offset().top;
// Compute the height, if any, of search box and other content in the
// results box but not part of the results.
resultsBoxMiscellaniaHeight = $grandparent.height() -
$select2Results.height();
height = widgetBoxOffset -
$window.scrollTop() -
resultsBoxMiscellaniaHeight;
}
// Leave a little cushion to prevent the dropdown from
// rendering off the edge of the viewport.
return height - settings(options, dropdownDownwards).cushion;
};
// Call on a jQuery Select2 element to maximize the height of the dropdown
// every time it is opened.
// @param {Object} options The options object passed in when this plugin is
// initialized
$.fn.maximizeSelect2Height = function (options) {
return this.each(function (_, el) {
// Each time the Select2 is opened, resize it to take up as much vertical
// space as possible given its position and the current viewport size.
$(el).on("select2:open", function () {
// We have to put this code block inside a timeout because we determine
// whether the dropdown is rendered upwards or downwards via a hack that
// looks at the CSS classes, and these aren't set until Select2 has a
// chance to render the box, which occurs after this event fires.
// The alternative solution that avoids using a timeout would be to
// directly modify the document's stylesheets (instead of the styles for
// individual elements), but that is both ugly/dangerous and actually
// impossible for us because we need to modify the styles of a parent
// node of a given DOM node when the parent has no unique ID, which CSS
// doesn't have the ability to do.
setTimeout(function () {
var $select2Results = $("#select2-" + el.id + "-results");
var $parent = $select2Results.parent();
var $grandparent = $parent.parent();
var dropdownDownwards = $grandparent
.hasClass("select2-dropdown--below");
var maxHeight = computeMaxHeight(
el.id,
$select2Results,
$grandparent,
options,
dropdownDownwards
);
// Set the max height of the relevant DOM elements. We use max-height
// instead of height directly to correctly handle cases in which there
// are only a few elements (we don't want a giant empty dropdown box).
$parent.css("max-height", maxHeight);
$select2Results.css("max-height", maxHeight);
// Select2 corrects the positioning of the results box on scroll, so
// we trigger that event here to let it auto-correct. This is done for
// the case where the dropdown appears upwards; we adjust its max
// height but we also want to move it up further, lest it cover up the
// initial dropdown box.
$(document).trigger("scroll");
});
});
});
};
})(jQuery);

View File

@ -14,13 +14,6 @@
@endif
</div>
<!--
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
{!! Session::get('show_trash:token') ? 'checked' : ''!!}/> {!! trans('texts.show_deleted_tokens')!!}
</label>
-->
@include('partials.bulk_form', ['entityType' => ENTITY_TOKEN])
{!! Datatable::table()
@ -40,15 +33,6 @@
window.onDatatableReady = actionListHandler;
function setTrashVisible() {
var checked = $('#trashed').is(':checked');
var url = '{{ URL::to('view_archive/token') }}' + (checked ? '/true' : '/false');
$.get(url, function(data) {
refreshDatatable();
})
}
</script>
@if (Utils::isNinja() && !Utils::isReseller())

View File

@ -31,13 +31,6 @@
</div>
{!! Former::close() !!}
<!--
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
{{ Session::get("show_trash:gateway") ? 'checked' : ''}}/>&nbsp; {{ trans('texts.show_archived_deleted')}} {{ Utils::transFlowText('gateways') }}
</label>
-->
@if ($showAdd)
{!! Button::primary(trans('texts.add_gateway'))
->asLinkTo(URL::to('/gateways/create'))
@ -121,14 +114,6 @@
<script>
window.onDatatableReady = actionListHandler;
function setTrashVisible() {
var checked = $('#trashed').is(':checked');
var url = '{{ URL::to('view_archive/gateway') }}' + (checked ? '/true' : '/false');
$.get(url, function(data) {
refreshDatatable();
})
}
function showLimitsModal(gateway_type, gateway_type_id, min_limit, max_limit) {
var modalLabel = {!! json_encode(trans('texts.set_limits')) !!};

View File

@ -16,7 +16,7 @@
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
{!! Session::get('show_trash:user') ? 'checked' : ''!!}/> {!! trans('texts.show_archived_users')!!}
{!! Session::get('entity_filter:user') != 'active' ? 'checked' : ''!!}/> {!! trans('texts.show_archived_users')!!}
</label>
@include('partials.bulk_form', ['entityType' => ENTITY_USER])
@ -41,7 +41,7 @@
function setTrashVisible() {
var checked = $('#trashed').is(':checked');
var url = '{{ URL::to('view_archive/user') }}' + (checked ? '/true' : '/false');
var url = '{{ URL::to('set_entity_filter/user') }}' + (checked ? '/active,archived' : '/active');
$.get(url, function(data) {
refreshDatatable();

View File

@ -45,17 +45,12 @@
@endif
&nbsp;
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
<!--
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
{{ Session::get("show_trash:{$entityType}") ? 'checked' : ''}}/>&nbsp; {{ trans('texts.show_archived_deleted')}}
-->
<span id="statusWrapper" style="display:none">
{!! Former::multiselect('statuses')
->select('Active')
->style('width: 200px')
->options($statuses)
->style('width: 220px')
->options(\App\Models\EntityModel::getClassName($entityType)::getStatuses($entityType))
->raw() !!}
</label>
</span>
<div id="top_right_buttons" class="pull-right">
<input id="tableFilter" type="text" style="width:140px;margin-right:17px;background-color: white !important"
@ -181,7 +176,7 @@
/*
function setTrashVisible() {
var checked = $('#trashed').is(':checked');
var url = '{{ URL::to('view_archive/' . $entityType) }}' + (checked ? '/true' : '/false');
var url = '{{ URL::to('set_entity_filter/' . $entityType) }}' + (checked ? '/true' : '/false');
$.get(url, function(data) {
refreshDatatable();
@ -259,12 +254,23 @@
$('#statuses').select2({
placeholder: "{{ trans('texts.status') }}",
}).on('change', function() {
}).val('{{ session('entity_filter:' . $entityType, STATUS_ACTIVE) }}'.split(','))
.trigger('change')
.on('change', function() {
var filter = $('#statuses').val();
if (filter) {
filter = filter.join(',');
} else {
filter = '';
}
var url = '{{ URL::to('set_entity_filter/' . $entityType) }}' + '/' + filter;
$.get(url, function(data) {
refreshDatatable();
}).val([0]).trigger('change');
})
}).maximizeSelect2Height();
$('#statusWrapper').show();
//$('#statuses').select2().val([0,1,2]).trigger('change');
});
</script>

View File

@ -108,7 +108,7 @@
/* Set the defaults for DataTables initialisation */
$.extend(true, $.fn.dataTable.defaults, {
"bSortClasses": false,
"sDom": "t<'row-fluid'<'span6'i><'span6'p>>l",
"sDom": "t<'row-fluid'<'span6 dt-left'i><'span6 dt-right'p>>l",
"sPaginationType": "bootstrap",
"bInfo": true,
"oLanguage": {