From 2b4245a64f2639ad2dea56ebfc48bb17b81792e1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 17 Dec 2013 15:14:47 +0200 Subject: [PATCH] bug fixes --- LICENSE | 0 README.md | 2 +- app/libraries/entity.php | 0 app/models/Invitation.php | 0 app/routes.php | 3 +++ app/views/invoices/edit.blade.php | 31 +++++++++++++++-------- app/views/reports/monthly.blade.php | 39 ----------------------------- 7 files changed, 25 insertions(+), 50 deletions(-) mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.md mode change 100755 => 100644 app/libraries/entity.php mode change 100755 => 100644 app/models/Invitation.php delete mode 100755 app/views/reports/monthly.blade.php diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 27e2abf1b5..0e2e66b4f6 --- a/README.md +++ b/README.md @@ -56,5 +56,5 @@ Configure config/database.php and then initialize the database * [webpatser/laravel-countries](https://github.com/webpatser/laravel-countries) - Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries * [briannesbitt/Carbon](https://github.com/briannesbitt/Carbon) - A simple API extension for DateTime with PHP 5.3+ * [thomaspark/bootswatch](https://github.com/thomaspark/bootswatch) - Themes for Bootstrap -* [mozilla/pdf.js)](https://github.com/mozilla/pdf.js) - PDF Reader in JavaScript +* [mozilla/pdf.js](https://github.com/mozilla/pdf.js) - PDF Reader in JavaScript * [nnnick/Chart.js](https://github.com/nnnick/Chart.js) - Simple HTML5 Charts using the tag \ No newline at end of file diff --git a/app/libraries/entity.php b/app/libraries/entity.php old mode 100755 new mode 100644 diff --git a/app/models/Invitation.php b/app/models/Invitation.php old mode 100755 new mode 100644 diff --git a/app/routes.php b/app/routes.php index e4e8a383c3..d401b701b6 100755 --- a/app/routes.php +++ b/app/routes.php @@ -16,6 +16,9 @@ //dd(new DateTime()); //Event::fire('user.signup'); +include(app_path().'/libraries/utils.php'); // TODO_FIX +include(app_path().'/handlers/UserEventHandler.php'); // TODO_FIX + Route::get('/send_emails', function() { Artisan::call('ninja:send-invoices'); }); diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 88ec23d579..81232fba22 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -279,11 +279,10 @@ $input.combobox(); $('.client_select input.form-control').on('change', function(e) { var clientId = parseInt($('input[name=client]').val(), 10); - //$('#modalLink').text(clientId ? 'Edit client details' : 'Create new client'); - if (clientId > 0) { - ko.mapping.fromJS(clientMap[clientId], model.client.mapping, model.client); + if (clientId > 0) { + model.loadClient(clientMap[clientId]); } else { - model.client.public_id(0); + model.client.public_id(0); // TODO_FIX } }).trigger('change'); @@ -293,14 +292,18 @@ //$('[name="client_combobox"]').focus(); @endif - /* $('#myModal').on('hidden.bs.modal', function () { - $('#popup_client_name').val(''); + if (model.clientBackup) { + console.log("Loading backup"); + //console.log(model.clientBackup); + model.loadClient(model.clientBackup); + refreshPDF(); + } }) - */ + $('#myModal').on('shown.bs.modal', function () { - $('#name').focus(); + $('#name').focus(); }) $('#actionDropDown > button:first').click(function() { @@ -311,7 +314,7 @@ applyComboboxListeners(); refreshPDF(); - }); + }); function applyComboboxListeners() { var value; @@ -457,6 +460,11 @@ } } + self.loadClient = function(client) { + //console.log(client); + ko.mapping.fromJS(client, model.client.mapping, model.client); + } + self.wrapped_terms = ko.computed({ read: function() { return this.terms(); @@ -474,6 +482,9 @@ }); self.showClientForm = function() { + self.clientBackup = ko.mapping.toJS(self.client); + console.log(self.clientBackup); + if (self.client.public_id() == 0) { $('#myModal input').val(''); $('#myModal #country_id').val(''); @@ -501,7 +512,7 @@ $('.client_select input.form-control').focus(); refreshPDF(); - + model.clientBackup = false; $('#myModal').modal('hide'); } diff --git a/app/views/reports/monthly.blade.php b/app/views/reports/monthly.blade.php deleted file mode 100755 index fdb6948da6..0000000000 --- a/app/views/reports/monthly.blade.php +++ /dev/null @@ -1,39 +0,0 @@ -@extends('header') - -@section('head') - @parent - - -@stop - -@section('content') - -
- -
- - - -@stop \ No newline at end of file