// #PSCFV-94 - AdminProducts, AdminCatalog
// new menu style git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9515 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+1
-16
@@ -84,21 +84,6 @@ if (Tools::isSubmit('ajaxProductManufacturers'))
|
||||
}
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('ajaxProductQuantity'))
|
||||
{
|
||||
require_once(dirname(__FILE__).'/tabs/AdminCatalog.php');
|
||||
$catalog = new AdminCatalog();
|
||||
$admin = new AdminProducts();
|
||||
|
||||
$languages = Language::getLanguages(false);
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
$product = new Product((int)(Tools::getValue('id_product')));
|
||||
if (!Validate::isLoadedObject($product))
|
||||
die (Tools::displayError('Product cannot be loaded'));
|
||||
|
||||
AdminTab::$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
echo $admin->ajaxProductQuantity($product);
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('ajaxReferrers'))
|
||||
{
|
||||
@@ -571,7 +556,7 @@ if (Tools::isSubmit('helpAccess'))
|
||||
|
||||
if (isset($item) AND isset($isoUser) AND isset($country))
|
||||
die(HelpAccess::displayHelp($item, $isoUser, $country, $version));
|
||||
die();
|
||||
die('{nohelp}');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('getHookableList'))
|
||||
|
||||
@@ -1,174 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7499 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
include_once(_PS_ADMIN_DIR_.'/../classes/AdminTab.php');
|
||||
include(_PS_ADMIN_DIR_.'/tabs/AdminCategories.php');
|
||||
include(_PS_ADMIN_DIR_.'/tabs/AdminProducts.php');
|
||||
|
||||
class AdminCatalog extends AdminTab
|
||||
{
|
||||
/** @var object AdminCategories() instance */
|
||||
private $adminCategories;
|
||||
|
||||
/** @var object AdminProducts() instance */
|
||||
private $adminProducts;
|
||||
|
||||
/** @var object AttributeGenerator() instance */
|
||||
private $attributeGenerator;
|
||||
|
||||
/** @var object imageResize() instance */
|
||||
private $imageResize;
|
||||
|
||||
/** @var object Category() instance for navigation*/
|
||||
private static $_category = NULL;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/* Get current category */
|
||||
$id_category = abs(Tools::getValue('id_category'));
|
||||
$shop = Context::getContext()->shop;
|
||||
if (!$id_category)
|
||||
$id_category = $shop->getCategory();
|
||||
else if ($id_category != $shop->getCategory())
|
||||
{
|
||||
// Check if current category is "inside" shop default category
|
||||
$sql = 'SELECT nleft, nright FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.$shop->getCategory();
|
||||
if ($interval = Category::getInterval($shop->getCategory()))
|
||||
{
|
||||
$sql = 'SELECT id_category FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.(int)$id_category.'
|
||||
AND nleft >= '.$interval['nleft'].'
|
||||
AND nright <= '.$interval['nright'];
|
||||
if (!Db::getInstance()->getValue($sql))
|
||||
$id_category = $shop->getCategory();
|
||||
}
|
||||
}
|
||||
self::$_category = new Category($id_category);
|
||||
if (!Validate::isLoadedObject(self::$_category))
|
||||
die('Category cannot be loaded');
|
||||
|
||||
$this->table = array('category', 'product');
|
||||
$this->adminCategories = new AdminCategories();
|
||||
$this->adminProducts = new AdminProducts();
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current category
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public static function getCurrentCategory()
|
||||
{
|
||||
return self::$_category;
|
||||
}
|
||||
|
||||
public function viewAccess($disable = false)
|
||||
{
|
||||
$result = parent::viewAccess($disable);
|
||||
$this->adminCategories->tabAccess = $this->tabAccess;
|
||||
$this->adminProducts->tabAccess = $this->tabAccess;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (isset($_GET['attributegenerator']))
|
||||
{
|
||||
if (!isset($this->attributeGenerator))
|
||||
{
|
||||
include_once(_PS_ADMIN_DIR_.'/tabs/AdminAttributeGenerator.php');
|
||||
$this->attributeGenerator = new AdminAttributeGenerator();
|
||||
}
|
||||
$this->attributeGenerator->postProcess();
|
||||
}
|
||||
$this->adminProducts->postProcess($this->token);
|
||||
}
|
||||
public function ajaxProcess()
|
||||
{
|
||||
if (Tools::getValue('addImage') !== false)
|
||||
$this->adminProducts->ajaxProcess();
|
||||
if (Tools::getValue('updateProductImageShopAsso'))
|
||||
$this->adminProducts->ajaxProcess();
|
||||
if (Tools::getValue('deleteImage'))
|
||||
$this->adminProducts->ajaxProcess();
|
||||
|
||||
}
|
||||
|
||||
public function displayErrors()
|
||||
{
|
||||
parent::displayErrors();
|
||||
$this->adminProducts->displayErrors();
|
||||
$this->adminCategories->displayErrors();
|
||||
if (Validate::isLoadedObject($this->attributeGenerator))
|
||||
$this->attributeGenerator->displayErrors();
|
||||
if (Validate::isLoadedObject($this->imageResize))
|
||||
$this->imageResize->displayErrors();
|
||||
}
|
||||
|
||||
public function display()
|
||||
{
|
||||
// @todo : this has to be dealt in AdminAttributeGenerator !!
|
||||
if (isset($_GET['attributegenerator']))
|
||||
{
|
||||
if (!isset($this->attributeGenerator))
|
||||
{
|
||||
include_once(_PS_ADMIN_DIR_.'/tabs/AdminAttributeGenerator.php');
|
||||
$this->attributeGenerator = new AdminAttributeGenerator();
|
||||
}
|
||||
$this->attributeGenerator->displayForm();
|
||||
}
|
||||
elseif (!isset($_GET['editImage']))
|
||||
{
|
||||
$home = false;
|
||||
$id_category = (int)(Tools::getValue('id_category'));
|
||||
if (!$id_category)
|
||||
{
|
||||
$home = true;
|
||||
$id_category = Context::getContext()->shop->getCategory();
|
||||
}
|
||||
$catalog_tabs = array('category', 'product');
|
||||
// Cleaning links
|
||||
$catBarIndex = self::$currentIndex;
|
||||
foreach ($catalog_tabs AS $tab)
|
||||
if (Tools::getValue($tab.'Orderby') && Tools::getValue($tab.'Orderway'))
|
||||
$catBarIndex = preg_replace('/&'.$tab.'Orderby=([a-z _]*)&'.$tab.'Orderway=([a-z]*)/i', '', self::$currentIndex);
|
||||
|
||||
echo '<div class="cat_bar"><span style="color: #3C8534;">'.$this->l('Current category').' :</span> '.getPath($catBarIndex, $id_category, '', '', 'catalog', $home).'</div>';
|
||||
//echo '<h2>'.$this->l('Categories').'</h2>';
|
||||
echo '<h1><a class="button" href="'.$this->context->link->getAdminLink('AdminCategories').'">'.$this->l('Categories').'</a></h1>';
|
||||
//$this->adminCategories->display($this->token);
|
||||
echo '<div style="margin:10px"> </div>';
|
||||
echo '<h1><a class="button" href="'.$this->context->link->getAdminLink('AdminProducts').'">'.$this->l('Products').'</a></h1>';
|
||||
//$this->adminProducts->display($this->token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4772,4 +4772,4 @@ class AdminProducts extends AdminTab
|
||||
|
||||
$this->displayErrors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,23 +36,25 @@ input.button[disabled=disabled]:hover{background-color:#FFF6D3}
|
||||
fieldset{background:#FFFFF0;border:1px solid #DFD5C3;font-size:1.1em;margin:0;padding:1em}
|
||||
legend{background:#FFF6D3;border:1px solid #DFD5C3;font-weight:700;margin:0;padding:.2em .5em;text-align:left}
|
||||
#menu{float:left;height:30px;line-height:normal;margin:10px 0 0;*margin:7px 0 0;padding:0;width:100%;padding:0 1px}
|
||||
#menu li{background:url(bg-tab.png) repeat-x 0 -2px;float:left;height:29px;list-style:none;margin:0 1px 0 0;list-style:none;display:block;border:1px solid #999999;-moz-border-radius-topright:6px;-moz-border-radius-topleft:6px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px}
|
||||
#menu li a{color:#000;display:block;height:20px;padding:8px 6px 4px 0;font-weight:bold;font-size:0.95em;}
|
||||
#menu li.maintab{background:url(bg-tab.png) repeat-x 0 -2px;float:left;height:29px;list-style:none;margin:0 1px 0 0;list-style:none;display:block;border:1px solid #999999;-moz-border-radius-topright:6px;-moz-border-radius-topleft:6px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px}
|
||||
#menu li.submenu_size .title{color:#000;display:block;height:20px;padding:8px 6px 4px 0;font-weight:bold;font-size:0.95em;}
|
||||
#menu li.submenu_size .title{_display:inline;_padding:6px 5px 4px 0}
|
||||
#menu li{_height:32px;_padding-top:3px}
|
||||
#menu img{display:inline;padding:0 3px 0 6px;vertical-align:top;width:16px;height:16px}
|
||||
#menu li.active,#menu li:hover{background-position:0 -38px;white-space:nowrap;}
|
||||
#menu li.active a{color:#000}
|
||||
#submenu{background:#ECEADE;clear:both;color:#666;margin:0;padding:0;border:1px solid #999999}
|
||||
.submenu{background:#ECEADE;clear:both;color:#666;margin:0;padding:0;border:1px solid #999999;z-index:9999}
|
||||
.withLeftBorder{background:transparent url(separator_subnav.png) no-repeat 0 5px}
|
||||
#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:7px;padding-right:7px;margin-top:8px;float:left;height:29px}
|
||||
#submenu li a{text-decoration:underline}
|
||||
#menu li{_height:32px;_padding-top:3px}
|
||||
#menu li a{_display:inline;_padding:6px 5px 4px 0}
|
||||
.tab-page {border:1px solid #ccc;background:#FFFFF0}
|
||||
.tab-row .tab.selected {border:1px solid #ccc;background:#FFF6D3;margin:1px -3px -3px 0px;top:-2px}
|
||||
.tab-row .tab {background:#EFEFEF}
|
||||
.submenu li{list-style:none;margin:0;padding-left:7px;padding-right:7px;margin-top:8px;float:left;height:16px;}
|
||||
.submenu li a{text-decoration:underline}
|
||||
.tab-row {height:24px;width:100px;margin-left:25px;border:1px solid #cccccc}
|
||||
.tab-row .tab .selected {background:#FFF6D3;margin:1px -3px -3px 25px;top:-2px;background-color:#eeeeee}
|
||||
.tab-row .tab {background:#EFEFEF;width:100px;}
|
||||
.tab-row .tab-page.selected {background:#FFF6D3;font-weight:bold;margin:1px -3px -3px 0px;top:-2px;background-color:#eeeeee}
|
||||
.tab-row .tab-page {background:#EFEFEF;width:100px;}
|
||||
hr {height: 1px;color:#E0D0B1;background-color:#E0D0B1}
|
||||
#footer {height:40px;background:#ECEADE url(footer-bg.png) repeat-x scroll left bottom;border:1px solid #999999;font-size:12px;clear:both;font-size:0.9em;color:#666666}
|
||||
#content {background-color:#FFF;border-left:1px solid #999999;border-right:1px solid #999999}
|
||||
#content {background-color:#FFF;border-left:1px solid #999999;border-right:1px solid #999999; border-top:1px solid #999999}
|
||||
input[type="text"],input[type="password"],input[type="file"],textarea {border:1px solid #E0D0B1}
|
||||
select {border: 1px solid #E0D0B1}
|
||||
select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disabled"] {border: 1px solid #CCCCCC;color: #AAAAAA}
|
||||
@@ -85,4 +87,6 @@ a.module_toggle_all{color: #268CCD;}
|
||||
.notifs_wrapper ul li {text-decoration: none;list-style: none;font-size:12px;padding:5px 0;}
|
||||
#header_infos .notifs_wrapper a {font-weight: bold;color: black;}
|
||||
.notifs_wrapper p {font-size: 12px;padding-top:8px;margin:0;border-top: 2px solid #E0E0E0;}
|
||||
.notifs_wrapper p.no_notifs {border: none;}
|
||||
.notifs_wrapper p.no_notifs {border: none;}
|
||||
.productTabs ol{padding:0;}
|
||||
.productTabs{background-color:#e0e0e0;border:1px solid #cccccc;position:absolute;top:100px;left:50px;}
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{include file='header.tpl'}
|
||||
|
||||
{if $display_header}
|
||||
{include file='header.tpl'}
|
||||
{/if}
|
||||
{if isset($conf)}
|
||||
<div class="conf">
|
||||
<img src="../img/admin/ok2.png" alt="" />{$conf}
|
||||
@@ -61,7 +61,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if count($informations) && $informations}
|
||||
{if isset($informations) && count($informations) && $informations}
|
||||
<div class="hint clear" style="display:block;">
|
||||
{foreach $informations as $info}
|
||||
{$info}
|
||||
@@ -115,5 +115,6 @@
|
||||
{/if}
|
||||
|
||||
{$page}
|
||||
|
||||
{include file='footer.tpl'}
|
||||
{if $display_footer}
|
||||
{include file='footer.tpl'}
|
||||
{/if}
|
||||
|
||||
@@ -108,4 +108,4 @@
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
<link href="../css/fileuploader.css" rel="stylesheet" type="text/css">
|
||||
<script src="../js/fileuploader.js" type="text/javascript"></script>
|
||||
<script src="../js/jquery/ui/jquery.ui.core.min.js" type="text/javascript"></script>
|
||||
<script src="../js/jquery/ui/jquery.ui.widget.min.js" type="text/javascript"></script>
|
||||
<script src="../js/jquery/ui/jquery.ui.progressbar.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="../js/admin.js"></script>
|
||||
{if isset($product_tabs)}
|
||||
<div class="productTabs">
|
||||
<ol class="tab">
|
||||
{foreach $product_tabs key=numStep item=tab}
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="link-{$tab.name}" href="{$tab.href}">{$tab.name}</a>{*todo href when nojs*}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var toload = new Array();
|
||||
var pos_select = {$pos_select};
|
||||
$(document).ready(function(){
|
||||
$(".tab-page").click(function(e){
|
||||
e.preventDefault();
|
||||
id = $(this).attr('id').substr(5);
|
||||
$(".tab-page").removeClass('selected');
|
||||
$("#product-tab-content").html("... LOADING ...");
|
||||
$("#link-"+id).addClass('selected');
|
||||
myurl = $(this).attr("href")+"&ajax=1";
|
||||
$.ajax({
|
||||
url : myurl,
|
||||
async : true,
|
||||
success :function(data)
|
||||
{
|
||||
$("#product-tab-content").html(data);
|
||||
var languages = new Array();
|
||||
if (id == 3)
|
||||
populate_attrs();
|
||||
if (id == 7)
|
||||
{
|
||||
$("#addAttachment").click(function() {
|
||||
return !$("#selectAttachment1 option:selected").remove().appendTo("#selectAttachment2");
|
||||
});
|
||||
$("#removeAttachment").click(function() {
|
||||
return !$("#selectAttachment2 option:selected").remove().appendTo("#selectAttachment1");
|
||||
});
|
||||
$("#product").submit(function() {
|
||||
$("#selectAttachment1 option").each(function(i) {
|
||||
$(this).attr("selected", "selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{***********************************************}
|
||||
{********** TO CHECK !!!!!!!!!!!!!!! ***********}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
ThickboxI18nImage = "{l s='Image'}";
|
||||
ThickboxI18nOf = "{l s='of'}";
|
||||
ThickboxI18nClose = "{l s='Close'}";
|
||||
ThickboxI18nOrEscKey = "{l s='(or "Esc")'}";
|
||||
ThickboxI18nNext = "{l s='Next >'}";
|
||||
ThickboxI18nPrev = "{l s='< Previous'}";
|
||||
tb_pathToImage = "../img/loadingAnimation.gif";
|
||||
//]]>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function toggleVirtualProduct(elt)
|
||||
{
|
||||
$("#is_virtual_file_product").hide();
|
||||
$("#virtual_good_attributes").hide();
|
||||
|
||||
if (elt.checked)
|
||||
{
|
||||
$('#virtual_good').show('slow');
|
||||
$('#virtual_good_more').show('slow');
|
||||
getE('out_of_stock_1').checked = 'checked';
|
||||
getE('out_of_stock_2').disabled = 'disabled';
|
||||
getE('out_of_stock_3').disabled = 'disabled';
|
||||
getE('label_out_of_stock_2').setAttribute('for', '');
|
||||
getE('label_out_of_stock_3').setAttribute('for', '');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#virtual_good').hide('slow');
|
||||
$('#virtual_good_more').hide('slow');
|
||||
getE('out_of_stock_2').disabled = false;
|
||||
getE('out_of_stock_3').disabled = false;
|
||||
getE('label_out_of_stock_2').setAttribute('for', 'out_of_stock_2');
|
||||
getE('label_out_of_stock_3').setAttribute('for', 'out_of_stock_3');
|
||||
}
|
||||
}
|
||||
|
||||
function uploadFile()
|
||||
{
|
||||
$.ajaxFileUpload (
|
||||
{
|
||||
url:'./uploadProductFile.php',
|
||||
secureuri:false,
|
||||
fileElementId:'virtual_product_file',
|
||||
dataType: 'xml',
|
||||
success: function (data, status)
|
||||
{
|
||||
data = data.getElementsByTagName('return')[0];
|
||||
var result = data.getAttribute("result");
|
||||
var msg = data.getAttribute("msg");
|
||||
var fileName = data.getAttribute("filename")
|
||||
if(result == "error")
|
||||
$("#upload-confirmation").html('<p>error: ' + msg + '</p>');
|
||||
else
|
||||
{
|
||||
$('#virtual_product_file').remove();
|
||||
$('#virtual_product_file_label').hide();
|
||||
$('#file_missing').hide();
|
||||
$('#delete_downloadable_product').show();
|
||||
$('#virtual_product_name').attr('value', fileName);
|
||||
$('#upload-confirmation').html(
|
||||
'<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">{l s='The file'} "' + fileName + '" {l s='has successfully been uploaded'}</a>' +
|
||||
'<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="' + msg + '" />');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function uploadFile2()
|
||||
{
|
||||
var link = '';
|
||||
$.ajaxFileUpload (
|
||||
{
|
||||
url:'./uploadProductFileAttribute.php',
|
||||
secureuri:false,
|
||||
fileElementId:'virtual_product_file_attribute',
|
||||
dataType: 'xml',
|
||||
success: function (data, status)
|
||||
{
|
||||
data = data.getElementsByTagName('return')[0];
|
||||
var result = data.getAttribute("result");
|
||||
var msg = data.getAttribute("msg");
|
||||
var fileName = data.getAttribute("filename");
|
||||
if(result == "error")
|
||||
$("#upload-confirmation2").html('<p>error: ' + msg + '</p>');
|
||||
else
|
||||
{
|
||||
$('#virtual_product_file_attribute').remove();
|
||||
$('#virtual_product_file_label').hide();
|
||||
$('#file_missing').hide();
|
||||
$('#delete_downloadable_product_attribute').show();
|
||||
$('#virtual_product_name_attribute').attr('value', fileName);
|
||||
$('#upload-confirmation2').html(
|
||||
'<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">{l s='The file'} "' + fileName + '" {l s='has successfully been uploaded'}</a>' +
|
||||
'<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="' + msg + '" />');
|
||||
|
||||
link = $("#delete_downloadable_product_attribute").attr('href');
|
||||
$("#delete_downloadable_product_attribute").attr('href', link+"&file="+msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<form action="{$form_action}" method="post" enctype="multipart/form-data" name="product" id="product">
|
||||
{$draft_warning}
|
||||
<input type="hidden" name="id_product" value="{$id_product}" />
|
||||
<input type="hidden" name="tabs" id="tabs" value="0" />
|
||||
<div class="tab-pane" id="tabPane1">
|
||||
<div id="product-tab-content">
|
||||
{$content}
|
||||
</div>
|
||||
</form>
|
||||
<br/>
|
||||
<a href="{$link->getAdminLink('AdminCatalog')}"><img src="../img/admin/arrow2.gif" />{l s='Back to list'}</a><br/>
|
||||
{else}
|
||||
{$content}
|
||||
{/if}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
<div class="tab-page" id="step2">
|
||||
<h4 class="tab" >2. {l s='Images'} (<span id="countImage">{$countImages}</span>)</h4>
|
||||
<table cellpadding="5">
|
||||
<tr>
|
||||
<td><b>{if isset($id_image)}{l s='Edit this product image'}{else}{l s='Add a new image to this product'}{/if}</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr style="width: 100%;" /><br />
|
||||
<table cellpadding="5" style="width:100%">
|
||||
<tr>
|
||||
<td class="col-left">{l s='File:'}</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<div id="file-uploader">
|
||||
<noscript>
|
||||
<p>{l s='Please enable JavaScript to use file uploader:'}</p>
|
||||
</noscript>
|
||||
</div>
|
||||
<div id="progressBarImage" class="progressBarImage"></div>
|
||||
<div id="showCounter" style="display:none;"><span id="imageUpload">0</span><span id="imageTotal">0</span></div>
|
||||
<ul id="listImage"></ul>
|
||||
<script type="text/javascript">var upbutton = "{l s='Upload a file'}"; </script>
|
||||
<script type="text/javascript">
|
||||
function deleteImg(id)
|
||||
{
|
||||
var conf = confirm("{l s='Are you sure?'}");
|
||||
if (conf)
|
||||
$.post(
|
||||
"ajax-tab.php",
|
||||
{
|
||||
action: "deleteImage",
|
||||
id_image:id,
|
||||
id_product : "{$id_product}",
|
||||
id_category : "{$id_category_default}",
|
||||
token : "{$token}",
|
||||
tab : "AdminProducts",
|
||||
ajax : 1,
|
||||
updateproduct : 1},
|
||||
function (data) {
|
||||
if (data)
|
||||
{
|
||||
cover = 0;
|
||||
if(data.imageDeleted)
|
||||
{
|
||||
if ($("#tr_" + id).find(".covered").attr("src") == "../img/admin/enabled.gif")
|
||||
cover = 1;
|
||||
$("#tr_" + id).remove();
|
||||
}
|
||||
if (cover)
|
||||
$("#imageTable tr").eq(1).find(".covered").attr("src", "../img/admin/enabled.gif");
|
||||
|
||||
$("#countImage").html(parseInt($("#countImage").html()) - 1);
|
||||
|
||||
// refreshImagePositions($("#imageTable"));
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function delQueue(id)
|
||||
{
|
||||
$("#img" + id).fadeOut("slow");
|
||||
$("#img" + id).remove();
|
||||
}
|
||||
$(document).ready(function () {
|
||||
var filecheck = 1;
|
||||
var uploader = new qq.FileUploader({
|
||||
element: document.getElementById("file-uploader"),
|
||||
action: "ajax-tab.php",
|
||||
debug: false,
|
||||
params: {
|
||||
id_product : "{$id_product}",
|
||||
id_category : "{$id_category_default}",
|
||||
token : "{$token}",
|
||||
tab : "AdminProducts",
|
||||
updateproduct : 1,
|
||||
addImage : 1,
|
||||
ajaxMode : 1,
|
||||
ajax: 1,
|
||||
},
|
||||
onComplete: function(id, fileName, responseJSON){
|
||||
var percent = ((filecheck * 100) / nbfile);
|
||||
$("#progressBarImage").progressbar({
|
||||
value: percent
|
||||
});
|
||||
if (percent != 100)
|
||||
{
|
||||
$("#imageUpload").html(parseInt(filecheck));
|
||||
$("#imageTotal").html(" / " + parseInt(nbfile) + " {l s='Images'}");
|
||||
$("#progressBarImage").show();
|
||||
$("#showCounter").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#progressBarImage").progressbar({
|
||||
value: 0
|
||||
});
|
||||
$("#progressBarImage").hide();
|
||||
$("#showCounter").hide();
|
||||
nbfile = 0;
|
||||
filecheck = 0;
|
||||
}
|
||||
if (responseJSON.success)
|
||||
{
|
||||
$("#imageTable tr:last").after(responseJSON.success);
|
||||
$("#countImage").html(parseInt($("#countImage").html()) + 1);
|
||||
$("#img" + id).remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#img" + id).addClass("red");
|
||||
$("#img" + id + " .errorImg").html(responseJSON.error);
|
||||
$("#img" + id + " .errorImg").show();
|
||||
|
||||
}
|
||||
if (percent >= 100)
|
||||
{
|
||||
refreshImagePositions($("#imageTable"));
|
||||
}
|
||||
filecheck++;
|
||||
},
|
||||
onSubmit: function(id, filename){
|
||||
$("#imageTable").show();
|
||||
$("#listImage").append("<li id=\'img"+id+"\'><div class=\"float\" >" + filename + "</div></div><a style=\"margin-left:10px;\" href=\"javascript:delQueue(" + id +");\"><img src=\"../img/admin/disabled.gif\" alt=\"\" border=\"0\"></a><p class=\"errorImg\"></p></li>");
|
||||
},
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{$content}
|
||||
@@ -0,0 +1,90 @@
|
||||
<div class="" id="step1">
|
||||
<h4 class="tab">1. {l s='Info.'}</h4>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
updateCurrentText();
|
||||
updateFriendlyURL();
|
||||
$.ajax({
|
||||
url: "ajax-tab.php",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: {
|
||||
ajaxProductManufacturers:"1",
|
||||
ajax : '1',
|
||||
token : "{$token}",
|
||||
controller : "AdminProducts",
|
||||
action : "productManufacturers",
|
||||
},
|
||||
success: function(j) {
|
||||
var options = $("select#id_manufacturer").html();
|
||||
if (j)
|
||||
for (var i = 0; i < j.length; i++)
|
||||
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
|
||||
$("select#id_manufacturer").replaceWith("<select id=\"id_manufacturer\">"+options+"</select>");
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
$("select#id_manufacturer").replaceWith("<p id=\"id_manufacturer\">[TECHNICAL ERROR] ajaxProductManufacturers: "+textStatus+"</p>");
|
||||
}
|
||||
|
||||
});
|
||||
$.ajax({
|
||||
url: "ajax-tab.php",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: {
|
||||
ajaxProductSuppliers:"1",
|
||||
ajax : '1',
|
||||
token : "{$token}",
|
||||
controller : "AdminProducts",
|
||||
action : "productSuppliers",
|
||||
},
|
||||
success: function(j) {
|
||||
var options = $("select#id_supplier").html();
|
||||
if (j)
|
||||
for (var i = 0; i < j.length; i++)
|
||||
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
|
||||
$("select#id_supplier").replaceWith("<select id=\"id_supplier\">"+options+"</select>");
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
$("select#id_supplier").replaceWith("<p id=\"id_supplier\">[TECHNICAL ERROR] ajaxProductSuppliers : "+textStatus+"</p>");
|
||||
}
|
||||
|
||||
});
|
||||
if ($('#available_for_order').is(':checked')){
|
||||
$('#show_price').attr('checked', 'checked');
|
||||
$('#show_price').attr('disabled', 'disabled');
|
||||
}
|
||||
else {
|
||||
$('#show_price').attr('disabled', '');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<b>{l s='Product global information'}</b> -
|
||||
<h3>{l s='Current product:'}<span id="current_product" style="font-weight: normal;">{l s='no name'}</span></h3>
|
||||
<script type="text/javascript">
|
||||
{$combinationImagesJs}
|
||||
$(document).ready(function(){
|
||||
$('#id_mvt_reason').change(function(){
|
||||
updateMvtStatus($(this).val());
|
||||
});
|
||||
updateMvtStatus($(this).val());
|
||||
});
|
||||
function updateMvtStatus(id_mvt_reason)
|
||||
{
|
||||
if (id_mvt_reason == -1)
|
||||
return $('#mvt_sign').hide();
|
||||
if ($('#id_mvt_reason option:selected').attr('rel') == -1)
|
||||
$('#mvt_sign').html('<img src="../img/admin/arrow_down.png" /> {l s='Decrease your stock'}');
|
||||
else
|
||||
$('#mvt_sign').html('<img src="../img/admin/arrow_up.png" /> {l s='Increase your stock'}');
|
||||
$('#mvt_sign').show();
|
||||
}
|
||||
</script>
|
||||
|
||||
{$content}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<a href="#" onclick="$('#add_specific_price').slideToggle();return false;"><img src="../img/admin/add.gif" alt="" />{l s='Add a new specific price'}</a>
|
||||
<div id="add_specific_price" style="display: none;">
|
||||
<input type="hidden" name="sp_id_shop" value="0" />
|
||||
<label>{l s='For:'}</label>
|
||||
<div class="margin-form">
|
||||
<select name="sp_id_shop">
|
||||
<option value="0">{l s='All shops'}</option>
|
||||
{foreach from=$shops item=shop}
|
||||
<option value="{$shop['id_shop']}">{$shop['name']|htmlentitiesUTF8}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
>
|
||||
<select name="sp_id_currency" id="spm_currency_0" onchange="changeCurrencySpecificPrice(0);">
|
||||
<option value="0">{l s='All currencies'}</option>
|
||||
{foreach from=$currencies item=currency}
|
||||
<option value="{$currency['id_currency']}">{$currency['name']|htmlentitiesUTF8}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
>
|
||||
<select name="sp_id_country">
|
||||
<option value="0">{l s='All countries'}</option>
|
||||
{foreach from=$countries item=country}
|
||||
<option value="{$country['id_country']}">{$country['name']|htmlentitiesUTF8}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
>
|
||||
<select name="sp_id_group">
|
||||
<option value="0">{l s='All groups'}</option>
|
||||
{foreach from=$groups item=group}
|
||||
<option value="'.(int)($group['id_group']).'">'.{$group['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label>{l s='Available from:'}</label>
|
||||
<div class="margin-form">
|
||||
<input class="datepicker" type="text" name="sp_from" value="" style="text-align: center" id="sp_from" /><span style="font-weight:bold; color:#000000; font-size:12px"> {l s='to'}</span>
|
||||
<input class="datepicker" type="text" name="sp_to" value="" style="text-align: center" id="sp_to" />
|
||||
</div>
|
||||
|
||||
<label>{l s='Starting at'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="sp_from_quantity" value="1" size="3" /> <span style="font-weight:bold; color:#000000; font-size:12px">{l s='unit'}</span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$(".datepicker").datepicker({
|
||||
prevText: '',
|
||||
nextText: ''
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<label>{l s='Product price'}
|
||||
{if $country_display_tax_label}
|
||||
{l s='(tax excl.):'}
|
||||
{/if}
|
||||
</label>
|
||||
{$content}
|
||||
Reference in New Issue
Block a user