1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Merge branch 'master' of github.com:hillelcoren/invoice-ninja

n, warum dieser
This commit is contained in:
Christian González 2015-10-05 14:50:30 +02:00
commit c14527e3f5
13 changed files with 70 additions and 26 deletions

View File

@ -20,4 +20,6 @@ MAIL_FROM_ADDRESS
MAIL_FROM_NAME
MAIL_PASSWORD
PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address'
PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address'
LOG=single

View File

@ -97,7 +97,11 @@ class AccountGatewayController extends BaseController
$data['url'] = 'gateways';
$data['method'] = 'POST';
$data['title'] = trans('texts.add_gateway');
$data['selectGateways'] = Gateway::where('payment_library_id', '=', 1)->where('id', '!=', GATEWAY_PAYPAL_EXPRESS)->where('id', '!=', GATEWAY_PAYPAL_EXPRESS)->orderBy('name')->get();
$data['selectGateways'] = Gateway::where('payment_library_id', '=', 1)
->where('id', '!=', GATEWAY_PAYPAL_EXPRESS)
->where('id', '!=', GATEWAY_BITPAY)
->where('id', '!=', GATEWAY_DWOLLA)
->orderBy('name')->get();
$data['hiddenFields'] = Gateway::$hiddenFields;
return View::make('accounts.account_gateway', $data);

View File

@ -13,10 +13,11 @@ class IntegrationController extends Controller
$eventId = Utils::lookupEventId(trim(Input::get('event')));
if (!$eventId) {
return Response::json('', 500);
return Response::json('Event is invalid', 500);
}
$subscription = Subscription::where('account_id', '=', Auth::user()->account_id)->where('event_id', '=', $eventId)->first();
$subscription = Subscription::where('account_id', '=', Auth::user()->account_id)
->where('event_id', '=', $eventId)->first();
if (!$subscription) {
$subscription = new Subscription();
@ -27,6 +28,10 @@ class IntegrationController extends Controller
$subscription->target_url = trim(Input::get('target_url'));
$subscription->save();
if (!$subscription->id) {
return Response::json('Failed to create subscription', 500);
}
return Response::json('{"id":'.$subscription->id.'}', 201);
}
}

View File

@ -368,7 +368,8 @@ class PaymentController extends BaseController
'message' => $affiliate->payment_subtitle,
'license' => $licenseKey,
'hideHeader' => true,
'productId' => $license->product_id
'productId' => $license->product_id,
'price' => $affiliate->price,
];
$name = "{$license->first_name} {$license->last_name}";

View File

