Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form layout incorrect #1673

Merged
merged 5 commits into from
Aug 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions upload/admin/controller/sale/voucher.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,14 +600,18 @@ public function send() {
$vouchers[] = $this->request->post['voucher_id'];
}

foreach ($vouchers as $voucher_id) {
$this->model_sale_voucher->sendVoucher($voucher_id);
if ($vouchers) {
foreach ($vouchers as $voucher_id) {
$this->model_sale_voucher->sendVoucher($voucher_id);
}

$json['success'] = $this->language->get('text_sent');
} else {
$json['error'] = $this->language->get('text_no_results');
}

$json['success'] = $this->language->get('text_sent');
}

$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
}
28 changes: 14 additions & 14 deletions upload/admin/view/template/catalog/category_form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="input-top"><?php echo $entry_top; ?></label>
<div class="col-sm-10">
<label class="checkbox">
<div class="col-sm-10 checkbox">
<label>
<?php if ($top) { ?>
<input type="checkbox" name="top" value="1" checked="checked" id="input-top" />
<?php } else { ?>
Expand Down Expand Up @@ -225,24 +225,24 @@
</form>
</div>
</div>
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script>
<script type="text/javascript"><!--
<?php foreach ($languages as $language) { ?>
CKEDITOR.replace('input-description<?php echo $language['language_id']; ?>');
<?php } ?>
//--></script>
//--></script>
<script type="text/javascript"><!--
$('input[name=\'path\']').autocomplete({
'source': function(request, response) {
$.ajax({
url: 'index.php?route=catalog/category/autocomplete&token=<?php echo $token; ?>&filter_name=' + encodeURIComponent(request),
dataType: 'json',
dataType: 'json',
success: function(json) {
json.unshift({
'category_id': 0,
'name': '<?php echo $text_none; ?>'
});

response($.map(json, function(item) {
return {
label: item['name'],
Expand All @@ -255,15 +255,15 @@ $('input[name=\'path\']').autocomplete({
'select': function(item) {
$('input[name=\'path\']').val(item['label']);
$('input[name=\'parent_id\']').val(item['value']);
}
}
});
//--></script>
//--></script>
<script type="text/javascript"><!--
$('input[name=\'filter\']').autocomplete({
'source': function(request, response) {
$.ajax({
url: 'index.php?route=catalog/filter/autocomplete&token=<?php echo $token; ?>&filter_name=' + encodeURIComponent(request),
dataType: 'json',
dataType: 'json',
success: function(json) {
response($.map(json, function(item) {
return {
Expand All @@ -276,18 +276,18 @@ $('input[name=\'filter\']').autocomplete({
},
'select': function(item) {
$('input[name=\'filter\']').val('');

$('#category-filter' + item['value']).remove();

$('#category-filter').append('<div id="category-filter' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="category_filter[]" value="' + item['value'] + '" /></div>');
}
}
});

$('#category-filter').delegate('.fa-minus-circle', 'click', function() {
$(this).parent().remove();
});
//--></script>
//--></script>
<script type="text/javascript"><!--
$('#language a:first').tab('show');
//--></script>
//--></script>
<?php echo $footer; ?>
10 changes: 5 additions & 5 deletions upload/admin/view/template/catalog/information_form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="input-bottom"><?php echo $entry_bottom; ?></label>
<div class="col-sm-10">
<label class="checkbox inline">
<div class="col-sm-10 checkbox">
<label>
<?php if ($bottom) { ?>
<input type="checkbox" name="bottom" value="1" checked="checked" id="input-bottom" />
<?php } else { ?>
Expand Down Expand Up @@ -190,13 +190,13 @@
</form>
</div>
</div>
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script>
<script type="text/javascript"><!--
<?php foreach ($languages as $language) { ?>
CKEDITOR.replace('input-description<?php echo $language['language_id']; ?>');
<?php } ?>
//--></script>
//--></script>
<script type="text/javascript"><!--
$('#language a:first').tab('show');
//--></script>
//--></script>
<?php echo $footer; ?>
8 changes: 4 additions & 4 deletions upload/catalog/model/account/customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public function addCustomer($data) {

$customer_group_info = $this->model_account_customer_group->getCustomerGroup($customer_group_id);

$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET customer_group_id = '" . (int)$customer_group_id . "', store_id = '" . (int)$this->config->get('config_store_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['account']) ? serialize($data['custom_field']['account']) : '') . "', salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', newsletter = '" . (isset($data['newsletter']) ? (int)$data['newsletter'] : 0) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', status = '1', approved = '" . (int)!$customer_group_info['approval'] . "', date_added = NOW()");
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET customer_group_id = '" . (int)$customer_group_id . "', store_id = '" . (int)$this->config->get('config_store_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['account']) ? serialize($data['custom_field']['account']) : '') . "', salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', newsletter = '" . (isset($data['newsletter']) ? (int)$data['newsletter'] : 0) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', status = '1', approved = '" . (int)!$customer_group_info['approval'] . "', date_added = NOW()");

$customer_id = $this->db->getLastId();

$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['address']) ? serialize($data['custom_field']['address']) : '') . "'");

$address_id = $this->db->getLastId();

$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int)$address_id . "' WHERE customer_id = '" . (int)$customer_id . "'");
$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int)$address_id . "' WHERE customer_id = '" . (int)$customer_id . "'");

$this->load->language('mail/customer');

Expand Down Expand Up @@ -84,7 +84,7 @@ public function editCustomer($data) {
}

public function editPassword($email, $password) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($password)))) . "' WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "'");
$this->db->query("UPDATE " . DB_PREFIX . "customer SET salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($password)))) . "' WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "'");

$this->event->trigger('customer_edit_password');
}
Expand Down Expand Up @@ -126,7 +126,7 @@ public function getIps($customer_id) {

return $query->rows;
}

public function isBanIp($ip) {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "customer_ban_ip` WHERE ip = '" . $this->db->escape($ip) . "'");

Expand Down
17 changes: 9 additions & 8 deletions upload/catalog/view/theme/default/template/product/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,22 @@
<div id="review"></div>
<h2><?php echo $text_write; ?></h2>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-name"><?php echo $entry_name; ?></label>
<div class="col-sm-10">
<div class="col-sm-12">
<label class="control-label" for="input-name"><?php echo $entry_name; ?></label>
<input type="text" name="name" value="" id="input-name" class="form-control" />
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-review"><?php echo $entry_review; ?></label>
<div class="col-sm-10">
<div class="col-sm-12">
<label class="control-label" for="input-review"><?php echo $entry_review; ?></label>
<textarea name="text" rows="5" id="input-review" class="form-control"></textarea>
<div class="help-block"><?php echo $text_note; ?></div>
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label"><?php echo $entry_rating; ?></label>
<div class="col-sm-10"><?php echo $entry_bad; ?>&nbsp;
<div class="col-sm-12">
<label class="control-label"><?php echo $entry_rating; ?></label>&nbsp;&nbsp;&nbsp;
<?php echo $entry_bad; ?>&nbsp;
<input type="radio" name="rating" value="1" />
&nbsp;
<input type="radio" name="rating" value="2" />
Expand All @@ -100,8 +101,8 @@
&nbsp;<?php echo $entry_good; ?></div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-captcha"><?php echo $entry_captcha; ?></label>
<div class="col-sm-10">
<div class="col-sm-12">
<label class="control-label" for="input-captcha"><?php echo $entry_captcha; ?></label>
<input type="text" name="captcha" value="" id="input-captcha" class="form-control" />
<img src="index.php?route=tool/captcha" alt="" id="captcha" /></div>
</div>
Expand Down