From 2ec7f2c608ecc52d52dbcdb6cf71fc3a941653bf Mon Sep 17 00:00:00 2001
From: wdammak <26695620+wdammak@users.noreply.github.com>
Date: Mon, 9 Sep 2019 22:15:14 +0200
Subject: [PATCH 1/3] Fix path Feature Logo
---
controllers/admin/AdminFeaturesController.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php
index fa72862a6..b3a1fc14e 100644
--- a/controllers/admin/AdminFeaturesController.php
+++ b/controllers/admin/AdminFeaturesController.php
@@ -171,7 +171,7 @@ public function renderForm()
}
$ps_img_url = _PS_IMG_DIR_.'rf/'.$obj->id.'.png';
if ($img_exist = file_exists($ps_img_url)) {
- $img_url = '../../hotelcommerce/img/rf/'.$obj->id.'.png';
+ $img_url = '../img/rf/'.$obj->id.'.png';
$image = "
";
}
From 7789d883c5d847349f61e891c39ca6979f6e24ec Mon Sep 17 00:00:00 2001
From: wdammak <26695620+wdammak@users.noreply.github.com>
Date: Mon, 9 Sep 2019 22:28:32 +0200
Subject: [PATCH 2/3] better terminology
Feature to Room Feature
---
controllers/admin/AdminFeaturesController.php | 38 +++++++++----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php
index b3a1fc14e..9dff6b6a5 100644
--- a/controllers/admin/AdminFeaturesController.php
+++ b/controllers/admin/AdminFeaturesController.php
@@ -175,10 +175,10 @@ public function renderForm()
$image = "
";
}
- $this->toolbar_title = $this->l('Add a new feature');
+ $this->toolbar_title = $this->l('Add a new room feature');
$this->fields_form = array(
'legend' => array(
- 'title' => $this->l('Feature'),
+ 'title' => $this->l('Room feature'),
'icon' => 'icon-info-sign'
),
'input' => array(
@@ -188,16 +188,16 @@ public function renderForm()
'name' => 'name',
'lang' => true,
'size' => 33,
- 'hint' => $this->l('Enter a name for the feature. Invalid characters:').' <>;=#{}',
+ 'hint' => $this->l('Enter a name for the room feature. Invalid characters:').' <>;=#{}',
'required' => true
),
array(
'type' => 'file',
- 'label' => $this->l('Feature Logo'),
+ 'label' => $this->l('Room Feature Logo'),
'name' => 'logo',
'image' => $img_exist ? $image : false,
'display_image' => true,
- 'hint' => $this->l('Upload a feature logo.'),
+ 'hint' => $this->l('Upload a room feature logo.'),
'required' => true
)
)
@@ -223,13 +223,13 @@ public function initPageHeaderToolbar()
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_feature'] = array(
'href' => self::$currentIndex.'&addfeature&token='.$this->token,
- 'desc' => $this->l('Add new feature', null, null, false),
+ 'desc' => $this->l('Add new room feature', null, null, false),
'icon' => 'process-icon-new'
);
$this->page_header_toolbar_btn['new_feature_value'] = array(
'href' => self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token,
- 'desc' => $this->l('Add new feature value', null, null, false),
+ 'desc' => $this->l('Add new room feature value', null, null, false),
'icon' => 'process-icon-new'
);
}
@@ -237,7 +237,7 @@ public function initPageHeaderToolbar()
if ($this->display == 'view') {
$this->page_header_toolbar_btn['new_feature_value'] = array(
'href' => self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token,
- 'desc' => $this->l('Add new feature value', null, null, false),
+ 'desc' => $this->l('Add new room feature value', null, null, false),
'icon' => 'process-icon-new'
);
}
@@ -283,7 +283,7 @@ public function initToolbar()
case 'view':
$this->toolbar_btn['newAttributes'] = array(
'href' => self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token,
- 'desc' => $this->l('Add new feature values')
+ 'desc' => $this->l('Add new room feature values')
);
$this->toolbar_btn['back'] = array(
'href' => self::$currentIndex.'&token='.$this->token,
@@ -301,12 +301,12 @@ public function initToolbarTitle()
switch ($this->display) {
case 'edit':
- $bread_extended[] = $this->l('Edit New Feature');
+ $bread_extended[] = $this->l('Edit New Room Feature');
$this->addMetaTitle($bread_extended[count($bread_extended) - 1]);
break;
case 'add':
- $bread_extended[] = $this->l('Add New Feature');
+ $bread_extended[] = $this->l('Add New Room Feature');
$this->addMetaTitle($bread_extended[count($bread_extended) - 1]);
break;
@@ -351,13 +351,13 @@ public function initFormFeatureValue()
$this->fields_form[0]['form'] = array(
'legend' => array(
- 'title' => $this->l('Feature value'),
+ 'title' => $this->l('Room feature value'),
'icon' => 'icon-info-sign'
),
'input' => array(
array(
'type' => 'select',
- 'label' => $this->l('Feature'),
+ 'label' => $this->l('Room feature'),
'name' => 'id_feature',
'options' => array(
'query' => Feature::getFeatures($this->context->language->id),
@@ -425,7 +425,7 @@ public function initFormFeatureValue()
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
$helper->fields_value = $this->getFieldsValue($feature_value);
$helper->toolbar_btn = $this->toolbar_btn;
- $helper->title = $this->l('Add a new feature value');
+ $helper->title = $this->l('Add a new room feature value');
$this->content .= $helper->generateForm($this->fields_form);
}
@@ -464,7 +464,7 @@ public function initContent()
}
} else {
$url = ''.$this->l('Performance').'';
- $this->displayWarning(sprintf($this->l('This feature has been disabled. You can activate it here: %s.'), $url));
+ $this->displayWarning(sprintf($this->l('This room feature has been disabled. You can activate it here: %s.'), $url));
}
$this->context->smarty->assign(
@@ -615,7 +615,7 @@ public function processSave()
// upload feature image
$imgPath = _PS_IMG_DIR_.'rf/'.$objFeature->id.'.png';
if (!ImageManager::resize($featureImage['tmp_name'], $imgPath)) {
- $this->errors[] = $this->l('Some error occurred while uploding feature image. Please try again.');
+ $this->errors[] = $this->l('Some error occurred while uploding room feature image. Please try again.');
}
}
@@ -695,12 +695,12 @@ public function ajaxProcessUpdatePositions()
if (isset($pos[2]) && (int)$pos[2] === $idFeature) {
if ($feature = new Feature((int)$pos[2])) {
if (isset($position) && $feature->updatePosition($way, $position, $idFeature)) {
- echo 'ok position '.(int)$position.' for feature '.(int)$pos[1].'\r\n';
+ echo 'ok position '.(int)$position.' for room feature '.(int)$pos[1].'\r\n';
} else {
- echo '{"hasError" : true, "errors" : "Can not update feature '.(int)$idFeature.' to position '.(int)$position.' "}';
+ echo '{"hasError" : true, "errors" : "Can not update room feature '.(int)$idFeature.' to position '.(int)$position.' "}';
}
} else {
- echo '{"hasError" : true, "errors" : "This feature ('.(int)$idFeature.') can t be loaded"}';
+ echo '{"hasError" : true, "errors" : "This room feature ('.(int)$idFeature.') can t be loaded"}';
}
break;
From f567ac935d8985579641574e37d7636cbf0c0b92 Mon Sep 17 00:00:00 2001
From: wdammak <26695620+wdammak@users.noreply.github.com>
Date: Tue, 10 Sep 2019 16:47:53 +0200
Subject: [PATCH 3/3] Better terminology
---
controllers/admin/AdminFeaturesController.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php
index 9dff6b6a5..94bd3d898 100644
--- a/controllers/admin/AdminFeaturesController.php
+++ b/controllers/admin/AdminFeaturesController.php
@@ -171,7 +171,7 @@ public function renderForm()
}
$ps_img_url = _PS_IMG_DIR_.'rf/'.$obj->id.'.png';
if ($img_exist = file_exists($ps_img_url)) {
- $img_url = '../img/rf/'.$obj->id.'.png';
+ $img_url = _PS_IMG_.'rf/'.$obj->id.'.png';
$image = "
";
}