@ -599,9 +599,8 @@ class Utils
public static function notifyZapier($subscription, $data)
{
$curl = curl_init();
$jsonEncodedData = json_encode($data->toPublicArray());
$opts = [
CURLOPT_URL => $subscription->target_url,
CURLOPT_RETURNTRANSFER => true,
@ -635,14 +634,23 @@ class Utils
return $return;
}
public static function hideIds($data)
public static function hideIds($data, $mapped = false)
{
$publicId = null;
if (!$mapped) {
$mapped = [];
}
foreach ($data as $key => $val) {
if (is_array($val)) {
$data[$key] = Utils::hideIds($val);
} else if ($key == 'id' || strpos($key, '_id')) {
if ($key == 'account' || isset($mapped[$key])) {
unset($data[$key]);
} else {
$mapped[$key] = true;
$data[$key] = Utils::hideIds($val, $mapped);
}
} elseif ($key == 'id' || strpos($key, '_id')) {
if ($key == 'public_id') {
$publicId = $val;
}

View File

@ -13,6 +13,7 @@ class Account extends Eloquent
{
use SoftDeletes;
protected $dates = ['deleted_at'];
protected $hidden = ['ip'];
/*
protected $casts = [

View File

@ -97,7 +97,7 @@ return [
|
*/
'log' => 'single',
'log' => env('LOG', 'single'),
/*
|--------------------------------------------------------------------------

View File

@ -24,7 +24,6 @@ class AddZapierSupport extends Migration {
$table->string('target_url');
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
$table->unique( ['account_id', 'event_id'] );
});
}

View File

@ -265,10 +265,10 @@ return array(
'user_email_footer' => 'Um deine E-Mail-Benachrichtigungen anzupassen besuche bitte '.SITE_URL.'/company/notifications',
'invoice_link_message' => 'Um deine Kundenrechnung anzuschauen, klicke auf den folgenden Link:',
'notification_invoice_paid_subject' => 'Die Rechnung :invoice wurde von :client bezahlt.',
'notification_invoice_sent_subject' => 'Die Rechnung :invoice wurde an :client versandt.',
'notification_invoice_sent_subject' => 'Die Rechnung :invoice wurde an :client versendet.',
'notification_invoice_viewed_subject' => 'Die Rechnung :invoice wurde von :client angeschaut.',
'notification_invoice_paid' => 'Eine Zahlung von :amount wurde von :client bezüglich Rechnung :invoice getätigt.',
'notification_invoice_sent' => 'Dem Kunden :client wurde die Rechnung :invoice über :amount versandt.',
'notification_invoice_sent' => 'Dem Kunden :client wurde die Rechnung :invoice über :amount versendet.',
'notification_invoice_viewed' => 'Der Kunde :client hat sich die Rechnung :invoice über :amount angesehen.',
'reset_password' => 'Du kannst dein Passwort zurücksetzen, indem du auf den folgenden Link klickst:',
'reset_password_footer' => 'Wenn du das Zurücksetzen des Passworts nicht beantragt hast, benachrichtige bitte unseren Support: ' . CONTACT_EMAIL,
@ -348,7 +348,7 @@ return array(
'advanced_settings' => 'Erweiterte Einstellungen',
'pro_plan_advanced_settings' => ':link um durch eine Pro-Mitgliedschaft erweiterte Einstellungen zu aktivieren',
'invoice_design' => 'Rechnungsvorlage',
'invoice_design' => 'Rechnungsdesign',
'specify_colors' => 'Farben wählen',
'specify_colors_label' => 'Wähle die in der Rechnung verwendeten Farben',
@ -452,14 +452,14 @@ return array(
'gateway_help_23' => 'Anmerkung: benutze deinen secret API key, nicht deinen publishable API key.',
'gateway_help_27' => ':link um sich bei TwoCheckout anzumelden.',
'more_designs' => 'Weitere Vorlagen',
'more_designs_title' => 'Zusätzliche Rechnungsvorlagen',
'more_designs_cloud_header' => 'Werde Pro-Mitglied für zusätzliche Rechnungsvorlagen',
'more_designs' => 'Weitere Designs',
'more_designs_title' => 'Zusätzliche Rechnungsdesigns',
'more_designs_cloud_header' => 'Werde Pro-Mitglied für zusätzliche Rechnungsdesigns',
'more_designs_cloud_text' => '',
'more_designs_self_host_header' => 'Erhalte 6 zusätzliche Rechnungsvorlagen für nur $'.INVOICE_DESIGNS_PRICE,
'more_designs_self_host_header' => 'Erhalte 6 zusätzliche Rechnungsdesigns für nur $'.INVOICE_DESIGNS_PRICE,
'more_designs_self_host_text' => '',
'buy' => 'Kaufen',
'bought_designs' => 'Die zusätzliche Rechnungsvorlagen wurden erfolgreich hinzugefügt',
'bought_designs' => 'Die zusätzliche Rechnungsdesigns wurden erfolgreich hinzugefügt',
'sent' => 'gesendet',
'vat_number' => 'USt-IdNr.',
@ -761,7 +761,7 @@ return array(
'reset_footer' => 'Reset footer',
'invoices_sent' => ':count invoice sent|:count invoices sent',
'status_draft' => 'Entwurf',
'status_sent' => 'Versandt',
'status_sent' => 'Versendet',
'status_viewed' => 'Angesehen',
'status_partial' => 'Teilweise',
'status_paid' => 'Bezahlt',
@ -789,7 +789,7 @@ return array(
'referral_program' => 'Referral Program',
'referral_code' => 'Referral Code',
'last_sent_on' => 'Zuletzt versandt am :date',
'last_sent_on' => 'Zuletzt versendet am :date',
'page_expire' => 'Diese Seite wird bald ablaufen, :click_here um weiter zu arbeiten',

View File

@ -123,6 +123,7 @@
success: function(result) {
if (result) {
localStorage.setItem('guest_key', '');
fbq('track', 'CompleteRegistration');
trackEvent('/account', '/signed_up');
NINJA.isRegistered = true;
$('#signUpButton').hide();
@ -164,6 +165,7 @@
NINJA.proPlanFeature = '';
function showProPlan(feature) {
$('#proPlanModal').modal('show');
fbq('track', 'InitiateCheckout');
trackEvent('/account', '/show_pro_plan/' + feature);
NINJA.proPlanFeature = feature;
}
@ -178,6 +180,7 @@
@if (Auth::check() && !Auth::user()->isPro())
function submitProPlan() {
fbq('track', 'AddPaymentInfo');
trackEvent('/account', '/submit_pro_plan/' + NINJA.proPlanFeature);
if (NINJA.isRegistered) {
$.ajax({

View File

@ -1171,12 +1171,16 @@
self.is_amount_discount = ko.observable(0);
self.frequency_id = ko.observable(4); // default to monthly
self.terms = ko.observable('');
self.default_terms = ko.observable("{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_terms)) }}");
self.terms_placeholder = ko.observable({{ !$invoice && $account->invoice_terms ? 'true' : 'false' }} ? self.default_terms() : '');
//self.default_terms = ko.observable("{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_terms)) }}");
//self.terms_placeholder = ko.observable({{ !$invoice && $account->invoice_terms ? 'true' : 'false' }} ? self.default_terms() : '');
self.default_terms = ko.observable(account.invoice_terms);
self.terms_placeholder = ko.observable({{ !$invoice && $account->invoice_terms ? 'account.invoice_terms' : false}});
self.set_default_terms = ko.observable(false);
self.invoice_footer = ko.observable('');
self.default_footer = ko.observable("{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_footer)) }}");
self.footer_placeholder = ko.observable({{ !$invoice && $account->invoice_footer ? 'true' : 'false' }} ? self.default_footer() : '');
//self.default_footer = ko.observable("{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_footer)) }}");
//self.footer_placeholder = ko.observable({{ !$invoice && $account->invoice_footer ? 'true' : 'false' }} ? self.default_footer() : '');
self.default_footer = ko.observable(account.invoice_footer);
self.footer_placeholder = ko.observable({{ !$invoice && $account->invoice_footer ? 'account.invoice_footer' : false}});
self.set_default_footer = ko.observable(false);
self.public_notes = ko.observable('');
self.po_number = ko.observable('');
@ -1813,6 +1817,7 @@
var products = {!! $products !!};
var clients = {!! $clients !!};
var countries = {!! $countries !!};
var account = {!! Auth::user()->account !!};
var clientMap = {};
var $clientSelect = $('select#client');

View File

@ -63,6 +63,21 @@
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{ env('FACEBOOK_PIXEL') }}');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=770151509796760&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>

View File

@ -112,6 +112,7 @@ header h3 em {
<script type="text/javascript">
$(function() {
fbq('track', 'Purchase', {value: '{{ $price }}', currency: 'USD'});
trackEvent('/license', '/product_{{ $productId }}');
@if (isset($redirectTo))