journal
This commit is contained in:
parent
094d0c6cc8
commit
8aa3108887
|
|
@ -143,7 +143,8 @@ class Sewer extends ComponentBase
|
|||
$data = post();
|
||||
|
||||
if ($data["produced_bag_qty"] == 0) {
|
||||
return Flash::error("Tikilen halta sanyny girizin");
|
||||
Flash::error("Tikilen halta sanyny girizin");
|
||||
return Redirect::refresh();
|
||||
}elseif(!$data["produced_bag_qty"] && $data["status"] == "working"){
|
||||
|
||||
$sewer = SewerModel::where("id", $data["sewer_id"])->first();
|
||||
|
|
@ -156,7 +157,7 @@ class Sewer extends ComponentBase
|
|||
Flash::success("Maglumatlar Ustunlikli Üýtgedildi");
|
||||
return Redirect::refresh();
|
||||
} else {
|
||||
return Flash::error("Yalnyshlyk bar!!");
|
||||
Flash::error("Yalnyshlyk bar!!");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
} else {
|
||||
|
|
@ -182,14 +183,15 @@ class Sewer extends ComponentBase
|
|||
$machinProduction->is_finished = true;
|
||||
$machinProduction->save();
|
||||
}else{
|
||||
return Flash::error("Status tamamlamaly!");
|
||||
Flash::error("Status tamamlamaly!");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
|
||||
if ($sewer && $pivotSewer) {
|
||||
Flash::success("Maglumatlar Ustunlikli Üýtgedildi");
|
||||
return Redirect::refresh();
|
||||
} else {
|
||||
return Flash::error("Yalnyshlyk bar!!");
|
||||
Flash::error("Yalnyshlyk bar!!");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?php namespace Romanah\Gokbakja\Controllers;
|
||||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
|
||||
class Journal extends Controller
|
||||
{
|
||||
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
|
||||
|
||||
public $listConfig = 'config_list.yaml';
|
||||
public $formConfig = 'config_form.yaml';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
BackendMenu::setContext('Romanah.Gokbakja', 'main-menu-item8');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<div data-control="toolbar">
|
||||
<a href="<?= Backend::url('romanah/gokbakja/journal/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
|
||||
<button
|
||||
class="btn btn-default oc-icon-trash-o"
|
||||
disabled="disabled"
|
||||
onclick="$(this).data('request-data', {
|
||||
checked: $('.control-list').listWidget('getChecked')
|
||||
})"
|
||||
data-request="onDelete"
|
||||
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
|
||||
data-trigger-action="enable"
|
||||
data-trigger=".control-list input[type=checkbox]"
|
||||
data-trigger-condition="checked"
|
||||
data-request-success="$(this).prop('disabled', true)"
|
||||
data-stripe-load-indicator>
|
||||
<?= e(trans('backend::lang.list.delete_selected')) ?>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
name: Journal
|
||||
form: $/romanah/gokbakja/models/journal/fields.yaml
|
||||
modelClass: Romanah\Gokbakja\Models\Journal
|
||||
defaultRedirect: romanah/gokbakja/journal
|
||||
create:
|
||||
redirect: 'romanah/gokbakja/journal/update/:id'
|
||||
redirectClose: romanah/gokbakja/journal
|
||||
update:
|
||||
redirect: romanah/gokbakja/journal
|
||||
redirectClose: romanah/gokbakja/journal
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
list: $/romanah/gokbakja/models/journal/columns.yaml
|
||||
modelClass: Romanah\Gokbakja\Models\Journal
|
||||
title: Journal
|
||||
noRecordsMessage: 'backend::lang.list.no_records'
|
||||
showSetup: true
|
||||
showCheckboxes: true
|
||||
recordsPerPage: 20
|
||||
toolbar:
|
||||
buttons: list_toolbar
|
||||
search:
|
||||
prompt: 'backend::lang.list.search_prompt'
|
||||
recordUrl: 'romanah/gokbakja/journal/update/:id'
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('romanah/gokbakja/journal') ?>">Journal</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<?= Form::open(['class' => 'layout']) ?>
|
||||
|
||||
<div class="layout-row">
|
||||
<?= $this->formRender() ?>
|
||||
</div>
|
||||
|
||||
<div class="form-buttons">
|
||||
<div class="loading-indicator-container">
|
||||
<button
|
||||
type="submit"
|
||||
data-request="onSave"
|
||||
data-hotkey="ctrl+s, cmd+s"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-primary">
|
||||
<?= e(trans('backend::lang.form.create')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-request="onSave"
|
||||
data-request-data="close:1"
|
||||
data-hotkey="ctrl+enter, cmd+enter"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-default">
|
||||
<?= e(trans('backend::lang.form.create_and_close')) ?>
|
||||
</button>
|
||||
<span class="btn-text">
|
||||
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('romanah/gokbakja/journal') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= Form::close() ?>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||
<p><a href="<?= Backend::url('romanah/gokbakja/journal') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?= $this->listRender() ?>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('romanah/gokbakja/journal') ?>">Journal</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<div class="form-preview">
|
||||
<?= $this->formRenderPreview() ?>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||
<?php endif ?>
|
||||
|
||||
<p>
|
||||
<a href="<?= Backend::url('romanah/gokbakja/journal') ?>" class="btn btn-default oc-icon-chevron-left">
|
||||
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||
</a>
|
||||
</p>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('romanah/gokbakja/journal') ?>">Journal</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<?= Form::open(['class' => 'layout']) ?>
|
||||
|
||||
<div class="layout-row">
|
||||
<?= $this->formRender() ?>
|
||||
</div>
|
||||
|
||||
<div class="form-buttons">
|
||||
<div class="loading-indicator-container">
|
||||
<button
|
||||
type="submit"
|
||||
data-request="onSave"
|
||||
data-request-data="redirect:0"
|
||||
data-hotkey="ctrl+s, cmd+s"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-primary">
|
||||
<?= e(trans('backend::lang.form.save')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-request="onSave"
|
||||
data-request-data="close:1"
|
||||
data-hotkey="ctrl+enter, cmd+enter"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-default">
|
||||
<?= e(trans('backend::lang.form.save_and_close')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="oc-icon-trash-o btn-icon danger pull-right"
|
||||
data-request="onDelete"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
|
||||
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
|
||||
</button>
|
||||
|
||||
<span class="btn-text">
|
||||
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('romanah/gokbakja/journal') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<?= Form::close() ?>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||
<p><a href="<?= Backend::url('romanah/gokbakja/journal') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php namespace Romanah\Gokbakja\Models;
|
||||
|
||||
use Model;
|
||||
use RainLab\User\Models\User;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
class Journal extends Model
|
||||
{
|
||||
use \October\Rain\Database\Traits\Validation;
|
||||
|
||||
use \October\Rain\Database\Traits\SoftDelete;
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
public $belongsTo = [
|
||||
'user' => [
|
||||
'RainLab\User\Models\User',
|
||||
'key' => 'user_id'
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
public $table = 'romanah_gokbakja_journal';
|
||||
|
||||
/**
|
||||
* @var array Validation rules
|
||||
*/
|
||||
public $rules = [
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
columns:
|
||||
id:
|
||||
label: id
|
||||
type: number
|
||||
created_at:
|
||||
label: created_at
|
||||
type: datetime
|
||||
updated_at:
|
||||
label: updated_at
|
||||
type: datetime
|
||||
type:
|
||||
label: type
|
||||
type: text
|
||||
content_id:
|
||||
label: content_id
|
||||
type: number
|
||||
user_id:
|
||||
label: user_id
|
||||
type: number
|
||||
note:
|
||||
label: note
|
||||
type: text
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
fields:
|
||||
content_id:
|
||||
label: 'Content id'
|
||||
span: auto
|
||||
type: number
|
||||
user:
|
||||
label: User
|
||||
nameFrom: name
|
||||
descriptionFrom: description
|
||||
span: auto
|
||||
type: relation
|
||||
type:
|
||||
label: Type
|
||||
options:
|
||||
'no': 'No'
|
||||
ProductionMachine: Machine
|
||||
SewerProduction: Sewer
|
||||
Production: Production
|
||||
Order: Order
|
||||
OrderItem: 'Order Item'
|
||||
Payment: 'Order Payment'
|
||||
Shipping: 'Order Shipping'
|
||||
span: full
|
||||
default: 'no'
|
||||
type: balloon-selector
|
||||
note:
|
||||
label: Note
|
||||
span: auto
|
||||
type: textarea
|
||||
|
|
@ -89,3 +89,7 @@ navigation:
|
|||
label: 'Cig mal'
|
||||
url: romanah/gokbakja/production
|
||||
icon: icon-life-ring
|
||||
main-menu-item8:
|
||||
label: Žurnal
|
||||
url: romanah/gokbakja/journal
|
||||
icon: icon-bell
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
<?php namespace Romanah\Gokbakja\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateRomanahGokbakjaJournal extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('romanah_gokbakja_journal', function($table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
$table->increments('id')->unsigned();
|
||||
$table->timestamp('created_at')->nullable();
|
||||
$table->timestamp('updated_at')->nullable();
|
||||
$table->timestamp('deleted_at')->nullable();
|
||||
$table->string('type')->default('no');
|
||||
$table->integer('content_id');
|
||||
$table->integer('user_id');
|
||||
$table->text('note')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('romanah_gokbakja_journal');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Romanah\Gokbakja\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateRomanahGokbakjaOrder7 extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_order', function($table)
|
||||
{
|
||||
$table->integer('user_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_order', function($table)
|
||||
{
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Romanah\Gokbakja\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateRomanahGokbakjaOrderItem7 extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_order_item', function($table)
|
||||
{
|
||||
$table->integer('user_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_order_item', function($table)
|
||||
{
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Romanah\Gokbakja\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateRomanahGokbakjaPayment2 extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_payment', function($table)
|
||||
{
|
||||
$table->integer('user_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_payment', function($table)
|
||||
{
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Romanah\Gokbakja\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateRomanahGokbakjaSewerProduction6 extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_sewer_production', function($table)
|
||||
{
|
||||
$table->integer('user_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_sewer_production', function($table)
|
||||
{
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Romanah\Gokbakja\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateRomanahGokbakjaShipping2 extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_shipping', function($table)
|
||||
{
|
||||
$table->integer('user_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('romanah_gokbakja_shipping', function($table)
|
||||
{
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -285,3 +285,21 @@
|
|||
1.0.96:
|
||||
- 'Updated table romanah_gokbakja_order_item'
|
||||
- builder_table_update_romanah_gokbakja_order_item_6.php
|
||||
1.0.97:
|
||||
- 'Updated table romanah_gokbakja_order'
|
||||
- builder_table_update_romanah_gokbakja_order_7.php
|
||||
1.0.98:
|
||||
- 'Updated table romanah_gokbakja_order_item'
|
||||
- builder_table_update_romanah_gokbakja_order_item_7.php
|
||||
1.0.99:
|
||||
- 'Updated table romanah_gokbakja_payment'
|
||||
- builder_table_update_romanah_gokbakja_payment_2.php
|
||||
1.0.100:
|
||||
- 'Updated table romanah_gokbakja_sewer_production'
|
||||
- builder_table_update_romanah_gokbakja_sewer_production_6.php
|
||||
1.0.101:
|
||||
- 'Updated table romanah_gokbakja_shipping'
|
||||
- builder_table_update_romanah_gokbakja_shipping_2.php
|
||||
1.0.102:
|
||||
- 'Created table romanah_gokbakja_journal'
|
||||
- builder_table_create_romanah_gokbakja_journal.php
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
title = "notifications"
|
||||
url = "/notifications"
|
||||
layout = "platform_main"
|
||||
is_hidden = 0
|
||||
==
|
||||
Loading…
Reference in New Issue