first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,207 @@
<?php
/**
* SOTESHOP/stProduct
*
* Ten plik należy do aplikacji stProduct opartej na licencji (Open License SOTE) Otwarta Licencja 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 stProduct
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
* @version $Id: components.class.php 1031 2009-05-07 13:03:25Z krzysiek $
*/
/**
* Komponenty stProduct
*
* @author Marcin Butlak <marcin.butlak@sote.pl>
*
* @package stProduct
* @subpackage actions
*/
class stProductComponents extends autoStProductComponents
{
public function executeExportMenu()
{
return $this->executeListMenu();
}
public function executeEditMenu()
{
parent::executeEditMenu();
$i18n = $this->getContext()->getI18n();
if (!$this->product->isNew())
{
$this->items["stProduct/moreList?product_id={$this->product->getId()}&category_id={$this->forward_parameters['category_id']}"] = $i18n->__('Dodatkowe opcje');
}
$this->processMenuItems();
$this->selected_item_path = $this->getUser()->getAttribute('selected', false, 'soteshop/component/menu');
}
public function executeEditCurrency()
{
$cache = new stFunctionCache('stCurrency');
$this->currency = $cache->cacheCall('stProductEdit::getCurrency');
}
/**
* Komponent wyświetlający drzewa kategorii
*/
public function executeCategory()
{
$c = new Criteria();
$user = $this->getUser();
$c->add(CategoryPeer::PARENT_ID, null, Criteria::ISNULL);
$this->roots = CategoryPeer::doSelect($c);
if ($this->product->isNew() && $this->getUser()->getAttribute('category_filter', null, 'soteshop/stProduct'))
{
$id = $this->getUser()->getAttribute('category_filter', null, 'soteshop/stProduct');
$this->categories = array($id => array('id' => $id, 'default' => true));
}
else
{
$this->categories = $this->getAssignedCategories($this->product->getId());
}
}
/**
* Komponent zdjecia
*/
public function executeImages()
{
$this->product = ProductPeer::retrieveByPK($this->product_id);
$this->dir = $this->product->getImage();
$this->photos = sfFinder::type('file')->name('*.jpg')->maxdepth(0)->relative()->in('uploads/products/'.$this->dir);
}
/**
* Główne zdjęcie produktu
*/
public function executeMainImage()
{
$this->product = ProductPeer::retrieveByPK($this->getRequestParameter('id'));
if ($this->product)
{
$this->dir = $this->product->getImage();
$this->photos = sfFinder::type('file')->name('*.jpg')->maxdepth(0)->relative()->in('uploads/products/'.$this->dir);
}
}
/**
* Pobieranie template dla wyświetlania opisu szczegółowego produktu
*/
public function executeProductViews()
{
$theme_name = strtolower(stTheme::getActiveTheme()->getTheme());
$filehtmlRoot = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'stProduct'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'theme'.DIRECTORY_SEPARATOR.$theme_name.DIRECTORY_SEPARATOR;
$files = sfFinder::type('file')->name('product_show_*.html')->in($filehtmlRoot);
$this->template_files = array();
foreach ($files as $file)
{
$file = str_replace($filehtmlRoot.'product_show_', '', $file);
$file = str_replace('.html', '', $file);
$this->template_files[$file] = $file;
}
$this->template_files = $this->getProductViewsNames($this->template_files);
}
public function executeDefaultImage()
{
$this->default_image = ProductHasSfAssetPeer::retrieveDefaultImage($this->product->getId());
}
/**
* Pobiera nazwy templatow z pliku yaml
*
* @param array $template_files
* @return array list templatow
*/
public function getProductViewsNames($template_files)
{
$fileymlRoot = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.'backend'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'stProduct'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'views.yml';
$yml = sfYaml::load($fileymlRoot);
return array_merge($template_files, $yml['show']);
}
/**
* Sprawdzanie czy występuje błąd z filtowaniem (5.0.0 -> 5.0.1)
*
*/
public function executeFixProducts()
{
$c = new Criteria();
$this->num_products = ProductPeer::doCount($c);
$c = new Criteria();
$c->addJoin(ProductI18nPeer::ID, ProductPeer::ID);
$c->add(ProductI18nPeer::CULTURE, "pl_PL");
$this->num_products_good = ProductPeer::doCount($c);
$this->culture = $this->getUser()->getCulture();
}
public function executeVat()
{
$c = new Criteria();
$this->taxes = TaxPeer::doSelect($c);
}
protected function getAssignedCategories($product_id)
{
$categories = array();
$assigned = $this->getRequestParameter('product_has_category');
$default = $this->getRequestParameter('product_default_category');
$c = new Criteria();
$c->add(ProductHasCategoryPeer::PRODUCT_ID, $product_id);
$c->addSelectColumn(ProductHasCategoryPeer::CATEGORY_ID);
$c->addSelectColumn(ProductHasCategoryPeer::IS_DEFAULT);
$rs = ProductHasCategoryPeer::doSelectRS($c);
while ($rs->next())
{
$row = $rs->getRow();
$id = $row[0];
if (null === $assigned || isset($assigned[$id]))
{
$categories[$id] = array('id' => $id, 'default' => $default ? $default == $id : $row[1]);
}
}
if ($assigned)
{
foreach ($assigned as $id)
{
if (!isset($categories[$id]))
{
$categories[$id] = array('id' => $id, 'default' => $default ? $default == $id : false);
}
}
}
return $categories;
}
}
?>

View File

@@ -0,0 +1,26 @@
<?php
/**
* SOTESHOP/stProduct
*
* Ten plik należy do aplikacji stProduct opartej na licencji (Open License SOTE) Otwarta Licencja 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 stProduct
* @subpackage configs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
* @version $Id: config.php 617 2009-04-09 13:02:31Z michal $
*/
/**
* Dodawanie routingów
*/
stPluginHelper::addRouting('stProductEdit', '/product/:action/id/:id', 'stProduct', 'edit', 'backend');
stPluginHelper::addRouting('stProduct', '/product/:action/*', 'stProduct', 'list', 'backend');
stPluginHelper::addRouting('stProductDefault', '/product/:action', 'stProduct', 'list', 'backend');
stSocketView::addComponent('stProduct.galleryCustom.Content','stProduct','gallery');
stPluginHelper::addRouting('stProductCategoryFilter', '/product/index/category_filter/:category_filter', 'stProduct', 'index', 'backend');

View File

@@ -0,0 +1,525 @@
generator:
class: stAdminGenerator
param:
model_class: Product
attachment_model_class: ProductHasAttachment
duplicate_model_class: Product
dimension_model_class: ProductDimension
theme: simple
head:
package: stProduct
applications: [stCategory, stProducer, stProductGroup, stQuestionPlugin]
custom_actions:
list: [attachment, duplicate, dimension]
edit: [attachment, dimension]
config: [presentation]
documentation:
pl: "https://www.sote.pl/docs/produkty"
en: "https://www.soteshop.com/docs/products"
list:
forward_parameters: [category_id]
use_stylesheet: [backend/stProductList.css]
use_helper: [stProduct, stAvailability]
auto_width: true
menu:
display: [list, export, import, config, presentation_config, dimensions]
fields:
list: {name: Lista, action: "@stProductDefault"}
config: {name: Konfiguracja, action: stProduct/config}
presentation_config: {name: Prezentacja, action: stProduct/presentationConfig}
export: {name: Eksport, action: stProduct/export}
import: {name: Import, action: stProduct/import}
dimensions: {name: Rozmiary, action: "@stProductDimension", i18n: stProductDimension}
display: [list_image, preview, =name, code, opt_price_brutto, producer_id, availability_id, stock, priority, active]
hideable: [availability_id, stock, priority]
fields:
code: {name: Kod, width: 1%, min_width: 90px}
man_code: {name: Kod producenta, width: 1%, min_width: 90px}
preview: {name: '', width: 1%, callback: list_product_preview}
name: {name: Nazwa, params: truncate_text=true, sort_field: product_i18n.name, callback: list_product_name}
stock: {name: Magazyn, align: right, width: 1%, filterable: false, callback: list_product_stock}
availability_id: {name: Dostępność, align: center, width: 10%, filterable: false, callback: list_product_availability, params: truncate_text=true truncate_text_lines=1}
opt_price_brutto: {name: Cena, width: 1%, align: right, callback: list_product_price, label_callback: list_product_price_label, filterable: false}
producer_id: {name: Producent, align: center, width: 10%, callback: list_product_producer, params: truncate_text=true}
list_image: {name: Zdjęcie, width: 1%, callback: list_product_image, filterable: false}
active: {name: Aktywny, width: 1%, align: center}
priority: {name: Priorytet, width: 1%, params: size=10, align: center, filterable: false}
editable:
code: -
name: -
producer_id: -
active: -
list_price: -
priority: -
additional_filters: [list_image, man_code, opt_price_brutto, description, weight, availability_id, stock, hide_price, priority, allegro]
filters:
producer_id: {params: style="max-width: 200px"}
name: {filter_field: product_i18n.name, params: size=21}
code: {params: size=21}
man_code: {params: size=21}
list_image: {partial: filter_list_image}
description: {name: Opis, filter_field: product_i18n.description, params: size=21}
weight: {name: Waga, empty: false}
stock: {name: Stan magazynowy, empty: false}
hide_price: {partial: filter_list_hide_price, filter_field: product.hide_price, name: Ukryj cenę}
priority: {empty: false}
allegro: {partial: filter_allegro, name: Wystawiony na allegro}
availability_id: {partial: filter_availability}
select_actions:
display:
"Ustaw aktywne:": [product_enabled, product_disabled]
actions:
_delete: -
product_enabled: {name: Tak, confirm: "Ustaw aktywne: Tak", action: productEnable, i18n: stAdminGeneratorPlugin}
product_disabled: {name: Nie, confirm: "Ustaw aktywne: Nie", action: productDisable, i18n: stAdminGeneratorPlugin}
description: Zarządzanie produktami w sklepie.
title: Lista
max_per_page: 12
peer_method: doSelectWithI18n
peer_count_method: doCountWithI18n
actions:
export: {name: Eksport, action: @stProduct?action=export&type=list&parameters=category_id, i18n: stProduct, icon: export}
_create: {name: Dodaj}
object_actions:
_edit: -
_delete: -
empty_message: {message: Brak produktów, i18n: stProduct}
new:
title: Nowy produkt
edit:
forward_parameters: [category_id]
use_helper: [stProduct, stDeliveryBackend/stDeliveryBackend]
menu:
display: [attachment, duplicate]
fields:
_edit: {name: Edycja podstawowa}
attachment: {name: Załączniki, action: stProduct/attachmentList?product_id=%%id%%}
duplicate: {name: Duplikaty, action: stProduct/duplicateList?product_id=%%id%%}
title: Edycja podstawowa
old_config:
"Punkty": true
display:
"NONE": [active, code, name, man_code, is_without_return]
"Ceny": [~edit_currency, vat, _price, _old_price, hide_price]
"Cena zasadnicza": [_bpum_default_value, _bpum_value]
"Punkty": [_points_only, points_value, points_earn]
"Producent/Kategorie/Grupy": [producer_id, product_category, product_group, product_accessories, product_recommend, priority, main_page_order]
"Dostępność/Magazyn": [availability_id, stock_managment, stock, execution_time, uom, is_stock_validated, stock_in_decimals, min_qty, max_qty, step_qty]
"Dostawa": [dimension_id, width, height, depth, weight, product_delivery, _delivery_price]
"Rabaty": [max_discount, discount_group]
"Zdjęcia": [product_image]
"Opis": [short_description, description, search_keywords]
hideable: [man_code, edit_currency, old_price, wholesale_price, group_price_id, "Cena zasadnicza", priority, main_page_order, "Dodatkowy opis"]
fields:
delivery_price: {name: Koszt dostawy, help: Koszt dostawy doliczany do łącznego kosztu dostawy dla każdej sztuki produktu}
dimension_id: {name: Rozmiar, type: product_dimension}
product_delivery: {name: Dostawy, type: product_delivery, params: control_name=product_delivery}
height: {name: Wysokość, type: delivery_dimension, params: size=8 decimals=1}
width: {name: Szerokość, type: delivery_dimension, params: size=8 decimals=1}
depth: {name: Głębokość, type: delivery_dimension, params: size=8 decimals=1}
man_code: {name: Kod producenta, help: Kod kreskowy EAN | GTIN | UPC}
active: {name: Aktywny}
name: {name: Nazwa, required: true, params: disabled=false size=78}
producer_id: {name: Producent, type: product_producer}
product_category: {name: Kategorie, type: product_category, params: control_name=product_category}
price: {name: Cena}
bpum_default_value: {name: Ilość jednostki miary, help: "Całkowita miara dla jednostki produktu np. 1kg, 10m, 100l."}
bpum_value: {name: Prezentuje cenę dla, help: "Wartość i jednostka dla jakiej ma być prezentowana cena zasadnicza."}
old_price: {name: Stara cena}
product_image: {name: Zdjęcie, hide_label: true, type: product_image}
code: {name: Kod, params: size=32}
vat: {name: Vat, type: product_tax}
description: {name: Opis pełny, type: textarea_tag, params: "rich=true tinymce_options=height:200,width:'100%' disabled=false"}
short_description: {name: Opis skrócony, type: textarea_tag, params: "rich=true tinymce_options=height:100,width:'100%',theme:'simple' disabled=false"}
enclosure: {name: Załącznik}
hide_price: {name: Ukryj cenę, type: product_hide_price}
edit_currency: {name: Waluta}
stock: {name: Stan magazynowy, type: product_stock}
execution_time: {name: Czas realizacji, params: disabled=false size=40}
uom: {name: Jednostka miary, type: product_uom, params: size=8 maxlength=32}
max_qty: {name: Maksymalna ilość, help: Maksymalna ilość produktu jaką może zamówić klient w ramach jednego zamówienia (0 oznacza brak), type: product_price}
min_qty: {name: Minimalna ilość, help: Minimalna ilość produktu jaką musi zamówić klient, type: product_price}
step_qty: {name: Wielokrotność ilości, help: Jeśli podana wyświetla liste wyboru ilości produktu o podanej wielokrotności zamiast pola tekstowego, type: product_step_qty}
availability_id: {name: Dostępność, type: product_availability}
weight: {name: Waga, type: product_weight}
is_stock_validated: {name: Sprawdzaj stan magazynowy, type: product_is_stock_validated, help: "Jeśli zaznaczone/ozdnaczone włącza/wyłącza sprawdzanie stanów magazynowy w koszyku. Pole jest ignorowane jeżeli w <b>Konfiguracja -> Konfiguracja produktów</b> opcja <b>Sprawdzanie stanu magazynowego w koszyku</b> jest odznaczona"}
stock_in_decimals: {name: Zezwalaj na części dziesiętne w ilości, type: product_stock_in_decimals}
max_discount: {name: Maksymalny rabat, postfix: "%"}
discount_group: {name: Grupy rabatowe, type: product_discount_group, params: control_name=discount_group}
product_group: {name: Grupy, type: product_group, params: control_name=product_group}
product_accessories: {name: Akcesoria, type: product_accessories, params: control_name=product_accessories}
product_recommend: {name: Polecane produkty, type: product_recommend, params: control_name=product_recommend}
priority: {name: Priorytet}
main_page_order: {name: Kolejność na stronie głównej}
points_value: {name: Cena w punktach, help: "Liczba punktów jaką należy wydać aby nabyć towar.",support: true}
points_earn: {name: Zarobione punkty, help: "Liczba punktów jakie klient sklepu otrzyma za zakupienie tego produktu.",support: true}
points_only: {name: Produkt tylko za punkty}
is_without_return: {name: Produkt bezzwrotny, help: "Produkt nie podlega procedurze zwrotu."}
stock_managment: {name: Zarządzaj magazynem, type: product_stock_managment }
search_keywords: {name: Opis do wyszukiwania, help: "Opis wyszukiwania nie pojawia się na karcie produktu, ale system będzie analizował go podczas wyszukiwania", params: disabled=false, type: textarea_tag}
actions:
preview: {name: Podgląd, action: preview, i18n: stProduct, icon: preview, only_for: edit, params: target="_blank"}
_list: {name: Pokaż listę}
duplicate: {name: Duplikuj, action: "@stProduct?action=duplicate&product_id=%%id%%", i18n: stProduct, only_for: edit}
_save: {name: Zapisz}
_save_and_add: {name: Zapisz i dodaj kolejny}
_delete: {name: Usuń}
config:
use_helper: [stProduct]
title: Konfiguracja
description: Zarządzanie produktami w sklepie.
menu: {use: menu.list}
display:
"NONE": [show_unique, list_type, sort_type, sort_asc_desc]
"Ceny produktów": [global_price_netto, show_without_price, show_price_filter, global_hide_price]
"Ilość produktów na": [long_list, short_list, other_list]
"Dostawy": [delivery_price_type]
"Historia ceny": [show_price_history, price_history_chart, price_history_show_change]
fields:
show_unique: {name: Nie pozwalaj na dublowanie produktów na stronie, checked: false, type: checkbox}
global_hide_price: {name: Ukryj cenę, type: config_hide_price, help: "Ukrywa cenę dla wszystkich produktów w sklepie"}
global_price_netto: {name: Ceny tylko w netto, checked: false, type: checkbox}
long_list: {name: liście pełnej}
short_list: {name: liście skróconej, hide_install_version: 6.6.4}
other_list: {name: liście alternatywnej, hide_install_version: 6.6.4}
show_without_price: {name: Pokaż produkty tylko z ustawioną ceną, checked: false, type: checkbox}
show_price_filter: {name: Pokaż filtr po cenie, type: checkbox, help: "Ze względu na stopień skomplikowania rabatów ceny po rabacie nie są filtrowane"}
show_price_history: {name: Pokaż historię ceny, type: checkbox, help: "Aktywuj historię ceny i zapamiętywanie minimalnej ceny 30 dni przed obniżką/zmianą."}
price_history_type:
name: Zapisywanie historii cen
type: select
displey: [simple,full]
options:
simple: {name: Uproszczone}
full: {name: Pełne}
help: "Uproszczone - Nie obejmuje rabatów grupowych produktów i modyfikatorów cen. Pełne - Obejmuje rabaty i modyfikatory cen. Wymaga dodatkowej konfiguracji harmonogramu zadań. Sprawdź dokumentację."
price_history_chart:
name: Wykres historii cen
type: select
displey: [show,hide]
options:
show: {name: Pokaż}
hide: {name: Nie pokazuj}
help: "Wykres historii cen pokazuje zmiany cen w ciągu ostatnich 30 dni i dodatkowe informacje o obniżkach cen."
price_history_show_change:
name: Informacja o najniższej cenie
type: select
displey: [all,down]
options:
all: {name: Pokazuj dla każdej zmiany ceny}
down: {name: Pokazuj tylko dla obniżki}
help: "Informacja o najniższej cenie z ostatnich 30 dni przed zmianą/obniżką ceny. Pojawia się tylko wtedy, kiedy cena się zmieniła."
delivery_price_type:
name: Koszt dostawy
type: select
display: [netto, brutto]
options:
netto: {name: Netto}
brutto: {name: Brutto}
list_type:
name: Domyślny typ prezentacji listy
hide_install_version: 6.6.4
type: select
display: [long, short, other]
options:
long: {name: Lista pełna, value: long}
short: {name: Lista skrócona, value: short}
other: {name: Lista alternatywna, value: other}
selected: long
sort_type:
name: Domyślne sortowanie po
type: select
display: [option1, option2, option3, option4]
options:
option1: {name: Nazwie, value: name}
option2: {name: Cenie, value: price}
option3: {name: Najnowszym, value: created_at}
option4: {name: Priorytecie, value: priority}
selected: option4
sort_asc_desc:
name: Domyślnie sortuj
type: select
display: [option1, option2]
options:
option1: {name: Rosnąco, value: asc}
option2: {name: Malejąco, value: desc}
selected: option1
actions:
_save: {name: Zapisz}
presentation_config:
title: Prezentacja
description: Zarządzanie produktami w sklepie.
hide_install_version:
"Lista skrócona": 6.6.4
display:
"NONE": [weight_unit]
"Karta produktu": [show_code, show_name, show_availability, show_depository, show_price, show_uom, show_basic_price, price_view, show_old_price, show_saved_price, show_discount, discount_type, show_compare, show_image, show_galery, show_description, show_short_description, show_other_products, other_products_num, show_available_payments, show_accessories, _show_product_recomandation, show_review, review_type, show_weight, show_execute_time, show_manufacturer, show_man_code, show_group_label]
"Lista pełna": [show_name_long, cut_name_long, cut_name_num_long, show_availability_long, show_depository_long, show_image_long, show_price_long, show_uom_long, show_basic_price_long, price_view_long, show_old_price_long, show_discount_long, show_basket_long, show_description_long, description_type_long, cut_description_long, cut_description_num_long, show_weight_long, button_type_long]
"Lista skrócona": [show_name_short, cut_name_short, cut_name_num_short, show_code_short, show_image_short, show_price_short, show_uom_short, show_basic_price_short, price_view_short, show_old_price_short, show_discount_short, show_basket_short, show_weight_short]
"Polecane produkty i akcesoria": [show_name_other, cut_name_other, cut_name_num_other, show_image_other, show_price_other, show_uom_other, show_basic_price_other, price_view_other, show_old_price_other, show_discount_other]
"Grupy produktów - strona główna": [show_name_group, cut_name_group, cut_name_num_group, show_availability_group, show_depository_group, show_image_group, show_price_group, show_uom_group, show_basic_price_group, price_view_group, show_description_group, description_type_group, cut_description_group, cut_description_num_group, show_old_price_group, show_discount_group, show_weight_group, button_type_group]
fields:
show_code: {name: Pokaż kod produktu, checked: false, type: checkbox}
show_available_payments: {name: Pokaż dostępne płatności, type: checkbox}
show_name: {name: Pokaż nazwę produktu, checked: true, type: checkbox}
show_price: {name: Pokaż cenę produktu, checked: true, type: checkbox}
show_basic_price: {name: Pokaż cenę zasadniczą, checked: false, type: checkbox}
show_basic_price_long: {name: Pokaż cenę zasadniczą, checked: false, type: checkbox}
show_basic_price_short: {name: Pokaż cenę zasadniczą, checked: false, type: checkbox}
show_uom: {name: Pokaż jednostkę miary przy cenie, checked: false, type: checkbox}
show_old_price: {name: Pokaż starą cenę produktu, checked: true, type: checkbox}
show_depository: {name: Pokaż stan magazynowy, checked: false, type: checkbox, i18n: stDepositoryBackend}
show_depository_long: {name: Pokaż stan magazynowy, checked: false, type: checkbox, i18n: stDepositoryBackend}
show_depository_group: {name: Pokaż stan magazynowy, checked: false, type: checkbox, i18n: stDepositoryBackend}
show_availability: {name: Pokaż dostępność, checked: false, type: checkbox}
weight_unit:
name: Jednostka wagi
type: select_tag
display: [g, kg]
options:
g: [name: "g"]
kg: [name: "kg"]
price_view:
name: Wyświetlenie ceny przy produkcie
type: select
display: [option1, option2, option3, option4]
options:
option1: {name: Wyświetlaj tylko cenę brutto, value: only_gross}
option2: {name: Wyświetlaj tylko cenę netto, value: only_net}
option3: {name: Wyświetlaj cenę netto i brutto - wyróżnij brutto, value: gross_net}
option4: {name: Wyświetlaj cenę netto i brutto - wyróżnij netto, value: net_gross}
selected: option1
show_saved_price: {name: Pokaż cenę katalogową, checked: false, type: checkbox}
show_discount: {name: Pokaż zaoszczędzoną kwotę przy rabacie, checked: false, type: checkbox}
discount_type:
name: Prezentacja rabatu
type: select
display: [option1, option2, option3]
options:
option1: {name: Wyświetlaj zaoszczędzone kwotę i procent, value: discount_amount_percentage}
option2: {name: Wyświetlaj tylko zaoszczędzoną kwotę, value: discount_amount}
option3: {name: Wyświetlaj tylko zaoszczędzony procent, value: discount_percentage}
selected: option1
show_compare: {name: Pokaż dodanie do porównania, checked: true, type: checkbox, old_config: true}
show_image: {name: Pokaż zdjęcie produktu, checked: true, type: checkbox}
show_galery: {name: Pokaż galerię produktu, checked: true, type: checkbox}
show_short_description: {name: Pokaż skrócony opis produktu, checked: true, type: checkbox}
show_description: {name: Pokaż pełny opis produktu, checked: true, type: checkbox}
show_other_products: {name: Pokaż polecane produkty, checked: true, type: checkbox}
other_products_num: {name: Liczba produktów polecanych, params: size=2}
show_accessories: {name: Pokaż akcesoria, checked: true, type: checkbox}
show_product_recomandation: {name: Włącz rekomendację produktu, checked: true, type: checkbox}
show_review: {name: Pokaż recenzje produktu, checked: true, type: checkbox}
review_type:
name: Prezentacja recenzji
type: select
display: [option1, option2, option3]
options:
option1: {name: Wyświetl w zakładce, value: option_1}
option2: {name: Wyświetl pod opisem, value: option_2}
option3: {name: Wyświetl pod zakładkami, value: option_3}
selected: option1
show_weight: {name: Pokaż wagę produktu, checked: true, type: checkbox}
show_weight_long: {name: Pokaż wagę produktu, checked: false, type: checkbox}
show_weight_short: {name: Pokaż wagę produktu, checked: false, type: checkbox}
show_weight_group: {name: Pokaż wagę produktu, checked: false, type: checkbox}
button_type_long:
name: Typ przycisku
type: select
display: [option1, option2]
options:
option1: {name: Dodaj do koszyka / Wybierz opcje, value: basket}
option2: {name: Sprawdź, value: check}
button_type_group:
name: Typ przycisku
type: select
display: [option1, option2]
options:
option1: {name: Dodaj do koszyka / Wybierz opcje, value: basket}
option2: {name: Sprawdź, value: check}
show_manufacturer: {name: Pokaż producenta, checked: false, type: checkbox}
show_man_code: {name: Pokaż kod producenta, checked: false, type: checkbox}
show_execute_time: {name: Pokaż czas realizacji, checked: true, type: checkbox}
show_name_long: {name: Pokaż nazwę produktu, checked: true, type: checkbox}
cut_name_long: {name: Skracaj nazwę produktu, checked: true, type: checkbox}
cut_name_num_long: {name: Ile znaków skracać nazwę produktu, params: size=4}
show_image_long: {name: Pokaż zdjęcie produktu, checked: true, type: checkbox}
show_price_long: {name: Pokaż cenę produktu, checked: true, type: checkbox}
show_uom_long: {name: Pokaż jednostkę miary przy cenie, checked: false, type: checkbox}
show_old_price_long: {name: Pokaż starą cenę produktu, checked: true, type: checkbox}
show_description_long: {name: Pokaż opis produktu, checked: true, type: checkbox}
description_type_long:
name: Jaki opis ma być używany
type: select
display: [option1, option2]
options:
option1: {name: Opis skrócony, value: short}
option2: {name: Opis pełny, value: full}
selected: option1
cut_description_long: {name: Skracaj wybrany opis, type: checkbox}
cut_description_num_long: {name: Ile znaków skracać opis produktu, params: size=4}
price_view_long:
name: Wyświetlenie ceny na liście
type: select
display: [option1, option2, option3, option4]
options:
option1: {name: Wyświetlaj tylko cenę brutto, value: only_gross}
option2: {name: Wyświetlaj tylko cenę netto, value: only_net}
option3: {name: Wyświetlaj cenę netto i brutto - wyróżnij brutto, value: gross_net}
option4: {name: Wyświetlaj cenę netto i brutto - wyróżnij netto, value: net_gross}
selected: option1
show_discount_long: {name: Pokaż rabat, checked: false, type: checkbox}
show_basket_long: {name: Pokaż koszyk, checked: true, type: checkbox}
show_availability_long: {name: Pokaż dostępność, checked: false, type: checkbox}
show_name_short: {name: Pokaż nazwę produktu, checked: true, type: checkbox}
cut_name_short: {name: Skracaj nazwę produktu, checked: true, type: checkbox}
cut_name_num_short: {name: Ile znaków skracać nazwę produktu, params: size=4}
show_image_short: {name: Pokaż zdjęcie produktu, checked: true, type: checkbox}
show_code_short: {name: Pokaż kod produktu, checked: false, type: checkbox}
show_price_short: {name: Pokaż cenę produktu, checked: true, type: checkbox}
show_uom_short: {name: Pokaż jednostkę miary przy cenie, checked: false, type: checkbox}
show_old_price_short: {name: Pokaż starą cenę produktu, checked: true, type: checkbox}
price_view_short:
name: Wyświetlenie ceny na liście
type: select
display: [option1, option2, option3, option4]
options:
option1: {name: Wyświetlaj tylko cenę brutto, value: only_gross}
option2: {name: Wyświetlaj tylko cenę netto, value: only_net}
option3: {name: Wyświetlaj cenę netto i brutto - wyróżnij brutto, value: gross_net}
option4: {name: Wyświetlaj cenę netto i brutto - wyróżnij netto, value: net_gross}
selected: option1
show_discount_short: {name: Pokaż rabat, checked: false, type: checkbox}
show_basket_short: {name: Pokaż koszyk, checked: true, type: checkbox}
show_name_other: {name: Pokaż nazwę produktu, checked: true, type: checkbox}
cut_name_other: {name: Skracaj nazwę produktu, checked: true, type: checkbox}
cut_name_num_other: {name: Ile znaków skracać nazwę produktu, params: size=2}
show_image_other: {name: Pokaż zdjęcie produktu, checked: true, type: checkbox}
show_price_other: {name: Pokaż cenę produktu, checked: true, type: checkbox}
show_uom_other: {name: Pokaż jednostkę miary przy cenie, checked: false, type: checkbox}
show_basic_price_other: {name: Pokaż cenę zasadniczą, checked: false, type: checkbox}
show_old_price_other: {name: Pokaż starą cenę produktu, checked: true, type: checkbox}
price_view_other:
name: Wyświetlenie ceny na liście
type: select
display: [option1, option2, option3, option4]
options:
option1: {name: Wyświetlaj tylko cenę brutto, value: only_gross}
option2: {name: Wyświetlaj tylko cenę netto, value: only_net}
option3: {name: Wyświetlaj cenę netto i brutto - wyróżnij brutto, value: gross_net}
option4: {name: Wyświetlaj cenę netto i brutto - wyróżnij netto, value: net_gross}
selected: option1
show_discount_other: {name: Pokaż rabat, checked: false, type: checkbox}
show_availability_other: {name: Pokaż dostępność, checked: false, type: checkbox}
show_name_group: {name: Pokaż nazwę produktu, checked: true, type: checkbox}
cut_name_group: {name: Skracaj nazwę produktu, checked: true, type: checkbox}
cut_name_num_group: {name: Ile znaków skracać nazwę produktu, params: size=4}
show_image_group: {name: Pokaż zdjęcie produktu, checked: true, type: checkbox}
show_price_group: {name: Pokaż cenę produktu, checked: true, type: checkbox}
show_uom_group: {name: Pokaż jednostkę miary przy cenie, checked: false, type: checkbox}
show_basic_price_group: {name: Pokaż cenę zasadniczą, checked: false, type: checkbox}
price_view_group:
name: Wyświetlenie ceny na liście
type: select
display: [option1, option2, option3, option4]
options:
option1: {name: Wyświetlaj tylko cenę brutto, value: only_gross}
option2: {name: Wyświetlaj tylko cenę netto, value: only_net}
option3: {name: Wyświetlaj cenę netto i brutto - wyróżnij brutto, value: gross_net}
option4: {name: Wyświetlaj cenę netto i brutto - wyróżnij netto, value: net_gross}
selected: option1
show_description_group: {name: Pokaż opis produktu, checked: true, type: checkbox}
description_type_group:
name: Jaki opis ma być używany
type: select
display: [option1, option2]
options:
option1: {name: Opis skrócony, value: short}
option2: {name: Opis pełny, value: full}
selected: option1
cut_description_group: {name: Skracaj wybrany opis, type: checkbox}
cut_description_num_group: {name: Ile znaków skracać opis produktu, params: size=4}
show_old_price_group: {name: Pokaż starą cenę produktu, checked: true, type: checkbox}
show_discount_group: {name: Pokaż rabat, checked: false, type: checkbox}
show_availability_group: {name: Pokaż dostępność, checked: false, type: checkbox}
show_group_label: {name: Pokaż etykietę grupy produktów, checked: false, type: checkbox}
actions:
_save: {name: Zapisz}
export:
include_file: export.yml
import:
include_file: import.yml
attachment_list:
forward_parameters: [product_id]
build_options:
related_id: forward_parameters.product_id
title: Załączniki
description: Zarządzanie plikami produktu.
display: [_attachment_list_name, _attachment_list_lang_flag, attachment_list_filesize, is_active]
menu: {use: edit.menu}
fields:
attachment_list_name: {name: Nazwa}
attachment_list_filesize: {name: Rozmiar}
is_active: {name: Aktywny}
attachment_list_lang_flag: {name: Wersja językowa}
empty_message: {message: Brak załączników, i18n: stProduct}
peer_method: doSelectJoinAll
filters:
language: {filter_field: product_has_attachment.language_id}
object_actions:
_edit: -
_delete: -
actions:
_create: {name: Dodaj załącznik, i18n: stProduct}
attachment_edit:
forward_parameters: [product_id]
build_options:
related_id: forward_parameters.product_id
description: Zarządzanie plikami produktu.
menu: {use: edit.menu}
display: [is_active, _attachment_edit_language, _attachment_edit_file, _attachment_edit_filename, description]
fields:
is_active: {name: Aktywny}
attachment_edit_language: {name: Wersja językowa, help: Po zapisaniu wersja językowa zostaje zablokowana}
attachment_edit_file: {name: Załącz/Zmień plik}
attachment_edit_filename: {name: Nazwa pliku}
description: {name: Opis, help: Dodatkowy opis wyświetlany przy każdym załączniku, type: textarea_tag, params: cols=30}
actions:
_delete: {name: Usuń}
_list: {name: Lista załączników, i18n: stProduct}
_save: {name: Zapisz}
_save_and_add: {name: Zapisz i dodaj nowy}
duplicate_list:
forward_parameters: [product_id]
build_options:
related_id: forward_parameters.product_id
title: Duplikaty
menu: {use: edit.menu}
display: [=code, _list_image, =name]
fields:
name: {name: Nazwa, params: size=40 link_to="stProduct/edit?id=%%id%%"}
list_image: {name: Zdjęcie}
code: {name: Kod produktu, params: link_to="stProduct/edit?id=%%id%%"}
filters:
name: {filter_field: product_i18n.name}
code: {filter_field: product.code}
peer_method: doSelectWithI18n
object_actions: []
actions:
duplicate: {name: "Zduplikuj produkt", icon: duplicate, action: duplicate}
parent: {name: "Zobacz oryginalny produkt", icon: preview, action: showParent}
empty_message: {message: "Ten produkt nie ma duplikatów"}

