Skip to content

Commit

Permalink
Merge pull request #27 from mc12345678/v4.0.34.a
Browse files Browse the repository at this point in the history
V4.0.34.a
  • Loading branch information
mc12345678 committed Apr 21, 2016
2 parents 828acbb + e85cc75 commit c73036e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
10 changes: 5 additions & 5 deletions admin/easypopulate_4.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: easypopulate_4.php, v4.0.33 02-29-2016 mc12345678 $
// $Id: easypopulate_4.php, v4.0.34a 04-02-2016 mc12345678 $

// CSV VARIABLES - need to make this configurable in the ADMIN
// $csv_delimiter = "\t"; // "\t" = tab AND "," = COMMA
Expand Down Expand Up @@ -78,7 +78,7 @@
//$sql_fail_test == true; // used to cause an sql error on new product upload - tests error handling & logs
/* Test area end */

$curver = '4.0.33a';
$curver = '4.0.34.a';
$message = '';
if (IS_ADMIN_FLAG) {
$new_version_details = plugin_version_check_for_updates(2069, $curver);
Expand All @@ -88,7 +88,7 @@
}

// Current EP Version - Modded by mc12345678 after Chadd had done so much
$curver = $curver . ' - Beta 02-29-2016' . $message;
$curver = $curver . ' - 04-02-2016' . $message;
$display_output = ''; // results of import displayed after script run
$ep_dltype = NULL;
$ep_stack_sql_error = false; // function returns true on any 1 error, and notifies user of an error
Expand Down Expand Up @@ -666,13 +666,13 @@ function init()

echo "<td align=center>" . zen_draw_form('delete_form', basename($_SERVER['SCRIPT_NAME']), /*$parameters = */'', 'post', /*$params =*/ '', $request_type == 'SSL') . zen_draw_hidden_field('delete', urlencode($files[$val[$i]]), /*$parameters = */'') . zen_draw_input_field('delete_button', EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DELETE, /*$parameters = */'', /*$required = */false, /*$type = */'submit') . "</form></td>";
/* echo "<td align=center><a href=\"" . $_SERVER['SCRIPT_NAME'] . "?delete=" . urlencode($files[$val[$i]]) . "\">" . EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DELETE . "</a></td>";*/
echo "<td align=center><a href=\"" . ($request_type == 'SSL' ? (EP4_ADMIN_TEMP_DIRECTORY !== 'true' ? /* Storeside */ HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG : /*Admin Side */ HTTPS_SERVER . DIR_WS_HTTPS_ADMIN) : (EP4_ADMIN_TEMP_DIRECTORY !== 'true' ? /* Storeside */ HTTP_CATALOG_SERVER . DIR_WS_CATALOG : /*Admin Side */ HTTP_SERVER . DIR_WS_ADMIN)) . $tempdir . $files[$val[$i]] . "\" target=_blank>" . EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DOWNLOAD . "</a></td></tr>\n";
echo "<td align=center><a href=\"" . (EP4_ADMIN_TEMP_DIRECTORY !== 'true' ? /* BOF Storeside */ defined('ENABLE_SSL_CATALOG') && ENABLE_SSL_CATALOG === 'true' ? HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_CATALOG_SERVER . DIR_WS_CATALOG /* EOF Storeside */ : /* BOF Adminside */ (defined('ENABLE_SSL_ADMIN') && ENABLE_SSL_ADMIN === 'true' ? (defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER) . (defined('DIR_WS_HTTPS_ADMIN') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN) : HTTP_SERVER . DIR_WS_ADMIN) /* EOF Adminside */) . $tempdir . $files[$val[$i]] . "\" target=_blank>" . EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DOWNLOAD . "</a></td></tr>\n";
} else {
echo "<td>&nbsp;</td>\n";
echo "<td>&nbsp;</td>\n";
// echo "<td align=center><a href=\"" . $_SERVER['SCRIPT_NAME'] . "?delete=" . urlencode($files[$val[$i]]) . "\">" . EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DELETE . "</a></td>";
echo "<td align=center>" . zen_draw_form('delete_form', basename($_SERVER['SCRIPT_NAME']), /*$parameters = */'', 'post', /*$params =*/ '', $request_type == 'SSL') . zen_draw_hidden_field('delete', urlencode($files[$val[$i]]), /*$parameters = */'') . zen_draw_input_field('delete_button', EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DELETE, /*$parameters = */'', /*$required = */false, /*$type = */'submit') . "</form></td>";
echo "<td align=center><a href=\"" . ($request_type == 'SSL' ? (EP4_ADMIN_TEMP_DIRECTORY !== 'true' ? /* Storeside */ HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG : /*Admin Side */ HTTPS_SERVER . DIR_WS_HTTPS_ADMIN) : (EP4_ADMIN_TEMP_DIRECTORY !== 'true' ? /* Storeside */ HTTP_CATALOG_SERVER . DIR_WS_CATALOG : /*Admin Side */ HTTP_SERVER . DIR_WS_ADMIN)) . $tempdir . $files[$val[$i]] . "\" target=_blank>" . EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DOWNLOAD . "</a></td></tr>\n";
echo "<td align=center><a href=\"" . (EP4_ADMIN_TEMP_DIRECTORY !== 'true' ? /* BOF Storeside */ defined('ENABLE_SSL_CATALOG') && ENABLE_SSL_CATALOG === 'true' ? HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_CATALOG_SERVER . DIR_WS_CATALOG /* EOF Storeside */ : /* BOF Adminside */ (defined('ENABLE_SSL_ADMIN') && ENABLE_SSL_ADMIN === 'true' ? (defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER) . (defined('DIR_WS_HTTPS_ADMIN') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN) : HTTP_SERVER . DIR_WS_ADMIN) /* EOF Adminside */) . $tempdir . $files[$val[$i]] . "\" target=_blank>" . EASYPOPULATE_4_DISPLAY_EXPORT_FILE_DOWNLOAD . "</a></td></tr>\n";
}
}
} // End loop within a filetype
Expand Down
27 changes: 19 additions & 8 deletions admin/easypopulate_4_import.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: easypopulate_4_import.php, v4.0.33 02-29-2016 mc12345678 $
// $Id: easypopulate_4_import.php, v4.0.34a 03-29-2016 mc12345678 $

