mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 02:54:36 -04:00
Fixes for deleting and reusing design names
This commit is contained in:
parent
cb2c7d37ab
commit
214396fa43
@ -25,6 +25,7 @@ use App\Transformers\DesignTransformer;
|
|||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DesignController.
|
* Class DesignController.
|
||||||
@ -412,6 +413,7 @@ class DesignController extends BaseController
|
|||||||
{
|
{
|
||||||
//may not need these destroy routes as we are using actions to 'archive/delete'
|
//may not need these destroy routes as we are using actions to 'archive/delete'
|
||||||
$design->is_deleted = true;
|
$design->is_deleted = true;
|
||||||
|
$design->name = $design->name . "_deleted_" . Str::random(5);
|
||||||
$design->delete();
|
$design->delete();
|
||||||
$design->save();
|
$design->save();
|
||||||
|
|
||||||
|
@ -11,9 +11,22 @@
|
|||||||
|
|
||||||
namespace App\Repositories;
|
namespace App\Repositories;
|
||||||
|
|
||||||
|
use App\Models\Design;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for DesignRepository .
|
* Class for DesignRepository .
|
||||||
*/
|
*/
|
||||||
class DesignRepository extends BaseRepository
|
class DesignRepository extends BaseRepository
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public function delete($design) :Design
|
||||||
|
{
|
||||||
|
|
||||||
|
$design->name = $design->name . "_deleted_" . Str::random(5);
|
||||||
|
|
||||||
|
parent::delete($design);
|
||||||
|
|
||||||
|
return $design;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,6 +232,10 @@ class HtmlEngine
|
|||||||
$data['$client2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client2', $this->client->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client2')];
|
$data['$client2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client2', $this->client->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client2')];
|
||||||
$data['$client3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client3', $this->client->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client3')];
|
$data['$client3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client3', $this->client->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client3')];
|
||||||
$data['$client4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client4', $this->client->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client4')];
|
$data['$client4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client4', $this->client->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client4')];
|
||||||
|
$data['$client.custom1'] = &$data['$client1'];
|
||||||
|
$data['$client.custom2'] = &$data['$client2'];
|
||||||
|
$data['$client.custom3'] = &$data['$client3'];
|
||||||
|
$data['$client.custom4'] = &$data['$client4'];
|
||||||
$data['$address1'] = ['value' => $this->client->address1 ?: ' ', 'label' => ctrans('texts.address1')];
|
$data['$address1'] = ['value' => $this->client->address1 ?: ' ', 'label' => ctrans('texts.address1')];
|
||||||
$data['$address2'] = ['value' => $this->client->address2 ?: ' ', 'label' => ctrans('texts.address2')];
|
$data['$address2'] = ['value' => $this->client->address2 ?: ' ', 'label' => ctrans('texts.address2')];
|
||||||
$data['$id_number'] = ['value' => $this->client->id_number ?: ' ', 'label' => ctrans('texts.id_number')];
|
$data['$id_number'] = ['value' => $this->client->id_number ?: ' ', 'label' => ctrans('texts.id_number')];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user