View File

@@ -0,0 +1,51 @@
export:
title: Eksport
menu: {use: list.menu}
default: stExporterCsv
filename: "eksport produktow"
forward_parameters: [category_id]
custom_parameters:
external_images: {name: "Eksportuj zdjęcia do innego sklepu", type: checkbox_tag}
primary_key: code
fields:
code: {name: Kod, sample: 123, type: string}
name: {name: Nazwa, sample: Produkt testowy, type: string}
currency_iso: {name: Waluta, sample: PLN}
currency_exchange: {name: Kurs, type: string, class: stProductImportExport}
vat_value: {name: "Stawka VAT [%]", sample: 0, type: double}
price_netto: {name: Cena netto, sample: 123.45, type: string, class: stProductImportExport}
price_brutto: {name: Cena brutto, sample: 123.45, type: double, class: stProductImportExport}
old_price_netto: {name: Stara cena netto, sample: 125.00, type: string, class: stProductImportExport}
old_price_brutto: {name: Stara cena brutto, sample: 125.00, type: double, class: stProductImportExport}
active: {name: Aktywny, sample: 1, type: integer}
description: {name: Opis, sample: Długi opis produktu, type: string}
short_description: {name: Opis skrócony, sample: Krótki opis produktu, type: string}
search_keywords: {name: Opis do wyszukiwania, type: string, i18n_file: stProduct}
product_images: {name: Zdjęcia, sample: image-1.jpg, class: stProductImportExport, type: string, md5hash: true }
weight: {name: Waga, sample: 2.5, type: double}
hide_price: {name: Ukryj cenę, sample: 1, type: integer, class: stProductImportExport}
uom: {name: Jednostka miary, sample: szt., type: string, class: stProductImportExport}
min_qty: {name: Minimalna ilość, sample: 0.01, type: double}
max_qty: {name: Maksymalna ilość, sample: 0.00, type: double}
step_qty: {name: Wielokrotność ilości, sample: 0.00, type: double}
is_stock_validated: {name: Sprawdzaj stan magazynowy, sample: 1, type: integer}
stock_in_decimals: {name: Zezwalaj na części dziesiętne w ilości, sample: 1, type: integer}
stock_managment: {name: Zarządzaj magazynem z opcjami produktu, class: stProductImportExport }
max_discount: {name: Maksymalny rabat, sample: 100, type: double}
execution_time: {name: Czas realizacji, sample: 1 dzień, type: string}
man_code: {name: Kod producenta, sample: 5900820005184, type: string}
points_value: {name: Cena w punktach, sample: 1, type: integer}
points_earn: {name: Zarobione punkty, sample: 1, type: integer}
points_only: {name: Produkt tylko za punkty, sample: 0, type: integer}
priority: {name: Priorytet, sample: 0, type: integer}
bpum_default_id: {name: Ilość jednostki miary (jednostka), sample: 0, type: integer}
bpum_default_value: {name: Ilość jednostki miary, sample: 2.5, type: double}
bpum_id: {name: Prezentuje cenę dla (jednostka), sample: 0, type: integer}
bpum_value: {name: Prezentuje cenę dla, sample: 2.5, type: double}
product_recommend: {name: Polecane produkty, class: stRecommendedProductsImportExport, md5hash: true }
width: {name: Szerokość, type: double }
height: {name: Wysokość, type: double }
depth: {name: Głębokość, type: double }
delivery_price: {name: Koszt dostawy, type: double }
deliveries: {name: Dostawy, class: stProductImportExport, md5hash: true }
attributes_label: {name: Atrybuty - tytuł, type: string, i18n_file: stProduct}

View File

@@ -0,0 +1,49 @@
import:
title: Import
menu: {use: list.menu}
default: stImporterCsv
default_class: stProductImportExport
filename: "import produktow"
primary_key: code
fields:
code: {name: Kod, sample: 123, type: custom}
name: {name: Nazwa, sample: Produkt testowy, require_on_create: true, type: custom}
currency_iso: {name: Waluta, type: custom, sample: PLN, require_with_fields: [price_netto, price_brutto, old_price_netto, old_price_brutto, wholesale_a_netto, wholesale_a_brutto, wholesale_b_netto, wholesale_b_brutto, wholesale_c_netto, wholesale_c_brutto]}
currency_exchange: {name: Kurs, type: custom, sample: 1.2}
vat_value: {name: "Stawka VAT [%]", sample: 0, type: double, require_with_fields: [price_netto, price_brutto, old_price_netto, old_price_brutto, wholesale_a_netto, wholesale_a_brutto, wholesale_b_netto, wholesale_b_brutto, wholesale_c_netto, wholesale_c_brutto]}
price_netto: {name: Cena netto, sample: 123.45, type: custom}
price_brutto: {name: Cena brutto, sample: 123.45, type: custom}
old_price_netto: {name: Stara cena netto, sample: 125.00, type: custom}
old_price_brutto: {name: Stara cena brutto, sample: 125.00, type: custom}
active: {name: Aktywny, sample: 1, type: integer}
description: {name: Opis, sample: Długi opis produktu}
short_description: {name: Opis skrócony, sample: Krótki opis produktu}
search_keywords: {name: Opis do wyszukiwania, type: string, i18n_file: stProduct}
product_images: {name: Zdjęcia, sample: image-1.jpg, class: stProductImportExport, md5hash: true }
weight: {name: Waga, sample: 2.5, type: double}
hide_price: {name: Ukryj cenę, sample: 1, type: integer, class: stProductImportExport}
uom: {name: Jednostka miary, sample: szt., type: string, require_on_create: true}
min_qty: {name: Minimalna ilość, sample: 0.01, type: custom}
max_qty: {name: Maksymalna ilość, sample: 0.00, type: double}
step_qty: {name: Wielokrotność ilości, sample: 0.00, type: double}
is_stock_validated: {name: Sprawdzaj stan magazynowy, sample: 1, type: integer}
stock_in_decimals: {name: Zezwalaj na części dziesiętne w ilości, sample: 1, type: integer}
stock_managment: {name: Zarządzaj magazynem z opcjami produktu, type: integer, class: stProductImportExport }
max_discount: {name: Maksymalny rabat, sample: 100, type: double}
execution_time: {name: Czas realizacji, sample: 1 dzień}
man_code: {name: Kod producenta, sample: 5900820005184}
points_value: {name: Cena w punktach, sample: 1, type: integer}
points_earn: {name: Zarobione punkty, sample: 1, type: integer}
points_only: {name: Produkt tylko za punkty, sample: 0, type: integer}
priority: {name: Priorytet, sample: 0, type: integer}
bpum_default_id: {name: Jednostka, sample: 0, type: integer}
bpum_default_value: {name: Ilość, sample: 2.5, type: double}
bpum_id: {name: Jednostka, sample: 0, type: integer}
bpum_value: {name: Prezentuje cenę dla, sample: 2.5, type: double}
product_recommend: {name: Polecane produkty, class: stRecommendedProductsImportExport, md5hash: true }
width: {name: Szerokość, type: double }
height: {name: Wysokość, type: double }
depth: {name: Głębokość, type: double }
delivery_price: {name: Koszt dostawy, type: double }
deliveries: {name: Dostawy, class: stProductImportExport, type: custom, md5hash: true }
attributes_label: {name: Atrybuty - tytuł, type: string, i18n_file: stProduct}

View File

@@ -0,0 +1,2 @@
soap:
is_secure: off

View File

@@ -0,0 +1,3 @@
show:
default: domyślny
classic: klasyczny

View File

@@ -0,0 +1,40 @@
<?php
class stExporterCsv1250List extends stExporterCsv1250
{
public function getDataCount()
{
$this->criteria->clearGroupByColumns();
return call_user_func($this->model.'Peer::doCountWithI18n', $this->criteria, true);
}
protected function getData($offset = 0)
{
if (!$this->criteria->getGroupByColumns())
{
$this->criteria->addGroupByColumn(ProductPeer::ID);
}
return parent::getData($offset);
}
protected function doSelect(Criteria $c)
{
return call_user_func($this->model.'Peer::doSelectWithI18n',$c);
}
protected function getCriteria(Criteria $criteria = null)
{
$criteria = sfContext::getInstance()->getUser()->getAttribute('criteria', null, 'soteshop/stProduct/export');
/**
* Load Map Builders fix
*/
foreach (sfContext::getInstance()->getUser()->getAttribute('map_builders', array(), 'soteshop/stProduct/export') as $class)
{
BasePeer::getMapBuilder($class);
}
return parent::getCriteria($criteria);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class stExporterCsvList extends stExporterCsv
{
public function getDataCount()
{
$this->criteria->clearGroupByColumns();
return call_user_func($this->model.'Peer::doCountWithI18n', $this->criteria, true);
}
protected function getData($offset = 0)
{
if (!$this->criteria->getGroupByColumns())
{
$this->criteria->addGroupByColumn(ProductPeer::ID);
}
return parent::getData($offset);
}
protected function doSelect(Criteria $c)
{
return call_user_func($this->model.'Peer::doSelectWithI18n',$c);
}
protected function getCriteria(Criteria $criteria = null)
{
$criteria = sfContext::getInstance()->getUser()->getAttribute('criteria', null, 'soteshop/stProduct/export');
/**
* Load Map Builders fix
*/
foreach (sfContext::getInstance()->getUser()->getAttribute('map_builders', array(), 'soteshop/stProduct/export') as $class)
{
BasePeer::getMapBuilder($class);
}
return parent::getCriteria($criteria);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class stExporterXml2003List extends stExporterXml2003
{
public function getDataCount()
{
$this->criteria->clearGroupByColumns();
return call_user_func($this->model.'Peer::doCountWithI18n', $this->criteria, true);
}
protected function getData($offset = 0)
{
if (!$this->criteria->getGroupByColumns())
{
$this->criteria->addGroupByColumn(ProductPeer::ID);
}
return parent::getData($offset);
}
protected function doSelect(Criteria $c)
{
return call_user_func($this->model.'Peer::doSelectWithI18n',$c);
}
protected function getCriteria(Criteria $criteria = null)
{
$criteria = sfContext::getInstance()->getUser()->getAttribute('criteria', null, 'soteshop/stProduct/export');
/**
* Load Map Builders fix
*/
foreach (sfContext::getInstance()->getUser()->getAttribute('map_builders', array(), 'soteshop/stProduct/export') as $class)
{
BasePeer::getMapBuilder($class);
}
return parent::getCriteria($criteria);
}
}

View File

@@ -0,0 +1,119 @@
<?php
use_helper('Asset', 'stPrice', 'I18N', 'stProductImage', 'stCurrency', 'stText', 'stCategory', 'stProducer');
function object_product_mytabs1(Product $product, $options = array())
{
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductHasTab1Peer::doSelectTab1ForTokenInput($product);
}
$results_formatter = _token_input_product_results_formatter();
$token_formatter = _token_input_product_token_formatter();
return st_tokenizer_input_tag($options['control_name'], st_url_for('@stProductEdit?action=ajaxProductsToken&id='.$product->getId()), $defaults, array('tokenizer' => array(
'preventDuplicates' => true,
'resultsFormatter' => $results_formatter,
'tokenFormatter' => $token_formatter,
'hintText' => __('Wpisz kod/nazwę szukanego produktu'),
'additionalDataFields' => array('code'),
'tokenLimit' => 20,
'sortable' => true
)));
}
function object_product_mytabs2(Product $product, $options = array())
{
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductHasTab2Peer::doSelectTab2ForTokenInput($product);
}
$results_formatter = _token_input_product_results_formatter();
$token_formatter = _token_input_product_token_formatter();
return st_tokenizer_input_tag($options['control_name'], st_url_for('@stProductEdit?action=ajaxProductsToken&id='.$product->getId()), $defaults, array('tokenizer' => array(
'preventDuplicates' => true,
'resultsFormatter' => $results_formatter,
'tokenFormatter' => $token_formatter,
'hintText' => __('Wpisz kod/nazwę szukanego produktu'),
'additionalDataFields' => array('code'),
'tokenLimit' => 20,
'sortable' => true
)));
}
function object_product_mytabs3(Product $product, $options = array())
{
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductHasTab3Peer::doSelectTab3ForTokenInput($product);
}
$results_formatter = _token_input_product_results_formatter();
$token_formatter = _token_input_product_token_formatter();
return st_tokenizer_input_tag($options['control_name'], st_url_for('@stProductEdit?action=ajaxProductsToken&id='.$product->getId()), $defaults, array('tokenizer' => array(
'preventDuplicates' => true,
'resultsFormatter' => $results_formatter,
'tokenFormatter' => $token_formatter,
'hintText' => __('Wpisz kod/nazwę szukanego produktu'),
'additionalDataFields' => array('code'),
'tokenLimit' => 20,
'sortable' => true
)));
}
function object_product_mytabs4(Product $product, $options = array())
{
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductHasTab4Peer::doSelectTab4ForTokenInput($product);
}
$results_formatter = _token_input_product_results_formatter();
$token_formatter = _token_input_product_token_formatter();
return st_tokenizer_input_tag($options['control_name'], st_url_for('@stProductEdit?action=ajaxProductsToken&id='.$product->getId()), $defaults, array('tokenizer' => array(
'preventDuplicates' => true,
'resultsFormatter' => $results_formatter,
'tokenFormatter' => $token_formatter,
'hintText' => __('Wpisz kod/nazwę szukanego produktu'),
'additionalDataFields' => array('code'),
'tokenLimit' => 20,
'sortable' => true
)));
}

