Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
datazen committed Aug 27, 2015
2 parents aa04d3c + 6e31091 commit ab31ea6
Show file tree
Hide file tree
Showing 93 changed files with 4,669 additions and 4,060 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public static function validateSerial($serial) {
$api_version = (defined('API_VERSION') && API_VERSION != NULL) ? API_VERSION : '1_0';
$request_type = getRequestType();
$resultXML = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/check/serial/', 'method' => 'post', 'parameters' => $validateArr, 'timeout' => 10));
$resultArr = utility::xml2arr($resultXML);
$resultArr = utility::xml2arr($resultXML);

if (count($resultArr) == 0) { // there was an error with the api
$error = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1750,8 +1750,8 @@ private static function _getSimpleOptionsTbody($options) {
if ( (isset($so['title']) && $so['title'] != NULL) ){
$items = '';
$itemsInput = '';
if (is_array($options['values'])) {
foreach ($options['values'] as $k => $v) {
if (is_array($options[$key]['values'])) {
foreach ($options[$key]['values'] as $k => $v) {
if (($v['options_id'] == $so['options_id']) && $v['customers_group_id'] == DEFAULT_CUSTOMERS_GROUP_ID && $so['products_id'] == $v['products_id']) {
$items .= '<div class="small"><span class="icon-right icon-blue with-small-padding"></span>' . $v['title'] . '</div>';
$itemsInput .= '<input type="hidden" id="simple_options_entry_' . $v['options_id'] . '_' . $v['values_id'] . '" name="simple_options_entry[' . $v['options_id'] . '][' . $v['values_id'] . ']" value="' . $v['title'] . '">';
Expand Down Expand Up @@ -2161,4 +2161,4 @@ private static function _hasSubProducts($id) {
return ( $Qchk->numberOfRows() === 1 );
}
}
?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static function getAll() {
while ( $Qspecials->next() ) {
$check = '<td><input class="batch" type="checkbox" name="batch[]" value="' . $Qspecials->valueInt('specials_id') . '" id="' . $Qspecials->valueInt('specials_id') . '"></td>';
$product = '<td>' . $Qspecials->value('products_name') . '</td>';
$price = '<td><s>' . $lC_Currencies->format($Qspecials->value('products_price')) . '</s>&nbsp;<font color="red">' . $lC_Currencies->format($Qspecials->value('specials_new_products_price')) . '</font></td>';
//$status = '<td><span class="align-center" id="status_' . $Qspecials->valueInt('specials_id') . '" onclick="updateStatus(\'' . $Qspecials->valueInt('specials_id') . '\', \'' . (($Qspecials->valueInt('specials_status') == 1) ? 0 : 1) . '\');">' . (($Qspecials->valueInt('specials_status') == 1) ? '<span class="icon-tick icon-size2 icon-green cursor-pointer with-tooltip" title="' . $lC_Language->get('text_disable_special') . '"></span>' : '<span class="icon-cross icon-size2 icon-red cursor-pointer with-tooltip" title="' . $lC_Language->get('text_enable_special') . '"></span>') . '</span></td>';
$status = '<td><span class="align-center">' . (($Qspecials->valueInt('status') == 1) ? '<span class="icon-tick icon-size2 icon-green with-tooltip" title="' . $lC_Language->get('text_active') . '"></span>' : '<span class="icon-cross icon-size2 icon-red with-tooltip" title="' . $lC_Language->get('text_inactive') . '"></span>') . '</span></td>';
$action = '<td class="align-right vertical-center">
Expand Down Expand Up @@ -231,4 +232,4 @@ public static function getTax($id) {
return $result;
}
}
?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@
.selectContainer { position:absolute; bottom:29px; left:30px }
</style>
<div class="with-padding-no-top">
<div id="templateSelectorContainer" style="position:absolute; top:98px; left:190px; z-index:2;"><div id="templateSelector"><form name="template" id="template" action="" onchange="updateTemplateSelector();"><?php echo lc_draw_pull_down_menu('filter', $templatesModulesArr, null, 'class="input with-small-padding"');?></form></div></div>
<div id="templateSelectorContainer" style="position:absolute; top:98px; left:190px; z-index:2;">
<div id="templateSelector">
<form name="template" id="template" action="" onchange="updateTemplateSelector();">
<?php echo lc_draw_pull_down_menu('filter', $templatesModulesArr, DEFAULT_TEMPLATE, 'class="input with-small-padding"'); ?>
</form>
</div>
</div>
<form name="batch" id="batch" action="#" method="post">
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="table responsive-table" id="dataTable">
<thead>
Expand Down
14 changes: 9 additions & 5 deletions catalog/admin/includes/applications/updates/classes/updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ public static function applyPackage($pharWithPath = null, $pharType = 'addon') {
self::log('*** Could NOT Set Permissions on PHP files/directories', $pharCode);
}
// remove the update phar
if (file_exists(DIR_FS_WORK . 'updates/update.phar')) unlink(DIR_FS_WORK . 'updates/update.phar');
if (file_exists(DIR_FS_WORK . 'updates/update.phar')) unlink(DIR_FS_WORK . 'updates/update.phar');

self::log('##### UPDATE TO ' . self::$_to_version . ' COMPLETE', $pharCode); }
} else {
// remove the addon phar & pubkey
Expand All @@ -571,7 +572,10 @@ public static function applyPackage($pharWithPath = null, $pharType = 'addon') {
* @access public
* @return boolean
*/
public static function doRunAfter() {
public static function doRunAfter() {
// remove the vqmod cache files
self::rmdir_r(DIR_FS_WORK . 'cache/vqmod/', true);

if (file_exists(DIR_FS_WORK . 'updates/runAfter/controller.php')) {
try {
include_once(DIR_FS_WORK . 'updates/runAfter/controller.php');
Expand Down Expand Up @@ -635,12 +639,12 @@ protected static function log($message, $code = null) {
* @access protected
* @return boolean
*/
protected static function rmdir_r($path) {
protected static function rmdir_r($path, $files_only = false) {
$i = new DirectoryIterator($path);
foreach($i as $f) {
if($f->isFile()) {
@unlink($f->getRealPath());
} else if(!$f->isDot() && $f->isDir()) {
if (!strstr($f->getRealPath(), '.htaccess')) @unlink($f->getRealPath());
} else if(!$f->isDot() && $f->isDir() && $files_only === false) {
self::rmdir_r($f->getRealPath());
@rmdir($f->getRealPath());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function getAll() {
* @return array
*/
public static function getData($id) {
global $lC_Database;
global $lC_Database, $lC_Language;

$lC_Currencies = new lC_Currencies();
$lC_Tax = new lC_Tax_Admin();
Expand Down Expand Up @@ -145,7 +145,6 @@ public static function getData($id) {
' <td colspan="2">&nbsp;</td>' . "\n" .
'</tr>' . "\n" .
'<tr>' . "\n" .
' <td width="200px" valign="top"><b>' . $lC_Language->get('field_shopping_cart_contents') . '</b></td>' . "\n" .
' <td><table border="0" cellspacing="0" cellpadding="2">' . "\n";
foreach ($cart['contents'] as $product) {
$data['cartContents'] .= '<tr>' . "\n" .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ function (data) {
' <p class="button-height inline-label">'+
' <label for="last_page_url" class="label"><?php echo $lC_Language->get('field_last_page_url'); ?></label>'+
' <span id="lastPageUrl"></span>'+
' </p>'+
' <p class="button-height inline-label">'+
' <label for="cart_contents" class="label"><?php echo $lC_Language->get('field_shopping_cart_contents'); ?></label>'+
' <span id="cartContents"></span>'+
' </p>'+
' </div>'+
'</div>',
Expand Down
1 change: 1 addition & 0 deletions catalog/admin/includes/languages/en_US.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
field_username = Email:
field_first_name = First Name:
field_last_name = Last Name:
field_shopping_cart_total = Total:

gender_male = Male
gender_female = Female
Expand Down
4 changes: 2 additions & 2 deletions catalog/admin/includes/languages/en_US/whos_online.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
field_entry_time = Entry Time:
field_last_click = Last Click:
field_last_page_url = Last Page URL:
field_shopping_cart_contents = Shopping Cart Contents:
field_shopping_cart_total = Shopping Cart Total:
field_shopping_cart_contents = Contents:
field_shopping_cart_total = Total:
introduction_delete_customer_session = Please verify the removal of this customer session.
Expand Down
4 changes: 3 additions & 1 deletion catalog/admin/includes/modules/services/reviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function install() {
$lC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('New Reviews', 'MAX_DISPLAY_NEW_REVIEWS', '6', 'Maximum number of new reviews to display', '6', '0', now())");
$lC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_public function, date_added) values ('Review Level', 'SERVICE_REVIEW_ENABLE_REVIEWS', '1', 'Customer level required to write a review.', '6', '0', 'lc_cfg_set_boolean_value(array(\'0\', \'1\', \'2\'))', now())");
$lC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_public function, date_added) values ('Moderate Reviews', 'SERVICE_REVIEW_ENABLE_MODERATION', '-1', 'Should reviews be approved by store admin.', '6', '0', 'lc_cfg_set_boolean_value(array(\'-1\', \'0\', \'1\'))', now())");
$lC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_public function, date_added) VALUES('Hide Reviews Ratings', 'SERVICE_REVIEW_HIDE_REVIEWS_RATING', 'Yes', 'Hide Reviews Rating Stars.', 6, 0, 'lc_cfg_set_boolean_value(array(\'Yes\', \'No\'))', now())");
}

public function remove() {
Expand All @@ -40,7 +41,8 @@ public function remove() {
public function keys() {
return array('MAX_DISPLAY_NEW_REVIEWS',
'SERVICE_REVIEW_ENABLE_REVIEWS',
'SERVICE_REVIEW_ENABLE_MODERATION');
'SERVICE_REVIEW_ENABLE_MODERATION',
'SERVICE_REVIEW_HIDE_REVIEWS_RATING');
}
}
?>
26 changes: 26 additions & 0 deletions catalog/includes/classes/banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,32 @@ public function display($id = null) {
return $banner_string;
}

/**
* Display all banners based on banners_group.
*
* @access public
* @return array
*/

public function getAllByGroup($banners_group = null) {
global $lC_Database;

$Qbanner = $lC_Database->query('select * from :table_banners where banners_group = :banners_group and status = "1"');
$Qbanner->bindTable(':table_banners', TABLE_BANNERS);
$Qbanner->bindValue(':banners_group', $banners_group);
$Qbanner->execute();

if( $Qbanner->numberOfRows() > 0 ){
while ( $Qbanner->next() ) {
if ( strtotime(lC_DateTime::getNow()) <= strtotime($Qbanner->value('expires_date')) ) {
$banners[] = $Qbanner->toArray();
}
}
}

return $banners;
}

/**
* Return the URL assigned to the banner
*
Expand Down
18 changes: 10 additions & 8 deletions catalog/includes/classes/category_tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function __construct() {
$this->_data = $catArr;
}

// if ($lC_Cache->isEnabled()) $lC_Cache->write($this->_data);
if ($lC_Cache->isEnabled()) $lC_Cache->write($this->_data);
}
}

Expand Down Expand Up @@ -441,15 +441,17 @@ protected function _calculateProductTotals($filter_active = true) {

$parent_category = $parent;

while ( $parent_category != $this->root_category_id ) {
foreach ( $this->_data as $parent_parent => $parent_categories ) {
foreach ( $parent_categories as $parent_category_id => $parent_category_info ) {
if ( $parent_category_id == $parent_category ) {
$this->_data[$parent_parent][$parent_category_id]['count'] += $this->_data[$parent][$id]['count'];
if ($this->root_category_id != 0) {
while ( $parent_category != $this->root_category_id ) {
foreach ( $this->_data as $parent_parent => $parent_categories ) {
foreach ( $parent_categories as $parent_category_id => $parent_category_info ) {
if ( $parent_category_id == $parent_category ) {
$this->_data[$parent_parent][$parent_category_id]['count'] += $this->_data[$parent][$id]['count'];

$parent_category = $parent_parent;
$parent_category = $parent_parent;

break 2;
break 2;
}
}
}
}
Expand Down
47 changes: 46 additions & 1 deletion catalog/includes/classes/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,52 @@ public function send() {
@ini_set('sendmail_from', '"' . $this->_from['name'] . '" <' . $this->_from['email_address'] . '>');
}

@mail(implode(', ', $to_email_addresses), $this->_subject, $this->_body, $headers);
if (EMAIL_TRANSPORT == 'smtp') {
require DIR_FS_CATALOG . 'ext/phpmailer/PHPMailerAutoload.php';

$mail = new PHPMailer;
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = (EMAIL_SMTP_DEBUG == '') ? 0 : EMAIL_SMTP_DEBUG;
//Ask for HTML-friendly debug output
$mail->Debugoutput = EMAIL_SMTP_DEBUG_OUTPUT;
//Set the hostname of the mail server
$mail->Host = EMAIL_SMTP_HOST_SERVER;
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = (EMAIL_SMTP_PORT_SERVER == '') ? 25 : EMAIL_SMTP_PORT_SERVER;
//Whether to use SMTP authentication
$mail->SMTPAuth = EMAIL_SMTP_ACTIVE_PASSWORD;
//Username to use for SMTP authentication
$mail->Username = (EMAIL_SMTP_ACTIVE_PASSWORD == false) ? '' : EMAIL_SMTP_USERNAME;
//Password to use for SMTP authentication
$mail->Password = (EMAIL_SMTP_ACTIVE_PASSWORD == false) ? '' : EMAIL_SMTP_PASSWORD;
//Set who the message is to be sent from
$mail->setFrom($this->_from['email_address'], $this->_from['name']);

foreach ( $this->_to as $to ) {
//Set who the message is to be sent to
$mail->addAddress($to['email_address'], $to['name']);
}
//Set the subject line
$mail->Subject = $this->_subject;
//convert HTML into a basic plain-text alternative body
$mail->msgHTML($this->_body);
//Replace the plain text body with one created manually
$mail->AltBody = $this->_body;
//send the message, check for errors
if (!$mail->send()) {
if (EMAIL_SMTP_DEBUG != 0){
$lC_MessageStack->add('header', 'Mailer Error: ' . $mail->ErrorInfo, 'error');
}
}
//end smtp
} else {
// use sendmail
@mail(implode(', ', $to_email_addresses), $this->_subject, $this->_body, $headers);
}

@ini_restore('sendmail_from');
}
Expand Down
Loading

0 comments on commit ab31ea6

Please sign in to comment.