mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Module relationships (#2556)
* Fix for wrong contact being deleted * dynamically load module relationships
This commit is contained in:
parent
95f1d24b8f
commit
f9ea784d63
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'client' => [
|
||||
'notes' => function ($self) {
|
||||
return $self->hasMany('Modules\Notes\Entities\Note');
|
||||
}
|
||||
],
|
||||
];
|
||||
'client' => [
|
||||
'notes' => ["hasMany", ['Modules\Notes\Entities\Note']]
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -25,5 +25,5 @@ class Note extends Model
|
||||
{
|
||||
return $this->hasMany(Note::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ class NotesServiceProvider extends ServiceProvider
|
||||
$this->registerViews();
|
||||
$this->registerFactories();
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@ class BaseModel extends Model
|
||||
if (config()->has($configPath)) {
|
||||
$function = config()->get($configPath);
|
||||
|
||||
return $function($this);
|
||||
return call_user_func_array(array($this, $function[0]), $function[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
15256
public/js/client_create.js
vendored
15256
public/js/client_create.js
vendored
File diff suppressed because one or more lines are too long
15256
public/js/client_create.min.js
vendored
15256
public/js/client_create.min.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/client_edit.js
vendored
2
public/js/client_edit.js
vendored
@ -22032,7 +22032,7 @@ var render = function() {
|
||||
attrs: { type: "button" },
|
||||
on: {
|
||||
click: function($event) {
|
||||
_vm.$emit("remove", _vm.contact.id)
|
||||
_vm.$emit("remove", _vm.contact)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
2
public/js/client_edit.min.js
vendored
2
public/js/client_edit.min.js
vendored
@ -22032,7 +22032,7 @@ var render = function() {
|
||||
attrs: { type: "button" },
|
||||
on: {
|
||||
click: function($event) {
|
||||
_vm.$emit("remove", _vm.contact.id)
|
||||
_vm.$emit("remove", _vm.contact)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
12588
public/js/coreui.js
vendored
12588
public/js/coreui.js
vendored
File diff suppressed because one or more lines are too long
12588
public/js/coreui.min.js
vendored
12588
public/js/coreui.min.js
vendored
File diff suppressed because one or more lines are too long
11560
public/js/localization.js
vendored
11560
public/js/localization.js
vendored
File diff suppressed because one or more lines are too long
11560
public/js/localization.min.js
vendored
11560
public/js/localization.min.js
vendored
File diff suppressed because one or more lines are too long
83
public/js/ninja.js
vendored
83
public/js/ninja.js
vendored
@ -1,83 +0,0 @@
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 4);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/app.js":
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
throw new Error("Module build failed: Error: ENOENT: no such file or directory, open '/Users/davidbomba/Development/invoice-ninja/resources/js/app.js'");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__("./resources/js/app.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
83
public/js/ninja.min.js
vendored
83
public/js/ninja.min.js
vendored
@ -1,83 +0,0 @@
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 4);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/app.js":
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
throw new Error("Module build failed: Error: ENOENT: no such file or directory, open '/Users/davidbomba/Development/invoice-ninja/resources/js/app.js'");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__("./resources/js/app.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-danger" v-on:click="$emit('remove',contact.id)"> {{ trans('texts.remove_contact') }}</button>
|
||||
<button type="button" class="btn btn-danger" v-on:click="$emit('remove',contact)"> {{ trans('texts.remove_contact') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
x
Reference in New Issue
Block a user