View File

@@ -0,0 +1,840 @@
<?php
use_helper('Asset', 'stPrice', 'I18N', 'stProductImage', 'stCurrency', 'stText', 'stCategory', 'stProducer', 'stAvailability');
sfLoader::loadHelpers(['stProductPicker'], 'stProduct');
function st_product_get_admin_header(Product $product, $title)
{
$image = st_product_image_path($product, 'thumb');
$url = url_for('@stProductEdit?id='.$product->getId());
$name = $product->getOptName();
return <<<HTML
<a href="$url"><img src="$image" alt="$name"> <span>$name</span></a>
<span>- $title</span>
HTML;
}
function object_product_is_stock_validated(Product $product, $method, $options)
{
return st_admin_checkbox_tag($options['control_name'], true, $product->getIsStockValidated(true), $options);
}
function object_product_stock_in_decimals(Product $product, $method, $options)
{
if ($product->getStepQty() > 0)
{
$options['disabled'] = true;
}
return select_tag($options['control_name'], options_for_select(array(
0 => __('Wyłączone', null, 'stProduct'),
1 => __('Do 1 miejsca po przecinku', null, 'stProduct'),
2 => __('Do 2 miejsc po przecinku', null, 'stProduct'),
), $product->getStockInDecimals()), $options);
}
/**
* Zwraca zdjęcie produktu dla listy
*
* @param Product|string $product Instacja produktu lub ścieżka do obrazka
* @param string $target
* @return string
*/
function list_product_image($product, $target = null)
{
$options = [
'class' => 'list_product_image',
'style' => 'background-image: url('.st_product_image_path($product, 'icon').')',
];
if (null !== $target)
{
$options['target'] = $target;
}
if (is_object($product) && $product instanceof Product)
{
$options['href'] = st_url_for('@stProductEdit?id='.$product->getId());
return content_tag('a', '', $options);
}
return content_tag('span', '', $options);
}
function object_product_hide_price($product, $method, $options)
{
return _product_hide_price($options['control_name'], $product->$method(), array(), array('include_custom' => __('Wyłączone', null, 'stProduct')));
}
function object_config_hide_price($config, $method, $options)
{
return _product_hide_price($options['control_name'], $config->get($method), array('default' => false), array('include_custom' => __('Wyłączone', null, 'stProduct')));
}
function _product_hide_price($name, $value, $options = array(), $html_options = array())
{
if (isset($options['default']))
{
$default = $options['default'];
unset($options['default']);
}
else
{
$default = true;
}
$values = _product_hide_price_options($default);
return select_tag($name, options_for_select($values, $value, $html_options), $options);
}
function _product_hide_price_options($default = true)
{
$options = array(
1 => __('Dla wszystkich klientów', null, 'stProduct'),
2 => __('Dla klientów niezalogowanych', null, 'stProduct'),
3 => __('Dla klientów niezweryfikowanych', null, 'stProduct'),
);
if ($default)
{
$options = array(__('Zgodnie z globalną konfiguracją', null, 'stProduct')) + $options;
}
return $options;
}
function object_product_dimension(Product $product, $method, $options)
{
$dimensions = ProductDimensionPeer::doSelectNamesCached();
$dimensions = array("" => "---") + $dimensions;
$id = get_id_from_name($options['control_name']);
$js =<<<JS
<script type="text/javascript">
jQuery(function($) {
$('#$id').change(function() {
var select = $(this);
var w = $('.row_width input');
var h = $('.row_height input');
var d = $('.row_depth input');
if (this.selectedIndex) {
var option = select.children(":selected");
var values = option.text().match(/\(([^x]+)x([^x]+)x([^ ]+) cm\)/);
w.val(values[1]).attr('disabled', true);
h.val(values[2]).attr('disabled', true);
d.val(values[3]).attr('disabled', true);
} else {
w.removeAttr('disabled');
h.removeAttr('disabled');
d.removeAttr('disabled');
}
}).change();
});
</script>
JS;
$link = st_get_admin_button('default', __('Konfiguracja rozmiarów', null, 'stProductDimension'), '@stProductDimension?action=list', array('size' => 'small', 'target' => '_blank', 'class' => 'bs-mt-2'));
return select_tag($options['control_name'], options_for_select($dimensions, $product->$method()), $options).$js.'<br>'.$link;
}
function list_product_name(Product $product, $list_mode)
{
$user = sfContext::getInstance()->getUser();
if ($list_mode == 'edit')
{
return input_tag('product['.$product->getId().'][name]', $product->getName());
}
else
{
if (st_check_strlen($product->getName()) > '64') {
return st_truncate_text($product->getName(), '65', '...');
} else {
return $product->getName();
}
}
}
function object_product_image(Product $product)
{
$images = array();
if (!$product->isNew())
{
$c = new Criteria();
$c->addSelectColumn(sfAssetPeer::ID);
$c->addSelectColumn(sfAssetPeer::FILENAME);
$c->addJoin(sfAssetPeer::ID, ProductHasSfAssetPeer::SF_ASSET_ID);
$c->add(ProductHasSfAssetPeer::PRODUCT_ID, $product->getId());
$c->addDescendingOrderByColumn(ProductHasSfAssetPeer::IS_DEFAULT);
$c->addAscendingOrderByColumn(ProductHasSfAssetPeer::ID);
$rs = sfAssetPeer::doSelectRs($c);
while($rs->next())
{
$images[$rs->getInt(1)] = '/media/products/'.$product->getAssetFolder().'/images/'.$rs->getString(2);
}
}
return content_tag('div', plupload_images_tag('product_images', $images, array('edit_url' => 'stProduct/imageGalleryEdit?culture='.$product->getCulture(), 'crop' => 'product')), array(
'style' => 'width: 100%',
));
}
function list_product_price_label($label)
{
$currency = stCurrency::getInstance(sfContext::getInstance())->getBackendMainCurrency();
return __($label, null, 'stProduct').' ['.$currency->getFrontSymbol().$currency->getBackSymbol().']';
}
function list_product_price(Product $product, $list_mode)
{
$user = sfContext::getInstance()->getUser();
if ($list_mode == 'edit')
{
$request = sfContext::getInstance()->getRequest();
$name = 'product['.$product->getId().'][price_brutto]';
$value = $request->hasErrors() && $product->getCurrencyExchange() == 1 ? $request->getParameter($name) : stPrice::round($product->getPriceBrutto());
return input_tag($name, $value, array(
'class' => 'editable',
'disabled' => $product->getCurrencyExchange() != 1,
'data-format' => 'decimal',
));
}
else
{
return '<p style="text-align: right">'.st_format_price($product->getPriceBrutto()).'</p>';
}
}
function list_product_stock(Product $product, $list_mode)
{
if ($list_mode == 'edit')
{
$name = 'product['.$product->getId().'][stock]';
$content = input_tag($name, stPrice::round($product->getStock(), $product->getStockInDecimals()), array(
'data-format' => 'decimal',
'data-format-decimals' => $product->getStockInDecimals(),
'size' => 8,
'class' => 'text-right',
'disabled' => $product->getOptHasOptions() > 1 && $product->getStockManagment() == ProductPeer::STOCK_PRODUCT_OPTIONS,
));
if ($product->getOptHasOptions() > 1 && $product->getStockManagment() == ProductPeer::STOCK_PRODUCT_OPTIONS)
{
$title = __('Produkt posiada opcje produktu, aby edytować stan magazynowy przedź do edycji<br>%link%', array(
'%link%' => st_link_to(__('stanu magazynowego opcji'), '@stDepositoryPlugin?action=optionsList&product_id='.$product->getId(), array('target' => '_blank')),
), 'stProduct');
$content = content_tag('span', $content, array('title' => $title, 'class' => 'tooltip'));
}
return $content;
}
else
{
return $product->getStock();
}
}
function list_product_availability(Product $product, $listMode)
{
if ($listMode == 'edit')
{
$name = 'product['.$product->getId().'][availability_id]';
return st_availability_select_tag($name, $product->getAvailabilityId());
}
return st_availability_backend_label($product);
}
function st_product_bpum_select_tag($name, $value, $options = array())
{
$selectOptions = [];
foreach (BaseBasicPriceUnitMeasurePeer::doSelect(new Criteria()) as $unit)
{
$selectOptions[$unit->getId()] = array(
'label' => $unit->getUnitSymbol().' ('.$unit->getUnitName().')',
'attr' => ['data-unit-group' => $unit->getUnitGroup()],
);
}
$options['selected'] = $value;
return select_tag($name, $selectOptions, $options);
}
/**
* Funkcja dodana na potrzeby zgodności wstecz
*
* @param Product $product
* @return void
*/
function list_stock(Product $product)
{
return $product->getStock();
}
function list_product_preview(Product $product)
{
return st_link_to(st_admin_get_icon('preview', array('title' => __('Podgląd'))), '@stProduct?action=preview&id='.$product->getId(), array('target' => '_blank'));
}
function list_product_info(Product $product)
{
$user = sfContext::getInstance()->getUser();
if ($user->getAttribute('list.mode', null, 'soteshop/stAdminGenerator/'.sfContext::getInstance()->getModuleName().'/config') == 'edit')
{
$code = input_tag('product['.$product->getId().'][code]', $product->getCode());
}
else
{
$code = $product->getCode();
}
return '<a href="'.st_url_for('@stProduct?id='.$product->getId()).'">'.$product->getName().'</a><p>'.__('Kod produktu').':&nbsp;&nbsp;'.$code.'</p>';
}
function object_product_producer(Product $product, $method, $options)
{
return producer_select_tag($options['control_name'], $product->getProducer(), array('include_custom' => __('Brak')));
}
function list_product_producer(Product $product, $list_mode = null)
{
$user = sfContext::getInstance()->getUser();
if ($list_mode == 'edit')
{
return producer_select_tag('product['.$product->getId().'][producer_id]', $product->getProducer(), array('include_custom' => __('Brak')));
}
else
{
return $product->getProducer();
}
}
function object_product_tax(Product $product, $method, $options = array())
{
use_helper('stPrice');
$cache = new stFunctionCache('stTax');
$tax_info = $cache->cacheCall('_object_product_tax_helper');
st_price_tax_managment_init(array(
'taxField' => 'product_vat',
'taxValues' => $tax_info['values'],
'priceFields' => array(
array('price' => 'product_price_netto', 'priceWithTax' => 'product_price_brutto'),
array('price' => 'product_old_price_netto', 'priceWithTax' => 'product_old_price_brutto'),
)));
return select_tag('product[vat]', options_for_select($tax_info['names'], $product->getTaxId() ? $product->getTaxId() : $tax_info['default']));
}
function _object_product_tax_helper()
{
$arr = array('values' => array());
$taxes = TaxPeer::doSelect(new Criteria());
foreach ($taxes as $tax)
{
$arr['values'][] = $tax->getVat();
$arr['names'][$tax->getId()] = $tax->getVatName();
if ($tax->getIsDefault())
{
$arr['default'] = $tax->getId();
}
}
return $arr;
}
function object_product_group(Product $product, $method, $options = array())
{
$cache = new stFunctionCache('stProductGroup');
$groups = $cache->cacheCall('_object_product_group_helper');
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductPeer::doSelectProductGroupsForTokenInput($product);
}
return st_tokenizer_input_tag($options['control_name'], $groups, $defaults, array('tokenizer' => array('preventDuplicates' => true, 'hintText' => __('Wpisz szukana grupę'))));
}
function _object_product_group_helper()
{
$groups = array();
$c = new Criteria();
$c->add(ProductGroupPeer::FROM_BASKET_VALUE, null, Criteria::ISNULL);
foreach (ProductGroupPeer::doSelect($c) as $group)
{
$groups[] = array('id' => $group->getId(), 'name' => $group->getName());
}
return $groups;
}
function object_product_delivery(Product $product, $method, $options = array())
{
$cache = new stFunctionCache('stDelivery');
$deliveries = $cache->cacheCall('_object_product_delivery_helper');
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = array(
'mode' => $parameters['mode'],
'ids' => stJQueryToolsHelper::parseTokensFromRequest($parameters['ids'])
);
}
else
{
$defaults = $product->getDeliveries();
if ($defaults && $defaults['ids'])
{
$tokens = array();
foreach ($defaults['ids'] as $id)
{
if (isset($deliveries[$id]))
{
$tokens[] = array(
'id' => $id,
'name' => $deliveries[$id]['name'],
);
}
}
$defaults['ids'] = $tokens;
}
if (!$defaults || !$defaults['ids'])
{
$defaults = null;
}
}
$select = select_tag($options['control_name'].'[mode]', options_for_select(array('' => __('Wszystkie', null, 'stProduct'), 'allow' => __('Zezwalaj', null, 'stProduct'), 'exclude' => __('Wykluczaj', null, 'stProduct')), $defaults ? $defaults['mode'] : null));
$token = st_tokenizer_input_tag($options['control_name'].'[ids]', array_values($deliveries), $defaults ? $defaults['ids'] : null, array('tokenizer' => array('preventDuplicates' => true, 'hintText' => __('Wpisz szukana dostawę', null, 'stProduct'))));
$content =<<< HTML
$select
<div id="product_delivery_token" style="margin-top: 5px; display: none">$token</div>
<script type="text/javascript">
jQuery(function(\$) {
\$('#product_delivery_mode').change(function() {
if (\$(this).val()) {
\$('#product_delivery_token').show();
} else {
\$('#product_delivery_token').hide();
}
}).change();
});
</script>
HTML;
return $content;
}
function _object_product_delivery_helper()
{
$deliveries = array();
$c = new Criteria();
$c->add(DeliveryPeer::ACTIVE, true);
$c->addAscendingOrderByColumn(DeliveryPeer::OPT_NAME);
foreach (DeliveryPeer::doSelect($c) as $delivery)
{
$id = $delivery->getId();
$deliveries[$id] = array('id' => $id, 'name' => $delivery->getOptName()." (".$id.")");
}
return $deliveries;
}
function object_product_category(Product $product, $method, $options = array())
{
$context = sfContext::getInstance();
$request = $context->getRequest();
$defaults = array();
$default = 0;
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
$default = $request->getParameter('product_default_category');
}
elseif ($product->isNew())
{
$categoryId = $request->getParameter('category_id');
if ($categoryId)
{
$category = CategoryPeer::retrieveByPK($categoryId);
if ($category)
{
$path = array();
foreach ($category->getPath() as $c)
{
$path[] = $c->getOptName();
}
$path[] = $category->getOptName();
$defaults = array(
array('id' => $category->getId(), 'name' => implode(' / ', $path))
);
$default = $category->getId();
}
}
}
else
{
$defaults = ProductPeer::doSelectCategoriesForTokenInput($product);
$default = ProductPeer::doSelectDefaultCategoryId($product);
if (!$default && $defaults) {
$default = $defaults[0]['id'];
}
}
return category_picker_input_tag($options['control_name'], $defaults, array('default' => $default));
}
function object_product_accessories(Product $product, $method, $options = array())
{
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductPeer::doSelectAccessoriesForTokenInput($product);
}
$results_formatter = _token_input_product_results_formatter();
$token_formatter = _token_input_product_token_formatter();
return st_tokenizer_input_tag($options['control_name'], st_url_for('@stProductEdit?action=ajaxProductsToken&id='.$product->getId()), $defaults, array('tokenizer' => array(
'preventDuplicates' => true,
'resultsFormatter' => $results_formatter,
'tokenFormatter' => $token_formatter,
'hintText' => __('Wpisz kod/nazwę szukanego produktu'),
'additionalDataFields' => array('code'),
'tokenLimit' => 20,
'sortable' => true
)));
}
function object_product_recommend(Product $product, $method, $options = array())
{
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductPeer::doSelectRecommendForTokenInput($product);
}
$results_formatter = _token_input_product_results_formatter();
$token_formatter = _token_input_product_token_formatter();
return st_tokenizer_input_tag($options['control_name'], st_url_for('@stProductEdit?action=ajaxProductsToken&id='.$product->getId()), $defaults, array('tokenizer' => array(
'preventDuplicates' => true,
'resultsFormatter' => $results_formatter,
'tokenFormatter' => $token_formatter,
'hintText' => __('Wpisz kod/nazwę szukanego produktu'),
'additionalDataFields' => array('code'),
'tokenLimit' => 20
)));
}
function object_product_discount_group(Product $product, $method, $options = array())
{
$cache = new stFunctionCache('stDiscount');
$groups = $cache->cacheCall('_object_product_discount_group_helper');
$request = sfContext::getInstance()->getRequest();
if ($request->hasErrors())
{
$parameters = $request->getParameter($options['control_name']);
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
}
else
{
$defaults = ProductPeer::doSelectDiscountGroupsForTokenInput($product);
}
return st_tokenizer_input_tag($options['control_name'], $groups, $defaults, array('tokenizer' => array('preventDuplicates' => true, 'hintText' => __('Wpisz nazwę szukanej grupy'))));
}
function _object_product_discount_group_helper()
{
$groups = array();
$c = new Criteria();
foreach (DiscountPeer::doSelect($c) as $group)
{
$groups[] = array('id' => $group->getId(), 'name' => $group->getName().' ('.$group->getValue().'%)');
}
return $groups;
}
function object_product_availability($product, $method, $options = array())
{
$c = new Criteria();
$select_options = array('' => __('Ustaw według magazynu'));
foreach (AvailabilityPeer::doSelectWithI18n($c) as $availability)
{
$select_options[$availability->getId()] = $availability->getAvailabilityName();
}
return select_tag($options['control_name'], options_for_select($select_options, $product->getAvailabilityId()), $options);
}
function object_product_step_qty(Product $product, $method, $options)
{
$id = get_id_from_name($options['control_name']);
$js =<<<JS
<script type="text/javascript">
jQuery(function($)
{
$('#$id').change(function(){
$('#product_stock_in_decimals').attr('checked' , this.value > 0);
$('#product_stock_in_decimals').attr('disabled' , this.value > 0);
});
});
</script>
JS;
return object_product_price($product, $method, $options).$js;
}
function object_product_weight(Product $product, $method, $options)
{
return object_product_price($product, $method, $options).' kg';
}
function object_product_stock_managment(Product $product, $method, $options)
{
$name = $options['control_name'];
unset($options['control_name']);
return select_tag($name, options_for_select(array(
ProductPeer::STOCK_PRODUCT_OPTIONS => __('z opcjami produktu'),
ProductPeer::STOCK_PRODUCT => __('bez opcji produktu')
), $product->getStockManagment()), $options);
}
function object_product_stock(Product $product, $method, $options)
{
$option_link = $product->getOptHasOptions() > 1 ? st_get_admin_button('edit', __('Edytuj', null, 'stProduct'), '@stDepositoryPlugin?action=optionsList&product_id='.$product->getId(), array('target' => '_blank')) : '';
$product_stock = object_product_price($product, $method, $options);
$spo = ProductPeer::STOCK_PRODUCT_OPTIONS;
$sp = ProductPeer::STOCK_PRODUCT;
$dsp = $dspo = '';
if ($product->hasStockManagmentWithOptions())
{
$dsp = 'style="display: none"';
}
else
{
$dspo = 'style="display: none"';
}
$html =<<<HTML
<div class="stock_managment" id="stock_managment_$spo" $dspo>$option_link</div>
<div class="stock_managment" id="stock_managment_$sp" $dsp>$product_stock</div>
<script type="text/javascript">
jQuery(function($) {
$('#product_stock_managment').change(function() {
var select = $(this);
var index = select.val();
var container = $('#stock_managment_'+index);
if (!container.is(':empty')) {
$('.stock_managment').hide();
container.show();
}
});
});
</script>
HTML;
return $html;
}
function object_product_uom($product, $method, $options)
{
return input_tag($options['control_name'], $product->getUom(), $options);
}
function object_product_price(Product $product, $method, $options)
{
$name = $options['control_name'];
unset($options['control_name']);
if (!isset($options['size']))
{
$options['size'] = 8;
}
if (!isset($options['maxlength']))
{
$options['maxlength'] = 11;
}
$js = st_price_add_format_behavior(get_id_from_name($name));
return input_tag($name, st_price_format($product->$method()), $options).$js;
}
function st_product_uom($product)
{
$i18n = sfContext::getInstance()->getI18N();
return $product ? $product->getFormattedUom($i18n) : ProductPeer::getDefaultUom($i18n);
}
function st_product_check_price_type()
{
$config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
return $config->get('price_type');
}
function st_product_get_attachment_icon($attachment)
{
$types = array('archive' => true, 'txt' => true, 'image' => true, 'pdf' => true);
$type = isset($types[$attachment->getType()]) ? $attachment->getType() : 'txt';
return st_backend_get_icon('file-'.$type);
}
function st_product_category_filter($parent)
{
if (is_object($parent))
{
$children = $parent->getChildren();
}
else
{
$children = $parent;
}
$content = '';
$is_first = true;
foreach ($children as $child)
{
$content .= _st_category_filter_item($child, strtr(microtime(true), '.', '-').'-'.$child->getId(), $is_first);
$is_first = false;
}
return content_tag('ul', $content);
}
function _st_category_filter_item(Category $item, $item_id, $is_first = false)
{
$params = array();
$has_children = $item->hasChildren();
if ($has_children)
{
$params['class'] = 'expandable loadable';
$children = content_tag('div', strtotime($item->getUpdatedAt()), array('id' => 'sub-categories-'.$item_id, 'class' => 'sub-categories', 'style' => 'display: none;'));
$expand_icon = content_tag('span', '&rsaquo;');
}
else
{
$children = '';
$expand_icon = '';
}
if ($is_first)
{
$params['class'] = isset($params['class']) ? $params['class'].' first' : 'first';
}
return content_tag('li', $children.link_to($item->getName().$expand_icon, '@stProductCategoryFilter?category_id='.$item->getId()), $params);
}

