Changeset 936127
- Timestamp:
- 06/21/2014 02:17:36 PM (12 years ago)
- Location:
- work-the-flow-file-upload/trunk
- Files:
-
- 14 edited
-
README.txt (modified) (6 diffs)
-
admin/class-wtf-fu-admin.php (modified) (6 diffs)
-
admin/includes/class-wtf-fu-options-admin.php (modified) (9 diffs)
-
admin/includes/class-wtf-fu-workflow-list-table.php (modified) (2 diffs)
-
admin/views/admin-templates-nonpro.php (modified) (1 diff)
-
admin/views/admin-workflow-edit.php (modified) (1 diff)
-
admin/views/admin-workflows.php (modified) (4 diffs)
-
admin/views/documentation.php (modified) (1 diff)
-
includes/class-wtf-fu-option-definitions.php (modified) (2 diffs)
-
includes/class-wtf-fu-options.php (modified) (4 diffs)
-
includes/wtf-fu-common-utils.php (modified) (5 diffs)
-
public/class-wtf-fu.php (modified) (3 diffs)
-
public/includes/class-wtf-fu-show-files-shortcode.php (modified) (3 diffs)
-
work-the-flow-file-upload.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
work-the-flow-file-upload/trunk/README.txt
r920715 r936127 5 5 Requires at least: 3.5.1 6 6 Tested up to: 3.9.1 7 Stable tag: 2. 1.17 Stable tag: 2.2.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 136 136 Use `[wtf_fu_show_files]` to display already upload files 137 137 e.g. 138 `[wtf_fu_show_files file_type="image" wtf_upload_dir="main_dir" wtf_upload_subdir="images" reorder="true" gallery="true"]` 139 140 The attribute file_type may currently be set to 'image' or 'music', if set to image then a thumbnail will be displayed if available and if 141 'music' then audio controls to allow playback will be displayed. 142 143 The `reorder=true` attribute here allows users to change the order of their uploaded image files by dragging and dropping thumbnail images. 144 When submitted the final order will then be written to in a text file along with the other files in the users upload directory. 145 146 The `gallery` attribute will display the full sized images in a lightbox slideshow when an image file thumbnail is clicked. 147 148 The wtf_fu_show_files short_code may also be called manually inside hooked functions (see the example file `examples/wtf-fu_hooks_example.php`) 149 so that files can be generated for display inside emails. 150 151 In this case you can use the attribute `"email_format" = "true"` to cause the styles to be converted to inline css. 152 153 e.g. 154 ` $shortcode_instance = Wtf_Fu_Show_Files_Shortcode::get_instance(); 155 $shortcode_instance->set_options(array( 156 'wtf_upload_dir' => "demofiles", 157 'file_type' => "image", 158 'email_format' => true 159 )); 160 $files_content = $shortcode_instance->generate_content();` 161 162 163 = What other short codes can I use inside the workflows ? = 164 165 Other workflow details can be retrieved using the `type='get' value='value_name'` attribute these are useful for 166 embedding the workflow name or stage title inside your workflow stages content. 167 168 e.g. 169 Welcome `[wtf_fu type="get" value="display_name"], // display the current users name`, 170 171 `[wtf_fu type="get" value="workflow" id="1" key="name"] // display the title name for workflow 1.` 138 `[wtf_fu_show_files wtf_upload_dir="main_dir" wtf_upload_subdir="images" reorder="true" gallery="true"]` 139 140 Note : The wtf_fu_show_files short_code can use the attribute `"email_format" = "true"` to cause the styles to be converted to inline css, making the output suitable for including in emails. 141 142 See the plugin's admin page `documentation tab` for the complete list of available shortcode attributes and their meanings. 143 144 = What other shortcuts can I use inside the workflows ? = 145 146 Shortcut placeholder fields can be used in the form %%XXXX%% and can be placed inside the workflow fields to represent various values at runtime. 147 e.g. 148 `%%USER_NAME%% The current users display name. 149 %%USER_EMAIL%% The current users email address. 150 %%ADMIN_NAME%% The site administrators display name. 151 %%ADMIN_EMAIL%% The site administrators email address. 152 %%SITE_URL%% The url link for this web site. 153 %%SITE_NAME%% The name of this web site. 154 %%WORKFLOW_NAME%% The name of the current workflow. 155 %%WORKFLOW_STAGE_TITLE%% The current workflow stage title. 156 %%WORKFLOW_STAGE_NUMBER%% The current stage number. 157 %%WORKFLOW_STAGE_HEADER%% The current workflow stage header content (Workflow Templates only) 158 %%WORKFLOW_BUTTON_BAR%% The button bar with PREV and NEXT buttons (Workflow Templates only) 159 %%WORKFLOW_STAGE_CONTENT%% The current workflow stage main content (Workflow Templates only) 160 %%WORKFLOW_STAGE_FOOTER%% The current workflow stage footer content (Workflow Templates only) 161 %%WTF_FU_POWERED_BY_LINK%% Includes a WFT-FU Powered by link to wtf-fu.com. (If allowed on the Plugin System Options page.) 162 %%ALL_WORKFLOW_USERS_EMAILS%% A list of users emails addresses that have commenced using the curent workflow. 163 %%ALL_SITE_USERS_EMAILS%% A list of all the sites registered users emails addresses. 164 %%USER_GROUP_XXXX_EMAILS%% A list of all the users of group XXXX emails addresses. Substitute XXXX with the required user group. 165 %%ARCHIVE_USERS_FILES%% Causes all of a users files to be auto archived into a zip file and returns a download link to the zip file. 166 ` 167 168 See the plugins admin page `documentation tab` for a complete up to date list of available shortcut codes and their meanings. 172 169 173 170 = Do I need to create a workflow just to enable file upload features ? = 174 171 175 172 No, the workflow and file upload capabilities are completely separate entities. 176 You can add file uploads to a page by embedding the `[wtf_fu_upload]` shortcode directly to a page. 173 You can add file uploads to a page or ppst just by embedding the `[wtf_fu_upload]` shortcode directly to a page or post. 174 177 175 There is no need to use a workflow at all if standalone file uploads are all you need. 178 176 179 However it is often useful to embed this short code inside a workflow stage so that uploading is then part of a defined workflow. 177 However it is often useful to embed this shortcode inside a workflow stage so that uploading is then part of a defined workflow. 178 Both ways will work. 180 179 181 180 = Will the css styles used by the plugin conflict with my themes css ? = … … 235 234 You may override as many or as few of these as you require. 236 235 236 See the Documentation tab on the plugins settings page for an up to date listing of all shortcode attributes. 237 237 238 = Can a user change the order of their uploaded files ? = 238 239 239 240 File uploads are handled asynchronously via ajax, so the initial order in which they arrive cannot be determined. 240 241 241 However you can use the `[wtf_fu_show_files reorder=" true"]` short-code to give users a list of their uploaded image thumbnails that242 However you can use the `[wtf_fu_show_files reorder="1"]` short-code to give users a list of their uploaded image thumbnails that 242 243 they can drag into their desired order. When the reorder is submitted file modified timestamps are adjusted to reflect the new order and a text file detailing the desired order 243 244 is added to the users upload directory. 244 245 245 e.g. `[wtf_fu_show_files file_type="image" wtf_upload_dir="mypackagename" wtf_upload_subdir="images" reorder="true"]`246 e.g. `[wtf_fu_show_files wtf_upload_dir="demofiles" wtf_upload_subdir="images" reorder="1"]` 246 247 247 248 = Can I configure the plugin to use different upload directories per shortcode instance ? = … … 324 325 325 326 == Changelog == 327 = 2.2.0 = 328 * Added extra shortcut field %%USER_ID%%. 329 * Added extra shortcut field %%USER_GROUP_XXXX_EMAILS%%. 330 A list of all the users of group XXXX emails addresses. Substitute XXXX with the required user group. 331 * Added extra shortcut field %%ARCHIVE_USERS_FILES%% 332 Triggers auto archiving of users upload directory and returns a download link for the file. Useful in automated email templates. 333 * Added ability to attach multiple email templates to workflow stages (PRO Feature). 334 * Fixed PHP Warnings with page redirects after deleting or cloning. 335 * Fixed improper reordering of stages when there are 10 or more stages in a workflow and a stage is deleted. 336 * Documentation updates. 337 326 338 = 2.1.1 = 327 339 * Fix issue with the 2.1.0 upgrade which could cause the PRO license key field to need re-entering under some circumstances. … … 405 417 generated emails. 406 418 * Additional actions and filters added to process email templates (PRO only feature). 419 * Documentation updates. 407 420 408 421 = 1.2.1 = … … 435 448 436 449 == Upgrade Notice == 450 = 2.2.0 = 451 * Extra shortcut fields %%USER_ID%%, %%USER_GROUP_XXXX_EMAILS%%, %%ARCHIVE_USERS_FILES%%. 452 * Multiple automated emails templates can now be attached to workflow stages (PRO Feature). 453 * Bug fixes. See changelog for full details. 454 * README file updates. 455 437 456 = 2.1.1 = 438 457 * Fix issue with the 2.1.0 upgrade which could cause the PRO license key field to need re-entering under some circumstances. -
work-the-flow-file-upload/trunk/admin/class-wtf-fu-admin.php
r920619 r936127 88 88 switch ($_REQUEST['operation']) { 89 89 case 'add_new_empty_workflow' : 90 $response_message = Wtf_Fu_Options_Admin::add_new_workflow(); 90 $wf_index = Wtf_Fu_Options_Admin::add_new_workflow(); 91 $response_message = "A new empty workflow with id = $wf_index has been added."; 91 92 //Wtf_Fu_Pro_Options_Admin::add_new_email_template(); 92 93 break; 93 94 case 'add_new_demo_workflow' : 94 $response_message = Wtf_Fu_Options_Admin::add_new_demo_workflow(); 95 $wf_index = Wtf_Fu_Options_Admin::add_new_demo_workflow(); 96 $response_message = "A new copy of the demo workflow with id = $wf_index has been added."; 95 97 break; 96 98 case 'add_new_default_email_template' : 97 if (has_action('wtf_fu_add_new_default_email_template_action')) { 98 do_action('wtf_fu_add_new_default_email_template_action'); 99 if (has_filter('wtf_fu_add_new_default_email_template_filter')) { 100 $index = apply_filters('wtf_fu_add_new_default_email_template_filter', null); 101 $response_message = "A new email template with id = $index has been added."; 99 102 } else { 100 103 log_me(" operation action not found for : {$_REQUEST['operation']}"); … … 102 105 break; 103 106 case 'add_new_default_workflow_template' : 104 if (has_action('wtf_fu_add_new_default_workflow_template_action')) { 105 do_action('wtf_fu_add_new_default_workflow_template_action'); 107 if (has_filter('wtf_fu_add_new_default_workflow_template_filter')) { 108 $index = apply_filters('wtf_fu_add_new_default_workflow_template_filter', null); 109 $response_message = "A new workflow template with id = $index has been added."; 106 110 } else { 107 111 log_me(" operation action not found for : {$_REQUEST['operation']}"); … … 465 469 // documentation page does not require options setup. 466 470 || ( $init_args['tab'] && $init_args['tab'] === wtf_fu_PAGE_DOCUMENATION_KEY ) 467 // Workflows list page has not options to set up unless468 // the 'wftab' sub page is defined.469 || ( $init_args['tab'] && $init_args['tab'] === wtf_fu_PAGE_WORKFLOWS_KEY && !$init_args['wftab'] )470 // Templates list page has not options to set up unless471 // the 'template-type' is defined.472 || ( $init_args['tab'] && $init_args['tab'] === wtf_fu_PAGE_TEMPLATES_KEY && !$init_args['template-type'] )473 471 ) { 474 472 return; // no options init required, or not a page for us. 475 473 } 474 475 // if workflow list then check if we need to do any clones or deletes. 476 if ( $init_args['tab'] && $init_args['tab'] === wtf_fu_PAGE_WORKFLOWS_KEY && !$init_args['wftab'] ) { 477 $this->do_bulk_workflow_actions(); // will re-direct and exit if any delete or clone actions are done. 478 // Workflows list page has no options to set up unless the 'wftab' sub page is defined. 479 // there is nothing more to do; 480 return; 481 } 482 483 if (isset($_REQUEST['delete_stage']) && isset($_GET['wf_id'])) { 484 Wtf_Fu_Options_Admin::delete_stage_and_reorder($_GET['wf_id'], $_REQUEST['delete_stage']); 485 // remove the delete tab and redirect back to page. 486 wp_redirect( remove_query_arg('delete_stage', $_SERVER['REQUEST_URI'])); 487 exit; 488 } 489 490 // Templates list page has not options to set up unless 491 // the 'template-type' is defined. 492 if ( $init_args['tab'] && $init_args['tab'] === wtf_fu_PAGE_TEMPLATES_KEY && $init_args['wtf-fu-action'] !== 'edit') { 493 if ( has_action('wtf_fu_process_templates_bulk_actions_action') ) { 494 do_action('wtf_fu_process_templates_bulk_actions_action'); 495 } 496 return; 497 } 498 499 476 500 477 501 $returning_from_submit = false; … … 567 591 $this->wtf_fu_initialize_options($init_args); 568 592 } 593 594 /* 595 * check if any delete or clone actions are required in the request. 596 */ 597 public function do_bulk_workflow_actions() { 598 // log_me('in bulk workflow'); 599 $redirect = false; 600 // One of possibly many requests for a bulk action. 601 if (isset($_REQUEST['workflow'])) { 602 603 foreach ($_REQUEST['workflow'] as $wf_id) { 604 605 /* process bulk action ... */ 606 switch ($this->current_bulk_action()) { 607 case 'delete' : 608 Wtf_Fu_Options_Admin::delete_workflow($wf_id); 609 $redirect = true; 610 break; 611 case 'clone' : 612 Wtf_Fu_Options_Admin::clone_workflow($wf_id); 613 $redirect = true; 614 break; 615 default : 616 } 617 } 618 } 619 620 /* Check if any single action links have been clicked. */ 621 if (isset($_REQUEST['wtf-fu-action']) && isset($_REQUEST['wf_id'])) { 622 switch ($_REQUEST['wtf-fu-action']) { 623 case 'delete' : 624 Wtf_Fu_Options_Admin::delete_workflow($_REQUEST['wf_id']); 625 $redirect = true; 626 break; 627 case 'clone' : 628 Wtf_Fu_Options_Admin::clone_workflow($_REQUEST['wf_id']); 629 $redirect = true; 630 break; 631 default : 632 } 633 } 634 635 //log_me($_SERVER['REQUEST_URI']); 636 637 if ($redirect) { 638 $redirect_uri = sprintf("?page=%s&tab=%s", $_REQUEST['page'], $_REQUEST['tab']); 639 //log_me( array('redirect url' => $redirect_uri) ); 640 wp_safe_redirect($redirect_uri); 641 exit; 642 } 643 } 644 645 /** 646 * returns the bulk action request var. 647 * @return boolean 648 */ 649 function current_bulk_action() { 650 if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) 651 return $_REQUEST['action']; 652 653 if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) 654 return $_REQUEST['action2']; 655 656 return false; 657 } 569 658 570 659 /** … … 587 676 588 677 if (get_option($init_args['option_data_key']) == false) { 589 log_me("adding option for **{$init_args['option_data_key']}**");678 //log_me("adding option for **{$init_args['option_data_key']}**"); 590 679 add_option($init_args['option_data_key'], apply_filters($init_args['option_data_key'], $option_defaults)); 591 680 } … … 632 721 633 722 $ret = add_options_page($page_title, $menu_title, $capability, $menu_slug, $callback); 634 log_me(array(635 'add_options_page ret=' => $ret,636 'page_title' => $page_title,637 'menu_title' => $menu_title,638 'capability' => $capability,639 'menu_slug' => $menu_slug,640 // 'callback' => $callback641 ));723 // log_me(array( 724 // 'add_options_page ret=' => $ret, 725 // 'page_title' => $page_title, 726 // 'menu_title' => $menu_title, 727 // 'capability' => $capability, 728 // 'menu_slug' => $menu_slug, 729 // // 'callback' => $callback 730 // )); 642 731 return $ret; 643 732 } -
work-the-flow-file-upload/trunk/admin/includes/class-wtf-fu-options-admin.php
r920619 r936127 141 141 * and updated to the new stage. 142 142 * 143 * returns true if any reordering was requiredfalse otherwise.143 * returns true if any reordering was done or false otherwise. 144 144 * 145 145 * @param type $wfid the numeric workflow id. … … 147 147 public static function reorder_stages($wfid) { 148 148 149 $stages = Wtf_Fu_Options::get_ workflow_stages($wfid, true);149 $stages = Wtf_Fu_Options::get_stage_ids_in_order($wfid); 150 150 $count = count($stages); 151 151 … … 157 157 $i = -1; 158 158 159 foreach ($stages as $k => $v) { 159 //log_me(array('stages' => $stages)); 160 foreach ($stages as $v) { 160 161 161 162 $i++; 162 if ($v['key_id'] == $i) { 163 164 // log_me("i=$i, v['key_id'] ={$v['key_id']}"); 165 166 if ($v == $i) { 163 167 continue; 164 168 } … … 170 174 * move this stage to stage $i 171 175 */ 172 $stage_options = get_option($k); 176 $stage_key = Wtf_Fu_Option_Definitions::get_workflow_stage_key($wfid, $v); 177 $stage_options = get_option($stage_key); 173 178 174 179 $new_key = Wtf_Fu_Option_Definitions::get_workflow_stage_key($wfid, $i); … … 178 183 add_option($new_key, $stage_options); 179 184 180 if (false === delete_option($ k)) {181 log_me(" REORDER ERROR : could not delete old option key $k");185 if (false === delete_option($stage_key)) { 186 log_me("ERROR reordering stages, could not remove the relocated stage with key $stage_key when moving from stage $v to $i"); 182 187 } 183 188 … … 186 191 * value. 187 192 */ 188 Wtf_Fu_Options_Admin::update_all_users_workflow_stage_settings($wfid, $v ['key_id'], $i);193 Wtf_Fu_Options_Admin::update_all_users_workflow_stage_settings($wfid, $v, $i); 189 194 $ret = true; // modification has occurred. 190 break;191 195 } 192 196 … … 209 213 210 214 211 $wf_users = Wtf_Fu_Options _Admin::get_workflow_users($wfid);215 $wf_users = Wtf_Fu_Options::get_workflow_users($wfid); 212 216 213 217 // log_me(array( '$wf_users' => $wf_users)); … … 492 496 } 493 497 } 494 return ( "A new copy of the demo workflow with id = $wf_index has been added.");498 return ($wf_index); 495 499 } 496 500 … … 567 571 public static function add_new_workflow_stage_options($wf_index, $stage) { 568 572 569 log_me(array("adding stage key-id = {$stage['key_id']} to workflow $wf_index" => $stage));573 //log_me(array("adding stage key-id = {$stage['key_id']} to workflow $wf_index" => $stage)); 570 574 571 575 if (!array_key_exists('key_id', $stage)) { -
work-the-flow-file-upload/trunk/admin/includes/class-wtf-fu-workflow-list-table.php
r920619 r936127 242 242 } 243 243 244 /**245 * process bulk action delete or clone.246 * also doess single actions as well.247 */248 function process_bulk_action() {249 250 $redirect = false;251 // One of possibly many requests for a bulk action.252 if (isset($_REQUEST['workflow'])) {253 254 foreach ($_REQUEST['workflow'] as $wf_id) {255 256 /* process bulk action ... */257 switch ($this->current_action()) {258 case 'delete' :259 Wtf_Fu_Options_Admin::delete_workflow($wf_id);260 $redirect = true;261 break;262 case 'clone' :263 Wtf_Fu_Options_Admin::clone_workflow($wf_id);264 $redirect = true;265 break;266 // case 'export' :267 // Wtf_Fu_Options_Admin::export_workflow($wf_id);268 // $redirect = true;269 // break;270 default :271 }272 }273 }274 275 /* Check if any single action links have been clicked. */276 if (isset($_REQUEST['wtf-fu-action']) && isset($_REQUEST['wf_id'])) {277 switch ($_REQUEST['wtf-fu-action']) {278 case 'delete' :279 Wtf_Fu_Options_Admin::delete_workflow($_REQUEST['wf_id']);280 $redirect = true;281 break;282 case 'clone' :283 Wtf_Fu_Options_Admin::clone_workflow($_REQUEST['wf_id']);284 $redirect = true;285 break;286 // case 'export' :287 // Wtf_Fu_Options_Admin::export_workflow($_REQUEST['wf_id']);288 // $redirect = true;289 // break;290 default :291 }292 }293 294 log_me($_SERVER['REQUEST_URI']);295 296 if ($redirect) {297 // redirect back to the base page so we remoce the bulk actions from the url.298 //$remove_args = array('wtf-fu-action');299 //$redirect_uri = remove_query_arg($remove_args, $_SERVER['REQUEST_URI']);300 301 $redirect_uri = sprintf("?page=%s&tab=%s", $_REQUEST['page'], $_REQUEST['tab']);302 log_me(array('redirect url' => $redirect_uri));303 wp_safe_redirect($redirect_uri);304 exit;305 }306 }307 244 308 245 /** … … 355 292 * case, we'll handle them within our package just to keep things clean. 356 293 */ 357 $this->process_bulk_action();294 //$this->process_bulk_action(); 358 295 359 296 -
work-the-flow-file-upload/trunk/admin/views/admin-templates-nonpro.php
r913912 r936127 67 67 This will then automatically generate and send an email whenever a user passes through the stage that the email is attached to.<br/> 68 68 Similarly you can attach Workflow page templates to a Workflow on the Workflow option tab, in this way you can create different layouts for different workflows.</p> 69 <p>Templates also support embedding of <strong>shortcut fields</strong> and the <code>[wtf_fu_show files]</code> shortcode.</p>69 <p>Templates also support embedding of <strong>shortcut fields</strong> and the <code>[wtf_fu_show_files]</code> shortcode. See the documentation tab for more details on available template shortcuts.</p> 70 70 <p>You can see some screenshots of the PRO version of the relevant page tabs below.</p> 71 71 </div> -
work-the-flow-file-upload/trunk/admin/views/admin-workflow-edit.php
r913912 r936127 32 32 } 33 33 34 if (isset($_REQUEST['delete_stage'])) {35 Wtf_Fu_Options_Admin::delete_stage_and_reorder($wfid, $_REQUEST['delete_stage']);36 // remove the delete tab and redirect back to page.37 wp_redirect( remove_query_arg('delete_stage', $_SERVER['REQUEST_URI']));38 }39 40 34 if (isset($_GET['wftab'])) { 41 35 $active_tab = $_GET['wftab']; 42 $stages = Wtf_Fu_Options::get WorkFlowStageIDs($wfid);36 $stages = Wtf_Fu_Options::get_stage_ids_in_order($wfid); 43 37 } 44 38 -
work-the-flow-file-upload/trunk/admin/views/admin-workflows.php
r920619 r936127 16 16 */ 17 17 18 /* 19 * Handle any bulk actions first then redirect to remove the actions from the url. 20 */ 21 18 22 require_once plugin_dir_path(__FILE__) 19 23 . '../../admin/includes/class-wtf-fu-workflow-list-table.php'; 20 24 21 25 22 if (class_exists('Wtf_fu_Pro')) {23 $import_nonce = wp_nonce_field('wtf_fu_import_nonce', 'wtf_fu_import_nonce', true);24 $import_submit_button = get_submit_button(__('Import'), 'secondary', 'submit', true);25 26 $import_section = "26 if (class_exists('Wtf_fu_Pro')) { 27 $import_nonce = wp_nonce_field('wtf_fu_import_nonce', 'wtf_fu_import_nonce', true); 28 $import_submit_button = get_submit_button(__('Import'), 'secondary', 'submit', true); 29 30 $import_section = " 27 31 <div class='postbox'><h3><span>Import Settings</span></h3> 28 32 <div class='inside'> … … 38 42 </div> 39 43 </div>"; 40 } else { 41 $import_section = "44 } else { 45 $import_section = " 42 46 <div class='postbox'><h3><span>Import Settings</span></h3> 43 47 <div class='inside'> 44 48 <p>Import and Export of workflows requires the PRO extension to be installed and activated.</p> 45 49 </div> 46 </div>"; 47 48 } 50 </div>"; 51 } 49 52 /* 50 53 * Add new workflow link. … … 71 74 <ol><li>Workflows are always created with an id equal to the first available number starting at 1. <br/> If a workflow is deleted then its number will be reused for the next added workflow. <br/> 72 75 Any embedded workflow shortcodes that were using this workflow id will then reference the new workflow.</li> 73 <li>Importing of any exported json files is not yet implemented.<br/></li>74 76 </ol> 75 77 </small> … … 78 80 <button name='add_new_empty_workflow' id='wtf_fu_operation_button' value="1"><span>Add New Empty Workflow</span></button> 79 81 <button name='add_new_demo_workflow' id='wtf_fu_operation_button' value="1"><span>Add New Cloned Demo Workflow</span></button> 80 <?php echo $import_section; ?> 81 82 83 84 85 86 </p> 87 <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> 88 <form id="workflows-filter" method="get"> 89 <!-- For plugins, we also need to ensure that the form posts back to our current page --> 90 <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" /> 91 <input type="hidden" name="tab" value="<?php echo $_REQUEST['tab'] ?>" /> 92 <input type="hidden" name="wtf-fu-action" value="<?php echo wtf_fu_get_value($_REQUEST, 'wtf-fu-action'); ?>" /> 93 <!-- Now we can render the completed list table --> 94 <?php $workflowListTable->display() ?> 95 </form> 82 <?php echo $import_section; ?> 83 </p> 84 <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> 85 <form id="workflows-filter" method="get"> 86 <!-- For plugins, we also need to ensure that the form posts back to our current page --> 87 <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" /> 88 <input type="hidden" name="tab" value="<?php echo $_REQUEST['tab'] ?>" /> 89 <input type="hidden" name="wtf-fu-action" value="<?php echo wtf_fu_get_value($_REQUEST, 'wtf-fu-action'); ?>" /> 90 <!-- Now we can render the completed list table --> 91 <?php $workflowListTable->display() ?> 92 </form> 96 93 </div> -
work-the-flow-file-upload/trunk/admin/views/documentation.php
r920619 r936127 61 61 <p>Email Templates may also contain the <code><strong>[wtf_fu_show_files email_format='1']</strong></code> shortcode if desired to include a show_files display inside an email.<br/> 62 62 The email_format option is used here to cause the html output to inline the css for use inside an email.</p> 63 <p>The default email template is below, this can be edited or cloned as desired for your own emails in the <code> Emails tab</code> where you can add your own html to the message as well as63 <p>The default email template is below, this can be edited or cloned as desired for your own emails in the <code>Templates tab</code> You can add your own html to the message as well as 64 64 modify the TO: CC: BCC: and FROM: fields.</p> 65 65 <p>After that you will be able to select the template to be emailed from a drop down list in the workflow stage options and the email will be automatically sent once the stage is completed by a user.</p> -
work-the-flow-file-upload/trunk/includes/class-wtf-fu-option-definitions.php
r920619 r936127 337 337 ), 338 338 wtf_fu_DEFAULTS_TEMPLATE_FIELDS_KEY => array( 339 '%%USER_ID%%' => 'The current users user ID.', 339 340 '%%USER_NAME%%' => 'The current users display name.', 340 341 '%%USER_EMAIL%%' => 'The current users email address.', … … 352 353 '%%WTF_FU_POWERED_BY_LINK%%' => 'Includes a WFT-FU Powered by link to wtf-fu.com. (If allowed on the Plugin System Options page.)', 353 354 '%%ALL_WORKFLOW_USERS_EMAILS%%' => 'A list of users emails addresses that have commenced using the curent workflow.', 354 '%%ALL_SITE_USERS_EMAILS%%' => 'A list of all the sites registered users emails addresses.' 355 ) 355 '%%ALL_SITE_USERS_EMAILS%%' => 'A list of all the sites registered users emails addresses.', 356 '%%USER_GROUP_XXXX_EMAILS%%' => 'A list of all the users of group XXXX emails addresses. Substitute XXXX with the required user group.', 357 '%%ARCHIVE_USERS_FILES%%' => 'Causes all of a users files to be auto archived into a zip file and returns a download link to the zip file. WARNING this will cause delays while archiving completes, only use this if the delay time is acceptable. Intended to allow templated emails to automatically archive and email an admin users uploaded files. Files can be manually archived from the admin pages which may be a better solution to avoid delays to the user.' 358 ) 356 359 ); 357 360 -
work-the-flow-file-upload/trunk/includes/class-wtf-fu-options.php
r920715 r936127 302 302 * sorted in numerical order. 303 303 */ 304 static function get WorkFlowStageIDs($wf_index) {304 static function get_stage_ids_in_order($wf_index) { 305 305 $ids = array(); 306 306 $stage_keys = self::get_workflow_stages($wf_index); … … 311 311 asort($ids, SORT_NUMERIC); 312 312 313 //log_me(array('getWorkFlowStageIDs' => $ids));313 //log_me(array('getWorkFlowStageIDs' => $ids)); 314 314 return $ids; 315 315 } … … 425 425 } 426 426 427 428 static function get_all_group_user_emails($group = '') { 429 $args = array('role' => $group); 430 $users = get_users($args); 431 return Wtf_Fu_Options::get_users_email_list($users); 432 } 433 427 434 /** 428 435 * return string of all emails for users in a workflow … … 432 439 static function get_all_user_emails($workflow_id = 0) { 433 440 434 $users = Wtf_Fu_Options::get_workflow_users($workflow_id); 441 $wf_users = Wtf_Fu_Options::get_workflow_users($workflow_id); 442 $users = array(); 443 444 foreach ($wf_users as $wf_user) { 445 $users[] = $wf_user['user']; 446 } 447 448 return Wtf_Fu_Options::get_users_email_list($users); 449 } 450 451 static function get_users_email_list($users) { 452 453 // log_me($users); 435 454 $emails = array(); 436 437 //log_me($users);438 455 439 456 foreach ($users as $user) { 440 $emails[] = $user ['user']->user_email;457 $emails[] = $user->user_email; 441 458 } 442 459 443 460 $email_list = implode(',', $emails); 444 461 // log_me($emails); 445 462 return $email_list; 446 463 } -
work-the-flow-file-upload/trunk/includes/wtf-fu-common-utils.php
r920619 r936127 461 461 } 462 462 463 function wtf_fu_multiple_list_box($id, $option_name, $val, $label, $values) { 464 465 $option_name .= '[]'; // append array so options.php will know to store as multiple values. 466 $size = count($values); 467 $html = "<select id=\"$id\" name=\"$option_name\" multiple size=\"$size\">"; 468 469 // if value is not set or legacy string then force to an array. 470 if (!is_array($val)) { 471 $val = array($val); 472 } 473 foreach ($values as $v) { 474 $html .= "<option "; 475 if (in_array($v['value'], $val)) { 476 $html .= "selected=\"selected\" "; 477 } 478 $html .= "value=\"{$v['value']}\">{$v['name']}</option>"; 479 } 480 $html .= '</select> '; 481 $html .= '<label for="' . $id . '">' . $label . '</label>'; 482 483 return $html; 484 } 485 463 486 /** 464 487 * Returns a table of all the available template fields. 465 488 */ 466 489 function wtf_fu_get_template_fields_table($ignore = false) { 467 $table = "<table ><tr><th>TEMPLATE SHORTCUT</th><th>ACTION</th></tr>";490 $table = "<table class='table'><tr><th>TEMPLATE SHORTCUT</th><th>ACTION</th></tr>"; 468 491 469 492 $arr = Wtf_Fu_Option_Definitions::get_instance()->get_page_option_fields_default_labels(wtf_fu_DEFAULTS_TEMPLATE_FIELDS_KEY); … … 600 623 601 624 foreach ($shortcuts as $shortcut) { 625 if ($shortcut === '%%USER_GROUP_XXXX_EMAILS%%') { 626 continue; //handled separately 627 } 602 628 foreach ($field_values as $value) { 603 629 if (strstr($value, $shortcut)) { … … 608 634 } 609 635 636 610 637 //log_me(array('shortcuts required' => $shortcuts_required )); 611 638 … … 618 645 $replace[$shortcut] = $wp_user->display_name; 619 646 break; 647 648 case '%%USER_ID%%' : 649 $wp_user = wp_get_current_user(); 650 $replace[$shortcut] = $wp_user->ID; 651 break; 620 652 621 653 case '%%USER_EMAIL%%' : … … 682 714 $replace[$shortcut] = wtf_fu_get_value($stage_options, 'footer'); 683 715 break; 684 716 717 case '%%ARCHIVE_USERS_FILES%%' : 718 $wp_user = wp_get_current_user(); 719 $zipname = 'auto_' . wtf_fu_create_archive_name($wp_user->ID, '', '.zip', false); 720 $replace[$shortcut] = wtf_fu_do_archive_user_files($wp_user->ID, $zipname); 721 break; 722 685 723 default : 686 724 //log_me("Shortcut replacement key not found for $shortcut"); 687 725 } 688 726 } 727 728 729 // Handle USER_GROUP_XXXX_EMAILS 730 $pattern = '/%%USER_GROUP_([^%]*)_EMAILS%%/'; 731 foreach ($field_values as $value) { 732 $matches = array(); 733 $num = preg_match_all($pattern, $value, $matches); 734 if ( $num >= 1 ) { 735 //log_me($matches); 736 for ( $i=0; $i < $num; $i++) { 737 $replace[$matches[0][$i]] 738 = Wtf_Fu_Options::get_all_group_user_emails($matches[1][$i]); 739 } 740 } 741 } 689 742 690 743 $fields = str_replace(array_keys($replace), array_values($replace), $fields); -
work-the-flow-file-upload/trunk/public/class-wtf-fu.php
r920715 r936127 44 44 * @var string 45 45 */ 46 const VERSION = '2. 1.1';46 const VERSION = '2.2.0'; 47 47 48 48 /** … … 433 433 434 434 if (!wp_script_is($fileupload_handle, 'enqueued')) { 435 log_me('class-wtf-fu registering and enqueuing ' . $fileupload_handle);435 //log_me('class-wtf-fu registering and enqueuing ' . $fileupload_handle); 436 436 wp_register_script($fileupload_handle, plugin_dir_url(__FILE__) . 'assets/js/wtf-fu-file-upload.js', array('jquery', 'wp-ajax-response'), Wtf_Fu::VERSION, true); 437 437 wp_enqueue_script($fileupload_handle); … … 441 441 )); 442 442 443 log_me("uploadFilesHtml wp_localize_script for $fileupload_handle = $ret");443 //log_me("uploadFilesHtml wp_localize_script for $fileupload_handle = $ret"); 444 444 } else { 445 log_me("$fileupload_handle is already enqueued");445 //log_me("$fileupload_handle is already enqueued"); 446 446 } 447 447 -
work-the-flow-file-upload/trunk/public/includes/class-wtf-fu-show-files-shortcode.php
r920619 r936127 48 48 public function set_options($attr) { 49 49 50 log_me(array("set_options passed in " => $attr));50 //log_me(array("set_options passed in " => $attr)); 51 51 52 52 /* … … 114 114 */ 115 115 public function __construct() { 116 log_me('__construct Wtf_Fu_Filereorder_Shortcode ');116 // log_me('__construct Wtf_Fu_Filereorder_Shortcode '); 117 117 } 118 118 … … 126 126 if (null == self::$instance) { 127 127 self::$instance = new self; 128 log_me("new " . __CLASS__ . " instance created.");128 //log_me("new " . __CLASS__ . " instance created."); 129 129 return self::$instance; 130 130 } 131 131 132 log_me("existing " . __CLASS__ . " instance returned.");132 //log_me("existing " . __CLASS__ . " instance returned."); 133 133 return self::$instance; 134 134 } -
work-the-flow-file-upload/trunk/work-the-flow-file-upload.php
r920715 r936127 5 5 * Plugin URI: http://wtf-fu.com 6 6 * Description: Front end Html5 File Upload and configurable Workflow steps. Multiple file drag and drop, gallery image display, file reordering and archiving. 7 * Version: 2. 1.17 * Version: 2.2.0 8 8 * Author: Lynton Reed 9 9 * Author URI: http://wtf-fu.com
Note: See TracChangeset
for help on using the changeset viewer.