if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
Expand Down Expand Up @@ -1109,7 +1109,7 @@
// iso-8859-1
// $categories_names_array[$lang['id']] = explode($categories_delimiter,$items[$filelayout['v_categories_name_'.$lang['id']]]);
// utf-8
$categories_names_array[$lang['id']] = mb_split($categories_delimiter, $items[$filelayout['v_categories_name_' . $lang['id']]]);
$categories_names_array[$lang['id']] = mb_split(preg_quote($categories_delimiter), $items[$filelayout['v_categories_name_' . $lang['id']]]);

// get the number of tokens in $categories_names_array[]
$categories_count[$lang['id']] = count($categories_names_array[$lang['id']]);
Expand Down Expand Up @@ -1919,7 +1919,13 @@
// the following is common in both the updating an existing product and creating a new product // mc12345678 updated to allow omission of v_products_description in the import file.
$add_products_description_data = false;
$zco_notifier->notify('EP4_IMPORT_FILE_PRODUCTS_DESCRIPTION_ADD_OR_CHANGE_DATA');
if (isset($v_products_name) || isset($v_products_description) || ($ep_supported_mods['psd'] == true && isset($v_products_short_desc) ) || isset($v_products_url) || $add_products_description_data) { //
if ((isset($v_products_name) && is_array($v_products_name)) || (isset($v_products_description) && is_array
($v_products_description)) ||
($ep_supported_mods['psd'] == true
&&
isset
($v_products_short_desc) ) || (isset($v_products_url) && is_array($v_products_url)) ||
$add_products_description_data) { //
// Effectively need a way to step through all language options, this section to be "accepted" if there is something to be updated. Prefer the ability to verify update need without having to loop on anything, but just by "presence" of information.
foreach ($langcode as $lang) {
// foreach ($v_products_name as $key => $name) { // Decouple the dependency on the products_name being imported to update the products_name, description, short description and/or URL. //mc12345678 2015-Dec-12
Expand Down Expand Up @@ -1987,7 +1993,8 @@
$sql .= ($update_count ? ", " : "") . " products_url = :v_products_url: ";
$update_count = true;
}

// If using this notifier to add to the $sql, the when something is added be sure to
// set $update_count = true;
$zco_notifier->notify('EP4_IMPORT_FILE_PRODUCTS_DESCRIPTION_UPDATE_FIELDS_VALUES');

$sql .= " WHERE products_id = :v_products_id: AND language_id = :language_id:";
Expand All @@ -2003,10 +2010,14 @@
$sql = $db->bindVars($sql, ':language_id:', $lang_id, 'integer');
$zco_notifier->notify('EP4_IMPORT_FILE_PRODUCTS_DESCRIPTION_FIELDS_BIND_END');

$result = ep_4_query($sql);
if ($result) {
zen_record_admin_activity('Updated product ' . (int) $v_products_id . ' description via EP4.', 'info');
}
// Be sure to run the update query only if there has been something provded to
// update.
if ($update_count == true) {
$result = ep_4_query($sql);
if ($result) {
zen_record_admin_activity('Updated product ' . (int)$v_products_id . ' description via EP4.', 'info');
}
} // Perform query if there is something to update.
} // END: already in description, update it
} // END: foreach on languages
} // END: Products Descriptions End
Expand Down
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,12 @@
https://www.zen-cart.com/downloads.php?do=file&id=2069
4.0.34 03/19/2016 After report of an issue with EP4.0.33 being used on ZC 1.5.5, a change was made to how paths are
generated for admin side related code.
On import of priceqty files, the absence of language designated fields
now that the products description section has been rewritten
would cause a sql error on update. This has been resolved.
4.0.34.a 04/02/2016 Apply correction to importing on category information. An attempt was previously made to centralize
the use of the delimiter between categories. The technical reason for this not working as
expected was that the multi-byte function that acts on the data required the delimiter to
be properly formatted regex type expression. The UTF-8 version of the character was not
properly formatted and no further action was taken on the variable (until now). This restores
EP4 to its full functionality before attempting to make that improvement.

0 comments on commit c73036e

Please sign in to comment.