first commit
This commit is contained in:
57
plugins/stAvailabilityPlugin/config/config.php
Normal file
57
plugins/stAvailabilityPlugin/config/config.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stAvailabilityPlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stAvailabilityPlugin opartej na licencji (Professional License SOTE).
|
||||
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
|
||||
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
|
||||
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
|
||||
*
|
||||
* @package stAvailabilityPlugin
|
||||
* @subpackage configs
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: config.php 617 2009-04-09 13:02:31Z michal $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Konfiguracja modułu stAvailabilityPlugin
|
||||
*
|
||||
* @package stAvailabilityPlugin
|
||||
* @author Krzysztof Bebło <krzysztof.beblo@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Włączanie modułów
|
||||
*/
|
||||
stPluginHelper::addEnableModule('stAvailabilityBackend', 'backend');
|
||||
stPluginHelper::addEnableModule('stAvailabilityProductBackend', 'backend');
|
||||
stPluginHelper::addEnableModule('stAvailabilityFrontend', 'frontend');
|
||||
|
||||
/**
|
||||
* Pobiera instancję obiektu sfEventDispatcher
|
||||
*/
|
||||
$dispatcher = stEventDispatcher::getInstance();
|
||||
|
||||
/**
|
||||
* Dodaje sluchacza
|
||||
*/
|
||||
$dispatcher->connect('stAdminGenerator.generateStProduct', array('stAvailabilityPluginListener', 'generate'));
|
||||
$dispatcher->connect('autoStProductActions.postSave', array('stAvailabilityPluginListener', 'postSave'));
|
||||
$dispatcher->connect('autoStProductActions.Edit', array('stAvailabilityPluginListener', 'Edit'));
|
||||
$dispatcher->connect('stProductActions.postAddProductCriteria', array('stAvailabilityPluginListener', 'addProductCriteria'));
|
||||
$dispatcher->connect('stNavigationFrontendActions.postShowHistoryCriteria', array('stAvailabilityPluginListener', 'addProductCriteria'));
|
||||
$dispatcher->connect('stNavigationFrontendComponents.postProductsBoxCriteria', array('stAvailabilityPluginListener', 'addProductCriteria'));
|
||||
$dispatcher->connect('stCategoryModel.postGetProducers', array('stAvailabilityPluginListener', 'addProductCriteria'));
|
||||
|
||||
|
||||
/**
|
||||
* Dodawanie routingów
|
||||
*/
|
||||
stPluginHelper::addRouting('stAvailabilityPlugin', '/availability/:action/*', 'stAvailabilityBackend', 'list', 'backend');
|
||||
/**
|
||||
* dodaje obsługę pola dostępności w produkcie
|
||||
*/
|
||||
sfPropelBehavior::registerHooks('stPropelProducts', array('stPropelProducts'));
|
||||
|
||||
sfPropelBehavior::add('Product', array('stPropelProducts'));
|
||||
@@ -0,0 +1,7 @@
|
||||
export:
|
||||
fields:
|
||||
product_availability: {name: Dostepnosc, class: AvailabilityPeer, type: string}
|
||||
|
||||
import:
|
||||
fields:
|
||||
product_availability: {class: AvailabilityPeer, type: string}
|
||||
65
plugins/stAvailabilityPlugin/config/generator/webapi.yml
Normal file
65
plugins/stAvailabilityPlugin/config/generator/webapi.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
webapi:
|
||||
AddProductAvalibility:
|
||||
description: 'Funkcja umożliwia dodanie nowego stanu magazynowego dla produktu. Przed dodaniem stanu magazynowego należy upwenić się czy produkt o podanym id istnieje, w przeciwnym wypadku zostatnie zwrócony błąd WEBAPI_VALIDATE_ERROR.'
|
||||
methodType: Add
|
||||
inType: object
|
||||
outType: object
|
||||
inFields:
|
||||
ProductId: {type: int, required: true, test_table: Product, where_field: id, description: 'Id produktu w sklepie, dla którego ma zostac dodany stan magazynowy. Produkt o podanym id musi istnieć'}
|
||||
Stock: {type: int, required: true, description: 'Liczba produktów w magazynie podana jako liczba całkowita.'}
|
||||
outFields:
|
||||
Id: {type: int, description: 'Id wpisu dodanego do magazynu'}
|
||||
|
||||
GetProductAvalibility:
|
||||
description: 'Funckja umożliwia pobranie stanów magazynowych dla produktów w sklepie.'
|
||||
methodType: Get
|
||||
inType: object
|
||||
outType: object
|
||||
inFields:
|
||||
Id: {type: int, required: true, description: 'id rekordu w bazie danych, jest to wartość !DepositoryId w danych produktu.'}
|
||||
outFields:
|
||||
Id: {type: int, description: 'Id pobranego rekordu.'}
|
||||
ProductId: {type: int, description: 'Id produktu dla którego określony jest stan magazynowy.'}
|
||||
AvalibilityId: {type: int, description: 'Liczba produktów w magazynie podana jako liczba całkowita.'}
|
||||
|
||||
UpdateProductAvalibility:
|
||||
description: 'Aktualizuje wartość stanu magazynowego dla danego produktu w sklepie.'
|
||||
methodType: Update
|
||||
inType: object
|
||||
outType: object
|
||||
inFields:
|
||||
Id: {type: int, required: true, description: 'Id rekordu w bazie danych, jest to wartość !DepositoryId w danych produktu.'}
|
||||
ProductId: {type: int, test_table: Product, where_field: id, description: 'Id produktu dla którego określony jest stan magazynowy.'}
|
||||
AvalibilityId: {type: int, description: 'Liczba produktów w magazynie podana jako liczba całkowita.'}
|
||||
outFields:
|
||||
_Update: {type: boolean, description: 'W przypadku powodzenia wartość ta przyjmuje true'}
|
||||
|
||||
DeleteProductAvalibility:
|
||||
description: 'Usuwa wpis o określonym id z magaznu, w przypadku gdy zostanie podany nieprawidłowy id funkcja zwraca błąd WEBAPI_INCORRECT_ID.'
|
||||
methodType: Delete
|
||||
inType: object
|
||||
outType: object
|
||||
inFields:
|
||||
Id: {type: int, required: true, description: 'Id rekordu w bazie danych, jest to wartość !DepositoryId w danych produktu.'}
|
||||
outFields:
|
||||
_Delete: {type: boolean, description: 'W przypadku powodzenia wartość ta przyjmuje true.'}
|
||||
|
||||
GetProductAvalibilityList:
|
||||
description: 'Zwraca listę wszystkich stanów magazynowych. Listę można skrócić wykorzystująć parametry _offset i _limit.'
|
||||
methodType: List
|
||||
inType: object
|
||||
outType: array
|
||||
inFields:
|
||||
_offset: {type: int, required: true, description: 'Określa przesunięce wyników o określony ofset.'}
|
||||
_limit: {type: int, required: true, description: 'Określa liczbę wyników w zapytaniu.'}
|
||||
outFields:
|
||||
Id: {type: int, description: 'Id rekordu w bazie danych, jest to wartość !DepositoryId w danych produktu.'}
|
||||
ProductId: {type: int, description: 'Id produktu dla którego określony jest stan magazynowy.'}
|
||||
AvalibilityId: {type: int, description: 'Liczba produktów w magazynie podana jako liczba całkowita.'}
|
||||
|
||||
CountProductAvalibility:
|
||||
description: 'Zwraca całkowitą liczbę rekordów w tabeli magazyn.'
|
||||
methodType: Count
|
||||
outType: object
|
||||
outFields:
|
||||
_Count: {type: int, description: 'Zawiera całkowitą liczbę rekordów w bazie magazyn.'}
|
||||
38
plugins/stAvailabilityPlugin/config/schema.yml
Normal file
38
plugins/stAvailabilityPlugin/config/schema.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
propel:
|
||||
_attributes:
|
||||
defaultIdMethod: native
|
||||
package: plugins.stAvailabilityPlugin.lib.model
|
||||
st_availability:
|
||||
_attributes:
|
||||
phpName: Availability
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
sf_asset_id:
|
||||
type: INTEGER
|
||||
required: false
|
||||
foreignTable: sf_asset
|
||||
foreignReference: id
|
||||
onDelete: setnull
|
||||
stock_from:
|
||||
type: DECIMAL
|
||||
size: 8
|
||||
scale: 2
|
||||
is_system_default:
|
||||
type: BOOLEAN
|
||||
opt_availability_name:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
color:
|
||||
type: VARCHAR
|
||||
size: 6
|
||||
image:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
@@ -0,0 +1,26 @@
|
||||
propel:
|
||||
st_availability:
|
||||
_attributes:
|
||||
phpName: Availability
|
||||
isI18N: true
|
||||
i18nTable: st_availability_i18n
|
||||
opt_availability_name: {change_column: availability_name}
|
||||
|
||||
st_availability_i18n:
|
||||
_attributes:
|
||||
phpName: AvailabilityI18n
|
||||
id:
|
||||
type: integer
|
||||
required: true
|
||||
primaryKey: true
|
||||
foreignTable: st_availability
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
culture:
|
||||
isCulture: true
|
||||
primaryKey: true
|
||||
type: VARCHAR
|
||||
size: 7
|
||||
availability_name:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
@@ -0,0 +1,8 @@
|
||||
propel:
|
||||
st_product:
|
||||
_attributes: {phpName: Product}
|
||||
availability_id:
|
||||
type: INTEGER
|
||||
foreignTable: st_availability
|
||||
foreignReference: id
|
||||
onDelete: setnull
|
||||
Reference in New Issue
Block a user