diff --git a/adm/scaddressedit.php b/adm/scaddressedit.php index 1968df6c..e9252935 100644 --- a/adm/scaddressedit.php +++ b/adm/scaddressedit.php @@ -3,32 +3,56 @@ require_once(dirname(__FILE__).'/../config/config.inc.php'); require_once(dirname(__FILE__).'/init.php'); if($cookie->isLoggedBack() && $cart = Tools::getValue('id_cart')) { -$address = Db::getInstance()->ExecuteS('SELECT * FROM ps_socolissimo_delivery_info WHERE id_cart = '.pSQL(intval(Tools::getValue('id_cart')))); -if(count($address) > 0) { - $address = $address[0]; +$address = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'socolissimo_delivery_info` + WHERE id_cart = '.pSQL(intval(Tools::getValue('id_cart'))).' +'); +if($address) { + if(Tools::getValue('getPR') + && ($h_xcoords = (float) Tools::getValue('h_xcoords')) + && ($h_ycoords = (float) Tools::getValue('h_ycoords'))) { + $pr_list = array(); + // ± 10km radius + header('Content-Type: text/json'); + echo json_encode(Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'lapostews_pr` + WHERE `ycoords` >= '.(float) $h_ycoords.' - 0.02 + AND `ycoords` <= '.(float) $h_ycoords.' + 0.02 + AND `xcoords` >= '.(float) $h_xcoords.' - 0.01 + AND `xcoords` <= '.(float) $h_xcoords.' + 0.01 + ')); + exit; + } + if(isset($_POST['submitSC'])) { - Db::getInstance()->Execute('UPDATE ps_socolissimo_delivery_info SET - delivery_mode = "'.pSQL(Tools::getValue('delivery_mode', '')).'", - prname = "'.pSQL(Tools::getValue('prname', '')).'", - prfirstname = "'.pSQL(Tools::getValue('prfirstname', '')).'", - cecompanyname = "'.pSQL(Tools::getValue('cecompanyname', '')).'", - prcompladress = "'.pSQL(Tools::getValue('prcompladress', '')).'", - pradress1 = "'.pSQL(Tools::getValue('pradress1', '')).'", - pradress2 = "'.pSQL(Tools::getValue('pradress2', '')).'", - pradress3 = "'.pSQL(Tools::getValue('pradress3', '')).'", - pradress4 = "'.pSQL(Tools::getValue('pradress4', '')).'", - przipcode = "'.pSQL(Tools::getValue('przipcode', '')).'", - prtown = "'.pSQL(Tools::getValue('prtown', '')).'", - cephonenumber = "'.pSQL(Tools::getValue('cephonenumber', '')).'", - ceemail = "'.pSQL(Tools::getValue('ceemail', '')).'", - cedeliveryinformation = "'.pSQL(Tools::getValue('cedeliveryinformation', '')).'", - cedoorcode1 = "'.pSQL(Tools::getValue('cedoorcode1', '')).'", - cedoorcode2 = "'.pSQL(Tools::getValue('cedoorcode2', '')).'", - prid = "'.pSQL(Tools::getValue('prid', '')).'" - WHERE id_cart = '.pSQL(intval(Tools::getValue('id_cart')))); - } + Db::getInstance()->Execute('UPDATE ps_socolissimo_delivery_info SET + delivery_mode = "'.pSQL(Tools::getValue('delivery_mode', '')).'", + prname = "'.pSQL(Tools::getValue('prname', '')).'", + prfirstname = "'.pSQL(Tools::getValue('prfirstname', '')).'", + cecompanyname = "'.pSQL(Tools::getValue('cecompanyname', '')).'", + cename = "'.pSQL(Tools::getValue('cename', '')).'", + cefirstname = "'.pSQL(Tools::getValue('cefirstname', '')).'", + prcompladress = "'.pSQL(Tools::getValue('prcompladress', '')).'", + pradress1 = "'.pSQL(Tools::getValue('pradress1', '')).'", + pradress2 = "'.pSQL(Tools::getValue('pradress2', '')).'", + pradress3 = "'.pSQL(Tools::getValue('pradress3', '')).'", + pradress4 = "'.pSQL(Tools::getValue('pradress4', '')).'", + przipcode = "'.pSQL(Tools::getValue('przipcode', '')).'", + prtown = "'.pSQL(Tools::getValue('prtown', '')).'", + cephonenumber = "'.pSQL(Tools::getValue('cephonenumber', '')).'", + ceemail = "'.pSQL(Tools::getValue('ceemail', '')).'", + cedeliveryinformation = "'.pSQL(Tools::getValue('cedeliveryinformation', '')).'", + cedoorcode1 = "'.pSQL(Tools::getValue('cedoorcode1', '')).'", + cedoorcode2 = "'.pSQL(Tools::getValue('cedoorcode2', '')).'", + prid = "'.pSQL(Tools::getValue('prid', '')).'" + WHERE id_cart = '.pSQL(intval(Tools::getValue('id_cart')))); + } ?> +
+ - + + + + + + + + +'.$this->l('Order by sub category positions and product name').'
'; - } elseif ((int)$this->_category->id_parent > 1) { - echo ''.$this->l('Order by product name').'
'; - } - - echo ''; - if (isset($this->_includeTab) AND sizeof($this->_includeTab)) - echo ''.$this->l('Add or modify customizable properties').' | -
'.$this->l('File fields:').' | -
-
- '.$this->l('Number of upload file fields displayed').' - |
-
'.$this->l('Text fields:').' | -
-
- '.$this->l('Number of text fields displayed').' - |
-
- - | -|
'.$this->l('Files fields:').' | -'; - $this->_displayLabelFields($obj, $labels, $languages, $defaultLanguage, _CUSTOMIZE_FILE_); - echo ' - | -
'.$this->l('Text fields:').' | -'; - $this->_displayLabelFields($obj, $labels, $languages, $defaultLanguage, _CUSTOMIZE_TEXTFIELD_); - echo ' - | -
'; - if ($hasFileLabels OR $hasTextLabels) - echo ''; - echo ' - | -
- '.$this->l('Attachments for this product:').' -- - '.$this->l('Remove').' >> - - |
-
- '.$this->l('Available attachments:').' -- - << '.$this->l('Add').' - - - |
-
'.$this->l('Name:').' | -';
- foreach ($this->_languages as $language)
- echo '
- id) ? ' onkeyup="if (isArrowKey(event)) return; copy2friendlyURL();"' : '').' onkeyup="if (isArrowKey(event)) return; updateCurrentText();" onchange="updateCurrentText();" /> *
- '.$this->l('Invalid characters:').' <>;=#{}
- ';
- echo ' |
-
'.$this->l('Reference:').' | -- - '.$this->l('Special characters allowed:').' .-_#\ - | -
'.$this->l('Supplier Reference:').' | -- - '.$this->l('Special characters allowed:').' .-_#\ - | -
'.$this->l('EAN13 or JAN:').' | -- '.$this->l('(Europe, Japan)').' - | -
'.$this->l('UPC:').' | -- '.$this->l('(US, Canada)').' - | -
'.$this->l('NC8 :').' | -- - | -
'.$this->l('Id pays origine :').' | -- - | -
'.$this->l('Location (warehouse):').' | -- - | -
'.$this->l('Width ( package ) :').' | -- '.Configuration::get('PS_DIMENSION_UNIT').' - | -
'.$this->l('Height ( package ) :').' | -- '.Configuration::get('PS_DIMENSION_UNIT').' - | -
'.$this->l('Deep ( package ) :').' | -- '.Configuration::get('PS_DIMENSION_UNIT').' - | -
'.$this->l('Weight ( package ) :').' | -- '.Configuration::get('PS_WEIGHT_UNIT').' - | -
'.$this->l('Status:').' | -
- getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
-
- - getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> - - |
-
'.$this->l('Options:').' | -
- getFieldValue($obj, 'available_for_order') ? 'checked="checked" ' : '').' onclick="if ($(this).is(\':checked\')){$(\'#show_price\').attr(\'checked\', \'checked\');$(\'#show_price\').attr(\'disabled\', \'disabled\');}else{$(\'#show_price\').attr(\'disabled\', \'\');}"/>
-
- - getFieldValue($obj, 'show_price') ? 'checked="checked" ' : '').' /> - - - getFieldValue($obj, 'online_only') ? 'checked="checked" ' : '').' /> - - |
-
'.$this->l('Condition:').' | -- - | -
'.$this->l('Manufacturer:').' | -- '.$this->l('Create').' - | -
'.$this->l('Supplier:').' | -- '.$this->l('Create').' - | -
'.$this->l('Order by sub category positions and product name').'
'; + } elseif ((int)$this->_category->id_parent > 1) { + echo ''.$this->l('Order by product name').'
'; + } + + echo ''; + if (isset($this->_includeTab) AND sizeof($this->_includeTab)) + echo ''.$this->l('Add or modify customizable properties').' | +
'.$this->l('File fields:').' | +
+
+ '.$this->l('Number of upload file fields displayed').' + |
+
'.$this->l('Text fields:').' | +
+
+ '.$this->l('Number of text fields displayed').' + |
+
+ + | +|
'.$this->l('Files fields:').' | +'; + $this->_displayLabelFields($obj, $labels, $languages, $defaultLanguage, _CUSTOMIZE_FILE_); + echo ' + | +
'.$this->l('Text fields:').' | +'; + $this->_displayLabelFields($obj, $labels, $languages, $defaultLanguage, _CUSTOMIZE_TEXTFIELD_); + echo ' + | +
'; + if ($hasFileLabels OR $hasTextLabels) + echo ''; + echo ' + | +
+ '.$this->l('Attachments for this product:').' ++ + '.$this->l('Remove').' >> + + |
+
+ '.$this->l('Available attachments:').' ++ + << '.$this->l('Add').' + + + |
+
'.$this->l('Name:').' | +';
+ foreach ($this->_languages as $language)
+ echo '
+ id) ? ' onkeyup="if (isArrowKey(event)) return; copy2friendlyURL();"' : '').' onkeyup="if (isArrowKey(event)) return; updateCurrentText();" onchange="updateCurrentText();" /> *
+ '.$this->l('Invalid characters:').' <>;=#{}
+ ';
+ echo ' |
+
'.$this->l('Reference:').' | ++ + '.$this->l('Special characters allowed:').' .-_#\ + | +
'.$this->l('Supplier Reference:').' | ++ + '.$this->l('Special characters allowed:').' .-_#\ + | +
'.$this->l('EAN13 or JAN:').' | ++ '.$this->l('(Europe, Japan)').' + | +
'.$this->l('UPC:').' | ++ '.$this->l('(US, Canada)').' + | +
'.$this->l('NC8 :').' | ++ + | +
'.$this->l('Id pays origine :').' | ++ + | +
'.$this->l('Location (warehouse):').' | ++ + | +
'.$this->l('Width ( package ) :').' | ++ '.Configuration::get('PS_DIMENSION_UNIT').' + | +
'.$this->l('Height ( package ) :').' | ++ '.Configuration::get('PS_DIMENSION_UNIT').' + | +
'.$this->l('Deep ( package ) :').' | ++ '.Configuration::get('PS_DIMENSION_UNIT').' + | +
'.$this->l('Weight ( package ) :').' | ++ '.Configuration::get('PS_WEIGHT_UNIT').' + | +
'.$this->l('Status:').' | +
+ getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
+
+ + getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + + |
+
'.$this->l('Options:').' | +
+ getFieldValue($obj, 'available_for_order') ? 'checked="checked" ' : '').' onclick="if ($(this).is(\':checked\')){$(\'#show_price\').attr(\'checked\', \'checked\');$(\'#show_price\').attr(\'disabled\', \'disabled\');}else{$(\'#show_price\').attr(\'disabled\', \'\');}"/>
+
+ + getFieldValue($obj, 'show_price') ? 'checked="checked" ' : '').' /> + + + getFieldValue($obj, 'online_only') ? 'checked="checked" ' : '').' /> + + |
+
'.$this->l('Condition:').' | ++ + | +
'.$this->l('Manufacturer:').' | ++ '.$this->l('Create').' + | +
'.$this->l('Supplier:').' | ++ '.$this->l('Create').' + | +
- id OR Tools::getValue('is_virtual_good')=='true') AND $productDownload->active) echo 'checked="checked"' ?> /> - -id OR !$productDownload->active) echo 'style="display:none;"' ?> >
-
-
+
+
+
- l('Your download repository is not writable.'); ?> - checkFile()): ?> + //]]> + + + '; + ?> +
+ |
- id OR Tools::getValue('is_virtual_good')=='true') AND $productDownload->active) echo 'checked="checked"' ?> /> + +id OR !$productDownload->active) echo 'style="display:none;"' ?> >
+
+
+ l('Your download repository is not writable.'); ?> + checkFile()): ?> -
- id): ?>
-
-
- l('This product is missing') ?>: l('Your server\'s maximum upload file size is') . ': '.$upload_mb.$this->l('Mb') ?> - - - - -
-
-
-
-
-
-
-
- l('This is the link').': '.$productDownload->getHtmlLink(false, true) ?>
- l('Delete this file') ?>
-
-
- - - - + -
+ id): ?>
+
-
+
-
-
+ l('This product is missing') ?>: l('Your server\'s maximum upload file size is') . ': '.$upload_mb.$this->l('Mb') ?> + + + + +
+
+
+
+
+
+
+
+ l('This is the link').': '.$productDownload->getHtmlLink(false, true) ?>
+ l('Delete this file') ?>
+
+
+ + + + - ++ + * + + + |
+ ||||
'.$this->l('Pre-tax wholesale price:').' | diff --git a/classes/Image.php b/classes/Image.php index 848f90bc..f5a2c58b 100755 --- a/classes/Image.php +++ b/classes/Image.php @@ -226,27 +226,55 @@ class ImageCore extends ObjectModel $imageOld = new Image($row['id_image']); $imageNew = clone $imageOld; $imageNew->id_product = (int)($id_product_new); - // A new id is generated for the cloned image when calling add() - if ($imageNew->add()) - { - $new_path = $imageNew->getPathForCreation(); - foreach ($imagesTypes AS $imageType) - { - if (file_exists(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'-'.$imageType['name'].'.jpg')) - { - if (!Configuration::get('PS_LEGACY_IMAGES')) - $imageNew->createImgFolder(); - copy(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'-'.$imageType['name'].'.jpg', - $new_path.'-'.$imageType['name'].'.jpg'); - } - } - if (file_exists(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'.jpg')) - copy(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'.jpg', $new_path.'.jpg'); + + if($imageNew->add()) { + $new_path = $imageNew->getPathForCreation(); - self::replaceAttributeImageAssociationId($combinationImages, (int)($imageOld->id), (int)($imageNew->id)); + if(file_exists(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'.jpg')) { + copy(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'.jpg', $new_path.'.jpg'); + } + + foreach($imagesTypes AS $imageType) { + if(file_exists(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'-'.$imageType['name'].'.jpg')) { + if(!Configuration::get('PS_LEGACY_IMAGES')) { + $imageNew->createImgFolder(); + } + copy(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'-'.$imageType['name'].'.jpg', $new_path.'-'.$imageType['name'].'.jpg'); + } else { + if(!Configuration::get('PS_LEGACY_IMAGES')) { + $imageNew->createImgFolder(); + } + imageResize($new_path.'.jpg', _PS_PROD_IMG_DIR_.$imageNew->getExistingImgPath().'-'.$imageType['name'].'.jpg', (int) $imageType['width'], (int) $imageType['height']); + } + } + + self::replaceAttributeImageAssociationId($combinationImages, (int)($imageOld->id), (int)($imageNew->id)); + } else { + return FALSE; } - else - return false; + + // // A new id is generated for the cloned image when calling add() + // if ($imageNew->add()) + // { + // $new_path = $imageNew->getPathForCreation(); + // foreach ($imagesTypes AS $imageType) + // { + // if (file_exists(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'-'.$imageType['name'].'.jpg')) + // { + // if (!Configuration::get('PS_LEGACY_IMAGES')) + // $imageNew->createImgFolder(); + // copy(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'-'.$imageType['name'].'.jpg', + // $new_path.'-'.$imageType['name'].'.jpg'); + // } + // } + // if (file_exists(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'.jpg')) + // copy(_PS_PROD_IMG_DIR_.$imageOld->getExistingImgPath().'.jpg', $new_path.'.jpg'); + + // self::replaceAttributeImageAssociationId($combinationImages, (int)($imageOld->id), (int)($imageNew->id)); + // } + // else + // return false; + } return self::duplicateAttributeImageAssociations($combinationImages); } diff --git a/js/jquery/jquery.ui.map.js b/js/jquery/jquery.ui.map.js new file mode 100644 index 00000000..25f6e23e --- /dev/null +++ b/js/jquery/jquery.ui.map.js @@ -0,0 +1,371 @@ +/*! + * jQuery FN Google Map 3.0-rc + * http://code.google.com/p/jquery-ui-map/ + * Copyright (c) 2010 - 2012 Johan Säll Larsson + * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php + */ +( function($) { + + /** + * @param name:string + * @param prototype:object + */ + $.a = function(name, prototype) { + + var namespace = name.split('.')[0]; + name = name.split('.')[1]; + + $[namespace] = $[namespace] || {}; + $[namespace][name] = function(options, element) { + if ( arguments.length ) { + this._setup(options, element); + } + }; + + $[namespace][name].prototype = $.extend({ + 'namespace': namespace, + 'pluginName': name + }, prototype); + + $.fn[name] = function(options) { + + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call(arguments, 1), + returnValue = this; + + if ( isMethodCall && options.substring(0, 1) === '_' ) { + return returnValue; + } + + this.each(function() { + var instance = $.data(this, name); + if (!instance) { + instance = $.data(this, name, new $[namespace][name](options, this)); + } + if (isMethodCall) { + var value = instance[options].apply(instance, args); + if ( options === 'get' || value != null ) { + returnValue = value; + } + } + }); + + return returnValue; + + }; + + }; + + $.a('ui.gmap', { + + /** + * Map options + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#MapOptions + */ + options: { + mapTypeId: 'roadmap', + zoom: 5 + }, + + /** + * Get or set options + * @param key:string + * @param options:object + * @return object + */ + option: function(key, options) { + if (options) { + this.options[key] = options; + this.get('map').set(key, options); + return; + } + return this.options[key]; + }, + + /** + * Setup plugin basics, + * @param options:object + * @param element:node + */ + _setup: function(options, element) { + this.el = element; + options = options || {}; + jQuery.extend(this.options, options, { 'center': this._latLng(options.center) }); + this._create(); + if ( this._init ) { this._init(); } + }, + + /** + * Instanciate the Google Maps object + */ + _create: function() { + var self = this; + this.instance = { 'map': new google.maps.Map(self.el, self.options), 'markers': [], 'overlays': [], 'services': [] }; + google.maps.event.addListenerOnce(self.instance.map, 'bounds_changed', function() { $(self.el).trigger('init', self.instance.map); }); + self._call(self.options.callback, self.instance.map); + }, + + /** + * Adds a latitude longitude pair to the bounds. + * @param position:google.maps.LatLng/string + */ + addBounds: function(position) { + var bounds = this.get('bounds', new google.maps.LatLngBounds()); + bounds.extend(this._latLng(position)); + this.get('map').fitBounds(bounds); + }, + + /** + * Helper function to check if a LatLng is within the viewport + * @param marker:google.maps.Marker + */ + inViewport: function(marker) { + var bounds = this.get('map').getBounds(); + return (bounds) ? bounds.contains(marker.getPosition()) : false; + }, + + /** + * Adds a custom control to the map + * @param panel:jquery/node/string + * @param position:google.maps.ControlPosition + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#ControlPosition + */ + addControl: function(panel, position) { + this.get('map').controls[position].push(this._unwrap(panel)); + }, + + /** + * Adds a Marker to the map + * @param markerOptions:google.maps.MarkerOptions + * @param callback:function(map:google.maps.Map, marker:google.maps.Marker) (optional) + * @return $(google.maps.Marker) + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#MarkerOptions + */ + addMarker: function(markerOptions, callback) { + markerOptions.map = this.get('map'); + markerOptions.position = this._latLng(markerOptions.position); + var marker = new (markerOptions.marker || google.maps.Marker)(markerOptions); + var markers = this.get('markers'); + if ( marker.id ) { + markers[marker.id] = marker; + } else { + markers.push(marker); + } + if ( marker.bounds ) { + this.addBounds(marker.getPosition()); + } + this._call(callback, markerOptions.map, marker); + return $(marker); + }, + + /** + * Clears by type + * @param ctx:string e.g. 'markers', 'overlays', 'services' + */ + clear: function(ctx) { + this._c(this.get(ctx)); + this.set(ctx, []); + }, + + _c: function(obj) { + for ( var property in obj ) { + if ( obj.hasOwnProperty(property) ) { + if ( obj[property] instanceof google.maps.MVCObject ) { + google.maps.event.clearInstanceListeners(obj[property]); + if ( obj[property].setMap ) { + obj[property].setMap(null); + } + } else if ( obj[property] instanceof Array ) { + this._c(obj[property]); + } + obj[property] = null; + } + } + }, + + /** + * Returns the objects with a specific property and value, e.g. 'category', 'tags' + * @param ctx:string in what context, e.g. 'markers' + * @param options:object property:string the property to search within, value:string, operator:string (optional) (AND/OR) + * @param callback:function(marker:google.maps.Marker, isFound:boolean) + */ + find: function(ctx, options, callback) { + var obj = this.get(ctx); + options.value = $.isArray(options.value) ? options.value : [options.value]; + for ( var property in obj ) { + if ( obj.hasOwnProperty(property) ) { + var isFound = false; + for ( var value in options.value ) { + if ( $.inArray(options.value[value], obj[property][options.property]) > -1 ) { + isFound = true; + } else { + if ( options.operator && options.operator === 'AND' ) { + isFound = false; + break; + } + } + } + callback(obj[property], isFound); + } + } + }, + + /** + * Returns an instance property by key. Has the ability to set an object if the property does not exist + * @param key:string + * @param value:object(optional) + */ + get: function(key, value) { + var instance = this.instance; + if ( !instance[key] ) { + if ( key.indexOf('>') > -1 ) { + var e = key.replace(/ /g, '').split('>'); + for ( var i = 0; i < e.length; i++ ) { + if ( !instance[e[i]] ) { + if (value) { + instance[e[i]] = ( (i + 1) < e.length ) ? [] : value; + } else { + return null; + } + } + instance = instance[e[i]]; + } + return instance; + } else if ( value && !instance[key] ) { + this.set(key, value); + } + } + return instance[key]; + }, + + /** + * Triggers an InfoWindow to open + * @param infoWindowOptions:google.maps.InfoWindowOptions + * @param marker:google.maps.Marker (optional) + * @param callback:function (optional) + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#InfoWindowOptions + */ + openInfoWindow: function(infoWindowOptions, marker, callback) { + var iw = this.get('iw', infoWindowOptions.infoWindow || new google.maps.InfoWindow); + iw.setOptions(infoWindowOptions); + iw.open(this.get('map'), this._unwrap(marker)); + this._call(callback, iw); + }, + + /** + * Triggers an InfoWindow to close + */ + closeInfoWindow: function() { + if ( this.get('iw') != null ) { + this.get('iw').close(); + } + }, + + /** + * Sets an instance property + * @param key:string + * @param value:object + */ + set: function(key, value) { + this.instance[key] = value; + }, + + /** + * Refreshes the map + */ + refresh: function() { + var map = this.get('map'); + var latLng = map.getCenter(); + $(map).triggerEvent('resize'); + map.setCenter(latLng); + }, + + /** + * Destroys the plugin. + */ + destroy: function() { + this.clear('markers'); + this.clear('services') + this.clear('overlays') + this._c(this.instance); + jQuery.removeData(this.el, this.name); + }, + + /** + * Helper method for calling a function + * @param callback + */ + _call: function(callback) { + if ( callback && $.isFunction(callback) ) { + callback.apply(this, Array.prototype.slice.call(arguments, 1)); + } + }, + + /** + * Helper method for google.maps.Latlng + * @param latLng:string/google.maps.LatLng + */ + _latLng: function(latLng) { + if ( !latLng ) { + return new google.maps.LatLng(0.0, 0.0); + } + if ( latLng instanceof google.maps.LatLng ) { + return latLng; + } else { + latLng = latLng.replace(/ /g,'').split(','); + return new google.maps.LatLng(latLng[0], latLng[1]); + } + }, + + /** + * Helper method for unwrapping jQuery/DOM/string elements + * @param obj:string/node/jQuery + */ + _unwrap: function(obj) { + return (!obj) ? null : ( (obj instanceof jQuery) ? obj[0] : ((obj instanceof Object) ? obj : $('#'+obj)[0]) ) + } + + }); + + jQuery.fn.extend( { + + triggerEvent: function(eventType) { + google.maps.event.trigger(this[0], eventType); + return this; + }, + + addEventListener: function(eventType, eventDataOrCallback, eventCallback) { + if ( google.maps && this[0] instanceof google.maps.MVCObject ) { + google.maps.event.addListener(this[0], eventType, eventDataOrCallback); + } else { + if (eventCallback) { + this.bind(eventType, eventDataOrCallback, eventCallback); + } else { + this.bind(eventType, eventDataOrCallback); + } + } + return this; + }, + + removeEventListener: function(eventType) { + if ( google.maps && this[0] instanceof google.maps.MVCObject ) { + if (eventType) { + google.maps.event.clearListeners(this[0], eventType); + } else { + google.maps.event.clearInstanceListeners(this[0]); + } + } else { + this.unbind(eventType); + } + return this; + } + + }); + + jQuery.each(('click rightclick dblclick mouseover mouseout drag dragend').split(' '), function(i, name) { + jQuery.fn[name] = function(a, b) { + return this.addEventListener(name, a, b); + } + }); + +} (jQuery) ); \ No newline at end of file diff --git a/js/jquery/jquery.ui.map.services.js b/js/jquery/jquery.ui.map.services.js new file mode 100644 index 00000000..bcca2c0f --- /dev/null +++ b/js/jquery/jquery.ui.map.services.js @@ -0,0 +1,63 @@ +/*! + * jQuery UI Google Map 3.0-rc + * http://code.google.com/p/jquery-ui-map/ + * Copyright (c) 2010 - 2012 Johan Säll Larsson + * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php + * + * Depends: + * jquery.ui.map.js + */ +( function($) { + + $.extend($.ui.gmap.prototype, { + + /** + * Computes directions between two or more places. + * @param directionsRequest:google.maps.DirectionsRequest + * @param directionsRendererOptions:google.maps.DirectionsRendererOptions (optional) + * @param callback:function(result:google.maps.DirectionsResult, status:google.maps.DirectionsStatus) + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#DirectionsRequest + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#DirectionsRendererOptions + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#DirectionsResult + */ + displayDirections: function(directionsRequest, directionsRendererOptions, callback) { + var self = this; + var directionService = this.get('services > DirectionsService', new google.maps.DirectionsService()); + var directionRenderer = this.get('services > DirectionsRenderer', new google.maps.DirectionsRenderer()); + if ( directionsRendererOptions ) { + directionRenderer.setOptions(directionsRendererOptions); + } + directionService.route(directionsRequest, function(results, status) { + if ( status === 'OK' ) { + directionRenderer.setDirections(results); + directionRenderer.setMap(self.get('map')); + } else { + directionRenderer.setMap(null); + } + callback(results, status); + }); + }, + + /** + * Displays the panorama for a given LatLng or panorama ID. + * @param panel:jQuery/String/Node + * @param streetViewPanoramaOptions:google.maps.StreetViewPanoramaOptions (optional) + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#StreetViewPanoramaOptions + */ + displayStreetView: function(panel, streetViewPanoramaOptions) { + this.get('map').setStreetView(this.get('services > StreetViewPanorama', new google.maps.StreetViewPanorama(this._unwrap(panel), streetViewPanoramaOptions))); + }, + + /** + * A service for converting between an address and a LatLng. + * @param geocoderRequest:google.maps.GeocoderRequest + * @param callback:function(result:google.maps.GeocoderResult, status:google.maps.GeocoderStatus), + * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#GeocoderResult + */ + search: function(geocoderRequest, callback) { + this.get('services > Geocoder', new google.maps.Geocoder()).geocode(geocoderRequest, callback); + } + + }); + +} (jQuery) ); \ No newline at end of file diff --git a/modules/blockbestsellers/blockbestsellers.php b/modules/blockbestsellers/blockbestsellers.php index 03ea98c7..71b4e1c0 100755 --- a/modules/blockbestsellers/blockbestsellers.php +++ b/modules/blockbestsellers/blockbestsellers.php @@ -111,7 +111,7 @@ class BlockBestSellers extends Module if(!$this->isCached('blockbestsellers_'.(int) $cookie->id_lang.'.tpl', $cache_id)) { $currency = new Currency((int)($params['cookie']->id_currency)); - $bestsellers = ProductSale::getBestSalesVp((int)($params['cookie']->id_lang), 0, 5); + $bestsellers = ProductSale::getBestSalesVp((int)($params['cookie']->id_lang), 0, 5, NULL, NULL, 10); if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY')) return; $best_sellers = array(); @@ -152,7 +152,7 @@ class BlockBestSellers extends Module if(!$this->isCached('blockbestsellers_cart_'.(int) $id_lang.'.tpl', $cache_id)) { $currency = new Currency((int)($params['cookie']->id_currency)); - $bestsellers = ProductSale::getBestSalesVp((int)($params['cookie']->id_lang), 0, 3); + $bestsellers = ProductSale::getBestSalesVp((int)($params['cookie']->id_lang), 0, 3, NULL, NULL, 10); if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY')) return; @@ -195,7 +195,7 @@ class BlockBestSellers extends Module if(!$this->isCached('blockbestsellers_home_'.(int) $cookie->id_lang.'.tpl', $cache_id)) { $currency = new Currency((int)($params['cookie']->id_currency)); - $bestsellers = ProductSale::getBestSalesVp((int)($params['cookie']->id_lang), 0, 5); + $bestsellers = ProductSale::getBestSalesVp((int)($params['cookie']->id_lang), 0, 5, NULL, NULL, 10); if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY')) return; $best_sellers = array(); diff --git a/modules/privatesales/AdminPrivateSalesSales.php b/modules/privatesales/AdminPrivateSalesSales.php index 88368248..87b93d8e 100755 --- a/modules/privatesales/AdminPrivateSalesSales.php +++ b/modules/privatesales/AdminPrivateSalesSales.php @@ -2,6 +2,7 @@ include_once(_PS_ROOT_DIR_.'/modules/privatesales/Sale.php'); class AdminPrivateSalesSales extends AdminTab { + private $imagelist; public function __construct() { diff --git a/modules/soflexibilite/soflexibilite.php b/modules/soflexibilite/soflexibilite.php index 70ccdefd..6bcbae82 100644 --- a/modules/soflexibilite/soflexibilite.php +++ b/modules/soflexibilite/soflexibilite.php @@ -1306,14 +1306,6 @@ class soflexibilite extends CarrierModule $soDelivery->city = $address_invoice->city; $soDelivery->country = Country::getIsoById((int)$address_invoice->id_country); }*/ - $address_delivery = new Address((int)$params['cart']->id_address_delivery); - if (Validate::isLoadedObject($address_delivery)) { - $soDelivery->address1 = $address_delivery->address1; - $soDelivery->address2 = $address_delivery->address2; - $soDelivery->postcode = $address_delivery->postcode; - $soDelivery->city = $address_delivery->city; - $soDelivery->country = Country::getIsoById((int)$address_delivery->id_country); - } // OCARAT modif update for customizations if ($this->ps15x) { @@ -1430,13 +1422,15 @@ class soflexibilite extends CarrierModule require_once dirname(__FILE__).'/classes/SoFlexibiliteWebService.php'; // Customer Name - $address = Db::getInstance()->ExecuteS('SELECT * FROM ps_socolissimo_delivery_info WHERE id_cart = '.pSQL((int)$order->id_cart)); + /*$address = Db::getInstance()->ExecuteS('SELECT * FROM ps_socolissimo_delivery_info WHERE id_cart = '.pSQL((int)$order->id_cart)); if(count($address) > 0) { $address = $address[0]; } if (!empty($address['prname']) && !empty($address['prname'])) { $fullname = sprintf('%s %s', $address['prfirstname'], $address['prname']); - } elseif (!empty($soDelivery->firstname) && !empty($soDelivery->lastname)) { + } else*/ + + if (!empty($soDelivery->firstname) && !empty($soDelivery->lastname)) { $fullname = sprintf('%s %s', $soDelivery->firstname, $soDelivery->lastname); } else { $fullname = sprintf('%s %s', $customer_address->firstname, $customer_address->lastname); @@ -1482,7 +1476,8 @@ class soflexibilite extends CarrierModule 'name' => $fullname, 'libelle' => in_array($soDelivery->type, array('DOM', 'DOS', 'BOM', 'BOS')) ? '' : $soDelivery->libelle, 'prid' => $soDelivery->id_point ? sprintf('%06s', $soDelivery->id_point) : null, - 'company' => $soDelivery->company ? $soDelivery->company : $customer_address->company, + /*'company' => $soDelivery->company ? $soDelivery->company : $customer_address->company,*/ + 'company' => $soDelivery->company, 'prname' => isset($relay_informations->nom) ? $relay_informations->nom : '', 'address1' => isset($relay_informations->adresse1) ? $relay_informations->adresse1 : ( in_array($soDelivery->type, array('DOM', 'DOS', 'BOM', 'BOS')) ? @@ -1498,7 +1493,7 @@ class soflexibilite extends CarrierModule 'city' => isset($relay_informations->localite) ? $relay_informations->localite : $soDelivery->city, 'country' => isset($relay_informations->libellePays) ? $relay_informations->libellePays : ( Tools::strlen($soDelivery->country) == 2 ? - Country::getNameById($this->context->employee->id_lang, Country::getByIso($soDelivery->country)) : + Country::getNameById($this->context->employee->id_lang, strtolower($soDelivery->country) == 'fr'? 8: Country::getByIso($soDelivery->country)) : $soDelivery->country ), 'iso_country' => isset($relay_informations->codePays) ? $relay_informations->codePays : $soDelivery->country, diff --git a/modules/stats_logistic/AdminStatsLogistic.php b/modules/stats_logistic/AdminStatsLogistic.php index d1e76f81..1c855b88 100755 --- a/modules/stats_logistic/AdminStatsLogistic.php +++ b/modules/stats_logistic/AdminStatsLogistic.php @@ -5,10 +5,15 @@ class AdminStatsLogistic extends AdminTab { $this->table = 'stats_logistic'; $this->lang = false; $this->date_begin = date('Y-m-d'); + $this->date_end = date('Y-m-d'); $this->date_stock = date('Y-m-d'); + $this->date_export_begin = date('Y-m-d'); $this->date_export_end = date('Y-m-d'); + + $this->date_expe_begin = date('Y-m-d'); + $this->date_expe_end = date('Y-m-d'); if (!empty($_GET['date_begin'])) { $this->date_begin = $_GET['date_begin']; @@ -193,7 +198,6 @@ class AdminStatsLogistic extends AdminTab { } } if ($result) { - //echo "