View File

@@ -0,0 +1,55 @@
<?php
use_helper('I18N');
use_stylesheet('backend/stProductEdit.css?v='.stApplication::getApplicationVersion('stProduct'));
function st_product_picker_tag($name, array $productIds, array $options = [])
{
$results_formatter = _token_input_product_results_formatter();
$token_formatter = _token_input_product_token_formatter();
$c = new Criteria();
$c->add(ProductPeer::ID, $productIds, Criteria::IN);
if (!empty($productIds))
{
$c->addOrderByField(ProductPeer::ID, $productIds);
}
$defaults = ProductPeer::doSelectTokens($c);
$options = array_merge(array(
'preventDuplicates' => true,
'resultsFormatter' => $results_formatter,
'tokenFormatter' => $token_formatter,
'hintText' => __('Wpisz kod/nazwę szukanego produktu', null, 'stProduct'),
'additionalDataFields' => array('code'),
'tokenLimit' => 20
), $options);
return st_tokenizer_input_tag($name, st_url_for('@stProductEdit?action=ajaxProductsToken&id=0'), $defaults, array('tokenizer' => $options));
}
function object_st_product_picker_tag($object, $method, $options = array(), $default_value = null)
{
$options = _parse_attributes($options);
$value = _get_object_value($object, $method, $default_value);
$name = _convert_method_to_name($method, $options);
return st_product_picker_tag($name, $value, $options);
}
function _token_input_product_token_formatter()
{
return "function (item) {
return '<li class=\"product_token\">'+item.name+'<span class=\"code\">('+item.code+')</span></li>';
}";
}
function _token_input_product_results_formatter()
{
return "function (item, token_input, query) {
return '<li class=\"product_token bs-d-flex bs-align-items-center\"><div class=\"image\"><div style=\"background-image: url('+item.image+')\"></div></div><span class=\"name\">'+item.name+'<span class=\"code\">('+item.code+')</span></span></li>';
}";
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
<?php
class stProductBreadcrumbsBuilder extends autoStProductBreadcrumbsBuilder
{
public function getDefaultBreadcrumbs()
{
if (null === $this->defaultBreadcrumbs)
{
$breadcrumbs = parent::getDefaultBreadcrumbs();
if (isset($this->forwardParameters['category_id']) && $this->forwardParameters['category_id'])
{
$category = CategoryPeer::retrieveByPK($this->forwardParameters['category_id']);
foreach ($category->getPath() as $parent)
{
$breadcrumbs->add($parent->getOptName(), !$parent->isRoot() ? '@stProduct?action=list&category_id='.$parent->getId() : null);
}
$breadcrumbs->add($category->getOptName(), '@stProduct?action=list&category_id='.$category->getId());
}
$this->defaultBreadcrumbs = $breadcrumbs;
}
return $this->defaultBreadcrumbs;
}
}

View File

@@ -0,0 +1,63 @@
<?php
class stProductCodeValidator extends sfValidator
{
protected $regex = null;
public function execute(&$value, &$error)
{
if (empty($value))
{
$error = 'Podaj kod produktu';
return false;
}
if (!$this->regex->execute($value, $error))
{
return false;
}
if (!$this->validateUnique($value, $error))
{
return false;
}
return true;
}
public function initialize($context, $parameters = array())
{
parent::initialize($context, $parameters);
$this->regex = new sfRegexValidator();
$this->regex->initialize($context, array('pattern' => '/["\']/', 'match' => false, 'match_error' => 'Kod produktu nie może zawierać znaków \' oraz "'));
return true;
}
protected function validateUnique($value, &$error)
{
$r = $this->getContext()->getRequest();
$c = new Criteria();
$c->add(ProductPeer::CODE, $value);
if ($this->getParameter('check_primary_key', true))
{
$c->add(ProductPeer::ID, $this->getParameter('primary_key', $r->getParameter(ProductPeer::translateFieldName('Id', BasePeer::TYPE_PHPNAME, BasePeer::TYPE_FIELDNAME))), Criteria::NOT_EQUAL);
}
if (ProductPeer::doCount($c))
{
$error = 'Ten kod produktu już jest wykorzystany. Wpisz inny kod.';
return false;
}
return true;
}
}

View File

@@ -0,0 +1,26 @@
<?php
class stProductEdit
{
public static function getCurrency()
{
$arr = array();
$currencies = CurrencyPeer::doSelect(new Criteria());
foreach ($currencies as $currency)
{
if ($currency->getIsSystemCurrency())
{
$arr['system_currency_id'] = $currency->getId();
}
$arr['exchange_rates'][$currency->getId()] = $currency->getExchangeBackend();
$arr['select_options'][$currency->getId()] = $currency->getNameBackend();
}
$arr['exchange_rates'] = json_encode($arr['exchange_rates']);
return $arr;
}
}

View File

@@ -0,0 +1,635 @@
<?php
/**
* SOTESHOP/stProduct
*
* Ten plik należy do aplikacji stProduct opartej na licencji (Open License SOTE) Otwarta Licencja 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 stProduct
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
* @version $Id: stProductImportExport.class.php 44822 2023-07-03 12:29:01Z marcin $
*/
class stProductImportExport extends autoStProductImportExport
{
protected static $deliveryModes = array(
"W" => "exclude",
"Z" => "allow",
"E" => "exclude",
"A" => "allow"
);
public static function ImportValidateCode($value, $product_code)
{
if (preg_match('/[\'"]/', $value))
{
stImportExportLog::getActiveLogger()->add($product_code, sfContext::getInstance()->getI18n()->__('Kod produktu nie może zawierać znakow \' oraz "'), 2);
return false;
}
return true;
}
public static function ImportValidateMinQty($value, $product_code, $data)
{
if ($data['max_qty'] > 0 && $value > $data['max_qty'])
{
stImportExportLog::getActiveLogger()->add($product_code, sfContext::getInstance()->getI18n()->__('Minimalna ilość nie może być większa od maksymalnej ilości', null, 'stProduct'), 2);
return false;
}
return true;
}
public static function ImportValidateCurrencyExchange($value, $product_code, $data)
{
if (empty($value) && $value !== 0)
{
return true;
}
if (!is_numeric($value))
{
$context = sfContext::getInstance();
stImportExportLog::getActiveLogger()->add($product_code, $context->getI18n()->__('Kurs "%%exchange%%" posiada nieprawidłowy format (poprawny format: 10, 10.0000)', array('%%exchange%%' => $value)), 2);
return false;
}
return true;
}
public static function ImportValidateCurrencyIso($value, $product_code, $data)
{
if (empty($value))
{
$context = sfContext::getInstance();
stImportExportLog::getActiveLogger()->add($product_code, $context->getI18n()->__('Brak ustawionej waluty'), 2);
return false;
}
if (CurrencyPeer::retrieveByIso($value) === null)
{
$context = sfContext::getInstance();
stImportExportLog::getActiveLogger()->add($product_code, $context->getI18n()->__('Waluta "%%currency%%" nie istnieje', array('%%currency%%' => $value)), 2);
return false;
}
return true;
}
public static function ImportValidateOldPriceNetto($value, $product_code, $data)
{
$context = sfContext::getInstance();
if (!self::validatePriceFormat($context, $value))
{
$message = $context->getI18n()->__('Stara cena netto "%%price%%" posiada nieprawidłowy format (poprawny format: 10, 10.00).', array('%%price%%' => $value));
stImportExportLog::getActiveLogger()->add($product_code, $message, 2);
return false;
}
if (!empty($value) && isset($data['old_price_brutto']) && $data['old_price_brutto'] && self::validateNettoBrutto($value, $data['old_price_brutto'], $data['vat_value'], $data['currency_iso']) == false)
{
stImportExportLog::getActiveLogger()->add($product_code, $context->getI18n()->__('Stara cena netto nie pokrywa się z ceną brutto (jeżeli chcesz zmienić cenę netto usuń cenę brutto).'), 2);
return false;
}
return true;
}
public static function ImportValidateOldPriceBrutto($value, $product_code, $data)
{
$context = sfContext::getInstance();
if (!self::validatePriceFormat($context, $value))
{
$message = $context->getI18n()->__('Stara cena brutto "%%price%%" posiada nieprawidłowy format (poprawny format: 10, 10.00).', array('%%price%%' => $value));
stImportExportLog::getActiveLogger()->add($product_code, $message, 2);
return false;
}
if (!empty($value) && isset($data['old_price_netto']) && $data['old_price_netto'] && self::validateNettoBrutto($data['old_price_netto'], $value, $data['vat_value'], $data['currency_iso']) == false)
{
stImportExportLog::getActiveLogger()->add($product_code, $context->getI18n()->__('Stara cena brutto nie pokrywa się z ceną netto (jeżeli chcesz zmienić cenę brutto usuń cenę netto).'), 2);
return false;
}
return true;
}
public static function ImportValidatePriceNetto($value, $product_code, $data)
{
$context = sfContext::getInstance();
if (!self::validatePriceFormat($context, $value))
{
$message = $context->getI18n()->__('Cena netto "%%price%%" posiada nieprawidłowy format (poprawny format: 10, 10.00).', array('%%price%%' => $value));
stImportExportLog::getActiveLogger()->add($product_code, $message, 2);
return false;
}
if (!empty($value) && isset($data['price_brutto']) && $data['price_brutto'] && self::validateNettoBrutto($value, $data['price_brutto'], $data['vat_value'], $data['currency_iso']) == false)
{
stImportExportLog::getActiveLogger()->add($product_code, $context->getI18n()->__('Cena netto nie pokrywa się z ceną brutto (jeżeli chcesz zmienić cenę netto usuń cenę brutto).'), 2);
return false;
}
return true;
}
public static function ImportValidatePriceBrutto($value, $product_code, $data)
{
$context = sfContext::getInstance();
if (!self::validatePriceFormat($context, $value))
{
$message = $context->getI18n()->__('Cena brutto "%%price%%" posiada nieprawidłowy format (poprawny format: 10, 10.00).', array('%%price%%' => $value));
stImportExportLog::getActiveLogger()->add($product_code, $message, 2);
return false;
}
if (!empty($value) && isset($data['price_netto']) && $data['price_netto'] && self::validateNettoBrutto($data['price_netto'], $value, $data['vat_value'], $data['currency_iso']) == false)
{
stImportExportLog::getActiveLogger()->add($product_code, $context->getI18n()->__('Cena brutto nie pokrywa się z ceną netto (jeżeli chcesz zmienić cenę brutto usuń cenę netto).'), 2);
return false;
}
return true;
}
public static function validatePriceFormat($context, $value)
{
$nv = new sfNumberValidator();
$nv->initialize($context, array(
'min' => 0,
'type' => 'any'
));
return empty($value) || $nv->execute($value, $error) == true;
}
public static function validateNettoBrutto($netto, $brutto, $tax, $currency)
{
$config = stConfig::getInstance(null, 'stCurrencyPlugin');
if ($currency != $config->get('default_currency'))
{
return true;
}
return stPrice::round($netto) == stPrice::extract($brutto, $tax) || stPrice::round($brutto) == stPrice::calculate($netto, $tax);
}
public static function setCurrencyExchange($product, $value, $logger, $data)
{
$config = stConfig::getInstance(null, 'stCurrencyPlugin');
if ($value && $data['currency_iso'] != $config->get('default_currency'))
{
$product->setCurrencyExchange($value);
$product->setHasFixedCurrency(true);
}
else
{
$product->setHasFixedCurrency(false);
$product->setCurrencyExchange($product->getCurrency()->getExchange());
}
}
public static function getCurrencyExchange($product)
{
return $product->getHasFixedCurrency() ? stPrice::round($product->getCurrencyExchange(), 4) : null;
}
public static function getPriceNetto($product)
{
return $product->getCurrencyExchange() == 1 ? stPrice::round($product->getPriceNetto()) : null;
}
public static function setPriceBrutto(Product $product, $value, $logger, $data)
{
$config = stConfig::getInstance(null, 'stCurrencyPlugin');
if ($data['currency_iso'] == $config->get('default_currency'))
{
$product->setPriceBrutto($value);
if (!isset($data['price_netto']))
{
$product->setPriceNetto(null);
}
$product->setCurrencyPrice(null);
}
else
{
$product->setCurrencyPrice($value);
}
}
public static function setPriceNetto(Product $product, $value, $logger, $data)
{
$product->setPriceNetto($value);
if (!isset($data['price_brutto']))
{
$product->setPriceBrutto(null);
}
}
public static function setOldPriceNetto(Product $product, $value, $logger, $data)
{
$product->setOldPriceNetto($value);
if (!isset($data['old_price_brutto']))
{
$product->setOldPriceBrutto(null);
}
}
public static function setOldPriceBrutto(Product $product, $value, $logger, $data)
{
$config = stConfig::getInstance(null, 'stCurrencyPlugin');
if ($data['currency_iso'] == $config->get('default_currency'))
{
$product->setOldPriceBrutto($value);
$product->setCurrencyOldPrice(null);
}
else
{
$product->setCurrencyOldPrice($value);
if (!isset($data['old_price_netto']))
{
$product->setOldPriceNetto(null);
}
}
}
public static function getPriceBrutto($product)
{
return $product->getCurrencyExchange() == 1 ? $product->getPriceBrutto() : $product->getCurrencyPrice();
}
public static function getOldPriceNetto($product)
{
return $product->getCurrencyExchange() == 1 ? stPrice::round($product->getOldPriceNetto()) : null;
}
public static function getOldPriceBrutto($product)
{
return $product->getCurrencyExchange() == 1 ? $product->getOldPriceBrutto() : $product->getCurrencyOldPrice();
}
public static function getUom($product)
{
return $product->getUom() ? $product->getUom() : sfContext::getInstance()->getI18N()->__('szt.');
}
public static function ImportValidateName($value, $product_code, $data)
{
if (strlen(trim($value)) == 0)
{
stImportExportLog::getActiveLogger()->add($product_code, sfContext::getInstance()->getI18n()->__('Nazwa produktu jest pusta'), 2);
return false;
}
return true;
}
public static function getStockManagment($product)
{
return intval($product->getStockManagment() == ProductPeer::STOCK_PRODUCT_OPTIONS);
}
public static function setStockManagment($product, $value)
{
return $product->setStockManagment($value ? ProductPeer::STOCK_PRODUCT_OPTIONS : ProductPeer::STOCK_PRODUCT);
}
public static function setHidePrice($product, $value)
{
if ($value == 4)
{
$value = null;
}
return $product->setHidePrice($value);
}
public static function getHidePrice($product)
{
$value = $product->getHidePrice();
return null === $value ? 4 : $value;
}
public static function setDeliveries($product, $value)
{
if (empty($value))
{
$product->setDeliveries(null);
}
else
{
$product->setDeliveries(self::parseDeliveries($value));
}
}
public static function getDeliveries($product)
{
$culture = sfContext::getInstance()->getUser()->getCulture();
$deliveries = $product->getDeliveries();
$ids = DeliveryPeer::retrieveIdsCached();
if (!$deliveries || !$deliveries["mode"] || !$deliveries["ids"])
{
return '';
}
$deliveries["ids"] = array_intersect($ids, $deliveries["ids"]);
if (!$deliveries["ids"])
{
return '';
}
$content = array();
if ($culture == 'pl_PL')
{
$content[] = $deliveries['mode'] == "exclude" ? "W" : "Z";
}
else
{
$content[] = $deliveries['mode'] == "exclude" ? "E" : "A";
}
$content[] = implode(", ", $deliveries["ids"]);
return implode(" | ", $content);
}
public static function parseDeliveries($value)
{
list($mode, $ids) = explode("|", preg_replace('/[ ]+/', "", $value));
return array(
"mode" => isset(self::$deliveryModes[trim($mode)]) ? self::$deliveryModes[trim($mode)] : null,
"ids" => explode(",", $ids)
);
}
public static function ImportValidateDeliveries($value, $product_code, $data)
{
$context = sfContext::getInstance();
if ($value)
{
$parsed = self::parseDeliveries($value);
if (null === $parsed['mode'] || empty($parsed['ids']) || in_array(false, filter_var_array($parsed['ids'], FILTER_VALIDATE_INT)))
{
$message = $context->getI18n()->__('Dostawy "%%deliveries%%" posiadają nieprawidłowy format (poprawny format: "W | 1, 2" lub "Z | 2, 3, 4").', array('%%deliveries%%' => $value));
stImportExportLog::getActiveLogger()->add($product_code, $message, 2);
return false;
}
$ids = array_diff($parsed['ids'], DeliveryPeer::retrieveIdsCached());
if ($ids && $ids != $parsed['ids'])
{
$message = $context->getI18n()->__('Dostawy o id "%%deliveries%%" nie istnieją lub nie są aktywne.', array('%%deliveries%%' => implode(", ", $ids)));
stImportExportLog::getActiveLogger()->add($product_code, $message, 2);
return false;
}
}
return true;
}
public static function getProductImages(Product $product, $logger, array $customParameters)
{
$externalImages = isset($customParameters['external_images']);
return implode(' | ', ProductPeer::getProductImagesArray($product, $externalImages));
}
public static function setProductImages(Product $product, $value, $logger = null)
{
$ok = true;
$default = true;
$imagesToProcess = array();
$allowedImageTypes = [IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG];
$allowedImageExtensions = ['jpg', 'jpeg', 'gif', 'png'];
$allowedImageFormats = ['JPEG', 'GIF', 'PNG'];
$images = array_flip(ProductPeer::getProductImagesArray($product));
$imageDir = sfConfig::get('sf_upload_dir').'/assets';
$remoteImageDir = $imageDir.'/remote';
$fileDownloader = new stFileDownloader(['encode' => false]);
$imagesToImport = array_map('trim', explode('|', $value));
if (!is_dir($remoteImageDir))
{
mkdir($remoteImageDir, 0755, true);
}
if (sfThumbnail::hasImageTypeSupport('webp'))
{
$allowedImageTypes[] = IMAGETYPE_WEBP;
$allowedImageExtensions[] = 'webp';
$allowedImageFormats[] = 'WebP';
}
$duplicates = array_unique(array_diff_assoc($imagesToImport, array_unique($imagesToImport)));
if (!empty($duplicates))
{
$logger->add($product->getCode(), sfContext::getInstance()->getI18n()->__('Kolumna %%column%% zawiera zduplikowane zdjęcie %%duplicates%%', array(
'%%column%%' => sprintf('<code>%s</code>', 'product_images'),
'%%duplicates%%' => sprintf('<code>%s</code>', implode(', ', $duplicates)),
), 'stProduct'), stImportExportLog::$WARNING);
$ok = false;
$imagesToImport = [];
}
foreach ($imagesToImport as $filename)
{
$url = null;
if (empty($filename))
{
continue;
}
$source = $imageDir.'/'.$filename;
$isUrl = false !== strpos($filename, '://');
if ($isUrl)
{
try
{
$url = str_replace(" ", "%20", $filename);
$fileDownloader->download($url, function(stFileDownloaderFile $file) use ($remoteImageDir, $url, $product, &$filename, &$source) {
$matches = [];
$filename = preg_match('/\/([^\/.]+)\.(png|jpeg|jpg|gif|webp)/', $filename, $matches) > 0 ? $matches[1] . '.' . $file->getExtension() : $product->getUrl() . '.' . $file->getExtension();
$source = $remoteImageDir . '/' . md5($url) . '-' . $filename;
if (!$file->move($source))
{
throw new stFileDownloaderException(sfContext::getInstance()->getI18n()->__('Wystąpił błąd podczas zapisu zdjęcia %%url%% do lokalizacji %%path%%', [
'%%url%%' => sprintf('<a href="%1$s" target="_blank">%1$s</a>', $url),
'%%path%%' => sprintf('<code>%s</code>', $source),
], 'stProduct'));
}
});
}
catch (stFileDownloaderException $e)
{
if ($logger)
{
$logger->add($product->getCode(), sfContext::getInstance()->getI18n()->__('Podczas pobierania zdjęcia %%url%% wystąpił błąd: %%error%%', array(
'%%url%%' => sprintf('<a href="%1$s" target="_blank">%1$s</a>', $url),
'%%error%%' => sprintf('<code>%s</code>', $e->getMessage()),
), 'stProduct'), stImportExportLog::$WARNING);
$ok = false;
continue;
}
}
}
elseif (!is_file($source) && !isset($images[$filename]))
{
if ($logger)
{
$logger->add($product->getCode(), sfContext::getInstance()->getI18n()->__('Zdjęcie %%filename%% nie zostało znalezione w katalogu %%dir%%', array(
'%%filename%%' => $isUrl ? sprintf('<a href="%1$s" target="_blank">%1$s</a>', $url) : sprintf('<code>%s</code>', $filename),
'%%dir%%' => sprintf('<code>%s</code>', basename(sfConfig::get('sf_web_dir')).'/uploads/assets'),
), 'stProduct'), stImportExportLog::$WARNING);
}
$ok = false;
continue;
}
if (function_exists('exif_imagetype'))
{
$type = exif_imagetype($source);
}
else
{
list(,,$type) = getimagesize($source);
}
$pathinfo = pathinfo($filename);
if ((!isset($images[$filename]) || $isUrl) && (!in_array($type, $allowedImageTypes) || !in_array(strtolower($pathinfo['extension']), $allowedImageExtensions)))
{
if ($logger)
{
$logger->add($product->getCode(), sfContext::getInstance()->getI18n()->__('Zdjęcie %%filename%% nie jest formacie %%allowed%%', array(
'%%filename%%' => $url ? sprintf('<a href="%1$s" target="_blank">%1$s</a>', $url) : sprintf('<code>%s</code>', basename(sfConfig::get('sf_web_dir')).'/uploads/assets/'.$filename),
'%%allowed%%' => sprintf('<code>%s</code>', implode(', ', $allowedImageFormats)),
), 'stProduct'), stImportExportLog::$WARNING);
}
$ok = false;
if ($isUrl)
{
unlink($source);
}
continue;
}
$imagesToProcess[] = array(
'is_url' => $isUrl,
'source' => $source,
'filename' => $filename,
);
}
if (!$ok)
{
throw new Exception(sfContext::getInstance()->getI18n()->__('Zdjęcia nie zostały zaimportowane. Popraw powyższe błędy.', null, 'stProduct'));
}
else
{
foreach ($imagesToProcess as $image)
{
$filename = $image['filename'];
$source = $image['source'];
$isUrl = $image['is_url'];
$sanitized_filename = sfAssetsLibraryTools::sanitizeName($filename);
$pha = new ProductHasSfAsset();
$pha->setProductId($product->getId());
if (!$isUrl && isset($images[$filename]))
{
$pha->setSfAssetId($images[$filename]);
unset($images[$filename]);
}
elseif (!$isUrl && isset($images[$sanitized_filename]))
{
$pha->setSfAssetId($images[$sanitized_filename]);
unset($images[$sanitized_filename]);
}
else
{
$pha->createAsset($filename, $source, ProductHasSfAssetPeer::IMAGE_FOLDER, null , null, true, $isUrl);
}
$pha->setIsDefault($default);
$pha->save();
$default = false;
}
foreach ($images as $id)
{
$asset = sfAssetPeer::retrieveByPK($id);
if (null !== $asset)
{
$asset->delete();
}
}
}
}
}

