1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Added initial page for the Timesheet controller

This commit is contained in:
Troels Liebe Bentsen 2014-10-20 22:30:48 +02:00
parent ae42a5a37a
commit 1bca065ca7
21 changed files with 1734 additions and 18 deletions

View File

@ -32,6 +32,7 @@ module.exports = function(grunt) {
'public/js/bootstrap-combobox.js',
'public/vendor/jspdf/dist/jspdf.min.js',
'public/vendor/handsontable/dist/jquery.handsontable.full.min.js',
'public/vendor/handsontable/lib/jquery-ui/js/jquery-ui.custom.min.js',
//'public/js/jspdf.source.js',
//'public/js/jspdf.plugin.split_text_to_size.js',
'public/js/script.js',
@ -60,6 +61,7 @@ module.exports = function(grunt) {
'public/css/bootstrap-combobox.css',
'public/css/typeahead.js-bootstrap.css',
'public/vendor/handsontable/dist/jquery.handsontable.full.css',
'public/vendor/handsontable/lib/jquery-ui/css/ui-bootstrap/jquery-ui.custom.css',
'public/css/style.css',
],
dest: 'public/built.css',

View File

@ -9,7 +9,14 @@ class TimesheetController extends \BaseController {
*/
public function index()
{
//
$data = [
'showBreadcrumbs' => false,
'timesheet' => [
'timesheet_number' => 1
]
];
return View::make('timesheets.edit', $data);
}

View File

@ -449,4 +449,5 @@ return array(
'gateway_help_23' => 'Note: use your secret API key, not your publishable API key.',
'gateway_help_27' => ':link to sign up for TwoCheckout.',
'timesheets' => 'Timesheets',
);

View File

@ -132,6 +132,8 @@ Route::group(array('before' => 'auth'), function()
Route::get('credits/create/{client_id?}/{invoice_id?}', 'CreditController@create');
Route::get('api/credits/{client_id?}', array('as'=>'api.credits', 'uses'=>'CreditController@getDatatable'));
Route::post('credits/bulk', 'CreditController@bulk');
Route::resource('timesheets', 'TimesheetController');
});
// Route group for API

View File

@ -0,0 +1,82 @@
@extends('header')
@section('head')
@parent
@stop
@section('content')
<ol class="breadcrumb">
<li>{{ link_to('timesheets', trans('texts.timesheets')) }}</li>
<li class='active'>{{ 1 }}</li>
</ol>
<div id="timesheet_table" style="height: 300px; overflow: auto">
</div>
<script type="text/javascript">
var table = $("#timesheet_table");
table.handsontable({
colHeaders: ['','Date', 'From', 'To', 'Hours', 'Owner', 'Project', 'Code', 'Tags' ],
startRows: 6,
startCols: 4,
//minSpareRows: 1,
stretchH: 'last',
colWidths: [25, 97, 50, 50, 50, 150, 150, 150, 150],
columns: [
{ data: "selected", type: 'checkbox' },
{ data: "date", type: 'date', dateFormat: 'yy-mm-dd' },
{ data: "from" },
{ data: "to" },
{ data: "hours", type: 'numeric', format: '0.00' },
{ data: "owner" },
{ data: "project", type: 'dropdown', source: ["Hobby", "Large Development"], strict: true },
{ data: "code", type: 'dropdown', source: ["DAMCO", "MYDAMCO", "SAXO", "STUDIE"], strict: true },
{ data: "tags", type: 'dropdown', source: ["design", "development", "bug"], strict: false },
],
//cells: function(row, col, prop) {
// return {
// type : {
// renderer : function (instance, td, row, col, prop, value, cellProperties) {
// }
// }
// };
//}
});
var data = [
{ selected: true, date:'2014-01-01', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-02', from:'00:00', to:'23:00', hours:'11', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-03', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-04', from:'23:00', to:'24:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-01', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-02', from:'00:00', to:'23:00', hours:'11', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-03', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-04', from:'23:00', to:'24:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-01', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-02', from:'00:00', to:'23:00', hours:'11', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-03', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-04', from:'23:00', to:'24:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-01', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-02', from:'00:00', to:'23:00', hours:'11', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-03', from:'10:00', to:'11:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
{ selected: true, date:'2014-01-04', from:'23:00', to:'24:00', hours:'1', owner:'Troels Liebe Bentsen', project:'Hobby', code:'TEST', tags:'design'},
];
table.handsontable("loadData", data);
/*
$.ajax({
url: "/api/events",
dataType: 'json',
type: 'GET',
success: function (res) {
$("#dataTable").data("handsontable").loadData(res);
}
});
*/
</script>
@stop

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB