]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Additional fixes for XML handler and listing builder
[mailer.git] / inc / mysql-manager.php
index fad3d46bc2860332d0d8358e6f363daa47edd8af..2b48644bdfcb8477ceaf7af1bc84c1d37995937a 100644 (file)
@@ -2331,7 +2331,16 @@ function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filter
                        // Filter all data
                        foreach ($row as $key => $value) {
                                // Search index
-                               $idx = searchXmlArray($key, $columns, 'column');
+                               $idx  = searchXmlArray($key, $columns, 'column');
+
+                               // Default name is NULL
+                               $name = NULL;
+
+                               // Is the name there?
+                               if (isset($columns[$idx]['name'])) {
+                                       // Then use it
+                                       $name = $columns[$idx]['name'];
+                               } // END - if
 
                                // Skip any missing entries
                                if ($idx === FALSE) {
@@ -2362,7 +2371,8 @@ function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filter
 
                                // Try to handle call-back functions and/or extra values
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'idx=' . $idx . ',row[' . $key . ']=' . $row[$key]);
-                               $row[$key] = doHandleExtraValues($filterFunctions, $extraValues, $idx, $row[$key], $userIdColumn, $key);
+                               //if ($key == 'forced_campaign_created') die($idx.'=<pre>'.print_r($columns,true).'</pre><pre>'.print_r($extraValues,true).'</pre>');
+                               $row[$key] = doHandleExtraValues($filterFunctions, $extraValues, $idx, $row[$key], $userIdColumn, ((!is_null($name)) ? $name : $key));
                        } // END - foreach
 
                        // Then list it