View File

@@ -0,0 +1,44 @@
<?php
class stProductNumberValidator extends sfNumberValidator
{
public function execute(&$value, &$error)
{
if (!parent::execute($value, $error))
{
return false;
}
$vat = $this->getContext()->getRequest()->getParameter('product[vat]');
$tax = TaxPeer::retrieveByPK($vat);
$netto = stCurrency::extractNettoFromBrutto($value, $tax->getVat());
$brutto = stCurrency::calculateBruttoFromNetto($netto, $tax->getVat());
$config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
if ($config->get('price_type') == 'brutto' && $value != $brutto)
{
$field_name = $this->getParameter('field_name', 'product[price]');
preg_match("/([^\[]+)\[([^\]]+)\]/", $field_name, $matches);
$field = $matches[1];
$name = $matches[2];
$fields = $this->getContext()->getRequest()->getParameter($field);
$fields[$name] = $brutto;
$this->getContext()->getRequest()->setParameter($field, $fields);
$error = 'Podana kwota brutto została skorygowana, kliknij "Zapisz" aby zatwierdzić zmiany';
return false;
}
return true;
}
}

View File

@@ -0,0 +1,70 @@
<?php
class stRecommendedProductsImportExport {
public static function getProductRecommend(Product $object) {
$recommended = $object->getProductHasRecommendsRelatedByProductId();
if (is_array($recommended)) {
$ids = array();
foreach($recommended as $item) {
if (is_object($item) && !is_null($item->getCode()))
$ids[] = $item->getCode();
}
return implode(',',$ids);
}
return '';
}
public static function setProductRecommend(Product $object, $value) {
$recommended = $object->getProductHasRecommendsRelatedByProductId();
// usuń w przypadku gdy pole puste
if (!strlen(trim($value))) {
if (is_array($recommended)) {
foreach($recommended as $item) {
$item->delete();
}
}
return ;
}
$idsNew = explode(',',$value);
foreach ($idsNew as $key=>$itemValue) {
if (strlen(trim($itemValue))) {
$idsNew[$key] = trim($itemValue);
} else {
unset($idsNew[$key]);
}
}
$ids = array();
if (is_array($recommended)) {
foreach($recommended as $item) {
$ids[] = $item->getCode();
}
}
$old = array_diff($ids, $idsNew);
$idsNew = array_unique(array_diff($idsNew, $ids));
foreach($recommended as $item) {
if (array_search($item->getCode(),$old)!== false) {
$item->delete();
}
}
foreach ($idsNew as $id) {
$c = new Criteria();
$c->add(ProductPeer::CODE,$id);
$recommend = ProductPeer::doSelectOne($c);
if (is_object($recommend) && $object->getId()!=$recommend->getId()) {
$tmp = new ProductHasRecommend();
$tmp->setProductId($object->getId());
$tmp->setRecommendId($recommend->getId());
$tmp->save();
}
}
}
}

View File

@@ -0,0 +1,39 @@
<ul class="admin_actions" style="float: left">
<?php if (!$allegro_auction->isNew()):?>
<?php if($sf_request->getParameter('list') == 'stAllegroPlugin'):?>
<?php echo st_get_admin_action('list', __('Lista', null, 'stAdminGeneratorPlugin'), 'stAllegroBackend/list', array('name' => 'list'));?>
<?php else:?>
<?php echo st_get_admin_action('list', __('Lista', null, 'stAdminGeneratorPlugin'), 'stProduct/allegroCustom?product_id='.$forward_parameters['product_id'], array('name' => 'list'));?>
<?php endif;?>
<?php endif;?>
</ul>
<ul class="admin_actions" style="float: right">
<?php if (!$allegro_auction->getAuctionId()):?>
<?php echo st_get_admin_action('save', __('Zapisz', null, 'stAdminGeneratorPlugin'), null, array('name' => 'save'));?>
<?php echo st_get_admin_action('validate_auction', __('Zapisz i waliduj', null, 'stAllegroBackend'), null, array('name' => 'validate_auction'));?>
<?php echo st_get_admin_action('auction', __('Zapisz i wystaw', null, 'stAllegroBackend'), null, array('name' => 'create_auction'));?>
<?php endif;?>
<?php if ($allegro_auction->getEnded() && 1==2):?>
<?php echo st_get_admin_action('refresh', __('Wystaw ponownie', null, 'stAllegroBackend'), null, array('name' => 'resale'));?>
<?php endif;?>
<?php if (!$allegro_auction->isNew()):?>
<?php echo st_get_admin_action('duplicate', __('Utwórz kopie', null, 'stAllegroBackend'), 'stAllegroBackend/duplicate?id='.$allegro_auction->getId(), array('name' => 'duplicate'));?>
<?php endif;?>
</ul>
<div class="clr"></div>
<?php if ($allegro_auction->getAuctionId()):?>
<script type="text/javascript" language="javascript">
jQuery(function($) {
$(document).ready(function() {
$('#st-allegro-edit-form :input').prop('disabled', true);
$('#st-allegro-edit-category-overlay-trigger, .token-input-delete-token-backend').hide();
$('.st-allegro-edit-options-overlay-trigger').hide();
$('.admin_actions :input').prop('disabled', false);
});
});
</script>
<?php endif;?>

View File

@@ -0,0 +1,421 @@
<?php $helper = new stAllegroEditHelper($allegro_auction, $forward_parameters);?>
<?php use_helper('stPrice', 'stProductImage', 'stAllegro');?>
<?php use_javascript('stPrice.js');?>
<?php use_javascript('stAllegroPlugin/stAllegroEdit.js?v2');?>
<?php use_stylesheet('backend/stAllegroPlugin.css?v2');?>
<?php init_tooltip('.st-allegro-tooltip');?>
<?php $hasOptions = ($allegro_auction->getProduct()->getOptHasOptions() > 1);?>
<?php $stAllegro = stAllegro::getInstance($allegro_auction->getEnvironment());?>
<?php echo form_tag('stProduct/allegroSave?product_id='.$forward_parameters['product_id'], array( 'id' => 'st-allegro-edit-form', 'name' => 'st-allegro-edit-form', 'class' => 'admin_form', 'multipart' => true));?>
<?php echo input_hidden_tag('id', $allegro_auction->getId(), array('id' => 'st-allegro-edit-id'));?>
<?php echo input_hidden_tag('allegro_auction[environment]', $allegro_auction->getEnvironment());?>
<?php echo input_hidden_tag('allegro_aucion[product_id]', $allegro_auction->getProductId()); ?>
<?php echo input_hidden_tag('environment', $allegro_auction->getEnvironment());?>
<?php echo ($sf_params->get('product_id')) ? input_hidden_tag('product_id', $sf_params->get('product_id')) : '';?>
<?php if ($sf_flash->has('allegro-validate-message')):?>
<?php $message = $sf_flash->get('allegro-validate-message');?>
<div id="st-allegro-notice" class="save-ok">
<h2><?php echo __('Pozytywny wynik walidacji - komunikat z serwisu aukcyjnego:', null, 'stAllegroBackend');?></h2>
<dl>
<?php foreach ($message as $key => $value):?>
<?php if ($key == 'itemPrice'):?>
<dt><?php echo __('Przewidywany koszt wystawienia:', null, 'stAllegroBackend');?></dt>
<dd><?php echo $value;?></dd>
<?php endif;?>
<?php endforeach;?>
</dl>
</div>
<?php endif;?>
<?php if ($sf_flash->has('allegro-error')):?>
<div class="form-errors">
<h2><?php echo __('Popraw dane w formularzu.', null, 'stAllegroBackend');?></h2>
<dl>
<dd><?php echo $sf_flash->get('allegro-error');?></dd>
</dl>
</div>
<?php endif;?>
<?php if ($sf_flash->has('allegro-validate-error')):?>
<div class="form-errors">
<h2><?php echo __('Negatywny wynik walidacji - komunikat błędu z serwisu aukcyjnego:', null, 'stAllegroBackend');?></h2>
<dl>
<dd><?php echo $sf_flash->get('allegro-validate-error');?></dd>
</dl>
</div>
<?php endif;?>
<?php if ($sf_flash->has('allegro-create-error')):?>
<div class="form-errors">
<h2><?php echo __('Błąd poczas wystawiania aukcji - komunikat błędu z serwisu aukcyjnego:', null, 'stAllegroBackend');?></h2>
<dl>
<dd><?php echo $sf_flash->get('allegro-create-error');?></dd>
</dl>
</div>
<?php endif;?>
<fieldset>
<h2><?php echo __('Informacje podstawowe', null, 'stAllegroBackend');?></h2>
<div class="content">
<?php if ($allegro_auction->getEnvironment() == 'Sandbox'):?>
<div class="row">
<label></label>
<div class="field">
<?php echo __('Aukcja wystawiana jest w trybie testowym.', null, 'stAllegroBackend');?><br />
</div>
</div>
<?php endif;?>
<div class="row row_name">
<label for="allegro_auction_name">
<b><?php echo __('Nazwa', null, 'stAllegroBackend');?></b>
</label>
<div class="field<?php if ($sf_request->hasError('allegro_auction{name}')):?> form-error<?php endif;?>">
<?php if ($sf_request->hasError('allegro_auction{name}')):?>
<?php echo form_error('allegro_auction{name}', array('class' => 'form-error-msg'));?>
<?php endif;?>
<?php echo object_input_tag($allegro_auction, 'getName', array('size' => 80, 'control_name' => 'allegro_auction[name]', 'maxlength' => 200));?>
<div class="clr"></div>
</div>
</div>
<?php if ($allegro_auction->getProduct()->getOptHasOptions() > 1):?>
<div id="st-allegro-edit-options-row" class="row">
<label>
<b><?php echo __('Opcje produktu', null, 'stAllegroBackend');?></b>
</label>
<div class="field">
<?php echo input_hidden_tag('allegro_auction[product_options]', $allegro_auction->getProductOptions(), array('id' => 'st-allegro-edit-hidden-product-options'));?>
<div id="st-allegro-edit-options-selected"></div>
<a id="st-allegro-edit-options-overlay-trigger-main" class="st-allegro-edit-options-overlay-trigger" href="#" rel="#st-allegro-edit-options-overlay" data-stock-for="0">
<?php echo __('Wybierz opcje produktu', null, 'stAllegroBackend');?>
</a>
<div class="clr"></div>
</div>
</div>
<div id="st-allegro-edit-options-overlay" class="popup_window">
<div id="st-allegro-edit-options-overlay-close" class="close">
<img src="/images/frontend/theme/default2/buttons/close.png" alt="" />
</div>
<h2>
<?php echo __('Wybierz opcje produktu', null, 'stAllegroBackend');?>
</h2>
<div class="content">
<div class="preloader_160x24"></div>
</div>
<div id="st-allegro-edit-options-overlay-submit">
<button class="submit" type="button">
<?php echo __('Wybierz', null, 'stAllegroBackend');?>
</button>
</div>
</div>
<?php endif;?>
<div class="row">
<label>
<b><?php echo __('Kategoria', null, 'stAllegroBackend');?></b>
</label>
<div class="field<?php if ($sf_request->hasError('allegro_auction{allegro_category_id}')):?> form-error<?php endif;?>">
<?php if ($sf_request->hasError('allegro_auction{allegro_category_id}')):?>
<?php echo form_error('allegro_auction{allegro_category_id}', array('class' => 'form-error-msg'));?>
<?php endif;?>
<?php echo st_get_partial('stAllegroBackend/edit_select_category', array('type' => 'edit', 'allegro_auction' => $allegro_auction, 'forward_parameters' => $forward_parameters, 'related_object' => $related_object)); ?>
<div class="clr"></div>
</div>
</div>
<div class="allegro-category-container"<?php if (!$allegro_auction->getAllegroCategory()): ?> style="display: none"<?php endif ?>>
<div class="row">
<label>
<b><?php echo __('Typ', null, 'stAllegroBackend');?></b>
</label>
<div class="field">
<ul class="st-allegro-edit-radio-list">
<li>
<?php echo radiobutton_tag('allegro_auction[auction_type]', 0, ($allegro_auction->getAuctionType() == 0) ? true : false, array('id' => 'st-allegro-edit-auction-type-auction'));?>
<label for="st-allegro-edit-auction-type-auction">
<?php echo __('Tylko Kup Teraz! (bez licytacji) lub licytacja', null, 'stAllegroBackend');?>
</label>
</li>
<li>
<?php echo radiobutton_tag('allegro_auction[auction_type]', 1, ($allegro_auction->getAuctionType() == 1) ? true : false, array('id' => 'st-allegro-edit-auction-type-shop'));?>
<label for="st-allegro-edit-auction-type-shop">
<?php echo __('Sklep (bez licytacji)', null, 'stAllegroBackend');?>
</label>
</li>
</ul>
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>
<b><?php echo __('Cena', null, 'stAllegroBackend');?></b>
</label>
<div class="field">
<table class="st_record_list" cellspacing="0">
<thead>
<tr>
<th><b><?php echo __('"Kup teraz !"', null, 'stAllegroBackend');?></b></th>
<th><b><?php echo __('Wywoławcza', null, 'stAllegroBackend');?></b></th>
<th><b><?php echo __('Minimalna', null, 'stAllegroBackend');?></b></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo input_tag('allegro_auction[price_buy_now]', st_price_format($allegro_auction->getPriceBuyNow()), array('size' => 8, 'class' => 'st-allegro-edit-price', 'id' => 'st-allegro-edit-price-buy-now'));?></td>
<td><?php echo input_tag('allegro_auction[price_start]', st_price_format($allegro_auction->getPriceStart()), array('size' => 8, 'class' => 'st-allegro-edit-price', 'id' => 'st-allegro-edit-price-start'));?></td>
<td><?php echo input_tag('allegro_auction[price_min]', st_price_format($allegro_auction->getPriceMin()), array('size' => 8, 'class' => 'st-allegro-edit-price', 'id' => 'st-allegro-edit-price-min'));?></td>
</tr>
</tbody>
</table>
<div class="clr"></div>
</div>
</div>
<?php echo st_allegro_edit_row('Liczba', $helper->getStock(), true);?>
<?php echo st_allegro_edit_row('Zdejmuj z magazynu podczas wystawiania', checkbox_tag('allegro_auction[depository_on_sale]', 1, $allegro_auction->getDepositoryOnSale()));?>
<?php echo st_allegro_edit_row('Czas trwania', $helper->getDuration());?>
<?php //echo st_allegro_edit_row('Automatyczne wznowienie oferty w sklepie', $helper->getResumption());?>
</div>
</div>
</fieldset>
<div class="allegro-category-container" <?php if (!$allegro_auction->getAllegroCategory()): ?> style="display: none"<?php endif ?>>
<fieldset>
<h2><?php echo __('Płatność i dostawa', null, 'stAllegroBackend');?></h2>
<div class="content">
<?php echo st_allegro_edit_row('Formy płatności', $helper->getPayOptions(), array('row' => 'allegro-pay-options'));?>
<?php echo st_allegro_edit_row('Dodatkowe informacje o przesyłce i płatności', textarea_tag('allegro_auction[other_text]', $allegro_auction->getOtherText(), array('id' => 'st-allegro-edit-other-text')));?>
<?php echo st_allegro_edit_row('Wysyłka w ciągu', $helper->getShippingTime());?>
<?php echo st_allegro_edit_row('Koszty wysyłki pokrywa', select_tag('allegro_auction[who_pay]', options_for_select(array(1 => __('kupujący', null, 'stAllegroBackend'), 0 => __('sprzedający', null, 'stAllegroBackend')), $allegro_auction->getWhoPay())));?>
<?php if(($allegroDelivery = $helper->getAllegroDelivery()) !== null):?>
<div class="row">
<label for="st-allegro-edit-allegro-delivery">
<?php echo __('Cennik dostawy', null, 'stAllegroBackend');?>
</label>
<div class="field">
<?php echo $allegroDelivery;?>
<div class="clr"></div>
</div>
</div>
<?php endif;?>
<div class="row">
<label>
<?php echo __('Opcje dostawy', null, 'stAllegroBackend');?>
</label>
<div class="field">
<div id="st-allegro-edit-deliveries">
<?php if($allegro_auction->isNew() && $sf_request->getMethod() !== sfRequest::POST):?>
<img id="st-allegro-edit-deliveries-loading" src="/images/frontend/theme/default2/loading.gif" alt=""/>
<?php else:?>
<?php echo st_get_component('stAllegroDeliveryBackend', 'deliveries', array('namespace' => 'allegro_auction', 'environment' => $allegro_auction->getEnvironment(), 'auction' => $allegro_auction->getId(), 'id' => -1, 'show' => true));?>
<?php endif;?>
</div>
<div class="clr"></div>
</div>
</div>
</div>
</fieldset>
<fieldset id="st-allegro-fieldset-images">
<h2><?php echo __('Zdjęcia', null, 'stAllegroBackend');?></h2>
<div class="content">
<div class="row">
<?php echo __('Wybierz zdjęcia, które będą załączone do aukcji i zaznacz domyślne zdjęcie.', null, 'stAllegroBackend');?><br />
<?php echo __('Jeśli chcesz wyświetlić zdjęcie w treści opisu, wprowadź jego nazwę w postaci np. {PHOTO:1} lub {PHOTO:2} itd. w miejscu, gdzie ma się ono pojawić.', null, 'stAllegroBackend');?>
</div>
<div class="row">
<div class="field">
<?php echo input_hidden_tag('allegro_auction[images]', '');?>
<div id="st-allegro-edit-images">
<?php foreach ($helper->getImages() as $k => $image): $number = $allegro_auction->hasNewDescriptionFormat() ? $image->getId() : $k + 1; $allegroAsset = $helper->getImageInformation($image); ?>
<div class="st-allegro-edit-image-box">
<div class="st-allegro-edit-image" data-selected="<?php echo intval($allegroAsset['selected']) ?>" data-number="<?php echo $number ?>">
<?php echo st_product_image_tag($image, 'full');?>
</div>
<div class="st-allegro-edit-image-desc">
<?php echo checkbox_tag('allegro_auction[images][selected]['.$image->getId().']', 1, $allegroAsset['selected'], array('title' => __('Eksport zdjęcia', null, 'stAllegroBackend')));?>
<?php echo radiobutton_tag('allegro_auction[images][default]', $image->getId(), $allegroAsset['default'], array('title' => __('Domyślne zdjęcie', null, 'stAllegroBackend')));?>
<?php if (!$allegro_auction->hasNewDescriptionFormat()): ?>
<label for="allegro_auction_default_image_<?php echo $image->getId();?>"><b>{PHOTO:<?php echo $number; ?>}</b></label>
<?php endif ?>
<div class="clr"></div>
</div>
</div>
<?php endforeach;?>
</div>
<div class="clr"></div>
</div>
</div>
</div>
</fieldset>
<fieldset id="st-allegro-fieldset-description">
<h2><?php echo __('Opis', null, 'stAllegroBackend');?></h2>
<div class="content">
<?php echo st_allegro_edit_row('Skrócony opis', textarea_tag('allegro_auction[short_text]', $allegro_auction->getShortText(), array('tinymce_options' => 'height:300,width:\'100%\','.($allegro_auction->getAuctionId() ? 'readonly:true' : 'theme:\'simple\''), 'rich' => true)));?>
<?php echo st_get_component('stAllegroBackend', 'description', array('auction' => $allegro_auction)) ?>
</div>
</fieldset>
<fieldset>
<h2><?php echo __('Dodatkowe opcje i atrybuty', null, 'stAllegroBackend');?></h2>
<div class="content">
<?php if (!$allegro_auction->hasNewDescriptionFormat()): ?>
<?php echo st_allegro_edit_row('Szablon', $helper->getTemplate());?>
<?php endif ?>
<div class="row allegro-options">
<label>
<?php echo __('Dodatkowe opcje', null, 'stAllegroBackend');?>
<a href="#" class="help" title="<?php echo __('Niektóre opcje mogą być dodatkowo płatne. Więcej w cenniku Allegro.', null, 'stAllegroBackend');?>"></a>
</label>
<div class="field">
<div class="field-container"><?php echo $helper->getOptions();?></div>
<div class="clr"></div>
</div>
</div>
<?php echo st_allegro_edit_row('EAN', input_tag('allegro_auction[ean]', $allegro_auction->getEan()));?>
<div id="st-allegro-edit-attributes">
<?php if (is_object($allegro_auction->getAllegroCategory())):?>
<?php echo st_get_component('stAllegroBackend', 'getAttributes', array('environment' => $allegro_auction->getEnvironment(), 'category' => $allegro_auction->getAllegroCategory()->getCatId(), 'auction' => $allegro_auction, 'product' => $allegro_auction->getProduct()));?>
<?php endif;?>
</div>
</div>
</fieldset>
<div id="edit_actions">
<?php st_include_partial('allegro_edit_actions', array('allegro_auction' => $allegro_auction, 'forward_parameters' => $forward_parameters));?>
</div>
</div>
</form>
<script type="text/javascript">
jQuery(function($) {
$(document).ready(function() {
$('#edit_actions').stickyBox();
$('.st-allegro-edit-price').change(function() {
$(this).val(stPrice.fixNumberFormat($(this).val()));
});
$('.st-allegro-edit-price').keypress(function(event) {
if (event.which == 13) {
$(this).val(stPrice.fixNumberFormat($(this).val()));
event.preventDefault();
}
});
$('.st-allegro-edit-quantity').change(function() {
$(this).val(stPrice.fixNumberFormat($(this).val(), 0));
});
$('.st-allegro-edit-quantity').keypress(function(event) {
if (event.which == 13) {
$(this).val(stPrice.fixNumberFormat($(this).val(), 0));
event.preventDefault();
}
});
stAllegroEdit.reloadTypeView();
$('input[name="allegro_auction[auction_type]"]').change(function () {
stAllegroEdit.reloadTypeView();
});
<?php if($allegro_auction->isNew() && $sf_request->getMethod() !== sfRequest::POST):?>
if ($('#st-allegro-edit-allegro-delivery').val() != -1)
stAllegroEdit.reloadDelivery();
<?php endif;?>
$('#st-allegro-edit-allegro-delivery').change(function() {
stAllegroEdit.reloadDelivery();
});
stAllegroEdit.setVariantsActivity();
$('.st-allegro-tooltip').removeData('tooltip'); $('.st-allegro-tooltip').tooltip();
<?php if($hasOptions):?>
if ($('#st-allegro-edit-options-selected').text().length == 0 && $('#st-allegro-edit-hidden-product-options').val().length != 0) {
stAllegroEdit.addLoading($('#st-allegro-edit-options-overlay-trigger-main'));
stAllegroEdit.processMainProductOptions('<?php echo st_url_for('stAllegroBackend/ajaxProductStock');?>?id=<?php echo $allegro_auction->getProductId();?>&selected=' + $('#st-allegro-edit-hidden-product-options').val(), ["<?php echo __('Zmień wybrane opcje', null, 'stAllegroBackend');?>"]);
}
$('.st-allegro-edit-options-overlay-trigger').live('click', function() {
console.log('niby dizała');
$('#st-allegro-edit-options-overlay').data('stock-for', $(this).data('stock-for'));
$('#st-allegro-edit-options-overlay').overlay({
speed: 'fast',
close: $('#st-allegro-edit-options-overlay > .close img'),
load: true,
mask: {
color: '#444',
loadSpeed: 'fast',
opacity: 0.5,
},
closeOnClick: false,
closeOnEsc: false,
onBeforeLoad: function() {
var content = this.getOverlay().children('.content');
$.get('<?php echo st_url_for('stAllegroBackend/ajaxProductOptions');?>?id=<?php echo $allegro_auction->getProductId();?>', function(html) {
content.html(html);
});
},
onClose: function() {
$('#st-allegro-edit-options-overlay').data('overlay', '');
}
});
});
$('.st-allegro-variant-checkbox:checked').each(function() {
var id = $(this).data('fid') + '-' + $(this).val();
stAllegroEdit.processProductOptions(id, '<?php echo st_url_for('stAllegroBackend/ajaxProductStock');?>?id=<?php echo $allegro_auction->getProductId();?>&selected=' + $('#st-allegro-variant-options-' + id).val());
});
$('#st-allegro-edit-options-overlay .submit').live('click', function() {
var api = $('#st-allegro-edit-options-overlay').data('overlay');
var options = $('#st-allegro-edit-options-overlay #product_options_selected').val();
$('#st-allegro-edit-hidden-product-options').val(options);
var stockFor = $('#st-allegro-edit-options-overlay').data('stock-for');
if (stockFor == 0)
stAllegroEdit.processMainProductOptions('<?php echo st_url_for('stAllegroBackend/ajaxProductStock');?>?id=<?php echo $allegro_auction->getProductId();?>&selected=' + options, ["<?php echo __('Zmień wybrane opcje', null, 'stAllegroBackend');?>"]);
else {
stAllegroEdit.processProductOptions(stockFor, '<?php echo st_url_for('stAllegroBackend/ajaxProductStock');?>?id=<?php echo $allegro_auction->getProductId();?>&selected=' + options);
$('#st-allegro-variant-options-' + stockFor).val(options);
// $.get('<?php echo st_url_for('stAllegroBackend/ajaxProductStock');?>?id=<?php echo $allegro_auction->getProductId();?>&selected=' + options, function(json) {
// var data = $.parseJSON(json);
// $('#st-allegro-variant-options-img-' + stockFor).attr('src', '/images/backend/icons/list.png');
// newTitle = 'Wybrane opcje: ';
// $.each(data.selected, function (key, value) {
// newTitle += '<b>' + key + ':</b> ' + value + ', ';
// });
// newTitle += '<br/>Kliknij aby zmienić opcje.';
// $('#st-allegro-variant-options-img-' + stockFor).attr('title', newTitle);
// $('#st-allegro-variant-options-img-' + stockFor).data('title', newTitle);
// $('#st-allegro-variant-options-img-' + stockFor).removeAttr("title");
// $('#st-allegro-variant-options-' + stockFor).val(options);
// });
}
api.close();
$('#st-allegro-edit-options-overlay').data('overlay', '');
});
<?php endif;?>
});
});
</script>

