From 9121a9e90c4ccb8a704098da1e02e13d3a06a8af Mon Sep 17 00:00:00 2001 From: Ben Keen Date: Thu, 5 Oct 2017 19:59:32 -0700 Subject: [PATCH] 3.0.0 --- code/ExportGroups.class.php | 2 + code/Module.class.php | 6 +- css/styles.css | 1 + export.php | 4 - lang/en_us.php | 4 +- module_config.php | 474 ++++++++++++++++++------------------ 6 files changed, 243 insertions(+), 248 deletions(-) diff --git a/code/ExportGroups.class.php b/code/ExportGroups.class.php index 831845e..6b8165a 100644 --- a/code/ExportGroups.class.php +++ b/code/ExportGroups.class.php @@ -87,6 +87,8 @@ public static function addExportGroup($info, $L) "popup_height" => null, "popup_width" => null, "action" => "new_window", + "action_button_text" => $L["word_generate"], + "smarty_template" => "", "headers" => "" ), $info); diff --git a/code/Module.class.php b/code/Module.class.php index c5a08ea..4562258 100644 --- a/code/Module.class.php +++ b/code/Module.class.php @@ -338,7 +338,6 @@ public function addExcelExportGroup() list ($success, $message, $export_group_id) = ExportGroups::addExportGroup(array( "group_name" => $L["word_excel"], "icon" => "xls.gif", - "action_button_text" => $L["word_generate"], "headers" => "Pragma: public\nCache-Control: max-age=0\nContent-Type: application/vnd.ms-excel; charset=utf-8\nContent-Disposition: attachment; filename={\$filename}", "smarty_template" => "\n\n\n\n\n{\$export_type_smarty_template}\n\n\n" ), $L); @@ -388,7 +387,7 @@ private function addXmlExportGroup () "group_name" => $L["word_xml"], "visibility" => "hide", "icon" => "xml.jpg", - "action_button_text" => $L["word_generate"], + "headers" => "Content-type: application/xml; charset=\"octet-stream\"\r\nContent-Disposition: attachment; filename={\$filename}", "smarty_template" => "\r\n\r\n{\$export_type_smarty_template}" ), $L); @@ -442,8 +441,7 @@ private function addCsvExportGroup() "group_name" => $L["word_csv"], "visibility" => "hide", "icon" => "csv.gif", - "action_button_text" => $L["word_generate"], - "headers" => "Content-type: text/csv; charset=\"octet-stream\"\r\nContent-Disposition: attachment; filename={\$filename}", + "headers" => "Content-type: text/csv;\r\nContent-Disposition: attachment; filename={\$filename}", "smarty_template" => "{\$export_type_smarty_template}" ), $L); diff --git a/css/styles.css b/css/styles.css index 1042460..1cbc303 100644 --- a/css/styles.css +++ b/css/styles.css @@ -79,6 +79,7 @@ ul.icon_list li { -moz-border-radius: 4px; border-radius: 4px; float: left; + cursor: pointer; } ul.icon_list li:hover, ul.icon_list li.selected { background-color: #bad7eb; diff --git a/export.php b/export.php index 1f43ca5..8eaa6c1 100644 --- a/export.php +++ b/export.php @@ -137,12 +137,8 @@ $placeholders["export_types"] = $export_types; $placeholders["export_type_smarty_template"] = $export_type_smarty_template; -//print_r($placeholders); -//exit; - $page = CoreGeneral::evalSmartyString($template, $placeholders); - if ($export_group_info["action"] == "new_window" || $export_group_info["action"] == "popup") { // if required, send the HTTP headers diff --git a/lang/en_us.php b/lang/en_us.php index fefe7b6..3a9969c 100644 --- a/lang/en_us.php +++ b/lang/en_us.php @@ -82,8 +82,8 @@ $L["text_export_group_summary"] = "Add the new export group below. After this step you will be able to edit all aspects of the new export group."; $L["text_export_manager_intro"] = "Welcome to the Export Manager module! This module lets you control the various ways in which your form submissions can be viewed and downloaded."; -$L["text_help_link"] = "For help on how to use this module, please see the module help documentation."; -$L["text_reset_defaults"] = "This page lets you reset all the configurations for the Export Manager's export groups and types. This is convenient if you've accidentally broken something. If you're upgrading to 2.1.0, resetting to the defaults is required because earlier export type code is no longer compatible. Please note that any client permissions will be lost by resetting to the defaults here."; +$L["text_help_link"] = "For help on how to use this module, please see the module help documentation."; +$L["text_reset_defaults"] = "This page lets you reset all the configurations for the Export Manager's export groups and types. This is convenient if you've accidentally broken something."; $L["validation_select_rows_to_export"] = "Please select those rows you would like to export."; $L["validation_no_export_group_name"] = "Please enter the export group name."; diff --git a/module_config.php b/module_config.php index 146dd3d..20e5464 100644 --- a/module_config.php +++ b/module_config.php @@ -3,254 +3,252 @@ $STRUCTURE = array(); $STRUCTURE["tables"] = array(); $STRUCTURE["tables"]["module_export_groups"] = array( - array( - "Field" => "export_group_id", - "Type" => "smallint(5) unsigned", - "Null" => "NO", - "Key" => "PRI", - "Default" => "" - ), - array( - "Field" => "group_name", - "Type" => "varchar(255)", - "Null" => "NO", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "access_type", - "Type" => "enum('admin','public','private')", - "Null" => "NO", - "Key" => "", - "Default" => "public" - ), - array( - "Field" => "form_view_mapping", - "Type" => "enum('all','except','only')", - "Null" => "NO", - "Key" => "", - "Default" => "all" - ), - array( - "Field" => "forms_and_views", - "Type" => "mediumtext", - "Null" => "YES", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "visibility", - "Type" => "enum('show','hide')", - "Null" => "NO", - "Key" => "", - "Default" => "show" - ), - array( - "Field" => "icon", - "Type" => "varchar(100)", - "Null" => "NO", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "action", - "Type" => "enum('file','popup','new_window')", - "Null" => "NO", - "Key" => "", - "Default" => "popup" - ), - array( - "Field" => "action_button_text", - "Type" => "varchar(255)", - "Null" => "NO", - "Key" => "", - "Default" => "{\$LANG.word_display}" - ), - array( - "Field" => "popup_height", - "Type" => "varchar(5)", - "Null" => "YES", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "popup_width", - "Type" => "varchar(5)", - "Null" => "YES", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "headers", - "Type" => "text", - "Null" => "YES", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "smarty_template", - "Type" => "mediumtext", - "Null" => "NO", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "list_order", - "Type" => "tinyint(4)", - "Null" => "NO", - "Key" => "", - "Default" => "" - ) + array( + "Field" => "export_group_id", + "Type" => "smallint(5) unsigned", + "Null" => "NO", + "Key" => "PRI", + "Default" => "" + ), + array( + "Field" => "group_name", + "Type" => "varchar(255)", + "Null" => "NO", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "access_type", + "Type" => "enum('admin','public','private')", + "Null" => "NO", + "Key" => "", + "Default" => "public" + ), + array( + "Field" => "form_view_mapping", + "Type" => "enum('all','except','only')", + "Null" => "NO", + "Key" => "", + "Default" => "all" + ), + array( + "Field" => "forms_and_views", + "Type" => "mediumtext", + "Null" => "YES", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "visibility", + "Type" => "enum('show','hide')", + "Null" => "NO", + "Key" => "", + "Default" => "show" + ), + array( + "Field" => "icon", + "Type" => "varchar(100)", + "Null" => "NO", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "action", + "Type" => "enum('file','popup','new_window')", + "Null" => "NO", + "Key" => "", + "Default" => "popup" + ), + array( + "Field" => "action_button_text", + "Type" => "varchar(255)", + "Null" => "NO", + "Key" => "", + "Default" => "{\$LANG.word_display}" + ), + array( + "Field" => "popup_height", + "Type" => "varchar(5)", + "Null" => "YES", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "popup_width", + "Type" => "varchar(5)", + "Null" => "YES", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "headers", + "Type" => "text", + "Null" => "YES", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "smarty_template", + "Type" => "mediumtext", + "Null" => "NO", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "list_order", + "Type" => "tinyint(4)", + "Null" => "NO", + "Key" => "", + "Default" => "" + ) ); $STRUCTURE["tables"]["module_export_group_clients"] = array( - array( - "Field" => "export_group_id", - "Type" => "mediumint(8) unsigned", - "Null" => "NO", - "Key" => "PRI", - "Default" => "" - ), - array( - "Field" => "account_id", - "Type" => "mediumint(8) unsigned", - "Null" => "NO", - "Key" => "PRI", - "Default" => "" - ) + array( + "Field" => "export_group_id", + "Type" => "mediumint(8) unsigned", + "Null" => "NO", + "Key" => "PRI", + "Default" => "" + ), + array( + "Field" => "account_id", + "Type" => "mediumint(8) unsigned", + "Null" => "NO", + "Key" => "PRI", + "Default" => "" + ) ); $STRUCTURE["tables"]["module_export_types"] = array( - array( - "Field" => "export_type_id", - "Type" => "mediumint(8) unsigned", - "Null" => "NO", - "Key" => "PRI", - "Default" => "" - ), - array( - "Field" => "export_type_name", - "Type" => "varchar(255)", - "Null" => "NO", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "export_type_visibility", - "Type" => "enum('show','hide')", - "Null" => "NO", - "Key" => "", - "Default" => "show" - ), - array( - "Field" => "filename", - "Type" => "varchar(255)", - "Null" => "NO", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "export_group_id", - "Type" => "smallint(6)", - "Null" => "YES", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "smarty_template", - "Type" => "text", - "Null" => "NO", - "Key" => "", - "Default" => "" - ), - array( - "Field" => "list_order", - "Type" => "tinyint(3) unsigned", - "Null" => "NO", - "Key" => "", - "Default" => "" - ) + array( + "Field" => "export_type_id", + "Type" => "mediumint(8) unsigned", + "Null" => "NO", + "Key" => "PRI", + "Default" => "" + ), + array( + "Field" => "export_type_name", + "Type" => "varchar(255)", + "Null" => "NO", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "export_type_visibility", + "Type" => "enum('show','hide')", + "Null" => "NO", + "Key" => "", + "Default" => "show" + ), + array( + "Field" => "filename", + "Type" => "varchar(255)", + "Null" => "NO", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "export_group_id", + "Type" => "smallint(6)", + "Null" => "YES", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "smarty_template", + "Type" => "text", + "Null" => "NO", + "Key" => "", + "Default" => "" + ), + array( + "Field" => "list_order", + "Type" => "tinyint(3) unsigned", + "Null" => "NO", + "Key" => "", + "Default" => "" + ) ); $HOOKS = array( - array( - "hook_type" => "template", - "action_location" => "admin_submission_listings_bottom", - "function_name" => "", - "hook_function" => "exp_display_export_options", - "priority" => "50" - ), - array( - "hook_type" => "template", - "action_location" => "client_submission_listings_bottom", - "function_name" => "", - "hook_function" => "exp_display_export_options", - "priority" => "50" - ) + array( + "hook_type" => "template", + "action_location" => "admin_submission_listings_bottom", + "function_name" => "", + "hook_function" => "displayExportOptions", + "priority" => "50" + ), + array( + "hook_type" => "template", + "action_location" => "client_submission_listings_bottom", + "function_name" => "", + "hook_function" => "displayExportOptions", + "priority" => "50" + ) ); $FILES = array( - "export.php", - "export_groups/", - "export_groups/add.php", - "export_groups/add_type.php", - "export_groups/edit.php", - "export_groups/index.html", - "export_groups/page_add_export_type.php", - "export_groups/page_edit_export_type.php", - "export_groups/page_export_types.php", - "export_groups/page_main.php", - "export_groups/page_permissions.php", - "global/", - "global/code/", - "global/code/export_groups.php", - "global/code/export_types.php", - "global/code/general.php", - "global/code/index.html", - "global/css/", - "global/css/index.html", - "global/css/styles.css", - "global/index.html", - "global/scripts/", - "global/scripts/admin.js", - "global/scripts/export_manager.js", - "global/scripts/index.html", - "help.php", - "images/", - "images/icon_export.gif", - "images/icons/", - "images/icons/csv.gif", - "images/icons/printer.gif", - "images/icons/printer.png", - "images/icons/xls.gif", - "images/icons/xml.jpg", - "index.php", - "lang/", - "lang/en_us.php", - "lang/index.html", - "library.php", - "module.php", - "module_config.php", - "reset.php", - "settings.php", - "smarty/", - "smarty/function.export_groups_dropdown.php", - "smarty/function.smart_display_field.php", - "smarty/index.html", - "templates/", - "templates/export_groups/", - "templates/export_groups/add.tpl", - "templates/export_groups/edit.tpl", - "templates/export_groups/index.html", - "templates/export_groups/tab_add_export_type.tpl", - "templates/export_groups/tab_edit_export_type.tpl", - "templates/export_groups/tab_export_types.tpl", - "templates/export_groups/tab_main.tpl", - "templates/export_groups/tab_permissions.tpl", - "templates/export_options_html.tpl", - "templates/help.tpl", - "templates/index.html", - "templates/index.tpl", - "templates/reset.tpl", - "templates/settings.tpl" + "code/", + "code/ExportGroups.class.php", + "code/ExportTypes.class.php", + "code/General.class.php", + "code/index.html", + "code/Module.class.php", + "css/", + "css/index.html", + "css/styles.css", + "export.php", + "export_groups/", + "export_groups/add.php", + "export_groups/add_type.php", + "export_groups/edit.php", + "export_groups/index.html", + "export_groups/page_add_export_type.php", + "export_groups/page_edit_export_type.php", + "export_groups/page_export_types.php", + "export_groups/page_main.php", + "export_groups/page_permissions.php", + "help.php", + "images/", + "images/icon_export.gif", + "images/icons/", + "images/icons/csv.gif", + "images/icons/printer.gif", + "images/icons/printer.png", + "images/icons/xls.gif", + "images/icons/xml.jpg", + "index.php", + "lang/", + "lang/en_us.php", + "lang/index.html", + "library.php", + "scripts/", + "scripts/admin.js", + "scripts/export_manager.js", + "scripts/index.html", + "module_config.php", + "reset.php", + "settings.php", + "smarty_plugins/", + "smarty_plugins/function.export_groups_dropdown.php", + "smarty_plugins/function.smart_display_field.php", + "smarty_plugins/index.html", + "templates/", + "templates/export_groups/", + "templates/export_groups/add.tpl", + "templates/export_groups/edit.tpl", + "templates/export_groups/index.html", + "templates/export_groups/tab_add_export_type.tpl", + "templates/export_groups/tab_edit_export_type.tpl", + "templates/export_groups/tab_export_types.tpl", + "templates/export_groups/tab_main.tpl", + "templates/export_groups/tab_permissions.tpl", + "templates/export_options_html.tpl", + "templates/help.tpl", + "templates/index.html", + "templates/index.tpl", + "templates/reset.tpl", + "templates/settings.tpl" );