update v1.0.7.9 R.C.
This is a Release Candidate. We are still testing.
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Model\helpdesk\Email;
|
||||
|
||||
use App\BaseModel;
|
||||
|
||||
class Smtp extends BaseModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
protected $table = 'send_mail';
|
||||
protected $fillable = ['driver', 'port', 'host', 'encryption', 'name', 'email', 'password'];
|
||||
}
|
13
app/Model/helpdesk/Form/FieldValue.php
Normal file
13
app/Model/helpdesk/Form/FieldValue.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Model\helpdesk\Form;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FieldValue extends Model
|
||||
{
|
||||
protected $table = "field_values";
|
||||
protected $fillable = ['field_id','parent_id','field_key','field_value'];
|
||||
|
||||
|
||||
}
|
@@ -4,8 +4,8 @@ namespace App\Model\helpdesk\Form;
|
||||
|
||||
use App\BaseModel;
|
||||
|
||||
class Fields extends BaseModel
|
||||
{
|
||||
class Fields extends BaseModel {
|
||||
|
||||
protected $table = 'custom_form_fields';
|
||||
|
||||
/**
|
||||
@@ -14,4 +14,29 @@ class Fields extends BaseModel
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['forms_id', 'label', 'name', 'type', 'value', 'required'];
|
||||
|
||||
public function valueRelation() {
|
||||
$related = "App\Model\helpdesk\Form\FieldValue";
|
||||
return $this->hasMany($related, 'field_id');
|
||||
}
|
||||
|
||||
public function values() {
|
||||
$value = $this->valueRelation();
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function deleteValues() {
|
||||
$values = $this->values()->get();
|
||||
if ($values->count() > 0) {
|
||||
foreach ($values as $value) {
|
||||
$value->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function delete() {
|
||||
|
||||
parent::delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -14,4 +14,50 @@ class Forms extends BaseModel
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['formname'];
|
||||
|
||||
|
||||
public function fieldRelation(){
|
||||
$related = "App\Model\helpdesk\Form\Fields";
|
||||
return $this->hasMany($related);
|
||||
}
|
||||
|
||||
public function fields(){
|
||||
$relation = $this->fieldRelation()->get();
|
||||
return $relation;
|
||||
}
|
||||
|
||||
public function fieldsDelete(){
|
||||
$fields = $this->fields();
|
||||
if($fields->count()>0){
|
||||
foreach($fields as $field){
|
||||
$field->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function formValueRelation(){
|
||||
$related = "App\Model\helpdesk\Form\FieldValue";
|
||||
return $this->hasMany($related,'child_id');
|
||||
}
|
||||
|
||||
public function formValueChild(){
|
||||
$childs = $this->formValueRelation()->get();
|
||||
return $childs;
|
||||
}
|
||||
|
||||
public function deleteFormChild(){
|
||||
$childs = $this->formValueChild();
|
||||
if($childs->count()>0){
|
||||
foreach ($childs as $child){
|
||||
$child->child_id = NULL;
|
||||
$child->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function delete() {
|
||||
$this->fieldsDelete();
|
||||
parent::delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ class Ticket_Thread extends BaseModel
|
||||
{
|
||||
protected $table = 'ticket_thread';
|
||||
protected $fillable = [
|
||||
'id', 'pid', 'ticket_id', 'staff_id', 'user_id', 'thread_type', 'poster', 'source', 'is_internal', 'title', 'body', 'format', 'ip_address', 'created_at', 'updated_at',
|
||||
'id', 'ticket_id', 'staff_id', 'user_id', 'thread_type', 'poster', 'source', 'is_internal', 'title', 'body', 'format', 'ip_address', 'created_at', 'updated_at',
|
||||
];
|
||||
|
||||
public function attach()
|
||||
|
@@ -15,7 +15,7 @@ class Tickets extends BaseModel
|
||||
// }
|
||||
public function thread()
|
||||
{
|
||||
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_thread', 'ticket_id');
|
||||
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Thread', 'ticket_id');
|
||||
}
|
||||
|
||||
public function collaborator()
|
||||
|
@@ -6,6 +6,6 @@ use App\BaseModel;
|
||||
|
||||
class Limit_Login extends BaseModel
|
||||
{
|
||||
protected $table = 'limit_login';
|
||||
protected $fillable = ['email', 'ip_address', 'duration', 'attempt_time', 'created_at', 'updated_at'];
|
||||
protected $table = 'login_attempts';
|
||||
protected $fillable = ['User', 'IP', 'Attempts', 'LastLogin', 'created_at', 'updated_at'];
|
||||
}
|
||||
|
Reference in New Issue
Block a user