View File

@@ -0,0 +1,43 @@
<?php
use_helper('stAsset');
use_javascript('/sfAssetsLibraryPlugin/js/helper.js');
?>
<?php echo input_file_tag('product_has_attachment[attachment_edit_file]') ?>
<?php if ($product_has_attachment->getSfAssetId()): $pha = $product_has_attachment; $path = '/product/attachment/'.$pha->getProduct()->getAssetFolder().'/'.$pha->getAssetCulture().'/'.$pha->getFilename() ?>
<p style="padding-top: 10px"><?php echo content_tag('a', $path, array('href' => $path)) ?></p>
<?php endif; ?>
<script type="text/javascript">
jQuery(function($) {
$(document).ready(function() {
var filename = $('#product_has_attachment_attachment_edit_filename');
$('#product_has_attachment_attachment_edit_file').change(function() {
var input = $(this);
var value = input.val();
if (value.indexOf("/") > 0) {
var file = value.split("/");
} else {
var file = value.split("\\");
}
value = file.pop();
console.log(value);
var ext = stAssetsLibraryHelper.extractExtension(value);
filename.val(stAssetsLibraryHelper.fixFilename(value, true));
$('#product_has_attachment_filename_ext').html(ext ? '.'+ext : '');
});
filename.change(function() {
var input = $(this);
var value = input.val();
input.val(stAssetsLibraryHelper.fixFilename(value, true));
if (input.val() == '') {
input.val(input.get(0).defaultValue);
}
});
});
});
</script>

View File

@@ -0,0 +1,13 @@
<?php
if ($product_has_attachment->getSfAssetId())
{
$ext = sfAssetsLibraryTools::getFileExtension($product_has_attachment->getSfAsset()->getFilename());
}
else
{
$ext = sfAssetsLibraryTools::getFileExtension($sf_request->getFileName('product_has_attachment[attachment_edit_file]'));
}
echo input_tag('product_has_attachment[attachment_edit_filename]', $product_has_attachment->getAttachmentEditFilename());
?>
<span id="product_has_attachment_filename_ext"><?php echo $ext ? '.'.$ext : '' ?></span>

View File

@@ -0,0 +1 @@
<?php echo object_select_tag($product_has_attachment->getLanguage(), 'getId', array('related_class' => 'Language', 'text_method' => 'getName', 'control_name' => 'product_has_attachment[attachment_edit_language]', 'disabled' => !$product_has_attachment->isNew())) ?>

View File

@@ -0,0 +1,8 @@
<?php
$id = $product_has_attachment->getLanguageId();
$c = new Criteria();
$c->add(LanguagePeer::ID, $id);
$language = LanguagePeer::doSelectOne($c);
?>
<?php echo get_language_flag_icon($language->getShortcut()) ?>

View File

@@ -0,0 +1,9 @@
<?php
use_helper('stProduct');
?>
<span style="float: left"><?php echo link_to(st_product_get_attachment_icon($product_has_attachment->getAttachment()), 'stProduct/attachmentEdit?product_id='.$product_has_attachment->getProductId().'&id='.$product_has_attachment->getId()) ?></span>
<span style="float: left; padding-left: 5px"><?php echo link_to($product_has_attachment->getFilename(), 'stProduct/attachmentEdit?product_id='.$product_has_attachment->getProductId().'&id='.$product_has_attachment->getId()) ?></span>
<br style="clear: left" />

View File

@@ -0,0 +1,13 @@
<?php
if (strlen($product->getFrontendAvailability()) > 10) {
echo st_truncate_text($product->getFrontendAvailability(), '10', '...');
} else {
echo $product->getFrontendAvailability();
}
?>

View File

@@ -0,0 +1,11 @@
<?php
$c = new Criteria();
$select_options = array('' => '---');
foreach (AvailabilityPeer::doSelectWithI18n($c) as $availability)
{
$select_options[$availability->getId()] = $availability->getAvailabilityName();
}
echo select_tag('filters[avail]', options_for_select($select_options, isset($filters['avail']) ? $filters['avail'] : null));

View File

@@ -0,0 +1,26 @@
<?php
/**
* Szablon dla partial'a _price
*
* @package stProduct
* @author Marcin Butlak <marcin.butlak@sote.pl>
* @copyright SOTE
* @license SOTE
* @version $Id: _price.php 2545 2009-08-11 13:58:21Z pawel $
*/
?>
<table class="st_record_list" cellspacing="0">
<thead>
<tr>
<th><?php echo __('Netto') ?></th>
<th><?php echo __('Brutto') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo input_tag ('product[basic_price_netto]', $product->getCurrency()->getIsSystemCurrency() ? st_price_format($product->getBasicPriceNetto()) : null, array('size' => 7, 'disabled' => !$product->getCurrency()->getIsSystemCurrency())) ?></td>
<td><?php echo input_tag ('product[basic_price_brutto]', st_price_format($product->getCurrency()->getIsSystemCurrency() ? $product->getBasicPriceBrutto() : $product->getCurrencyPrice()), array('size' => 7)) ?></td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,36 @@
<?php
/**
* @var Product $product
*/
echo input_tag($name.'[value]', $product->getBpumDefaultValue(), ['data-format' => 'decimal']) . ' ' . st_product_bpum_select_tag($name.'[unit]', $product->getBpumDefaultId(), ['include_custom' => '---']);
?>
<script>
jQuery(function($) {
$(document).ready(function() {
$('#<?php echo get_id_from_name($name.'[unit]') ?>').change(function() {
let source = $(this);
let target = $('#product_bpum_value_unit');
if (source.val()) {
let targetVal = target.val();
let options = '<option value="">---</option>';
let unitGroup = source.children(':selected').data('unit-group');
source.children('option[data-unit-group="'+unitGroup+'"]').each(function() {
let option = $(this);
options += '<option value="'+option.val()+'">'+option.html()+'</option>';
});
target.html(options);
target.val(targetVal);
$('.row_bpum_value').show();
target.selectBox('update');
} else {
$('.row_bpum_value').hide();
}
}).change();
});
});
</script>

View File

@@ -0,0 +1,5 @@
<?php
/**
* @var Product $product
*/
echo input_tag($name.'[value]', $product->getBpumValue(), ['data-format' => 'decimal']) . ' ' . st_product_bpum_select_tag($name.'[unit]', $product->getBpumId(), ['include_custom' => '---']);

View File

@@ -0,0 +1,36 @@
<?php
/**
* Szablon dla komponentu category
*
* @package stProduct
* @author Marcin Butlak <marcin.butlak@sote.pl>
* @copyright SOTE
* @license SOTE
* @version $Id: _category.php 661 2009-04-16 07:01:00Z michal $
*/
if ($product->isNew())
{
$params = array('product_hash' => $product->hashCode());
}
else
{
$params = array('product_id' => $product->getId());
}
if ($sf_request->hasErrors())
{
$params['assigned-categories'] = implode('-', $sf_request->getParameter('product_has_category', array()));
$params['default-category'] = $sf_request->getParameter('product_default_category');
}
?>
<div id="st_product_has_categories">
<?php foreach ($categories as $category): ?>
<?php if ($category['default']): ?>
<input type="hidden" value="<?php echo $category['id'] ?>" name="product_default_category" id="product_default_category" />
<?php endif; ?>
<input type="hidden" value="<?php echo $category['id'] ?>" name="product_has_category[<?php echo $category['id'] ?>]" id="product_has_category_<?php echo $category['id'] ?>" />
<?php endforeach; ?>
</div>

View File

@@ -0,0 +1,103 @@
<?php
use_stylesheet('backend/stProduct.css?version=5');
use_javascript('/stCategoryTreePlugin/js/jquery-1.3.2.min.js', 'first');
use_javascript('/stCategoryTreePlugin/js/jquery-no-conflict.js', 'first');
if (isset($parent))
{
$children = $parent->getChildren();
$id = $parent->getId();
}
else
{
$id = 'null';
}
?>
<?php if ($include_container): ?>
<div id="stProduct-category-filter" style="display: none">
<?php endif; ?>
<ul id="cf-<?php echo $id ?>">
<?php if (isset($return_value)): ?>
<li class="expandable returnable">
<span id="cf-trigger-<?php echo $return_value['return_id'] ?>" class="trigger">&laquo;</span>
<?php
if (!$return_value['id'])
{
echo st_link_to($return_value['label'], '#', array('onclick' => 'return false;', 'class' => 'trigger link', 'id' => 'cf-link-trigger-'.$return_value['return_id']));
}
else
{
echo st_link_to($return_value['label'], '@stProductCategoryFilter?filters[category]='.$return_value['id']);
}
?>
</li>
<?php endif; ?>
<?php foreach ($children as $child): $has_children = $child->hasChildren(); $is_root = $child->isRoot() ?>
<li<?php if ($has_children): ?> class="expandable"<?php endif; ?>>
<?php if ($has_children): ?>
<span id="cf-trigger-<?php echo $child->getId() ?>" class="trigger">&rsaquo;</span>
<?php endif; ?>
<?php
if ($is_root)
{
echo st_link_to($child->getName(), '#', array('onclick' => 'return false;', 'class' => 'trigger link', 'id' => 'cf-link-trigger-'.$child->getId()));
}
else
{
echo st_link_to($child->getName(), '@stProductCategoryFilter?filters[category]='.$child->getId());
}
?>
</li>
<?php endforeach; ?>
</ul>
<br style="clear: left" />
<?php if ($include_container): ?>
</div>
<?php endif; ?>
<script type="text/javascript">
jQuery(function($) {
var items = $('#cf-<?php echo $id ?> li.expandable .trigger');
$.each(items, function() {
$(this).click(function() {
var o = $(this);
var id = this.id;
id = id.replace('cf-trigger-', '');
id = id.replace('cf-link-trigger-', '');
if (o.hasClass('link'))
{
var obj2 = $('cf-trigger-'+id);
obj2.html('<?php echo image_tag('backend/stProduct/ajax_loader.gif') ?>');
obj2.addClass('selected');
}
else
{
o.html('<?php echo image_tag('backend/stProduct/ajax_loader.gif') ?>');
}
o.addClass('selected');
$.each(items, function () { $(this).unbind('click'); });
$.ajax({
url: '<?php echo st_url_for('stProduct/ajaxFilterCategory'); ?>/id/' + id,
dataType: 'html',
success: function (data)
{
$('#stProduct-category-filter').html(data);
}
});
});
});
});
</script>

View File

@@ -0,0 +1,13 @@
<?php
if (strlen($product->getCode()) > 20) {
echo st_truncate_text($product->getCode(), '20', '...');
} else {
echo $product->getCode();
}
?>

View File

@@ -0,0 +1,15 @@
<?php
if ($sf_flash->get('update_product_options_stock_computation'))
{
use_helper('stProgressBar');
$task = new stProductOptionsStockUpdateComputationProgressBarTask($sf_context);
st_admin_section_start();
echo progress_bar($task);
st_admin_section_end();
}
else
{
include st_admin_get_template_path(__FILE__);
}

View File

@@ -0,0 +1 @@
<?php echo asset_image_tag($default_image, $image_type)?>

View File

@@ -0,0 +1,3 @@
<?php echo input_tag('product[delivery_price]', stPrice::round($product->getDeliveryPrice()), array('size' => 8)) ?> <?php echo __(ucfirst($product->getConfiguration()->get('delivery_price_type', 'netto'))) ?>
<?php echo st_price_add_format_behavior('product_delivery_price') ?>

View File

@@ -0,0 +1,7 @@
<?php echo input_tag('filters[list_stock][from]', isset($filters['list_stock']['from']) ? $filters['list_stock']['from'] : null, array (
'size' => 4,
'class' => 'float',
)) . ' - ' . input_tag('filters[list_stock][to]', isset($filters['list_stock']['to']) ? $filters['list_stock']['to'] : null, array (
'size' => 4,
'class' => 'float',
)) ?>

View File

@@ -0,0 +1,10 @@
<?php
// auto-generated by sfPropelAdmin
// date: 2010/06/02 14:24:21
?>
<?php
$c = new Criteria();
$c->add(DiscountHasProductPeer::PRODUCT_ID, $forward_parameters['product_id']);
$assigned = $discount->countDiscountHasProducts($c);
?>
<td><?php echo $assigned || $discount->getAllProducts() ? image_tag(sfConfig::get('sf_admin_web_dir').'/images/tick.png') : '-' ?></td>

View File

@@ -0,0 +1,67 @@
<table class="st_record_list" cellspacing="0">
<thead>
<tr>
<th><?php echo __('Waluta') ?></th>
<th><?php echo st_admin_checkbox_tag('product[has_fixed_currency_exchange]', true, $product->getHasFixedCurrency(), array('disabled' => $product->getCurrency()->getIsSystemCurrency(), 'label' => __('Zablokuj kurs'))) ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo select_tag('product[edit_currency]', options_for_select($currency['select_options'], $product->getCurrency()->getId())) ?></td>
<td><?php echo input_tag('product[fixed_currency_exchange]', $product->getHasFixedCurrency() ? $product->getFixedCurrencyExchangeBackend() : $product->getCurrency()->getExchangeBackend() , array('disabled' => !$product->getHasFixedCurrency(), 'size' => 6)) ?></td>
</tr>
</tbody>
</table>
<script type="text/javascript">
jQuery(function($) {
var currency_exchange = <?php echo $currency['exchange_rates'] ?>;
var fixed_currency_exchange = $('#product_fixed_currency_exchange');
var currency_fixed = $('#product_has_fixed_currency_exchange');
var currency = $('#product_edit_currency');
var prev_selected = currency.val();
currency.change(function()
{
var selected = $(this).val();
if (selected == '<?php echo $currency['system_currency_id'] ?>')
{
stPriceTaxManagment.instance.enablePriceFields();
currency_fixed.prop('disabled', true);
fixed_currency_exchange.prop('disabled', true);
stPriceTaxManagment.instance.refreshPriceFields();
}
else
{
stPriceTaxManagment.instance.disablePriceFields();
$.each(stPriceTaxManagment.instance.priceFields, function () {
this.price.value = '';
});
currency_fixed.prop('disabled', false);
fixed_currency_exchange.prop('disabled', !currency_fixed.prop('checked'));
}
fixed_currency_exchange.val(currency_exchange[selected]);
});
currency_fixed.change(function() {
fixed_currency_exchange.prop('disabled', !currency_fixed.prop('checked'));
});
fixed_currency_exchange.change(function() {
$(this).val(stPrice.fixNumberFormat($(this).val(), 4));
});
});
</script>

View File

@@ -0,0 +1,2 @@
<?php
include st_admin_get_template_path(__DIR__ . '/_listMenu.php');

View File

@@ -0,0 +1,36 @@
<?php use_helper('stImageSize', 'stProductPhoto'); ?>
<div style="width: 300px; float: left">
<?php if ($sf_request->hasError('product{image}')): ?>
<?php echo form_error('product{image}', array('class' => 'form-error-msg')) ?>
<?php endif; ?>
<?php $value = object_admin_input_file_tag($product, 'getImage', array (
'control_name' => 'product[image]',
'include_remove' => false,
));
echo $value ? $value : '&nbsp;'
?>
<br />
<?php echo st_product_photo($product->getImage(), 128, 128, "/sfAsset/edit?id=".$product->getAssetMainId()); ?>
</div>
<?php $assets = getAssets($product->getId(), 6) ?>
<?php $index = 0; ?>
<div style="float: left; border: 1px solid #cccccc;">
<?php foreach($assets as $asset): ?>
<?php $index++ ?>
<div style="margin: 5px; float: left; width: 84px; height: 84px;border: 1px dashed #cccccc"><?php echo st_asset_photo_link($asset->getPath(), 84, 84, "/sfAsset/edit?id=".$asset->getId()); ?></div>
<?php if ( ($index % 3) == 0): ?><br class="st_clear_all" /><?php endif; ?>
<?php endforeach; ?>
</div>
<br class="st_clear_all" />
<br />
<?php if ($sf_request->getParameter("id")): ?>
<?php echo st_get_admin_actions_head('style="margin-top: 0px; float: right;"') ?>
<?php echo st_get_admin_action('save', __('Zapisz'), null, array ('name' => 'save',)) ?>
<?php echo st_get_admin_actions_foot() ?>
<?php endif; ?>

View File

@@ -0,0 +1,5 @@
<?php
$options = array("" => "---", 1 => __('tak', null, 'stAdminGeneratorPlugin'), 0 => __('nie', null, 'stAdminGeneratorPlugin'));
echo select_tag('filters[allegro]', options_for_select($options, isset($filters['allegro']) ? $filters['allegro'] : null));
?>

View File

@@ -0,0 +1,5 @@
<?php
echo st_availability_select_tag('filters[availability_id]', isset($filters['availability_id']) ? $filters['availability_id'] : null, [
'include_custom' => '---',
]);

View File

@@ -0,0 +1,5 @@
<?php
$options = array("" => "---", -1 => __('Wyłączone')) + _product_hide_price_options();
echo select_tag('filters[hide_price]', options_for_select($options, isset($filters['hide_price']) ? $filters['hide_price'] : null));
?>

View File

@@ -0,0 +1,5 @@
<?php
echo select_tag('filters[list_image]',
options_for_select(array(1 => __('tak', array(), 'stAdminGeneratorPlugin'), 0 => __('nie', array(), 'stAdminGeneratorPlugin')),
isset($filters['list_image']) ? $filters['list_image'] : null, array ('include_custom' => '---')))
?>

View File

@@ -0,0 +1,9 @@
<?php if (($num_products != $num_products_good) && ($culture == "pl_PL")):?>
<div style="border: 1px solid red; padding: 20px; width: 250px; margin: 0px auto;">
<?php echo st_get_admin_actions_head('style="margin-top: 10px;"') ?>
Przed rozpoczęciem pracy w aplikacji <b>Produkty</b> klknij poniższy przycisk: <br /><br />
<?php echo st_get_admin_action('save', __('Optymalizuj produkty'), 'stProduct/fixProducts', array (
)) ?> <?php echo st_get_admin_actions_foot() ?>
</div>
<br />
<?php endif;?>

