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

Fixed creating invoices

This commit is contained in:
Hillel Coren 2015-03-31 12:38:24 +03:00
parent 36473a0722
commit bb66ed7a96
64 changed files with 884 additions and 104 deletions

View File

@ -6,8 +6,11 @@ use Utils;
use View;
use Input;
use Cache;
use Redirect;
use DB;
use App\Models\Invoice;
use App\Models\Invitation;
use App\Models\Client;
use App\Models\Account;
use App\Models\Product;

View File

@ -7,10 +7,13 @@ use Schema;
use Session;
use Request;
use View;
use App\Models\Currency;
use DateTimeZone;
use Input;
use Log;
use DateTime;
use stdClass;
use App\Models\Currency;
class Utils
{

View File

@ -1,11 +1,14 @@
<?php namespace App\Models;
<?php namespace App\Models;
use Eloquent;
use Utils;
use Illuminate\Database\Eloquent\SoftDeletes;
class Account extends Eloquent
{
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
public function users()
{

View File

@ -1,10 +1,15 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class AccountGateway extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public function gateway()
{
return $this->belongsTo('Gateway');
return $this->belongsTo('App\Models\Gateway');
}
public function getCreditcardTypes()

View File

@ -1,7 +1,10 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class AccountGatewayToken extends Eloquent
{
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
public $timestamps = true;
}

View File

@ -1,9 +1,14 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class AccountToken extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
}

View File

@ -1,11 +1,14 @@
<?php namespace App\Models;
use Auth;
use Eloquent;
use Utils;
use Session;
use Request;
class Activity extends Eloquent
{
public $timestamps = true;
protected $softDelete = false;
public $timestamps = true;
public function scopeScope($query)
{
@ -14,7 +17,7 @@ class Activity extends Eloquent
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function user()

View File

@ -1,7 +1,12 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Client extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public static $fieldName = 'Client - Name';
public static $fieldPhone = 'Client - Phone';
public static $fieldAddress1 = 'Client - Street';
@ -14,47 +19,47 @@ class Client extends EntityModel
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function invoices()
{
return $this->hasMany('Invoice');
return $this->hasMany('App\Models\Invoice');
}
public function payments()
{
return $this->hasMany('Payment');
return $this->hasMany('App\Models\Payment');
}
public function contacts()
{
return $this->hasMany('Contact');
return $this->hasMany('App\Models\Contact');
}
public function projects()
{
return $this->hasMany('Project');
return $this->hasMany('App\Models\Project');
}
public function country()
{
return $this->belongsTo('Country');
return $this->belongsTo('App\Models\Country');
}
public function currency()
{
return $this->belongsTo('Currency');
return $this->belongsTo('App\Models\Currency');
}
public function size()
{
return $this->belongsTo('Size');
return $this->belongsTo('App\Models\Size');
}
public function industry()
{
return $this->belongsTo('Industry');
return $this->belongsTo('App\Models\Industry');
}
public function getTotalCredit()

View File

@ -1,7 +1,12 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Contact extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public static $fieldFirstName = 'Contact - First Name';
public static $fieldLastName = 'Contact - Last Name';
public static $fieldEmail = 'Contact - Email';
@ -9,7 +14,7 @@ class Contact extends EntityModel
public function client()
{
return $this->belongsTo('Client');
return $this->belongsTo('App\Models\Client');
}
public function getPersonType()

View File

@ -4,8 +4,7 @@ use Eloquent;
class Country extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
public $timestamps = false;
protected $visible = ['id', 'name'];
}

View File

@ -1,15 +1,20 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Credit extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public function invoice()
{
return $this->belongsTo('Invoice')->withTrashed();
return $this->belongsTo('App\Models\Invoice')->withTrashed();
}
public function client()
{
return $this->belongsTo('Client')->withTrashed();
return $this->belongsTo('App\Models\Client')->withTrashed();
}
public function getName()

View File

@ -5,5 +5,4 @@ use Eloquent;
class Currency extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -5,5 +5,4 @@ use Eloquent;
class DateFormat extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -5,5 +5,4 @@ use Eloquent;
class DatetimeFormat extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -6,9 +6,7 @@ use Utils;
class EntityModel extends Eloquent
{
protected $softDelete = true;
public $timestamps = true;
protected $hidden = ['id'];
public static function createNew($parent = false)

View File

@ -5,5 +5,4 @@ use Eloquent;
class Frequency extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -3,10 +3,13 @@
use Eloquent;
use Omnipay;
use Illuminate\Database\Eloquent\SoftDeletes;
class Gateway extends Eloquent
{
public $timestamps = true;
protected $softDelete = false;
use SoftDeletes;
protected $dates = ['deleted_at'];
public function paymentlibrary()
{

View File

@ -5,5 +5,4 @@ use Eloquent;
class Industry extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -1,15 +1,20 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Invitation extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public function invoice()
{
return $this->belongsTo('Invoice');
return $this->belongsTo('App\Models\Invoice');
}
public function contact()
{
return $this->belongsTo('Contact')->withTrashed();
return $this->belongsTo('App\Models\Contact')->withTrashed();
}
public function user()
@ -19,7 +24,7 @@ class Invitation extends EntityModel
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function getLink()

View File

@ -1,10 +1,15 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Invoice extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function user()
@ -14,27 +19,27 @@ class Invoice extends EntityModel
public function client()
{
return $this->belongsTo('Client')->withTrashed();
return $this->belongsTo('App\Models\Client')->withTrashed();
}
public function invoice_items()
{
return $this->hasMany('InvoiceItem')->orderBy('id');
return $this->hasMany('App\Models\InvoiceItem')->orderBy('id');
}
public function invoice_status()
{
return $this->belongsTo('InvoiceStatus');
return $this->belongsTo('App\Models\InvoiceStatus');
}
public function invoice_design()
{
return $this->belongsTo('InvoiceDesign');
return $this->belongsTo('App\Models\InvoiceDesign');
}
public function invitations()
{
return $this->hasMany('Invitation')->orderBy('invitations.contact_id');
return $this->hasMany('App\Models\Invitation')->orderBy('invitations.contact_id');
}
public function getName()

View File

@ -5,5 +5,4 @@ use Eloquent;
class InvoiceDesign extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -1,14 +1,19 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class InvoiceItem extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public function invoice()
{
return $this->belongsTo('Invoice');
return $this->belongsTo('App\Models\Invoice');
}
public function product()
{
return $this->belongsTo('Product');
return $this->belongsTo('App\Models\Product');
}
}

View File

@ -5,5 +5,4 @@ use Eloquent;
class InvoiceStatus extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -5,5 +5,4 @@ use Eloquent;
class Language extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -1,7 +1,10 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class License extends Eloquent
{
public $timestamps = true;
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
}

View File

@ -1,30 +1,35 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Payment extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public function invoice()
{
return $this->belongsTo('Invoice')->withTrashed();
return $this->belongsTo('App\Models\Invoice')->withTrashed();
}
public function invitation()
{
return $this->belongsTo('Invitation');
return $this->belongsTo('App\Models\Invitation');
}
public function client()
{
return $this->belongsTo('Client')->withTrashed();
return $this->belongsTo('App\Models\Client')->withTrashed();
}
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function contact()
{
return $this->belongsTo('Contact');
return $this->belongsTo('App\Models\Contact');
}
public function getAmount()

View File

@ -9,6 +9,6 @@ class PaymentLibrary extends Eloquent
public function gateways()
{
return $this->hasMany('Gateway', 'payment_library_id');
return $this->hasMany('App\Models\Gateway', 'payment_library_id');
}
}

View File

@ -5,5 +5,4 @@ use Eloquent;
class PaymentTerm extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -5,5 +5,4 @@ use Eloquent;
class PaymentType extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -1,7 +1,12 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Product extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
public static function findProductByKey($key)
{
return Product::scope()->where('product_key', '=', $key)->first();

View File

@ -10,7 +10,7 @@ class Project extends Eloquent
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function user()
@ -20,12 +20,12 @@ class Project extends Eloquent
public function client()
{
return $this->belongsTo('Client');
return $this->belongsTo('App\Models\Client');
}
public function codes()
{
return $this->hasMany('ProjectCode');
return $this->hasMany('App\Models\ProjectCode');
}
public static function createNew($parent = false)

View File

@ -3,14 +3,17 @@
use Auth;
use Utils;
use Illuminate\Database\Eloquent\SoftDeletes;
class ProjectCode extends Eloquent
{
public $timestamps = true;
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function user()
@ -20,12 +23,12 @@ class ProjectCode extends Eloquent
public function project()
{
return $this->belongsTo('Project');
return $this->belongsTo('App\Models\Project');
}
public function events()
{
return $this->hasMany('TimesheetEvent');
return $this->hasMany('App\Models\TimesheetEvent');
}
public static function createNew($parent = false)

View File

@ -5,5 +5,4 @@ use Eloquent;
class Size extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -1,7 +1,12 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
use Eloquent;
class Subscription extends Eloquent
{
public $timestamps = true;
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
}

View File

@ -1,5 +1,9 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class TaxRate extends EntityModel
{
use SoftDeletes;
protected $dates = ['deleted_at'];
}

View File

@ -5,5 +5,4 @@ use Eloquent;
class Theme extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -1,13 +1,16 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class Timesheet extends Eloquent
{
public $timestamps = true;
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function user()
@ -17,6 +20,6 @@ class Timesheet extends Eloquent
public function timesheet_events()
{
return $this->hasMany('TimeSheetEvent');
return $this->hasMany('App\Models\TimeSheetEvent');
}
}

View File

@ -3,10 +3,13 @@
use Auth;
use Utils;
use Illuminate\Database\Eloquent\SoftDeletes;
class TimesheetEvent extends Eloquent
{
public $timestamps = true;
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
/* protected $dates = array('org_updated_at');
@ -22,7 +25,7 @@ class TimesheetEvent extends Eloquent
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function user()
@ -32,22 +35,22 @@ class TimesheetEvent extends Eloquent
public function source()
{
return $this->belongsTo('TimesheetEventSource');
return $this->belongsTo('App\Models\TimesheetEventSource');
}
public function timesheet()
{
return $this->belongsTo('Timesheet');
return $this->belongsTo('App\Models\Timesheet');
}
public function project()
{
return $this->belongsTo('Project');
return $this->belongsTo('App\Models\Project');
}
public function project_code()
{
return $this->belongsTo('ProjectCode');
return $this->belongsTo('App\Models\ProjectCode');
}
/**

View File

@ -3,14 +3,17 @@
use Auth;
use Utils;
use Illuminate\Database\Eloquent\SoftDeletes;
class TimesheetEventSource extends Eloquent
{
public $timestamps = true;
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
public function account()
{
return $this->belongsTo('Account');
return $this->belongsTo('App\Models\Account');
}
public function user()
@ -20,7 +23,7 @@ class TimesheetEventSource extends Eloquent
public function events()
{
return $this->hasMany('TimesheetEvent');
return $this->hasMany('App\Models\TimesheetEvent');
}
public static function createNew($parent = false)

View File

@ -5,5 +5,4 @@ use Eloquent;
class Timezone extends Eloquent
{
public $timestamps = false;
protected $softDelete = false;
}

View File

@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\SoftDeletes;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
@ -34,8 +35,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*/
protected $hidden = ['password', 'remember_token'];
protected $softDelete = true;
use SoftDeletes;
protected $dates = ['deleted_at'];
public function account()
{

View File

@ -1,15 +1,15 @@
<?php namespace App\Ninja\Repositories;
use AccountGateway;
use Auth;
use Invitation;
use Invoice;
use InvoiceItem;
use Language;
use Request;
use Session;
use Utils;
use App\Models\AccountGateway;
use App\Models\Invitation;
use App\Models\Invoice;
use App\Models\InvoiceItem;
use App\Models\Client;
use App\Models\Contact;
use App\Models\Account;

View File

@ -1,7 +1,8 @@
<?php namespace App\Ninja\Repositories;
use Client;
use Contact;
use App\Models\Client;
use App\Models\Contact;
use App\Models\Activity;
class ClientRepository
{

View File

@ -1,7 +1,7 @@
<?php namespace App\Ninja\Repositories;
use Credit;
use Client;
use App\Models\Credit;
use App\Models\Client;
use Utils;
class CreditRepository

View File

@ -1,9 +1,9 @@
<?php namespace App\Ninja\Repositories;
use Invoice;
use InvoiceItem;
use Invitation;
use Product;
use App\Models\Invoice;
use App\Models\InvoiceItem;
use App\Models\Invitation;
use App\Models\Product;
use Utils;
class InvoiceRepository

View File

@ -1,9 +1,9 @@
<?php namespace App\Ninja\Repositories;
use Payment;
use Credit;
use Invoice;
use Client;
use App\Models\Payment;
use App\Models\Credit;
use App\Models\Invoice;
use App\Models\Client;
use Utils;
class PaymentRepository

View File

@ -1,6 +1,6 @@
<?php namespace App\Ninja\Repositories;
use TaxRate;
use App\Models\TaxRate;
use Utils;
class TaxRateRepository

10
config/bootstrapper.php Normal file
View File

@ -0,0 +1,10 @@
<?php
/**
* Default config values
*/
return [
'bootstrapVersion' => '3.3.0',
'jqueryVersion' => '2.1.0',
'icon_prefix' => 'glyphicon'
];

View File

@ -0,0 +1,149 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Table specific configuration options.
|--------------------------------------------------------------------------
|
*/
'table' => array(
/*
|--------------------------------------------------------------------------
| Table class
|--------------------------------------------------------------------------
|
| Class(es) added to the table
| Supported: string
|
*/
'class' => 'table table-bordered',
/*
|--------------------------------------------------------------------------
| Table ID
|--------------------------------------------------------------------------
|
| ID given to the table. Used for connecting the table and the Datatables
| jQuery plugin. If left empty a random ID will be generated.
| Supported: string
|
*/
'id' => '',
/*
|--------------------------------------------------------------------------
| DataTable options
|--------------------------------------------------------------------------
|
| jQuery dataTable plugin options. The array will be json_encoded and
| passed through to the plugin. See https://datatables.net/usage/options
| for more information.
| Supported: array
|
*/
'options' => array(
"sPaginationType" => "full_numbers",
"bProcessing" => false
),
/*
|--------------------------------------------------------------------------
| DataTable callbacks
|--------------------------------------------------------------------------
|
| jQuery dataTable plugin callbacks. The array will be json_encoded and
| passed through to the plugin. See https://datatables.net/usage/callbacks
| for more information.
| Supported: array
|
*/
'callbacks' => array(),
/*
|--------------------------------------------------------------------------
| Skip javascript in table template
|--------------------------------------------------------------------------
|
| Determines if the template should echo the javascript
| Supported: boolean
|
*/
'noScript' => false,
/*
|--------------------------------------------------------------------------
| Table view
|--------------------------------------------------------------------------
|
| Template used to render the table
| Supported: string
|
*/
'table_view' => 'chumper.datatable::template',
/*
|--------------------------------------------------------------------------
| Script view
|--------------------------------------------------------------------------
|
| Template used to render the javascript
| Supported: string
|
*/
'script_view' => 'chumper.datatable::javascript',
/*
|--------------------------------------------------------------------------
| Option view
|--------------------------------------------------------------------------
|
| Template used to render the options recursive
|
*/
'options_view' => config('chumper.datatable::options')
),
/*
|--------------------------------------------------------------------------
| Engine specific configuration options.
|--------------------------------------------------------------------------
|
*/
'engine' => array(
/*
|--------------------------------------------------------------------------
| Search for exact words
|--------------------------------------------------------------------------
|
| If the search should be done with exact matching
| Supported: boolean
|
*/
'exactWordSearch' => false,
)
);

16
config/countries.php Normal file
View File

@ -0,0 +1,16 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Database settings
|--------------------------------------------------------------------------
|
| The name of the table to create in the database
|
*/
'table_name' => 'countries',
);

157
config/debugbar.php Normal file
View File

@ -0,0 +1,157 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Debugbar Settings
|--------------------------------------------------------------------------
|
| Debugbar is enabled by default, when debug is set to true in app.php.
| You can override the value by setting enable to true or false instead of null.
|
*/
'enabled' => null,
/*
|--------------------------------------------------------------------------
| Storage settings
|--------------------------------------------------------------------------
|
| DebugBar stores data for session/ajax requests.
| You can disable this, so the debugbar stores data in headers/session,
| but this can cause problems with large data collectors.
| By default, file storage (in the storage folder) is used. Redis and PDO
| can also be used. For PDO, run the package migrations first.
|
*/
'storage' => array(
'enabled' => true,
'driver' => 'file', // redis, file, pdo
'path' => storage_path() . '/debugbar', // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO)
),
/*
|--------------------------------------------------------------------------
| Vendors
|--------------------------------------------------------------------------
|
| Vendor files are included by default, but can be set to false.
| This can also be set to 'js' or 'css', to only include javascript or css vendor files.
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
| and for js: jquery and and highlight.js
| So if you want syntax highlighting, set it to true.
| jQuery is set to not conflict with existing jQuery scripts.
|
*/
'include_vendors' => true,
/*
|--------------------------------------------------------------------------
| Capture Ajax Requests
|--------------------------------------------------------------------------
|
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
| you can use this option to disable sending the data through the headers.
|
*/
'capture_ajax' => true,
/*
|--------------------------------------------------------------------------
| DataCollectors
|--------------------------------------------------------------------------
|
| Enable/disable DataCollectors
|
*/
'collectors' => array(
'phpinfo' => true, // Php version
'messages' => true, // Messages
'time' => true, // Time Datalogger
'memory' => true, // Memory usage
'exceptions' => true, // Exception displayer
'log' => true, // Logs from Monolog (merged in messages if enabled)
'db' => true, // Show database (PDO) queries and bindings
'views' => true, // Views with their data
'route' => true, // Current route information
'laravel' => false, // Laravel version and environment
'events' => false, // All events fired
'default_request' => false, // Regular or special Symfony request logger
'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages
'logs' => false, // Add the latest log messages
'files' => false, // Show the included files
'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status
'session' => false, // Display session data in a separate tab
),
/*
|--------------------------------------------------------------------------
| Extra options
|--------------------------------------------------------------------------
|
| Configure some DataCollectors
|
*/
'options' => array(
'auth' => array(
'show_name' => false, // Also show the users name/email in the debugbar
),
'db' => array(
'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
'explain' => array( // EXPERIMENTAL: Show EXPLAIN output on queries
'enabled' => false,
'types' => array('SELECT'), // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
),
'hints' => true, // Show hints for common mistakes
),
'mail' => array(
'full_log' => false
),
'views' => array(
'data' => false, //Note: Can slow down the application, because the data can be quite large..
),
'route' => array(
'label' => true // show complete route on bar
),
'logs' => array(
'file' => null
),
),
/*
|--------------------------------------------------------------------------
| Inject Debugbar in Response
|--------------------------------------------------------------------------
|
| Usually, the debugbar is added just before <body>, by listening to the
| Response after the App is done. If you disable this, you have to add them
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
*/
'inject' => true,
/*
|--------------------------------------------------------------------------
| DebugBar route prefix
|--------------------------------------------------------------------------
|
| Sometimes you want to set route prefix to be used by DebugBar to load
| its resources from. Usually the need comes from misconfigured web server or
| from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
|
*/
'route_prefix' => '_debugbar',
);

66
config/former.php Normal file
View File

@ -0,0 +1,66 @@
<?php return array(
// Markup
////////////////////////////////////////////////////////////////////
// Whether labels should be automatically computed from name
'automatic_label' => true,
// The default form type
'default_form_type' => 'horizontal',
// The framework to be used by Former
'framework' => 'TwitterBootstrap3',
// Validation
////////////////////////////////////////////////////////////////////
// Whether Former should fetch errors from Session
'fetch_errors' => true,
// Whether Former should try to apply Validator rules as attributes
'live_validation' => true,
// Whether Former should automatically fetch error messages and
// display them next to the matching fields
'error_messages' => true,
// Checkables
////////////////////////////////////////////////////////////////////
// Whether checkboxes should always be present in the POST data,
// no matter if you checked them or not
'push_checkboxes' => false,
// The value a checkbox will have in the POST array if unchecked
'unchecked_value' => 0,
// Required fields
////////////////////////////////////////////////////////////////////
// The class to be added to required fields
'required_class' => 'required',
// A facultative text to append to the labels of required fields
'required_text' => '<sup>*</sup>',
// Translations
////////////////////////////////////////////////////////////////////
// Where Former should look for translations
'translate_from' => 'validation.attributes',
// Whether text that comes out of the translated
// should be capitalized (ex: email => Email) automatically
'capitalize_translations' => true,
// An array of attributes to automatically translate
'translatable' => array(
'help',
'inlineHelp',
'blockHelp',
'placeholder',
'data_placeholder',
'label',
),
);

14
config/former/Nude.php Normal file
View File

@ -0,0 +1,14 @@
<?php
return array(
// HTML markup and classes used by the "Nude" framework for icons
'icon' => array(
'tag' => 'i',
'set' => null,
'prefix' => 'icon',
),
);

View File

@ -0,0 +1,14 @@
<?php
return array(
// HTML markup and classes used by Bootstrap for icons
'icon' => array(
'tag' => 'i',
'set' => null,
'prefix' => 'icon',
),
);

View File

@ -0,0 +1,26 @@
<?php
return array(
// Map Former-supported viewports to Bootstrap 3 equivalents
'viewports' => array(
'large' => 'lg',
'medium' => 'md',
'small' => 'sm',
'mini' => 'xs',
),
// Width of labels for horizontal forms expressed as viewport => grid columns
'labelWidths' => array(
'large' => 4,
'small' => 4,
),
// HTML markup and classes used by Bootstrap 3 for icons
'icon' => array(
'tag' => 'span',
'set' => 'glyphicon',
'prefix' => 'glyphicon',
),
);

View File

@ -0,0 +1,35 @@
<?php
return array(
// Map Former-supported viewports to Foundation 3 equivalents
'viewports' => array(
'large' => '',
'medium' => null,
'small' => 'mobile-',
'mini' => null,
),
// Width of labels for horizontal forms expressed as viewport => grid columns
'labelWidths' => array(
'large' => 2,
'small' => 4,
),
// Classes to be applied to wrapped labels in horizontal forms
'wrappedLabelClasses' => array('right','inline'),
// HTML markup and classes used by Foundation 3 for icons
'icon' => array(
'tag' => 'i',
'set' => null,
'prefix' => 'fi',
),
);

View File

@ -0,0 +1,36 @@
<?php
return array(
// Map Former-supported viewports to Foundation 4 equivalents
// Foundation 4 also has an experimental "medium" breakpoint
// explained at http://foundation.zurb.com/docs/components/grid.html
'viewports' => array(
'large' => 'large',
'medium' => null,
'small' => 'small',
'mini' => null,
),
// Width of labels for horizontal forms expressed as viewport => grid columns
'labelWidths' => array(
'small' => 3,
),
// Classes to be applied to wrapped labels in horizontal forms
'wrappedLabelClasses' => array('right','inline'),
// HTML markup and classes used by Foundation 4 for icons
'icon' => array(
'tag' => 'i',
'set' => 'general',
'prefix' => 'foundicon',
),
);

89
config/ide-helper.php Normal file
View File

@ -0,0 +1,89 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Filename & Format
|--------------------------------------------------------------------------
|
| The default filename (without extension) and the format (php or json)
|
*/
'filename' => '_ide_helper',
'format' => 'php',
/*
|--------------------------------------------------------------------------
| Helper files to include
|--------------------------------------------------------------------------
|
| Include helper files. By default not included, but can be toggled with the
| -- helpers (-H) option. Extra helper files can be included.
|
*/
'include_helpers' => false,
'helper_files' => array(
base_path().'/vendor/laravel/framework/src/Illuminate/Support/helpers.php',
),
/*
|--------------------------------------------------------------------------
| Model locations to include
|--------------------------------------------------------------------------
|
| Define in which directories the ide-helper:models command should look
| for models.
|
*/
'model_locations' => array(
'app',
),
/*
|--------------------------------------------------------------------------
| Extra classes
|--------------------------------------------------------------------------
|
| These implementations are not really extended, but called with magic functions
|
*/
'extra' => array(
'Eloquent' => array('Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'),
'Session' => array('Illuminate\Session\Store'),
),
'magic' => array(
'Log' => array(
'debug' => 'Monolog\Logger::addDebug',
'info' => 'Monolog\Logger::addInfo',
'notice' => 'Monolog\Logger::addNotice',
'warning' => 'Monolog\Logger::addWarning',
'error' => 'Monolog\Logger::addError',
'critical' => 'Monolog\Logger::addCritical',
'alert' => 'Monolog\Logger::addAlert',
'emergency' => 'Monolog\Logger::addEmergency',
)
),
/*
|--------------------------------------------------------------------------
| Interface implementations
|--------------------------------------------------------------------------
|
| These interfaces will be replaced with the implementing class. Some interfaces
| are detected by the helpers, others can be listed below.
|
*/
'interfaces' => array(
'\Illuminate\Contracts\Auth\Authenticatable' => config('auth.model', 'App\User'),
)
);

20
config/image.php Normal file
View File

@ -0,0 +1,20 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
|
| Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => 'gd'
);

View File

@ -57,9 +57,9 @@
<div class="navbar-form navbar-right">
@if (Auth::check())
@if (!Auth::user()->registered)
{!! Button::success(trans('texts.sign_up'), array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal')) !!} &nbsp;
{!! Button::success(trans('texts.sign_up'), array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal'))->small() !!} &nbsp;
@elseif (!Auth::user()->isPro())
{!! Button::success(trans('texts.go_pro'), array('id' => 'proPlanButton', 'data-toggle'=>'modal', 'data-target'=>'#proPlanModal')) !!} &nbsp;
{!! Button::success(trans('texts.go_pro'), array('id' => 'proPlanButton', 'data-toggle'=>'modal', 'data-target'=>'#proPlanModal'))->small() !!} &nbsp;
@endif
@endif

View File

@ -11,7 +11,7 @@
@if ($invoice && $invoice->id)
<ol class="breadcrumb">
<li>{{ link_to(($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'), trans('texts.' . ($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'))) }}</li>
<li>{!! link_to(($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'), trans('texts.' . ($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'))) !!}</li>
<li class='active'>{{ $invoice->invoice_number }}</li>
</ol>
@endif
@ -513,7 +513,7 @@
</div>
<div style="background-color: #fff; padding-left: 16px; padding-right: 16px">
&nbsp; {{ isset($recurringHelp) ? $recurringHelp : '' }} &nbsp;
&nbsp; {!! isset($recurringHelp) ? $recurringHelp : '' !!} &nbsp;
</div>
<div class="modal-footer" style="margin-top: 0px">
@ -1602,8 +1602,8 @@
}
}
var products = {{ $products }};
var clients = {{ $clients }};
var products = {!! $products !!};
var clients = {!! $clients !!};
var clientMap = {};
var $clientSelect = $('select#client');
@ -1630,12 +1630,12 @@
model.addTaxRate({{ $taxRate }});
@endforeach
@if ($invoice)
var invoice = {{ $invoice }};
var invoice = {!! $invoice !!};
ko.mapping.fromJS(invoice, model.invoice().mapping, model.invoice);
if (model.invoice().is_recurring() === '0') {
model.invoice().is_recurring(false);
}
var invitationContactIds = {{ json_encode($invitationContactIds) }};
var invitationContactIds = {!! json_encode($invitationContactIds) !!};
var client = clientMap[invoice.client.public_id];
if (client) { // in case it's deleted
for (var i=0; i<client.contacts.length; i++) {

View File

@ -0,0 +1,23 @@
<script type="text/javascript">
jQuery(document).ready(function(){
// dynamic table
oTable = jQuery('#{!! $id !!}').dataTable({
@if ($first = true)
@foreach ( $options as $k => $o )@if ( $first == false ),@endif
@if (($first = false) == false &&!is_numeric($k)){!! json_encode($k); $obj_parent = true !!}:@endif
@if ( is_string($o))
@if ( @preg_match("#^\s*function\s*\([^\)]*#", $o))
{!! $o !!}@else
{!! json_encode($o) !!}@endif
@else
@if (is_array($o) && ($obj = false) == false)@include(Config::get('chumper.datatable.table.options_view'), array('options' => $o))@else
{!! json_encode($o) !!}@endif
@endif
@endforeach
@endif
@if ( $first == false ),@endif
@foreach ($callbacks as $k => $o) {!! json_encode($k) !!}: {!! $o !!}
@endforeach
});
});
</script>

View File

@ -0,0 +1,20 @@
@if ($first = true && ($is_obj = false ) == false)
@foreach ( $options as $k => $o )@if ( $first == false ),@endif
@if ($first == true && ($first = false) == false)
@if(!is_numeric($k))
{!! '{'; $is_obj = true; !!}
@else [@endif
@endif
@if (!is_numeric($k)){!! json_encode($k); $obj_parent = true !!}:@endif
@if ( is_string($o))
@if ( @preg_match("#^\s*function\s*\([^\)]*#", $o))
{!! $o !!}@else
{!! json_encode($o) !!}@endif
@else
@if (is_array($o) && ($obj = false) == false)@include(Config::get('chumper.datatable.table.options_view'), array('options' => $o))@else
{!! json_encode($o) !!}@endif
@endif
@endforeach
@if($is_obj)
}@else]@endif
@endif

View File

@ -0,0 +1,27 @@
<table id="{!! $id !!}" class="{!! $class !!}">
<colgroup>
@for ($i = 0; $i < count($columns); $i++)
<col class="con{!! $i !!}" />
@endfor
</colgroup>
<thead>
<tr>
@foreach($columns as $i => $c)
<th align="center" valign="middle" class="head{!! $i !!}">{!! $c !!}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach($data as $d)
<tr>
@foreach($d as $dd)
<td>{!! $dd !!}</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
@if (!$noScript)
@include(Config::get('chumper.datatable.table.script_view'), array('id' => $id, 'options' => $options, 'callbacks' => $callbacks))
@endif