View File

@@ -0,0 +1,10 @@
<?php if ($sf_request->hasError('product{group_price_id}')): ?>
<?php echo form_error('product{group_price_id}', array('class' => 'form-error-msg')) ?>
<?php endif; ?>
<?php echo object_select_tag($product, 'getGroupPriceId', array (
'related_class' => 'GroupPrice',
'control_name' => 'product[group_price_id]',
'include_custom' => __("---", null, 'stAdminGeneratorPlugin'),
'include_blank' => false,
)); ?>

View File

@@ -0,0 +1,6 @@
<?php echo input_file_tag("trust[icon_f]", ""); ?><br />
<?php if ($trust->getIconF() != "") : ?>
<img src="/uploads<?php echo $trust->getIconF(); ?>" alt="" style="max-width: 40px; margin-top: 7px;"><br />
<?php echo link_to(__('Usuń ikone'), 'stTrustBackend/deleteProductImage?image=icon_f&product_id='.$trust->getProductId()) ?>
<br class="st_clear_all">
<?php endif; ?>

View File

@@ -0,0 +1,6 @@
<?php echo input_file_tag("trust[icon_s]", ""); ?><br />
<?php if ($trust->getIconS() != "") : ?>
<img src="/uploads<?php echo $trust->getIconS(); ?>" alt="" style="max-width: 40px; margin-top: 7px;"><br />
<?php echo link_to(__('Usuń ikone'), 'stTrustBackend/deleteProductImage?image=icon_s&product_id='.$trust->getProductId()) ?>
<br class="st_clear_all">
<?php endif; ?>

View File

@@ -0,0 +1,6 @@
<?php echo input_file_tag("trust[icon_t]", ""); ?><br />
<?php if ($trust->getIconT() != "") : ?>
<img src="/uploads<?php echo $trust->getIconT(); ?>" alt="" style="max-width: 40px; margin-top: 7px;"><br />
<?php echo link_to(__('Usuń ikone'), 'stTrustBackend/deleteProductImage?image=icon_t&product_id='.$trust->getProductId()) ?>
<br class="st_clear_all">
<?php endif; ?>

View File

@@ -0,0 +1,19 @@
<?php
/**
* Szablon dla partial'a _product_image
*
* @package stProduct
* @author Marcin Olejniczak <marcin.olejniczak@sote.pl>
* @copyright SOTE
* @license SOTE
* @version $Id: _image.php 617 2009-04-09 13:02:31Z michal $
*/
?>
<?php if ($sf_request->hasError('product{image}')): ?>
<?php echo form_error('product{image}', array('class' => 'form-error-msg')) ?>
<?php endif; ?>
<?php $value = object_admin_input_file_tag($product, 'getImage', array (
'control_name' => 'product[image]',
)); echo $value ? $value : '&nbsp;' ?>
<br class="st_clear_all" />
<?php st_include_component('stProduct', 'mainImage');?><br>

View File

@@ -0,0 +1,13 @@
<?php use_helper('stProductPhoto');?>
<?php foreach ($photos as $photo):?>
<div style="float:left; margin:10px">
<?php if ($photo==get_main_image($photos)):?>
<?php echo image_tag('/uploads/products/'.$dir.'/'.$photo, array('width'=>150))?>
<?php else:?>
<?php echo image_tag('/uploads/products/'.$dir.'/'.$photo, array('width'=>50))?>
<?php endif;?>
</div>
<?php endforeach;?>
<br>
<?php echo link_to(__('Przejdź do galerii aby zarządzać zdjęciami produktu'), 'product/galleryEdit?id='.$product->getId())?>

View File

@@ -0,0 +1 @@
<?php echo checkbox_tag('lukas_product[disable]', 1, $lukas_product->getDisable());

View File

@@ -0,0 +1,12 @@
<?php
$c = new Criteria();
$c->add(ProductForSfAssetPeer::PRODUCT_ID , $forward_parameters['product_id']);
$c->add(ProductForSfAssetPeer::SF_ASSET_ID , $sf_asset->getId());
$asset = ProductForSfAssetPeer::doSelectOne($c);
if ( $asset ):
$assigned = $asset->getIsMain();
else:
$assigned = false;
endif;
?>
<?php echo $assigned ? image_tag(sfConfig::get('sf_admin_web_dir').'/images/tick.png') : '-' ?>

View File

@@ -0,0 +1,13 @@
<?php
$languages = LanguagePeer::doSelect(new Criteria());
$reviewLanguages = array();
foreach ($languages as $language) {
$c = new Criteria();
$c->add(LanguageI18nPeer::CULTURE, sfContext::getInstance()->getUser()->getCulture());
$LanguageI18n = $language->getLanguageI18ns($c);
$reviewLanguages[$language->getOriginalLanguage()] = $LanguageI18n[0]->getName();
}
echo select_tag("review[language]", options_for_select($reviewLanguages, $review->getLanguage()));

View File

@@ -0,0 +1,18 @@
<?php
/**
* @var sfWebRequest $sf_request
*/
if ($sf_request->getParameter('category_id') && !$filters)
{
$empty_message = 'Wybrana kategoria nie ma przypisanych produktów';
}
if ($sf_context->getActionName() == 'listLong')
{
include __DIR__ . '/_list_long.php';
}
else
{
include sfConfig::get('sf_module_cache_dir').'/auto'.ucfirst($sf_context->getModuleName()).'/templates/_list.php';
}

View File

@@ -0,0 +1,9 @@
<?php if ($sf_context->getActionName() == 'listLong'): ?>
<style>
.list_select_control,
.admin_actions .action-edit {
display: none;
}
</style>
<?php endif ?>
<?php include sfConfig::get('sf_module_cache_dir').'/auto'.ucfirst($sf_context->getModuleName()).'/templates/_list_actions.php'; ?>

View File

@@ -0,0 +1,28 @@
<div class="header" style="margin-bottom: 15px">
<div class="pager_bar">
<?php
echo select_tag('product_list_type', options_for_select(array(
st_url_for($sf_context->getModuleName().'/setConfiguration?for_action=list&params[list_type]=listLong') => __('Lista pełna', null, 'stBackendMain'),
st_url_for($sf_context->getModuleName().'/setConfiguration?for_action=list&params[list_type]=list') => __('Lista skrócona', null, 'stBackendMain'),
), st_url_for($sf_context->getModuleName().'/setConfiguration?for_action=list&params[list_type]='.$sf_context->getActionName())))
?>
</div><div class="menu categories">
<ul>
<li class="expandable">
<span>
<img src="<?php echo get_app_icon('stCategory') ?>" alt="<?php echo __('Kategorie', null, 'stBackendMain') ?>">
<span><?php echo __('Kategorie', null, 'stBackendMain') ?></span>
</span>
<?php st_include_component('stCategory', 'tree', array('selected' => $sf_request->getParameter('category_id'))) ?>
</li>
</ul>
</div>
<div class="clr"></div>
</div>
<script>
jQuery(function($) {
$('#product_list_type').change(function() {
window.location = $(this).val();
});
});
</script>

View File

@@ -0,0 +1,4 @@
<?php echo st_get_component('stCategory', 'treeBreadcrumbs') ?>
<?php echo st_get_component("stProduct", "fixProducts", array('pager' => $pager)); ?>

View File

@@ -0,0 +1,6 @@
<?php use_helper('stAsset'); ?>
<p style="text-align: left">
<?php if ($product->getOptImage()): ?>
<?php echo link_to(st_asset_image_tag($product->getOptImage(), 'icon'), 'stProduct/edit?id=' . $product->getId()) ?>
<?php endif; ?>
</p>

View File

@@ -0,0 +1,43 @@
<script type="text/javascript">
jQuery(function($) {
function equalHeight(group) {
tallest = 0;
group.each(function() {
$(this).css("height", "auto");
thisHeight = $(this).height();
if (thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height(tallest);
}
$(window).load(function() {
equalHeight($("#product_list_backend .name"));
});
});
</script>
<div id="product_list_backend">
<?php foreach ($pager->getResults() as $product) : ?>
<div class="item box roundies">
<a class="image" href="<?php echo st_url_for('stProduct/edit?id=' . $product->getId()) ?>"><span style="background-image: url('<?php echo st_product_image_path($product, 'large') ?>')"></span></a>
<div class="name"><?php echo link_to($product->getName(), 'stProduct/edit?id=' . $product->getId(), ['class' => 'truncate-text', 'style' => '--truncate-text-lines: 3']) ?></div>
<div class="actions">
<?= st_link_to(st_backend_get_icon('edit', array('title' => __('Edycja'))), '@stProduct?action=edit&id=' . $product->getId()) ?>
<?= st_link_to(st_backend_get_icon('preview', array('title' => __('Podgląd'))), '@stProduct?action=preview&id=' . $product->getId(), array('target' => '_blank')); ?>
<?= st_link_to(st_backend_get_icon('delete-circle', array('title' => __('Usuń'))), '@stProduct?action=delete&id=' . $product->getId(), array(
'post' => true,
'confirm' => __('Potwierdź usuniecie produktu?'),
)) ?>
</div>
<div class="price"><?php echo st_back_price($product->getPriceBrutto(true), true, true); ?></div>
<div style="clear: both;"></div>
</div>
<?php endforeach; ?>
<div style="clear: both;"></div>
</div>
<?php if (!$pager->getNbResults()) : ?>
<?php echo __('Brak rekordów - zmień kryteria wyszukiwania', null, 'stAdminGeneratorPlugin') ?>
<?php endif; ?>

View File

@@ -0,0 +1,32 @@
<?php
/**
* Szablon dla partial'a _list_price
*
* @package stProduct
* @author Marcin Butlak <marcin.butlak@sote.pl>
* @copyright SOTE
* @license SOTE
* @version $Id: _list_price.php 617 2009-04-09 13:02:31Z michal $
*/
?>
<?php use_helper('stCurrency') ?>
<?php use_javascript('stPrice.js') ?>
<?php if ($sf_user->getAttribute('list.mode', null, 'soteshop/stAdminGenerator/stProduct/config') == 'edit'): ?>
<?php echo st_front_symbol() ?> <?php echo input_tag('product['.$product->getId().'][price_brutto]', $sf_request->hasErrors() && $product->getCurrencyExchange() == 1 ? $sf_request->getParameter('product['.$product->getId().'][price_brutto]') : stPrice::round($product->getPriceBrutto()), array('style' => 'width: 70px', 'class' => 'editable', 'disabled' => $product->getCurrencyExchange() != 1)) ?> <?php echo st_back_symbol() ?>
<script type="text/javascript">
var field = $('product_<?php echo $product->getId() ?>_price_brutto');
field.observe('change', function() {
this.value = stPrice.fixNumberFormat(this.value);
});
field.observe('keypress', function(event) {
if (event.keyCode == Event.KEY_RETURN)
{
this.value = stPrice.fixNumberFormat(this.value);
}
});
</script>
<?php else: ?>
<?php echo st_back_price($product->getPriceBrutto(), true,true); ?>
<?php endif; ?>

View File

@@ -0,0 +1,12 @@
<?php use_helper('stProductPhoto','stImageSize');?>
<?php use_stylesheet('/css/backend/stProduct.css'); ?>
<?php if($product):?>
<?php foreach ($photos as $photo):?>
<?php if ($photo==get_main_image($dir)):?>
<div style="width:200px; height:200px;border:1px solid #D6D6D6; padding: 10px;">
<?php echo link_to(st_product_photo('/uploads/products/'.$dir.'/'.$photo, 200, 200), 'product/galleryEdit?id='.$product->getId() )?><br>
</div>
<?php endif;?>
<?php endforeach;?>
<?php echo link_to(__('Przejdź do galerii'), 'product/galleryEdit?id='.$product->getId())?>
<?php endif;?>

View File

@@ -0,0 +1,59 @@
</div>
<?php use_helper('smMyTabs'); ?>
<div class="row">
<label>Nazwa zakładki 1</label>
<div class="field">
<input type="text" name="product[my_tab1]" id="my_tab1" value="<?php echo $product->getMyTab1();?>" size="40">
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>Produkty zakładki 1</label>
<div class="field">
<?php echo object_product_mytabs1($product, array('control_name' => 'product[product_mytabs1]')); ?>
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>Nazwa zakładki 2</label>
<div class="field">
<input type="text" name="product[my_tab2]" id="my_tab2" value="<?php echo $product->getMyTab2();?>" size="40">
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>Produkty zakładki 2</label>
<div class="field">
<?php echo object_product_mytabs2($product, array('control_name' => 'product[product_mytabs2]')); ?>
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>Nazwa zakładki 3</label>
<div class="field">
<input type="text" name="product[my_tab3]" id="my_tab3" value="<?php echo $product->getMyTab3();?>" size="40">
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>Produkty zakładki 3</label>
<div class="field">
<?php echo object_product_mytabs3($product, array('control_name' => 'product[product_mytabs3]')); ?>
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>Nazwa zakładki 4</label>
<div class="field">
<input type="text" name="product[my_tab4]" id="my_tab4" value="<?php echo $product->getMyTab4();?>" size="40">
<div class="clr"></div>
</div>
</div>
<div class="row">
<label>Produkty zakładki 4</label>
<div class="field">
<?php echo object_product_mytabs4($product, array('control_name' => 'product[product_mytabs4]')); ?>
<div class="clr"></div>
</div>
</div>
<div>

View File

@@ -0,0 +1,6 @@
<?php echo input_date_tag('config[new_product_date]', $config->get('new_product_date', null, false), array (
'rich' => true,
'withtime' => true,
'calendar_button_img' => '/sf/sf_admin/images/date.png',
'readonly' => 'readonly',
)); ?>

View File

@@ -0,0 +1,25 @@
<?php
/**
* Szablon dla partial'a _price
*
* @package stProduct
* @author Marcin Butlak <marcin.butlak@sote.pl>
* @copyright SOTE
* @license SOTE
* @version $Id: _old_price.php 2545 2009-08-11 13:58:21Z pawel $
*/
?>
<table class="st_record_list" cellspacing="0">
<thead>
<tr>
<th><?php echo __('Netto') ?></th>
<th><?php echo __('Brutto') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo input_tag ('product[old_price_netto]', $product->getCurrency()->getIsSystemCurrency() ? st_price_format($product->getOldPriceNetto()) : null, array('size' => 8, 'disabled' => !$product->getCurrency()->getIsSystemCurrency())) ?></td>
<td><?php echo input_tag ('product[old_price_brutto]', st_price_format($product->getCurrency()->getIsSystemCurrency() ? $product->getOldPriceBrutto() : $product->getCurrencyOldPrice()), array('size' => 8)) ?></td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,29 @@
<?php echo checkbox_tag('product[points_only]', true, $product->getPointsOnly()); ?>
<script type="text/javascript">
var points_only = $('product_points_only');
setInputs();
points_only.observe('click', function() {
setInputs();
});
function setInputs(){
$('product_price_netto')[points_only.checked ? 'disable' : 'enable']();
$('product_price_brutto')[points_only.checked ? 'disable' : 'enable']();
$('product_old_price_netto')[points_only.checked ? 'disable' : 'enable']();
$('product_old_price_brutto')[points_only.checked ? 'disable' : 'enable']();
$('product_vat')[points_only.checked ? 'disable' : 'enable']();
$('product_edit_currency')[points_only.checked ? 'disable' : 'enable']();
$('product_wholesale_a_netto')[points_only.checked ? 'disable' : 'enable']();
$('product_wholesale_b_netto')[points_only.checked ? 'disable' : 'enable']();
$('product_wholesale_c_netto')[points_only.checked ? 'disable' : 'enable']();
$('product_wholesale_a_brutto')[points_only.checked ? 'disable' : 'enable']();
$('product_wholesale_b_brutto')[points_only.checked ? 'disable' : 'enable']();
$('product_wholesale_c_brutto')[points_only.checked ? 'disable' : 'enable']();
}
</script>

View File

@@ -0,0 +1,26 @@
<?php
/**
* Szablon dla partial'a _price
*
* @package stProduct
* @author Marcin Butlak <marcin.butlak@sote.pl>
* @copyright SOTE
* @license SOTE
* @version $Id: _price.php 2545 2009-08-11 13:58:21Z pawel $
*/
?>
<table class="st_record_list" cellspacing="0">
<thead>
<tr>
<th><b><?php echo __('Netto') ?></b></th>
<th><b><?php echo __('Brutto') ?></b></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo input_tag ('product[price_netto]', $product->getCurrency()->getIsSystemCurrency() ? st_price_format($product->getPriceNetto()) : null, array('size' => 7, 'disabled' => !$product->getCurrency()->getIsSystemCurrency())) ?></td>
<td><?php echo input_tag ('product[price_brutto]', st_price_format($product->getCurrency()->getIsSystemCurrency() ? $product->getPriceBrutto() : $product->getCurrencyPrice()), array('size' => 7)) ?></td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,7 @@
<?php if (array_key_exists($config->get('product_view'),$template_files)): ?>
<?php $select_option=$config->get('product_view');?>
<?php else:?>
<?php $select_option='default';?>
<?php endif;?>
<?php echo select_tag('config[product_view]', options_for_select($template_files,$select_option));?>

View File

@@ -0,0 +1 @@
<?php st_include_component('stAvailabilityProductBackend', 'productAvailability');

View File

@@ -0,0 +1 @@
<?php echo ProductPeer::retrieveByPK($forward_parameters['product_id']); ?>

View File

@@ -0,0 +1,15 @@
<?php $product = $product_has_positioning->getProduct();?>
<?php echo input_tag('product_has_positioning[product_url]', $product->getFriendlyUrl(), array('size' => '40')) ?>
<?php list($culture) = explode('_', $product->getCulture()); ?>
<p>
<?php echo st_link_to(null, 'stProduct/frontendShow?url=' . $product->getFriendlyUrl(), array(
'absolute' => true,
'for_app' => 'frontend',
'for_lang' => $culture,
'no_script_name' => true,
'class' => 'st_admin_external_link',
'target' => '_blank')) ?>
</p>

View File

@@ -0,0 +1 @@
<?php st_include_component('stDelivery','product');?>

View File

@@ -0,0 +1,156 @@
<?php
// auto-generated by sfPropelAdmin
// date: 2021/06/18 15:13:36
?>
<div style="margin-bottom: 10px; padding: 5px 10px; background-color: #f9f9f9;">
<?php st_include_component("stReview", "linkToAddReview", array('product_id' => $forward_parameters['product_id'])); ?>
</div>
<table cellspacing="0" cellpadding="0" class="st_record_list record_list">
<thead>
<tr>
<?php if ($review_action_select_options): ?>
<th width="1%">
<?php echo st_admin_checkbox_tag('review[select_control_head]', true, false, array('class' => 'selector_control')) ?>
</th>
<?php endif; ?>
<th width="1%">&nbsp;</th>
<?php st_include_partial('review_list_th_tabular', array('forward_parameters' => $forward_parameters, 'pager' => $pager)) ?>
<th width="1%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php $i = 1; $k=1; foreach ($pager->getResults() as $review): $odd = fmod(++$i, 2); ?>
<tr class="<?php if ($odd): ?>highlight<?php endif ?>">
<?php if ($review_action_select_options): ?>
<td>
<?php echo st_admin_checkbox_tag('review[selected][' . $review->getId() . ']', $review->getId(), false, array('class' => 'selector')) ?>
</td>
<?php endif; ?>
<td>
<ul class="st_object_actions">
<li>
<a href="<?php echo url_for('stProduct/reviewEdit?id='.intval($review->getId()).'&product_id='.$forward_parameters['product_id']) ?>" data-admin-confirm="" data-admin-action="edit">
<?php echo st_admin_get_icon('edit', array('title' => __('edit', null, 'stProduct'))) ?>
</a>
</li>
</ul>
</td>
<?php st_include_partial('review_list_td_tabular', array('review' => $review, 'forward_parameters' => $forward_parameters)) ?>
<?php st_include_partial('review_list_td_actions', array('review' => $review, 'forward_parameters' => $forward_parameters)) ?>
</tr>
<?php endforeach; ?>
<?php if (!$pager->getNbResults()): ?>
<tr><td colspan="9">
<?php echo __('Brak rekordów - zmień kryteria wyszukiwania', null, 'stAdminGeneratorPlugin') ?>
</td></tr>
<?php endif; ?>
</tbody>
</table>
<script type="text/javascript">
jQuery(function($) {
var highlighted = false;
var selectors = null;
function submitChanges() {
$('#record_list_form')
.attr('action', "<?php echo st_url_for('stProduct/reviewUpdateList') ?>")
.submit();
}
function submitSelectFormChanges(select, ajax) {
var form = select.closest('form');
if (ajax) {
$(document).trigger('preloader', 'show');
$.post(select.val(), form.serialize(), function(response) {
$(document).trigger('preloader', ['update', response]);
});
} else {
form.attr('action', select.val());
form.submit();
}
}
$('#update-list-form').click(function() {
submitChanges();
return false;
});
$('#filter_list_form .is_empty_field input[type=checkbox]').change(function() {
var input = $(this);
var inputs = input.closest('.field').find('input, select').not('[type=checkbox]');
inputs.prop('disabled', input.prop('checked'));
}).change();
$('.record_list').each(function() {
var recordList = $(this);
<?php if ($sf_user->getParameter('mode', null, 'soteshop/stAdminGenerator/stProduct/reviewList/config') == 'edit'): ?>
recordList.find('input.editable').keypress(function(e) {
if (e.which == 13) {
submitChanges();
return false;
}
});
<?php endif ?>
selectors = recordList.find('input.selector').change(function() {
var input = $(this);
if (input.prop('checked')) {
if (highlighted) {
highlighted = false;
$('body td.highlight').removeClass('highlight');
}
input.closest('tr').addClass('selected');
} else {
input.closest('tr').removeClass('selected');
}
});
recordList.find('input.selector_control').change(function() {
selectors.prop('checked', $(this).prop('checked')).change();
});
});
$('.list_select_control select').change(function() {
var select = $(this);
if (select.val()) {
if (selectors.is(':checked')) {
var option = select.find(':selected');
var category = option.data('category');
var ajax = option.data('ajax');
var confirm_msg = '<?php echo __("Jesteś pewien, że chcesz wykonać operację", null, "stAdminGeneratorPlugin")." \"%action%\" ".__("na wybranych rekordach?", null, "stAdminGeneratorPlugin") ?>';
var confirm = option.data('confirm');
if (confirm !== 0) {
var message = category ? category+': '+option.text() : option.text();
var confirmed = window.confirm(confirm_msg.replace('%action%', confirm ? confirm : message));
if (confirmed)
{
submitSelectFormChanges(select, ajax);
}
}
else {
submitSelectFormChanges(select, ajax);
}
select.val("");
} else {
highlighted = true;
selectors.closest('td').addClass('highlight');
select.val("");
window.alert('<?php echo __("Musisz wybrać przynajmniej jeden rekord", null, "stAdminGeneratorPlugin") ?>');
}
}
});
});
</script>

View File

@@ -0,0 +1,15 @@
<?php if ($sf_request->hasError('config{show_product_recomandation}')):?>
<?php echo form_error('config{show_product_recomandation}', array('class' => 'form-error-msg'));?>
<?php endif;?>
<?php echo checkbox_tag('config[show_product_recomandation]', 1, $config->get('show_product_recomandation', true, false));?>
<?php if (stRegisterSync::getPackageVersion('stRecommendPlugin') === null):?>
<script type="text/javascript">
jQuery(function($) {
$(document).ready(function() {
$("#config_show_product_recomandation").parent().parent().css("display", "none");
});
});
</script>
<?php endif;?>

View File

@@ -0,0 +1,6 @@
<?php echo input_file_tag("review[user_picture]", ""); ?><br/>
<?php if ($review->getUserPicture()!=""): ?>
<img src="/uploads<?php echo $review->getUserPicture(); ?>" alt="" style="width: 60px; height: 60px; margin-top: 10px; margin-bottom: 10px; border-radius: 50%;" ><br/>
<?php echo link_to(__('Usuń zdjęcie'),'stProduct/deleteImage?id='.$review->getId())?>
<br class="st_clear_all">
<?php endif; ?>

View File

@@ -0,0 +1,30 @@
<?php
// auto-generated by sfPropelAdmin
// date: 2015/10/23 10:25:34
?>
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date', 'VisualEffect', 'stAdminGenerator') ?>
<?php st_include_partial('stProduct/header', array('related_object' => $related_object, 'title' => __('Wystaw produkty na aukcji',
array(), 'stProduct'), 'culture' => null, 'route' => 'stProduct/allegroCustom')) ?>
<?php
?>
<?php st_include_component('stProduct', 'editMenu', array('forward_parameters' => $forward_parameters, 'related_object' => $related_object)) ?>
<div id="sf_admin_header">
<?php echo stSocketView::openComponents('stProduct.allegroCustom.Header'); ?>
</div>
<div id="sf_admin_content" style="padding: 10px 0;">
<?php st_include_partial('stProduct/custom_messages', array('forward_parameters' => $forward_parameters)) ?>
<?php echo stSocketView::openComponents('stProduct.allegroCustom.Content'); ?>
</div>
<div id="sf_admin_footer">
<?php echo stSocketView::openComponents('stProduct.allegroCustom.Footer'); ?>
</div>
<?php st_include_partial('stProduct/footer', array('related_object' => null, 'forward_parameters' => $forward_parameters)) ?>

View File

@@ -0,0 +1,32 @@
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'VisualEffect', 'stAdminGenerator', 'stDate') ?>
<?php
use_stylesheet('backend/stProductEdit.css');
?>
<?php
sfLoader::loadHelpers('stProduct', 'stProduct');
sfLoader::loadHelpers('stDeliveryBackend', 'stDeliveryBackend');
?>
<?php st_include_partial('stProduct/header', array('related_object' => $product, 'title' => __('Duplikowanie produktu'), 'route' => 'stProduct/edit?id=' . $product->getId(), 'forward_parameters' => $forward_parameters)) ?>
<?php st_include_partial('stProduct/edit_menu', array('related_object' => $product, 'forward_parameters' => $forward_parameters)) ?>
<?php echo form_tag(stAdminGeneratorHelper::applyParametersToUrl('stProduct/duplicate?product_id=' . $product->getId(), $forward_parameters), array(
'id' => 'admin_edit_form',
'name' => 'admin_edit_form',
'class' => 'admin_form',
'multipart' => true,
)) ?>
<?php st_admin_section_start() ?>
<?php echo object_input_hidden_tag($product, 'getId') ?>
<?php echo st_admin_get_form_field('product[code]', __("Kod nowego produktu"), $new_code) ?>
<?php echo st_admin_get_form_field('product[name]', __("Nazwa nowego produktu"), $product->getOptName(), null, array('size' => 78)) ?>
<?php st_admin_section_end() ?>
<div id="edit_actions">
<?php echo st_get_admin_actions(array(
array('label' => __("Duplikuj"), 'type' => 'save', 'params' => array('icon' => 'duplicate', 'name' => 'save'))
)) ?>
</div>
</form>

View File

@@ -0,0 +1,7 @@
<?php use_helper('stProgressBar'); ?>
<?php if ($checked): ?>
<?php echo progress_bar('stFixCode', 'stFixCode', 'fixCode', stFixCode::countProducts()); ?>
<?php else :?>
<?php echo __("Operacja ta zmieni wszystkie niedozwolone kody na poprawne.")?>
<?php echo link_to(__("Wykonaj."),'stProduct/fixCode?checked=true')?>
<?php endif; ?>

View File

@@ -0,0 +1,14 @@
<?php use_helper('I18N', 'Text', 'stAdminGenerator', 'Object', 'Validation', 'ObjectAdmin', 'stDate', 'stProgressBar') ?>
<?php echo st_get_admin_head('stProduct', __('Lista produktów',
array()), __('Zarządzanie produktami w sklepie.',
array()), array (
0 => 'stCategory',
1 => 'stProducer',
2 => 'stProductGroup',
3 => 'stReview',
)) ?>
<div style="text-align: center; margin: 0px auto; width: 200px;">
<?php echo progress_bar('stFixProducts', 'stFixProducts', 'fixProducts', stFixProducts::countProducts()); ?>
</div>
<?php echo st_get_admin_foot() ?>

View File

@@ -0,0 +1,35 @@
<?php use_helper('stProduct', 'stAdminGenerator') ?>
<div class="close"></div>
<h2><?php echo __('Edycja opisu zdjęcia') ?></h2>
<div class="content">
<form class="admin_form" action="<?php echo st_url_for('stProduct/imageGalleryEdit?culture='.$asset->getCulture()) ?>?image_id=<?php echo $asset->getId() ?>">
<div style="text-align: center">
<?php echo st_product_image_tag($asset, 'icon') ?>
</div>
<?php echo textarea_tag('plupload_edit[description]', $asset->getDescription(), array('style' => 'width: 100%; height: 150px')) ?>
<?php echo st_get_admin_actions(array(
array('type' => 'save', 'label' => __('Zapisz', null, 'stBackend')),
)); ?>
</form>
</div>
<script type="text/javascript">
jQuery(function($) {
$('#plupload_edit_overlay form').submit(function() {
var overlay = $('#plupload_edit_overlay');
overlay.addClass('preloader_160x24');
$.post(this.action, $(this).serializeArray(), function() {
overlay.removeClass('preloader_160x24');
overlay.data('overlay').close();
});
return false;
});
});
</script>

View File

@@ -0,0 +1,2 @@
<?php
include sfConfig::get('sf_module_cache_dir').'/auto'.ucfirst($sf_context->getModuleName()).'/templates/listSuccess.php';

View File

@@ -0,0 +1,48 @@
<?php use_helper('I18N', 'stAdminGenerator', 'stBackend');?>
<?php st_include_partial('stProduct/header', array('related_object' => $product, 'title' => __('Dodatkowe opcje'), 'route' => null, 'forward_parameters' => $forward_parameters));?>
<?php st_include_partial('stProduct/edit_menu', array('related_object' => $product, 'forward_parameters' => $forward_parameters));?>
<div id="sf_admin_content">
<?php if (stSoteshopVersion::getVersion() == stSoteshopVersion::ST_SOTESHOP_VERSION_POLISH):?>
<div class="application_shortcuts">
<ul>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/main/icons/stAllegroPlugin.png');?>); background-size: 35px 35px;" href="<?php echo url_for('@stAllegroPlugin?action=list&product_id='.$product->getId());?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Allegro'), '@stAllegroPlugin?action=list&product_id='.$product->getId());?>
</div>
</li>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/main/icons/stLukasPlugin.png');?>); background-size: 35px 35px;" href="<?php echo url_for('stProduct/lukasEdit?product_id='.$product->getId());?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Credit Agricole Raty'), 'stProduct/lukasEdit?product_id='.$product->getId());?>
</div>
</li>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/main/icons/stGoogleShoppingPlugin.png');?>); background-size: 35px 35px;" href="<?php echo url_for('@stGoogleShoppingPlugin?action=edit&product_id='.$product->getId().'&view=product');?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Google Shopping'), '@stGoogleShoppingPlugin?action=edit&product_id='.$product->getId().'&view=product');?>
</div>
</li>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/main/icons/stCompatibilityPlugin.png');?>); background-size: 35px 35px;" href="<?php echo url_for('@stCompatibilityPlugin?action=productConfig&product_id='.$product->getId());?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Moduł zgodności', null, 'stCompatibilityBackend'), '@stCompatibilityPlugin?action=productConfig&product_id='.$product->getId());?>
</div>
</li>
</ul>
<div class="clr"></div>
</div>
<?php else:?>
<?php echo __('Brak dodatkowych opcji.');?>
<?php endif;?>
</div>
<?php st_include_partial('stProduct/footer');?>

View File

@@ -0,0 +1,25 @@
<?php
// auto-generated by sfPropelAdmin
// date: 2012/05/24 13:41:13
?>
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'VisualEffect', 'stAdminGenerator', 'stDate') ?>
<?php
?>
<?php st_include_partial('stProduct/header', array('related_object' => $related_object, 'title' => $online_files->isNew() ? __('Dodaj nowy',
array(), 'stAdminGeneratorPlugin') : __('',
array(), 'stAdminGeneratorPlugin'), 'route' => 'stProduct/onlineAudioEdit?id='.$online_files->getId().'&product_id='.$forward_parameters['product_id'])) ?>
<?php st_include_partial('stProduct/edit_menu', array('forward_parameters' => $forward_parameters, 'related_object' => $related_object));?>
<div id="sf_admin_content">
<?php st_include_component('stProduct/online_audio_edit_messages', array('online_files' => $online_files, 'labels' => $labels, 'forward_parameters' => $forward_parameters)) ?>
<?php st_include_partial('stProduct/online_audio_edit_form', array('online_files' => $online_files, 'labels' => $labels, 'forward_parameters' => $forward_parameters)) ?>
<?php echo st_get_component('appOnlineCodesBackend','showFileList',array('related_object'=>$related_object, 'media_type'=>'ST_AUDIO')); ?></br>
</div>
<?php st_include_partial('stProduct/footer', array('related_object' => $related_object, 'forward_parameters' => $forward_parameters)) ?>

View File

@@ -0,0 +1,59 @@
<?php use_helper('I18N', 'Text', 'stAdminGenerator', 'Object', 'Validation', 'ObjectAdmin', 'stDate') ?>
<?php $related_object = ProductPeer::retrieveByPk($sf_params->get('product_id')) ?>
<?php st_include_partial('stProduct/header', array('related_object' => $related_object, 'title' => __('Pliki i kody online', array(), 'appOnlineCodesBackend'), 'route' => 'stProduct/onlineCodesList')) ?>
<?php st_include_partial('stProduct/edit_menu', array('forward_parameters' => $forward_parameters, 'related_object' => $related_object));?>
<div id="sf_admin_content">
<div class="application_shortcuts" style="height: 50px; border: 1px solid #ccc; padding: 10px;">
<ul>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/beta/icons/48x48/appOnlineCodesPlugin_audio.png');?>); background-size: 35px 35px;" href="<?php echo url_for('stProduct/onlineAudioCreate?product_id='.$related_object->getId());?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Audio', array(), 'appOnlineCodesBackend'), 'stProduct/onlineAudioCreate?product_id='.$related_object->getId());?>
</div>
</li>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/beta/icons/48x48/appOnlineCodesPlugin_images.png');?>); background-size: 35px 35px;" href="<?php echo url_for('stProduct/onlineImagesCreate?product_id='.$related_object->getId());?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Zdjęcia', array(), 'appOnlineCodesBackend'), 'stProduct/onlineImagesCreate?product_id='.$related_object->getId());?>
</div>
</li>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/beta/icons/48x48/appOnlineCodesPlugin_docs.png');?>); background-size: 35px 35px;" href="<?php echo url_for('stProduct/onlineDocsCreate?product_id='.$related_object->getId());?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Dokumenty', array(), 'appOnlineCodesBackend'), 'stProduct/onlineDocsCreate?product_id='.$related_object->getId());?>
</div>
</li>
<li>
<div class="icon" style="float: left;">
<a style="background-image: url(<?php echo get_app_icon('/images/backend/beta/icons/48x48/appOnlineCodesPlugin_codes.png');?>); background-size: 35px 35px;" href="<?php echo url_for('stProduct/onlineCodesCreate?product_id='.$related_object->getId());?>"></a>
</div>
<div class="name">
<?php echo link_to(__('Kody', array(), 'appOnlineCodesBackend'), 'stProduct/onlineCodesCreate?product_id='.$related_object->getId());?>
</div>
</li>
</ul>
</div>
<div style="clear: both;">
<br />
<div>
<?php echo st_get_component('appOnlineCodesBackend','showFileList',array('related_object'=>$related_object )); ?></br>
<?php echo st_get_component('appOnlineCodesBackend','showCodeList',array('related_object'=>$related_object )); ?>
</div>
<div class="clr"></div>
</div>
<?php st_include_partial('stProduct/footer', array('related_object' => $related_object)) ?>
<script type="text/javascript">
jQuery(function($) {
$('#list_actions').stickyBox();
});
</script>

View File

@@ -0,0 +1,24 @@
<?php
// auto-generated by sfPropelAdmin
// date: 2012/05/24 13:41:13
?>
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'VisualEffect', 'stAdminGenerator', 'stDate') ?>
<?php
?>
<?php st_include_partial('stProduct/header', array('related_object' => $related_object, 'title' => $online_codes->isNew() ? __('Dodaj nowy',
array(), 'stAdminGeneratorPlugin') : __('',
array(), 'stAdminGeneratorPlugin'), 'route' => 'stProduct/onlineCodesEdit?id='.$online_codes->getId().'&product_id='.$forward_parameters['product_id'])) ?>
<?php st_include_partial('stProduct/edit_menu', array('forward_parameters' => $forward_parameters, 'related_object' => $related_object));?>
<div id="sf_admin_content">
<?php st_include_component('stProduct/online_codes_edit_messages', array('online_codes' => $online_codes, 'labels' => $labels, 'forward_parameters' => $forward_parameters)) ?>
<?php st_include_partial('stProduct/online_codes_edit_form', array('online_codes' => $online_codes, 'labels' => $labels, 'forward_parameters' => $forward_parameters)) ?>
<?php echo st_get_component('appOnlineCodesBackend','showCodeList',array('related_object'=>$related_object )); ?>
</div>
<?php st_include_partial('stProduct/footer', array('related_object' => $related_object, 'forward_parameters' => $forward_parameters)) ?>

View File

@@ -0,0 +1,25 @@
<?php
// auto-generated by sfPropelAdmin
// date: 2012/05/24 13:41:13
?>
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'VisualEffect', 'stAdminGenerator', 'stDate') ?>
<?php
?>
<?php st_include_partial('stProduct/header', array('related_object' => $related_object, 'title' => $online_files->isNew() ? __('Dodaj nowy',
array(), 'stAdminGeneratorPlugin') : __('',
array(), 'stAdminGeneratorPlugin'), 'route' => 'stProduct/onlineDocsEdit?id='.$online_files->getId().'&product_id='.$forward_parameters['product_id'])) ?>
<?php st_include_partial('stProduct/edit_menu', array('forward_parameters' => $forward_parameters, 'related_object' => $related_object));?>
<div id="sf_admin_content">
<?php st_include_component('stProduct/online_docs_edit_messages', array('labels' => $labels, 'forward_parameters' => $forward_parameters)) ?>
<?php st_include_partial('stProduct/online_docs_edit_form', array('online_files' => $online_files, 'labels' => $labels, 'forward_parameters' => $forward_parameters, 'related_object'=>$related_object)) ?>
<?php echo st_get_component('appOnlineCodesBackend','showFileList',array('related_object'=>$related_object, 'media_type'=>'ST_DOCS')); ?></br>
</div>
<?php st_include_partial('stProduct/footer', array('related_object' => $related_object, 'forward_parameters' => $forward_parameters)) ?>

View File

@@ -0,0 +1,25 @@
<?php
// auto-generated by sfPropelAdmin
// date: 2012/05/24 13:41:13
?>
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'VisualEffect', 'stAdminGenerator', 'stDate') ?>
<?php
?>
<?php st_include_partial('stProduct/header', array('related_object' => $related_object, 'title' => $online_files->isNew() ? __('Dodaj nowy',
array(), 'stAdminGeneratorPlugin') : __('',
array(), 'stAdminGeneratorPlugin'), 'route' => 'stProduct/onlineImagesEdit?id='.$online_files->getId().'&product_id='.$forward_parameters['product_id'])) ?>
<?php st_include_partial('stProduct/edit_menu', array('forward_parameters' => $forward_parameters, 'related_object' => $related_object));?>
<div id="sf_admin_content">
<?php st_include_component('stProduct/online_images_edit_messages', array('online_files' => $online_files, 'labels' => $labels, 'forward_parameters' => $forward_parameters)) ?>
<?php st_include_partial('stProduct/online_images_edit_form', array('online_files' => $online_files, 'labels' => $labels, 'forward_parameters' => $forward_parameters)) ?>
<?php echo st_get_component('appOnlineCodesBackend','showFileList',array('related_object'=>$related_object, 'media_type'=>'ST_IMAGES' )); ?></br>
</div>
<?php st_include_partial('stProduct/footer', array('related_object' => $related_object, 'forward_parameters' => $forward_parameters)) ?>

View File

@@ -0,0 +1,55 @@
<?php include sfConfig::get('sf_module_cache_dir') . '/autoStProduct/templates/presentationConfigSuccess.php' ?>
<?php if ($config->get('global_price_netto')){ ?>
<script type="text/javascript">
jQuery(function($) {
document.getElementById("config_price_view").disabled = true;
document.getElementById("config_price_view").value = "only_net";
var config_price_view = document.createElement("input");
config_price_view.setAttribute("type", "hidden");
config_price_view.setAttribute("name", "config[price_view]");
config_price_view.setAttribute("value", "only_net");
document.getElementById("config_actions").appendChild(config_price_view);
document.getElementById("config_price_view_long").disabled = true;
document.getElementById("config_price_view_long").value = "only_net";
var config_price_view_long = document.createElement("input");
config_price_view_long.setAttribute("type", "hidden");
config_price_view_long.setAttribute("name", "config[price_view_long]");
config_price_view_long.setAttribute("value", "only_net");
document.getElementById("config_actions").appendChild(config_price_view_long);
document.getElementById("config_price_view_group").disabled = true;
document.getElementById("config_price_view_group").value = "only_net";
var config_price_view_group = document.createElement("input");
config_price_view_group.setAttribute("type", "hidden");
config_price_view_group.setAttribute("name", "config[price_view_group]");
config_price_view_group.setAttribute("value", "only_net");
document.getElementById("config_actions").appendChild(config_price_view_group);
<?php if (stTheme::getInstance(sfContext::getInstance())->getVersion() < 7){ ?>
document.getElementById("config_price_view_short").disabled = true;
document.getElementById("config_price_view_short").value = "only_net";
var config_price_view_short = document.createElement("input");
config_price_view_short.setAttribute("type", "hidden");
config_price_view_short.setAttribute("name", "config[price_view_short]");
config_price_view_short.setAttribute("value", "only_net");
document.getElementById("config_actions").appendChild(config_price_view_short);
document.getElementById("config_price_view_other").disabled = true;
document.getElementById("config_price_view_other").value = "only_net";
var config_price_view_other = document.createElement("input");
config_price_view_other.setAttribute("type", "hidden");
config_price_view_other.setAttribute("name", "config[price_view_other]");
config_price_view_other.setAttribute("value", "only_net");
document.getElementById("config_actions").appendChild(config_price_view_other);
<?php } ?>
});
</script>
<?php } ?>

View File

@@ -0,0 +1,13 @@
fields:
allegro_auction{name}:
required:
msg: "Proszę podać nazwę aukcji."
sfStringValidator:
max: 50
max_error: "Nazwa aukcji musi być krótsza niż 50 znaków."
allegro_auction{allegro_category_id}:
required:
msg: "Proszę wybrać kategorię."
allegro_auction{images}:
stAllegroImageValidator:
msg: "Liczba eksportowanych zdjęć nie może być większa niż 8."

View File

@@ -0,0 +1,10 @@
fields:
config{long_list}:
required:
msg: Podaj liczbę produktów na liście pełnej
sfNumberValidator:
min: 1
min_error: Minimalna wartość to 1.
type: integer
type_error: Podaj liczbę całkowitą
nan_error: Podaj liczbę całkowitą

View File

@@ -0,0 +1,9 @@
fields:
product{code}:
required:
msg: Podaj kod produktu
stProductCodeValidator:
check_primary_key: false
product{name}:
required:
msg: Podaj nazwę produktu

View File

@@ -0,0 +1,44 @@
fields:
product{code}:
required:
msg: Podaj kod produktu
stProductCodeValidator:
product{name}:
required:
msg: Podaj nazwę produktu
product{uom}:
sfStringValidator:
max: 32
product{stock}:
sfNumberValidator:
min: 0
min_error: Stan magazynowy nie może być mniejszy od 0
type: any
type_error: Podaj liczbę
nan_error: Podaj liczbę
product{min_qty}:
sfNumberValidator:
min: 0.01
min_error: Minimalna ilość musi być większa od 0
type: any
type_error: Podaj liczbę
nan_error: Podaj liczbę
product{weight}:
sfNumberValidator:
min: 0
min_error: Waga produktu nie może być mniejsza od 0
type: any
type_error: Podaj liczbę
nan_error: Podaj liczbę
product{main_page_order}:
sfNumberValidator:
min: 0
min_error: Minimalna wartość nie może być mniejsza od 0
type: integer
type_error: Podaj liczbę
nan_error: Podaj liczbę
product{edit_image}:
file: True
stAssetFileValidator:
mime_types: "@web_images"

View File

@@ -0,0 +1,6 @@
fields:
product_has_sf_asset{gallery_edit_image_name}:
sfRegexValidator:
match: No
match_error: Nazwa pliku może zawierać wyłącznie litery alfabetu angielskiego (a-z), cyfry (0-9) oraz znaki _-
pattern: "/[^a-z0-9_-]/i"

View File

@@ -0,0 +1,12 @@
fillin:
enabled: true
fields:
online_files{name}:
required:
msg: Proszę podać nazwę
online_files{filename}:
required:
msg: Proszę podać plik
file: true

View File

@@ -0,0 +1,11 @@
fillin:
enabled: true
fields:
online_codes{name}:
required:
msg: Proszę podać nazwę
online_codes{code}:
required:
msg: Proszę podać kod

View File

@@ -0,0 +1,12 @@
fillin:
enabled: true
fields:
online_files{name}:
required:
msg: Proszę podać nazwę
online_files{filename}:
required:
msg: Proszę podać plik
file: true

Some files were not shown because too many files have changed in this diff Show More