├── .gitignore ├── .gitmodules ├── .travis.yml ├── Gruntfile.js ├── README.md ├── admin ├── assets │ ├── css │ │ ├── editor-shortcodes.css │ │ ├── support-admin-faqs-menu.css │ │ ├── support-faqs-menu.css │ │ ├── support-menu.css │ │ └── support-welcome.css │ ├── images │ │ ├── support-system.png │ │ ├── support-welcome-1.png │ │ ├── support-welcome-2.png │ │ └── support-welcome-3.png │ └── js │ │ └── editor-shortcodes.js ├── class-abstract-menu.php ├── class-admin-faqs-menu.php ├── class-admin-support-menu.php ├── class-incsub-support-admin.php ├── class-network-faq-categories-menu.php ├── class-network-faqs-menu.php ├── class-network-settings-menu.php ├── class-network-support-menu.php ├── class-network-ticket-categories-menu.php ├── class-network-welcome-menu.php ├── class-parent-support-menu.php ├── inc │ ├── ajax.php │ ├── class-table-faq-categories.php │ ├── class-table-faqs.php │ ├── class-table-ticket-categories.php │ ├── class-table-tickets-history.php │ ├── class-table-tickets.php │ └── tinymce-shortcodes-i18n.php └── views │ ├── add-new-faq.php │ ├── add-new-ticket.php │ ├── admin-faq.php │ ├── edit-faq-category.php │ ├── edit-faq.php │ ├── edit-ticket-category.php │ ├── edit-ticket-details-metabox.php │ ├── edit-ticket-history-metabox.php │ ├── edit-ticket-history.php │ ├── edit-ticket-update-metabox.php │ ├── network-faq-categories.php │ ├── network-faqs.php │ ├── network-settings-front.php │ ├── network-settings-general.php │ ├── network-settings-tabs.php │ ├── network-ticket-categories.php │ ├── network-tickets.php │ ├── ticket-status-links.php │ ├── tickets-table-form.php │ └── welcome.php ├── assets ├── css │ ├── admin-bar.css │ ├── incsub-support.css │ └── single-ticket-menu.css ├── images │ ├── ajax-loader.gif │ ├── fi-minus.svg │ ├── fi-plus.svg │ ├── icon32.png │ ├── icons.png │ ├── spinner.gif │ ├── staff.gif │ └── user.gif ├── js │ ├── foundation-init.js │ ├── foundation.js │ ├── foundation.min.js │ ├── settings.js │ ├── support-system-init.js │ ├── support-system.js │ └── support-system.min.js └── scss │ ├── _forms.scss │ ├── _settings.scss │ ├── _type.scss │ └── incsub-support.scss ├── bin └── install-wp-tests.sh ├── bower.json ├── changelog.txt ├── config-release.rb ├── config.rb ├── dev-README.md ├── gulpfile.js ├── inc ├── classes │ ├── class-faq-category.php │ ├── class-faq.php │ ├── class-query.php │ ├── class-settings.php │ ├── class-shortcodes.php │ ├── class-ticket-category.php │ ├── class-ticket-reply.php │ ├── class-ticket.php │ └── shortcodes │ │ ├── class-abstract-shortcode.php │ │ ├── class-shortcode-faqs.php │ │ ├── class-shortcode-submit-ticket-form.php │ │ └── class-shortcode-tickets-index.php ├── helpers │ ├── capabilities.php │ ├── faq-category.php │ ├── faq.php │ ├── general.php │ ├── settings.php │ ├── template.php │ ├── ticket-category.php │ ├── ticket-reply.php │ └── ticket.php ├── integration │ └── pro-sites.php ├── mail-contents.php ├── support-menu.php ├── templates │ ├── faqs-nav.php │ ├── index-faqs.php │ ├── index-tickets.php │ ├── single-ticket.php │ ├── ticket-replies.php │ ├── ticket-reply.php │ └── tickets-nav.php └── upgrades.php ├── incsub-support.php ├── languages └── incsub-support.pot ├── license-foundation.txt ├── model └── model.php ├── package.json ├── phpunit.xml ├── tests ├── bootstrap.php ├── lib │ └── pro-sites.php ├── multisite │ └── ticket.php ├── test-empty.php ├── test-faq-category.php ├── test-faq.php ├── test-integration.php ├── test-ticket-category.php ├── test-ticket-reply.php └── test-ticket.php └── tmp └── log-search.log /.gitignore: -------------------------------------------------------------------------------- 1 | Support.k* 2 | bower_components/ 3 | .sass-cache/ 4 | node_modules/ 5 | npm-debug.log 6 | .DS_Store 7 | build/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dash-notice"] 2 | path = dash-notice 3 | url = git@bitbucket.org:incsub/wpmudev-dashboard-notification.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3 5 | - 5.4 6 | 7 | env: 8 | - WP_VERSION=latest WP_MULTISITE=0 9 | - WP_VERSION=latest WP_MULTISITE=1 10 | - WP_VERSION=3.8 WP_MULTISITE=0 11 | - WP_VERSION=3.8 WP_MULTISITE=1 12 | 13 | before_script: 14 | - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION 15 | 16 | script: phpunit 17 | -------------------------------------------------------------------------------- /admin/assets/css/editor-shortcodes.css: -------------------------------------------------------------------------------- 1 | i.mce-i-mce-i-incsub-support-sos { 2 | position: relative; 3 | } 4 | 5 | i.mce-i-mce-i-incsub-support-sos:before { 6 | font-family: 'dashicons'; 7 | position: absolute; 8 | top: 0; 9 | left: 0; 10 | width: 100%; 11 | height: 100%; 12 | text-align: center; 13 | content: "\f468"; 14 | font-size:20px; 15 | } 16 | -------------------------------------------------------------------------------- /admin/assets/css/support-admin-faqs-menu.css: -------------------------------------------------------------------------------- 1 | .js .postbox .handlediv:before { 2 | content: '\f142'; 3 | } 4 | 5 | .js .postbox.closed .handlediv:before { 6 | content: '\f140'; 7 | } 8 | 9 | .js .postbox .inside { 10 | overflow:hidden; 11 | } 12 | 13 | .js .postbox .handlediv:before { 14 | right: 12px; 15 | font: 400 20px/1 dashicons; 16 | speak: none; 17 | display: inline-block; 18 | padding: 8px 10px; 19 | top: 0; 20 | position: relative; 21 | -webkit-font-smoothing: antialiased; 22 | -moz-osx-font-smoothing: grayscale; 23 | text-decoration: none!important; 24 | } 25 | 26 | .js .postbox .hndle { 27 | cursor:pointer; 28 | } -------------------------------------------------------------------------------- /admin/assets/css/support-faqs-menu.css: -------------------------------------------------------------------------------- 1 | .incsub-support-meter { 2 | height:15px; 3 | position: relative; 4 | background: #555; 5 | -moz-border-radius: 3px; 6 | -webkit-border-radius: 3px; 7 | border-radius: 3px; 8 | width:40%; 9 | text-align: center; 10 | color:white; 11 | font-weight: bold; 12 | line-height: 15px; 13 | font-size: 11px; 14 | } 15 | 16 | .incsub-support-meter > span { 17 | display: block; 18 | height: 100%; 19 | -moz-border-radius: 3px; 20 | -webkit-border-radius: 3px; 21 | border-radius: 3px; 22 | 23 | position: relative; 24 | overflow: hidden; 25 | } 26 | 27 | .incsub-support-meter > span.incsub-support-meter-yes { 28 | background-color: #2B9647; 29 | } 30 | 31 | .incsub-support-meter > span.incsub-support-meter-no { 32 | background-color: #C73A28; 33 | } -------------------------------------------------------------------------------- /admin/assets/css/support-menu.css: -------------------------------------------------------------------------------- 1 | #support-attachments-list { 2 | margin:0; 3 | } 4 | 5 | #support-attachments-list li { 6 | padding-bottom:10px; 7 | } 8 | #support-attachments-list li:last-child { 9 | border-bottom: 1px solid #BABABA; 10 | margin-bottom: 10px; 11 | } 12 | 13 | 14 | .ticket-priority-0:before { 15 | color:gray; 16 | } 17 | .ticket-priority-1:before { 18 | color:green; 19 | } 20 | .ticket-priority-2:before { 21 | color:#7272EF; 22 | } 23 | .ticket-priority-3:before { 24 | color:#DA7126; 25 | } 26 | .ticket-priority-4:before { 27 | color:#D00000; 28 | } 29 | 30 | .row-actions .open-ticket { 31 | color:#006505; 32 | } 33 | .row-actions .close-ticket { 34 | color:#d98500; 35 | } 36 | 37 | #support-tickets .dashicons-before:before { 38 | font-size: 16px; 39 | line-height: 1.2; 40 | } 41 | 42 | table.ticketshistory .support-system-reply-subject { 43 | margin-top:0; 44 | } 45 | 46 | table.ticketshistory th.column-poster { 47 | width:200px; 48 | } 49 | 50 | table.ticketshistory th.column-message { 51 | width:65%; 52 | } 53 | 54 | table.ticketshistory th.column-date { 55 | width:15%; 56 | } 57 | table.ticketshistory th.column-create_faq { 58 | width:10%; 59 | } 60 | 61 | table.ticketshistory .ticket-acttachments-wrap { 62 | background: #EBEBEB; 63 | padding: 0 15px; 64 | margin-top: 20px; 65 | display: inline-block; 66 | margin-bottom: 20px; 67 | border:1px solid #DADADA; 68 | border-radius:3px 69 | } 70 | 71 | .support-system-add-reply-subtitle { 72 | margin-top:0; 73 | } 74 | 75 | .support-system-error { 76 | margin-top: 50px; 77 | border-left: 4px solid #7C110C; 78 | background: #dd3d36; 79 | -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); 80 | box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); 81 | padding: 1px 12px; 82 | color: white; 83 | } 84 | 85 | .support-attachments button:before { 86 | content: "\f502"; 87 | font-family: 'dashicons'; 88 | } 89 | 90 | .wp-core-ui .support-attachments button { 91 | color: #FFF; 92 | border-color: #407138; 93 | background: #529348; 94 | -webkit-box-shadow: inset 0 1px 0 #5CA351,0 1px 0 rgba(0,0,0,.08); 95 | box-shadow: inset 0 1px 0 #5CA351,0 1px 0 rgba(0,0,0,.08); 96 | } 97 | 98 | .wp-core-ui .support-attachments button:hover { 99 | background: #5DA152; 100 | border-color: #374434; 101 | color:white; 102 | } 103 | 104 | .wp-core-ui .support-attachments button:active, 105 | .wp-core-ui .support-attachments button:focus { 106 | background: #5DA152; 107 | border-color: #407138; 108 | color:white; 109 | } 110 | 111 | .support-attachments .remove-file:before { 112 | content: "\f335"; 113 | font-family: 'dashicons'; 114 | vertical-align: middle; 115 | } 116 | 117 | .wp-core-ui .remove-file { 118 | margin-left:1em; 119 | color: #FFF; 120 | border-color: #992727; 121 | background: #B53737; 122 | -webkit-box-shadow: inset 0 1px 0 #DD4343,0 1px 0 rgba(0,0,0,.08); 123 | box-shadow: inset 0 1px 0 #DD4343,0 1px 0 rgba(0,0,0,.08); 124 | } 125 | 126 | .wp-core-ui .remove-file:hover { 127 | background: #C03A3A; 128 | border-color: #5E1717; 129 | color: white; 130 | } 131 | 132 | .wp-core-ui .remove-file:active, 133 | .wp-core-ui .remove-file:focus { 134 | background: #C03A3A; 135 | border-color: #5E1717; 136 | color: white; 137 | } 138 | 139 | 140 | ul.ticket-fields li { 141 | float:left; 142 | width:30%; 143 | margin-right:25px; 144 | margin-bottom:15px; 145 | } 146 | 147 | #poststuff ul.ticket-fields h3.ticket-field-label { 148 | padding-left:0; 149 | padding-bottom:0; 150 | } 151 | 152 | ul.ticket-fields .ticket-field-value { 153 | margin-left:10px; 154 | } 155 | #support-system-ticket-update .inside { 156 | padding:0; 157 | } 158 | #support-system-ticket-update .inside .ticket-update-fields { 159 | padding:0 12px 12px; 160 | } 161 | 162 | #support-system-ticket-update .inside .ticket-update-fields .ticket-field-label { 163 | font-weight: bold; 164 | } 165 | #support-system-ticket-update .inside .ticket-update-fields .ticket-field-value { 166 | margin-top:0; 167 | margin-bottom:20px; 168 | } 169 | #support-system-ticket-update #ticket-closed .ticket-field-label, 170 | #support-system-ticket-update #ticket-closed .ticket-field-value { 171 | display:inline-block; 172 | margin-bottom:15px; 173 | } 174 | #support-system-ticket-update #ticket-closed .ticket-field-value input { 175 | margin-top:15px; 176 | } 177 | #support-system-ticket-update #ticket-closed .ticket-field-label { 178 | width:88%; 179 | float:right; 180 | } 181 | #support-system-ticket-update #ticket-closed .ticket-field-value { 182 | width:10%; 183 | float:left; 184 | } 185 | #submit-ticket-details { 186 | float:right; 187 | } 188 | #support-system-ticket-history .inside { 189 | padding:0; 190 | margin:0; 191 | } 192 | #support-system-ticket-history td.poster { 193 | width:10%; 194 | } 195 | #support-system-ticket-history td.message { 196 | width:70%; 197 | } 198 | #edit-ticket-form { 199 | padding:17px; 200 | } 201 | 202 | #edit-ticket-form-errors { 203 | padding-top: 40px; 204 | } 205 | -------------------------------------------------------------------------------- /admin/assets/css/support-welcome.css: -------------------------------------------------------------------------------- 1 | .about-wrap .support-system-badge { 2 | background: #D8D8D8 url(../images/support-system.png) no-repeat -122px -17px; 3 | color:#333; 4 | width:230px; 5 | } 6 | .badge-version { 7 | background: #69A5A4; 8 | padding: 11px; 9 | border-top: 1px solid rgb(79, 124, 123); 10 | color: white; 11 | text-shadow: 1px 1px 0px #333; 12 | } -------------------------------------------------------------------------------- /admin/assets/images/support-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/admin/assets/images/support-system.png -------------------------------------------------------------------------------- /admin/assets/images/support-welcome-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/admin/assets/images/support-welcome-1.png -------------------------------------------------------------------------------- /admin/assets/images/support-welcome-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/admin/assets/images/support-welcome-2.png -------------------------------------------------------------------------------- /admin/assets/images/support-welcome-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/admin/assets/images/support-welcome-3.png -------------------------------------------------------------------------------- /admin/assets/js/editor-shortcodes.js: -------------------------------------------------------------------------------- 1 | ( function () { 2 | tinymce.PluginManager.add( 'incsub_support_shortcodes', function ( editor ) { 3 | var ed = tinymce.activeEditor; 4 | 5 | var support_system_menu = [ 6 | { 7 | text: ed.getLang( 'support_system_shortcodes.tickets_list_menu_title' ), 8 | onclick: function () { 9 | editor.insertContent( '[support-system-tickets-index]' ); 10 | } 11 | }, 12 | { 13 | text: 'FAQs index', 14 | onclick: function () { 15 | editor.insertContent( '[support-system-faqs]' ); 16 | } 17 | }, 18 | ]; 19 | 20 | 21 | if ( ed.getLang( 'support_system_shortcodes.is_network' ) == 1 ) { 22 | support_system_menu.push({ 23 | text: ed.getLang( 'support_system_shortcodes.submit_ticket_form_text' ), 24 | onclick: function () { 25 | editor.windowManager.open({ 26 | title: ed.getLang( 'support_system_shortcodes.submit_ticket_form_submit_ticket_form_title' ), 27 | body: [ 28 | { 29 | type: 'checkbox', 30 | name: 'blog_field', 31 | label: ed.getLang( 'support_system_shortcodes.submit_ticket_form_blog_field_label' ), 32 | checked: true 33 | }, 34 | { 35 | type: 'checkbox', 36 | name: 'category_field', 37 | label: ed.getLang( 'support_system_shortcodes.submit_ticket_form_category_field_label' ), 38 | checked: true 39 | }, 40 | { 41 | type: 'checkbox', 42 | name: 'priority_field', 43 | label: ed.getLang( 'support_system_shortcodes.submit_ticket_form_priority_field_label' ), 44 | checked: true 45 | } 46 | ], 47 | onsubmit: function ( e ) { 48 | var blog_field = e.data.blog_field ? '' : ' blog_field="0"'; 49 | var category_field = e.data.category_field ? '' : ' category_field="0"'; 50 | var priority_field = e.data.priority_field ? '' : ' priority_field="0"'; 51 | 52 | editor.insertContent( '[support-system-submit-ticket-form' + blog_field + ' ' + category_field + ' ' + priority_field + ']' ); 53 | } 54 | }); 55 | } 56 | }); 57 | } 58 | else { 59 | support_system_menu.push({ 60 | text: ed.getLang( 'support_system_shortcodes.submit_ticket_form_text' ), 61 | onclick: function () { 62 | editor.windowManager.open({ 63 | title: ed.getLang( 'support_system_shortcodes.submit_ticket_form_submit_ticket_form_title' ), 64 | body: [ 65 | { 66 | type: 'checkbox', 67 | name: 'category_field', 68 | label: ed.getLang( 'support_system_shortcodes.submit_ticket_form_category_field_label' ), 69 | checked: true 70 | }, 71 | { 72 | type: 'checkbox', 73 | name: 'priority_field', 74 | label: ed.getLang( 'support_system_shortcodes.submit_ticket_form_priority_field_label' ), 75 | checked: true 76 | } 77 | ], 78 | onsubmit: function ( e ) { 79 | var category_field = e.data.category_field ? '' : ' category_field="0"'; 80 | var priority_field = e.data.priority_field ? '' : ' priority_field="0"'; 81 | 82 | editor.insertContent( '[support-system-submit-ticket-form' + category_field + ' ' + priority_field + ']' ); 83 | } 84 | }); 85 | } 86 | }); 87 | } 88 | editor.addButton( 'incsub_support_shortcodes', { 89 | icon: 'mce-i-incsub-support-sos', 90 | type: 'menubutton', 91 | menu: support_system_menu 92 | }); 93 | }); 94 | })(); -------------------------------------------------------------------------------- /admin/class-abstract-menu.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 15 | $this->network = $network; 16 | 17 | if ( $network ) 18 | add_action( 'network_admin_menu', array( &$this, 'add_menu' ) ); 19 | else 20 | add_action( 'admin_menu', array( &$this, 'add_menu' ) ); 21 | } 22 | 23 | public abstract function add_menu(); 24 | public abstract function render_inner_page(); 25 | 26 | public function render_page() { 27 | ?> 28 |
29 | ' . esc_html( get_admin_page_title() ) . '', $this->page_id ); 37 | ?> 38 | 39 | render_inner_page(); ?> 40 |
41 | 42 | slug || ! $cap ) 51 | return; 52 | 53 | $this->menu_title = $page_title; 54 | 55 | $this->page_id = add_menu_page( 56 | $menu_title, 57 | $page_title, 58 | $cap, 59 | $this->slug, 60 | array( $this, 'render_page' ), 61 | $icon 62 | ); 63 | 64 | 65 | add_action( 'load-' . $this->page_id, array( $this, 'on_load' ) ); 66 | } 67 | 68 | protected function add_submenu_page( $parent_slug, $menu_title, $page_title, $cap ) { 69 | $this->menu_title = $page_title; 70 | $this->page_id = add_submenu_page( 71 | $parent_slug, 72 | $page_title, 73 | $menu_title, 74 | $cap, 75 | $this->slug, 76 | array( $this, 'render_page' ) 77 | ); 78 | 79 | add_action( 'load-' . $this->page_id, array( $this, 'on_load' ) ); 80 | } 81 | 82 | public function get_menu_url() { 83 | if ( $this->network ) 84 | return network_admin_url( 'admin.php?page=' . $this->slug ); 85 | else 86 | return admin_url( 'admin.php?page=' . $this->slug ); 87 | } 88 | 89 | public function get_menu_title() { 90 | return $this->menu_title; 91 | } 92 | 93 | public function render_row( $title, $markup ) { 94 | ?> 95 | 96 | 97 | 98 | 99 | 100 | 101 | page_id, array( $this, 'set_filters' ) ); 39 | 40 | } 41 | 42 | public function set_filters() { 43 | add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_scripts' ) ); 44 | add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_styles' ) ); 45 | } 46 | 47 | public function enqueue_scripts( $hook ) { 48 | incsub_support_enqueue_main_script(); 49 | } 50 | 51 | public function enqueue_styles( $hook ) { 52 | wp_enqueue_style( 'mu-support-faq-css', INCSUB_SUPPORT_PLUGIN_URL . 'admin/assets/css/support-admin-faqs-menu.css', array( ), '20130402' ); 53 | } 54 | 55 | 56 | public function render_inner_page() { 57 | $faq_categories = incsub_support_get_faq_categories(); 58 | 59 | if ( isset( $_POST['submit-faq-search'] ) && check_admin_referer( 'faq_search' ) ) { 60 | $new_faq_categories = array(); 61 | foreach ( $faq_categories as $key => $item ) { 62 | $answers = incsub_support_get_faqs( array( 's' => $_POST['faq-s'], 'per_page' => -1, 'category' => $item->cat_id ) ); 63 | if ( count( $answers ) > 0 ) { 64 | $the_faq = $item; 65 | $the_faq->answers = $answers; 66 | $the_faq->faqs = count( $answers ); 67 | $new_faq_categories[] = $the_faq; 68 | } 69 | } 70 | 71 | $index = 0; 72 | $faq_categories = $new_faq_categories; 73 | } 74 | else { 75 | foreach ( $faq_categories as $key => $item ) { 76 | $faq_categories[ $key ]->faqs = incsub_support_count_faqs_on_category( $item->cat_id ); 77 | $faq_categories[ $key ]->answers = incsub_support_get_faqs( array( 'category' => $item->cat_id ) ); 78 | } 79 | } 80 | 81 | $half_of_array = ceil( count( $faq_categories ) / 2 ); 82 | 83 | include_once( 'views/admin-faq.php' ); 84 | 85 | } 86 | 87 | public function embed_media( $match ) { 88 | require_once( ABSPATH . WPINC . '/class-oembed.php' ); 89 | $wp_oembed = _wp_oembed_get_object(); 90 | 91 | $embed_code = $wp_oembed->get_html( $match[1] ); 92 | return $embed_code; 93 | } 94 | } -------------------------------------------------------------------------------- /admin/class-incsub-support-admin.php: -------------------------------------------------------------------------------- 1 | includes(); 12 | $this->add_menus(); 13 | } 14 | 15 | /** 16 | * Include needed files 17 | */ 18 | private function includes() { 19 | require_once( 'class-abstract-menu.php' ); 20 | 21 | // Network 22 | require_once( 'class-parent-support-menu.php' ); 23 | require_once( 'class-network-support-menu.php' ); 24 | require_once( 'class-network-ticket-categories-menu.php' ); 25 | require_once( 'class-network-faqs-menu.php' ); 26 | require_once( 'class-network-faq-categories-menu.php' ); 27 | require_once( 'class-network-settings-menu.php' ); 28 | require_once( 'class-network-welcome-menu.php' ); 29 | 30 | // Admin 31 | require_once( 'class-admin-support-menu.php' ); 32 | require_once( 'class-admin-faqs-menu.php' ); 33 | 34 | if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { 35 | require_once( 'inc/ajax.php' ); 36 | } 37 | } 38 | 39 | 40 | /** 41 | * Create the menu objects 42 | */ 43 | private function add_menus() { 44 | $menus = array(); 45 | $network = false; 46 | 47 | if ( is_multisite() ) { 48 | if ( is_network_admin() && incsub_support_current_user_can( 'manage_options' ) ) { 49 | 50 | /** 51 | * Filters the Support System Menus 52 | * 53 | * @param Array $menus Support Sytem Menus array 54 | array( 55 | [menu_key] => array( 56 | [class] => 'PHP Class name', 57 | [slug] => 'WordPress Admin Menu Slug' 58 | ), 59 | ... 60 | ) 61 | */ 62 | $menus = apply_filters( 'incsub_support_menus', array( 63 | 'network_support_menu' => array( 64 | 'class' => 'Incsub_Support_Network_Support_Menu', 65 | 'slug' => 'ticket-manager' 66 | ), 67 | 'network_ticket_categories_menu' => array( 68 | 'class' => 'Incsub_Support_Network_Ticket_Categories', 69 | 'slug' => 'ticket-categories' 70 | ), 71 | 'network_faqs_menu' => array( 72 | 'class' => 'Incsub_Support_Network_FAQ_Menu', 73 | 'slug' => 'support-faq-manager' 74 | ), 75 | 'network_faq_categories_menu' => array( 76 | 'class' => 'Incsub_Support_Network_FAQ_Categories', 77 | 'slug' => 'faq-categories' 78 | ), 79 | 'network_settings_menu' => array( 80 | 'class' => 'Incsub_Support_Network_Settings_Menu', 81 | 'slug' => 'mu-support-settings' 82 | ), 83 | 'network_welcome' => array( 84 | 'class' => 'Incsub_Support_Welcome_Menu', 85 | 'slug' => 'mu-support-welcome' 86 | ) 87 | ) ); 88 | 89 | $network = true; 90 | } 91 | elseif ( ! is_network_admin() && is_admin() ) { 92 | /** 93 | * Filters the Support System Menus 94 | * 95 | * @param Array $menus Support Sytem Menus array 96 | array( 97 | [menu_key] => array( 98 | [class] => 'PHP Class name', 99 | [slug] => 'WordPress Admin Menu Slug' 100 | ), 101 | ... 102 | ) 103 | */ 104 | $menus = apply_filters( 'incsub_support_menus', array( 105 | 'admin_support_menu' => array( 106 | 'class' => 'Incsub_Support_Admin_Support_Menu', 107 | 'slug' => 'ticket-manager' 108 | ), 109 | 'admin_faq_menu' => array( 110 | 'class' => 'Incsub_Support_Admin_FAQ_Menu', 111 | 'slug' => 'support-faq' 112 | ) 113 | ) ); 114 | 115 | } 116 | } 117 | elseif ( ! is_multisite() && is_admin() ) { 118 | /** 119 | * Filters the Support System Menus 120 | * 121 | * @param Array $menus Support Sytem Menus array 122 | array( 123 | [menu_key] => array( 124 | [class] => 'PHP Class name', 125 | [slug] => 'WordPress Admin Menu Slug' 126 | ), 127 | ... 128 | ) 129 | */ 130 | $menus = apply_filters( 'incsub_support_menus', array( 131 | 'admin_support_menu' => array( 132 | 'class' => 'Incsub_Support_Admin_Support_Menu', 133 | 'slug' => 'ticket-manager' 134 | ), 135 | 'network_ticket_categories_menu' => array( 136 | 'class' => 'Incsub_Support_Network_Ticket_Categories', 137 | 'slug' => 'ticket-categories' 138 | ), 139 | 'network_faqs_menu' => array( 140 | 'class' => 'Incsub_Support_Network_FAQ_Menu', 141 | 'slug' => 'support-faq-manager' 142 | ), 143 | 'network_faq_categories_menu' => array( 144 | 'class' => 'Incsub_Support_Network_FAQ_Categories', 145 | 'slug' => 'faq-categories' 146 | ), 147 | 'network_settings_menu' => array( 148 | 'class' => 'Incsub_Support_Network_Settings_Menu', 149 | 'slug' => 'mu-support-settings' 150 | ), 151 | 'network_welcome' => array( 152 | 'class' => 'Incsub_Support_Welcome_Menu', 153 | 'slug' => 'mu-support-welcome' 154 | ), 155 | 'admin_faq_menu' => array( 156 | 'class' => 'Incsub_Support_Admin_FAQ_Menu', 157 | 'slug' => 'support-faq' 158 | ) 159 | ) ); 160 | } 161 | 162 | foreach ( $menus as $key => $menu ) { 163 | if ( class_exists( $menu['class'] ) ) { 164 | $args = array( 'slug' => $menu['slug'], 'is_network' => $network ); 165 | $r = new ReflectionClass( $menu['class'] ); 166 | $this->menus[ $key ] = $r->newInstanceArgs( $args ); 167 | } 168 | } 169 | } 170 | } 171 | 172 | -------------------------------------------------------------------------------- /admin/class-network-faq-categories-menu.php: -------------------------------------------------------------------------------- 1 | ' . sprintf( _x( 'Edit %s', 'Edit faq category menu title', INCSUB_SUPPORT_LANG_DOMAIN ), $faq_category->cat_name ) . ''; 23 | } 24 | 25 | public function on_load() { 26 | $edit = false; 27 | $add = false; 28 | 29 | if ( ( $edit = isset( $_POST['submit-edit-faq-category'] ) || $add = isset( $_POST['submit-new-faq-category'] ) ) ) { 30 | $edit = isset( $_POST['submit-edit-faq-category'] ); 31 | $add = isset( $_POST['submit-new-faq-category'] ); 32 | 33 | if ( $edit ) { 34 | if ( ! incsub_support_current_user_can( 'update_faq_category' ) ) 35 | return; 36 | 37 | // Editing a category ? 38 | $faq_category_id = absint( $_POST['faq_cat_id'] ); 39 | $faq_category = incsub_support_get_faq_category( $faq_category_id ); 40 | if ( ! $faq_category ) 41 | return; 42 | check_admin_referer( 'edit-faq-category-' . $faq_category->cat_id ); 43 | } 44 | elseif ( $add ) { 45 | if ( ! incsub_support_current_user_can( 'insert_faq_category' ) ) 46 | return; 47 | 48 | check_admin_referer( 'add-faq-category' ); 49 | } 50 | else { 51 | return; 52 | } 53 | 54 | $cat_name = trim( $_POST['cat_name'] ); 55 | if ( empty( $cat_name ) ) 56 | add_settings_error( 'support_system_submit_category', 'empty-category-name', __( 'Category name must not be empty', INCSUB_SUPPORT_LANG_DOMAIN ) ); 57 | else 58 | $category_name = $_POST['cat_name']; 59 | 60 | if ( ! get_settings_errors( 'support_system_submit_category' ) ) { 61 | if ( $add ) { 62 | incsub_support_insert_faq_category( $category_name ); 63 | $redirect = add_query_arg( 'added', 'true', $this->get_menu_url() ); 64 | wp_redirect( $redirect ); 65 | exit(); 66 | } 67 | elseif ( $edit ) { 68 | incsub_support_update_faq_category( $faq_category->cat_id, array( 'cat_name' => $category_name, 'user_id' => $user_id ) ); 69 | $redirect = add_query_arg( 70 | array( 71 | 'updated' => 'true' 72 | ), $this->get_menu_url() 73 | ); 74 | wp_redirect( $redirect ); 75 | exit(); 76 | } 77 | } 78 | } 79 | 80 | } 81 | 82 | public function render_inner_page() { 83 | if ( isset( $_GET['category'] ) && $_GET['action'] == 'edit' ) { 84 | $faq_category = incsub_support_get_faq_category( absint( $_GET['category'] ) ); 85 | if ( ! $faq_category ) 86 | wp_die( __( 'The category does not exist', INCSUB_SUPPORT_LANG_DOMAIN ) ); 87 | 88 | $category_name = $faq_category->cat_name; 89 | if ( ! empty( $_POST['cat_name'] ) && trim( $_POST['cat_name'] ) ) 90 | $category_name = stripslashes_deep( $_POST['cat_name'] ); 91 | 92 | 93 | $updated = isset( $_GET['updated'] ); 94 | 95 | settings_errors( 'support_system_submit_category' ); 96 | include_once( 'views/edit-faq-category.php' ); 97 | } 98 | else { 99 | include_once( 'inc/class-table-faq-categories.php' ); 100 | $cats_table = new Incsub_Support_FAQ_Categories_Table(); 101 | $cats_table->prepare_items(); 102 | 103 | $category_name = ''; 104 | if ( isset( $_POST['cat_name'] ) ) 105 | $category_name = sanitize_text_field( stripslashes_deep( $_POST['cat_name'] ) ); 106 | 107 | $added = isset( $_GET['added'] ); 108 | $updated = isset( $_GET['updated'] ); 109 | 110 | settings_errors( 'support_system_submit_category' ); 111 | include_once( 'views/network-faq-categories.php' ); 112 | } 113 | } 114 | 115 | 116 | } -------------------------------------------------------------------------------- /admin/class-network-support-menu.php: -------------------------------------------------------------------------------- 1 | 0 ) ); 16 | 17 | $menu_title = __( 'Support', INCSUB_SUPPORT_LANG_DOMAIN ); 18 | if ( $unviewed_tickets ) { 19 | $warning_title = __( '%d unviewed tickets', INCSUB_SUPPORT_LANG_DOMAIN ); 20 | $menu_title .= " " . number_format_i18n( $unviewed_tickets ) . ""; 21 | } 22 | parent::add_menu_page( 23 | __( 'Support Ticket Management System', INCSUB_SUPPORT_LANG_DOMAIN ), 24 | $menu_title, 25 | is_multisite() ? 'manage_network' : 'manage_options', 26 | 'dashicons-sos' 27 | ); 28 | 29 | if ( isset( $_GET['action'] ) && isset( $_GET['tid'] ) && 'edit' === $_GET['action'] ) 30 | add_filter( 'support_system_admin_page_title', '__return_empty_string' ); 31 | 32 | } 33 | 34 | public function render_inner_page() { 35 | $action = isset( $_GET['action'] ) ? $_GET['action'] : false; 36 | 37 | if ( 'edit' == $action && isset( $_GET['tid'] ) ) { 38 | $this->render_inner_page_details(); 39 | } 40 | else { 41 | $this->render_inner_page_tickets_table(); 42 | } 43 | } 44 | 45 | 46 | public function set_tickets_table_query_args( $args ) { 47 | $category = $this->get_filter( 'category' ); 48 | $priority = $this->get_filter( 'priority' ); 49 | $s = $this->get_filter( 's' ); 50 | 51 | $args['s'] = $s; 52 | $args['priority'] = $priority; 53 | $args['category'] = $category; 54 | 55 | return $args; 56 | } 57 | 58 | 59 | } -------------------------------------------------------------------------------- /admin/class-network-ticket-categories-menu.php: -------------------------------------------------------------------------------- 1 | ' . sprintf( _x( 'Edit %s', 'Edit ticket category menu title', INCSUB_SUPPORT_LANG_DOMAIN ), $ticket_category->cat_name ) . ''; 23 | } 24 | 25 | public function on_load() { 26 | $edit = false; 27 | $add = false; 28 | if ( ( $edit = isset( $_POST['submit-edit-ticket-category'] ) || $add = isset( $_POST['submit-new-ticket-category'] ) ) ) { 29 | $edit = isset( $_POST['submit-edit-ticket-category'] ); 30 | $add = isset( $_POST['submit-new-ticket-category'] ); 31 | 32 | if ( $edit ) { 33 | if ( ! incsub_support_current_user_can( 'update_ticket_category' ) ) 34 | return; 35 | 36 | // Editing a category ? 37 | $ticket_category_id = absint( $_POST['ticket_cat_id'] ); 38 | $ticket_category = incsub_support_get_ticket_category( $ticket_category_id ); 39 | if ( ! $ticket_category ) 40 | return; 41 | check_admin_referer( 'edit-ticket-category-' . $ticket_category->cat_id ); 42 | } 43 | elseif ( $add ) { 44 | if ( ! incsub_support_current_user_can( 'insert_ticket_category' ) ) 45 | return; 46 | 47 | check_admin_referer( 'add-ticket-category' ); 48 | } 49 | else { 50 | return; 51 | } 52 | 53 | $cat_name = trim( $_POST['cat_name'] ); 54 | if ( empty( $cat_name ) ) 55 | add_settings_error( 'support_system_submit_category', 'empty-category-name', __( 'Category name must not be empty', INCSUB_SUPPORT_LANG_DOMAIN ) ); 56 | else 57 | $category_name = $_POST['cat_name']; 58 | 59 | $user_id = 0; 60 | if ( ! empty( $_POST['super-admins'] ) && $user = get_user_by( 'login', $_POST['super-admins'] ) ) 61 | $user_id = $user->ID; 62 | 63 | if ( ! get_settings_errors( 'support_system_submit_category' ) ) { 64 | if ( $add ) { 65 | incsub_support_insert_ticket_category( $category_name, $user_id ); 66 | $redirect = add_query_arg( 'added', 'true', $this->get_menu_url() ); 67 | wp_redirect( $redirect ); 68 | exit(); 69 | } 70 | elseif ( $edit ) { 71 | incsub_support_update_ticket_category( $ticket_category->cat_id, array( 'cat_name' => $category_name, 'user_id' => $user_id ) ); 72 | $redirect = add_query_arg( 73 | array( 74 | 'updated' => 'true', 75 | 'action' => 'edit', 76 | 'category' => $ticket_category->cat_id 77 | ), $this->get_menu_url() 78 | ); 79 | wp_redirect( $redirect ); 80 | exit(); 81 | } 82 | } 83 | } 84 | 85 | } 86 | 87 | public function render_inner_page() { 88 | if ( isset( $_GET['category'] ) && $_GET['action'] == 'edit' ) { 89 | $ticket_category = incsub_support_get_ticket_category( absint( $_GET['category'] ) ); 90 | if ( ! $ticket_category ) 91 | wp_die( __( 'The category does not exist', INCSUB_SUPPORT_LANG_DOMAIN ) ); 92 | 93 | $category_name = $ticket_category->cat_name; 94 | if ( ! empty( $_POST['cat_name'] ) && trim( $_POST['cat_name'] ) ) 95 | $category_name = stripslashes_deep( $_POST['cat_name'] ); 96 | 97 | $user = get_userdata( $ticket_category->user_id ); 98 | if ( $user ) 99 | $user = $user->data->user_login; 100 | else 101 | $user = ''; 102 | if ( isset( $_POST['super-admins'] ) ) 103 | $user = $_POST['super-admins']; 104 | 105 | $super_admins_dropdown = incsub_support_super_admins_dropdown( 106 | array( 107 | 'show_empty' => __( 'None', INCSUB_SUPPORT_LANG_DOMAIN ) , 108 | 'echo' => false, 109 | 'selected' => $user 110 | ) 111 | ); 112 | 113 | $updated = isset( $_GET['updated'] ); 114 | 115 | settings_errors( 'support_system_submit_category' ); 116 | include_once( 'views/edit-ticket-category.php' ); 117 | } 118 | else { 119 | include_once( 'inc/class-table-ticket-categories.php' ); 120 | $cats_table = new Incsub_Support_Ticket_Categories_Table(); 121 | $cats_table->prepare_items(); 122 | 123 | $category_name = ''; 124 | if ( isset( $_POST['cat_name'] ) ) 125 | $category_name = sanitize_text_field( stripslashes_deep( $_POST['cat_name'] ) ); 126 | 127 | $user = ''; 128 | if ( isset( $_POST['super-admins'] ) ) 129 | $user = $_POST['super-admins']; 130 | 131 | $super_admins_dropdown = incsub_support_super_admins_dropdown( 132 | array( 133 | 'show_empty' => __( 'None', INCSUB_SUPPORT_LANG_DOMAIN ) , 134 | 'echo' => false, 135 | 'selected' => $user 136 | ) 137 | ); 138 | 139 | $added = isset( $_GET['added'] ); 140 | 141 | settings_errors( 'support_system_submit_category' ); 142 | include_once( 'views/network-ticket-categories.php' ); 143 | } 144 | } 145 | 146 | 147 | } -------------------------------------------------------------------------------- /admin/class-network-welcome-menu.php: -------------------------------------------------------------------------------- 1 | menu_title = sprintf( __( 'Welcome to Support System %s', INCSUB_SUPPORT_LANG_DOMAIN ), incsub_support_get_version() ); 7 | $this->page_id = add_dashboard_page( 8 | $this->menu_title, 9 | $this->menu_title, 10 | is_multisite() ? 'manage_network' : 'manage_options', 11 | $this->slug, 12 | array( $this, 'render_page' ) 13 | ); 14 | 15 | 16 | add_action( 'admin_head', array( $this, 'admin_head' ) ); 17 | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) ); 18 | add_action( 'admin_init', array( $this, 'redirect_to_here' ), 99 ); 19 | } 20 | 21 | public function enqueue_styles() { 22 | $file = 'about'; 23 | if ( is_rtl() ) 24 | $file .= '-rtl'; 25 | 26 | $file .= '.css'; 27 | 28 | wp_enqueue_style( 'support-system-welcome-custom', INCSUB_SUPPORT_PLUGIN_URL . 'admin/assets/css/support-welcome.css'); 29 | } 30 | 31 | 32 | public function render_page() { 33 | 34 | if ( is_multisite() ) 35 | $settings_url = network_admin_url( 'admin.php?page=mu-support-settings' ); 36 | else 37 | $settings_url = admin_url( 'admin.php?page=mu-support-settings' ); 38 | 39 | include_once( 'views/welcome.php' ); 40 | 41 | } 42 | 43 | public function render_inner_page() {} 44 | 45 | public function admin_head() { 46 | remove_submenu_page( 'index.php', $this->slug ); 47 | } 48 | 49 | public function redirect_to_here() { 50 | if ( ! get_transient( 'incsub_support_welcome' ) ) { 51 | return; 52 | } 53 | 54 | if ( is_multisite() && ! is_super_admin() ) 55 | return; 56 | elseif ( ! is_multisite() && ! current_user_can( 'manage_options' ) ) 57 | return; 58 | 59 | delete_transient( 'incsub_support_welcome' ); 60 | 61 | $url = is_multisite() ? network_admin_url( 'index.php?page=' . $this->slug ) : admin_url( 'index.php?page=' . $this->slug ); 62 | wp_redirect( $url ); 63 | exit; 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /admin/inc/ajax.php: -------------------------------------------------------------------------------- 1 | __( 'Category', INCSUB_SUPPORT_LANG_DOMAIN ), 13 | 'plural' => __( 'Categories', INCSUB_SUPPORT_LANG_DOMAIN ), 14 | 'ajax' => false 15 | ) ); 16 | 17 | } 18 | 19 | function column_default( $item, $column_name ){ 20 | 21 | $value = ''; 22 | switch ( $column_name ) { 23 | default : $value = $item[ $column_name ]; break; 24 | } 25 | return $value; 26 | } 27 | 28 | 29 | function get_columns(){ 30 | $columns = array( 31 | 'cb' => '', 32 | 'id' => __( 'ID', INCSUB_SUPPORT_LANG_DOMAIN ), 33 | 'name' => __( 'Name', INCSUB_SUPPORT_LANG_DOMAIN ), 34 | 'faqs' => __( 'FAQs', INCSUB_SUPPORT_LANG_DOMAIN ) 35 | ); 36 | return $columns; 37 | } 38 | 39 | function column_cb($item){ 40 | if ( '0' == $item->defcat ) { 41 | return sprintf( 42 | '', 43 | $this->_args['singular'], 44 | $item->cat_id 45 | ); 46 | } 47 | else { 48 | return ''; 49 | } 50 | } 51 | 52 | function column_id( $item ) { 53 | return $item->cat_id; 54 | } 55 | 56 | function column_faqs( $item ) { 57 | return $item->get_faqs_count(); 58 | } 59 | 60 | function column_name( $item ) { 61 | 62 | $base_url = remove_query_arg( 'added' ); 63 | $base_url = remove_query_arg( 'updated', $base_url ); 64 | 65 | $delete_link = add_query_arg( 66 | array( 67 | 'action' => 'delete', 68 | 'category' => (int)$item->cat_id 69 | ), 70 | $base_url 71 | ); 72 | 73 | $set_default_link = add_query_arg( 74 | array( 75 | 'action' => 'set_default', 76 | 'category' => (int)$item->cat_id 77 | ), 78 | $base_url 79 | ); 80 | 81 | $edit_link = add_query_arg( 82 | array( 83 | 'action' => 'edit', 84 | 'category' => (int)$item->cat_id 85 | ), 86 | $base_url 87 | ); 88 | 89 | $actions = array( 90 | 'edit' => sprintf( __( 'Edit', INCSUB_SUPPORT_LANG_DOMAIN ), $edit_link ) 91 | ); 92 | 93 | if ( $item->defcat ) { 94 | return '' . $item->cat_name . ' ' . __( '[Default category]', INCSUB_SUPPORT_LANG_DOMAIN ) . '' . $this->row_actions($actions); 95 | } 96 | else { 97 | $more_actions = array( 98 | 'delete' => sprintf( __( 'Delete', INCSUB_SUPPORT_LANG_DOMAIN ), $delete_link ), 99 | 'set_default' => sprintf( __( 'Set as default', INCSUB_SUPPORT_LANG_DOMAIN ), $set_default_link ) 100 | ); 101 | $actions = array_merge( $actions, $more_actions ); 102 | return '' . $item->cat_name . '' . $this->row_actions($actions); 103 | } 104 | } 105 | 106 | 107 | function get_bulk_actions() { 108 | $actions = array( 109 | 'delete' => __( 'Delete', INCSUB_SUPPORT_LANG_DOMAIN ) 110 | ); 111 | return $actions; 112 | } 113 | 114 | function process_bulk_action() { 115 | if ( 'delete' === $this->current_action() ) { 116 | $categories = array(); 117 | if ( ! empty( $_REQUEST['category'] ) && ! is_array( $_REQUEST['category'] ) ) 118 | $categories = array( absint( $_REQUEST['category'] ) ); 119 | elseif ( is_array( $_REQUEST['category'] ) ) 120 | $categories = array_map( 'absint', $_REQUEST['category'] ); 121 | 122 | foreach ( $categories as $cat_id ) 123 | incsub_support_delete_faq_category( $cat_id ); 124 | } 125 | if ( 'set_default' === $this->current_action() ) { 126 | incsub_support_set_default_faq_category( absint( $_GET['category'] ) ); 127 | } 128 | } 129 | 130 | 131 | 132 | function prepare_items() { 133 | 134 | $this->process_bulk_action(); 135 | 136 | 137 | $per_page = 7; 138 | 139 | $columns = $this->get_columns(); 140 | $hidden = array( 'id' ); 141 | $sortable = $this->get_sortable_columns(); 142 | 143 | $this->_column_headers = array( 144 | $columns, 145 | $hidden, 146 | $sortable 147 | ); 148 | 149 | $current_page = $this->get_pagenum(); 150 | 151 | $args = array( 152 | 'per_page' => $per_page, 153 | 'page' => $current_page 154 | ); 155 | $this->items = incsub_support_get_faq_categories( $args ); 156 | $total_items = incsub_support_get_faq_categories_count( $args ); 157 | 158 | $this->set_pagination_args( array( 159 | 'total_items' => $total_items, 160 | 'per_page' => $per_page, 161 | 'total_pages' => ceil($total_items/$per_page) 162 | ) ); 163 | 164 | } 165 | 166 | } 167 | ?> -------------------------------------------------------------------------------- /admin/inc/class-table-ticket-categories.php: -------------------------------------------------------------------------------- 1 | __( 'Category', INCSUB_SUPPORT_LANG_DOMAIN ), 13 | 'plural' => __( 'Categories', INCSUB_SUPPORT_LANG_DOMAIN ), 14 | 'ajax' => false 15 | ) ); 16 | 17 | } 18 | 19 | function column_default( $item, $column_name ){ 20 | 21 | $value = ''; 22 | switch ( $column_name ) { 23 | default : $value = $item[ $column_name ]; break; 24 | } 25 | return $value; 26 | } 27 | 28 | 29 | function get_columns(){ 30 | $columns = array( 31 | 'cb' => '', 32 | 'id' => __( 'ID', INCSUB_SUPPORT_LANG_DOMAIN ), 33 | 'name' => __( 'Name', INCSUB_SUPPORT_LANG_DOMAIN ), 34 | 'user' => __( 'Assign to user', INCSUB_SUPPORT_LANG_DOMAIN ), 35 | 'tickets' => __( 'Tickets', INCSUB_SUPPORT_LANG_DOMAIN ) 36 | ); 37 | return $columns; 38 | } 39 | 40 | function column_cb($item){ 41 | if ( '0' == $item->defcat ) { 42 | return sprintf( 43 | '', 44 | $this->_args['singular'], 45 | $item->cat_id 46 | ); 47 | } 48 | else { 49 | return ''; 50 | } 51 | } 52 | 53 | function column_id( $item ) { 54 | return $item->cat_id; 55 | } 56 | 57 | function column_name( $item ) { 58 | 59 | $base_url = remove_query_arg( 'added' ); 60 | $base_url = remove_query_arg( 'updated', $base_url ); 61 | 62 | $delete_link = add_query_arg( 63 | array( 64 | 'action' => 'delete', 65 | 'category' => (int)$item->cat_id 66 | ), 67 | $base_url 68 | ); 69 | 70 | $set_default_link = add_query_arg( 71 | array( 72 | 'action' => 'set_default', 73 | 'category' => (int)$item->cat_id 74 | ), 75 | $base_url 76 | ); 77 | 78 | $edit_link = add_query_arg( 79 | array( 80 | 'action' => 'edit', 81 | 'category' => (int)$item->cat_id 82 | ), 83 | $base_url 84 | ); 85 | 86 | $actions = array( 87 | 'edit' => sprintf( __( 'Edit', INCSUB_SUPPORT_LANG_DOMAIN ), $edit_link ) 88 | ); 89 | 90 | if ( $item->defcat ) { 91 | return '' . $item->cat_name . ' ' . __( '[Default category]', INCSUB_SUPPORT_LANG_DOMAIN ) . '' . $this->row_actions($actions); 92 | } 93 | else { 94 | $more_actions = array( 95 | 'delete' => sprintf( __( 'Delete', INCSUB_SUPPORT_LANG_DOMAIN ), $delete_link ), 96 | 'set_default' => sprintf( __( 'Set as default', INCSUB_SUPPORT_LANG_DOMAIN ), $set_default_link ) 97 | ); 98 | $actions = array_merge( $actions, $more_actions ); 99 | return '' . $item->cat_name . '' . $this->row_actions($actions); 100 | } 101 | } 102 | 103 | function column_user( $item ) { 104 | $user_login = __( 'None', INCSUB_SUPPORT_LANG_DOMAIN ); 105 | if ( $user = get_user_by( 'id', $item->user_id ) ) 106 | $user_login = $user->data->user_login; 107 | 108 | return $user_login; 109 | } 110 | 111 | 112 | function column_tickets( $item ) { 113 | return $item->get_tickets_count(); 114 | } 115 | 116 | function get_bulk_actions() { 117 | $actions = array( 118 | 'delete' => __( 'Delete', INCSUB_SUPPORT_LANG_DOMAIN ) 119 | ); 120 | return $actions; 121 | } 122 | 123 | function process_bulk_action() { 124 | if ( 'delete' === $this->current_action() ) { 125 | $categories = array(); 126 | if ( ! empty( $_REQUEST['category'] ) && ! is_array( $_REQUEST['category'] ) ) 127 | $categories = array( absint( $_REQUEST['category'] ) ); 128 | elseif ( is_array( $_REQUEST['category'] ) ) 129 | $categories = array_map( 'absint', $_REQUEST['category'] ); 130 | 131 | foreach ( $categories as $cat_id ) 132 | incsub_support_delete_ticket_category( $cat_id ); 133 | } 134 | if ( 'set_default' === $this->current_action() ) { 135 | incsub_support_set_default_ticket_category( absint( $_GET['category'] ) ); 136 | } 137 | } 138 | 139 | 140 | 141 | function prepare_items() { 142 | 143 | $this->process_bulk_action(); 144 | 145 | 146 | $per_page = 7; 147 | 148 | $columns = $this->get_columns(); 149 | $hidden = array( 'id' ); 150 | $sortable = $this->get_sortable_columns(); 151 | 152 | $this->_column_headers = array( 153 | $columns, 154 | $hidden, 155 | $sortable 156 | ); 157 | 158 | $current_page = $this->get_pagenum(); 159 | 160 | $args = array( 161 | 'per_page' => $per_page, 162 | 'page' => $current_page 163 | ); 164 | $this->items = incsub_support_get_ticket_categories( $args ); 165 | $total_items = incsub_support_get_ticket_categories_count( $args ); 166 | 167 | $this->set_pagination_args( array( 168 | 'total_items' => $total_items, 169 | 'per_page' => $per_page, 170 | 'total_pages' => ceil($total_items/$per_page) 171 | ) ); 172 | 173 | } 174 | 175 | } 176 | ?> -------------------------------------------------------------------------------- /admin/inc/class-table-tickets-history.php: -------------------------------------------------------------------------------- 1 | __( 'Ticket History', INCSUB_SUPPORT_LANG_DOMAIN ), 15 | 'plural' => __( 'Tickets History', INCSUB_SUPPORT_LANG_DOMAIN ), 16 | 'ajax' => false 17 | ) ); 18 | 19 | } 20 | 21 | public function set_ticket( $ticket_id ) { 22 | $this->ticket_id = $ticket_id; 23 | } 24 | 25 | function column_default( $item, $column_name ){ 26 | 27 | $value = ''; 28 | switch ( $column_name ) { 29 | default : $value = $item->$column_name; break; 30 | } 31 | return $value; 32 | } 33 | 34 | 35 | function get_columns(){ 36 | $columns = array( 37 | 'poster' => __( 'Author', INCSUB_SUPPORT_LANG_DOMAIN ), 38 | 'message' => __( 'Ticket Message/Reply', INCSUB_SUPPORT_LANG_DOMAIN ), 39 | ); 40 | 41 | if ( incsub_support_current_user_can( 'insert_faq' ) ) { 42 | $columns['create_faq'] = ''; 43 | } 44 | 45 | return $columns; 46 | } 47 | 48 | public function display() { 49 | 50 | ?> 51 | 52 | 53 | 54 | display_rows_or_placeholder(); ?> 55 | 56 | 57 |
58 | 59 | 60 | 65 | get_poster_id() ); 71 | if ( ! $poster ) 72 | return __( 'Unknown user', INCSUB_SUPPORT_LANG_DOMAIN ); 73 | 74 | if ( function_exists( "get_avatar" ) ) 75 | $avatar = get_avatar( $poster->ID, 32 ); 76 | 77 | return '

' . $avatar . '

' . $poster->data->display_name . '

'; 78 | } 79 | 80 | function column_create_faq( $item ) { 81 | ob_start(); 82 | $link = add_query_arg( 'action', 'create-faq-from-ticket' ); 83 | $link = add_query_arg( 'tid', absint( $this->ticket_id ), $link ); 84 | $link = add_query_arg( 'rid', absint( $item->message_id ), $link ); 85 | $link = wp_nonce_url( $link, 'create-faq-from-ticket-' . $this->ticket_id . '-' . $item->message_id ); 86 | ?> 87 | 89 | 90 | 97 |
message_date ) ); ?>
98 | is_main_reply ): ?> 99 |

subject; ?>

100 | 101 |

message; ?>

102 | attachments ) ): ?> 103 |
104 |

105 | 110 |
111 | 112 | get_columns(); 119 | $hidden = array(); 120 | $sortable = $this->get_sortable_columns(); 121 | 122 | $this->_column_headers = array( 123 | $columns, 124 | $hidden, 125 | $sortable 126 | ); 127 | 128 | $this->items = incsub_support_get_ticket_replies( $this->ticket_id ); 129 | 130 | $total_items = count( $this->items ); 131 | $per_page = $total_items; 132 | 133 | $this->set_pagination_args( array( 134 | 'total_items' => $total_items, 135 | 'per_page' => $per_page, 136 | 'total_pages' => ceil($total_items/$per_page) 137 | ) ); 138 | 139 | } 140 | 141 | } 142 | ?> -------------------------------------------------------------------------------- /admin/inc/tinymce-shortcodes-i18n.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | render_row( 'Question', ob_get_clean() ); ?> 8 | 9 | render_row( __( 'FAQ Category', INCSUB_SUPPORT_LANG_DOMAIN ), $categories_dropdown ); ?> 10 | 11 | 12 | true ) ); ?> 13 | render_row( 'Answer', ob_get_clean() ); ?> 14 | 15 |
16 | 17 |

18 | 19 | 20 | 21 |

22 |
23 | -------------------------------------------------------------------------------- /admin/views/add-new-ticket.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 |

6 | 7 |
8 | 9 | render_row( __( 'Subject', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 10 | 11 | render_row( __( 'Category', INCSUB_SUPPORT_LANG_DOMAIN ), $categories_dropdown ); ?> 12 | render_row( __( 'Priority', INCSUB_SUPPORT_LANG_DOMAIN ), $priorities_dropdown ); ?> 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | true ) ); ?> 21 | render_row( __( 'Problem description', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 22 | 23 | 24 |
25 | render_row( __( 'Attachments', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 26 | 27 | 28 | 29 | 30 |
31 |

32 | 33 | 34 | 35 |

36 |
37 | 38 | 52 | -------------------------------------------------------------------------------- /admin/views/admin-faq.php: -------------------------------------------------------------------------------- 1 | 21 | 22 |
23 |
24 |

25 |
26 |
27 |

28 |
29 | 30 | 31 | 32 |
33 |
34 | 41 | 48 |
49 |
50 |
51 |
52 | 53 |
54 | 55 |
56 | answers as $faq ): ?> 57 |
58 |

59 |

question; ?>

60 |
61 | answer ); 70 | $answer = apply_filters( 'the_content', $answer ); 71 | ?> 72 | 73 |
74 | 75 |

76 |

77 | faq_id . '" data-vote="yes"> ' . __( 'Yes', INCSUB_SUPPORT_LANG_DOMAIN ) . ' '; ?> 78 | 79 |

80 |
81 |
82 |
83 | 84 |
85 | 86 |
87 | 88 | 93 | -------------------------------------------------------------------------------- /admin/views/edit-faq-category.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 | 5 |
6 | 7 | 8 | 9 | render_row( __( 'Category name', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 10 |
11 | 12 | cat_id, '_wpnonce' ); ?> 13 | 14 |
-------------------------------------------------------------------------------- /admin/views/edit-faq.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | render_row( 'Question', ob_get_clean() ); ?> 8 | 9 | render_row( __( 'FAQ Category', INCSUB_SUPPORT_LANG_DOMAIN ), $categories_dropdown ); ?> 10 | 11 | 12 | true ) ); ?> 13 | render_row( 'Answer', ob_get_clean() ); ?> 14 | 15 |
16 | 17 |

18 | 19 | faq_id ); ?> 20 | 21 | 22 |

23 |
24 | -------------------------------------------------------------------------------- /admin/views/edit-ticket-category.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 | 5 |
6 | 7 | 8 | 9 | render_row( __( 'Category name', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 10 | render_row( __( 'Assign to user', INCSUB_SUPPORT_LANG_DOMAIN ), $super_admins_dropdown ); ?> 11 |
12 | 13 | cat_id, '_wpnonce' ); ?> 14 | 15 |
-------------------------------------------------------------------------------- /admin/views/edit-ticket-details-metabox.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /admin/views/edit-ticket-history-metabox.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/admin/views/edit-ticket-history-metabox.php -------------------------------------------------------------------------------- /admin/views/edit-ticket-history.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 |

8 | 9 |
10 | 11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | true, 'quicktags' => array() ) ); ?> 20 | 21 | 22 | 23 |
24 | render_row( __( 'Attachments', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 25 | render_row(__( 'Category', INCSUB_SUPPORT_LANG_DOMAIN ), $categories_dropdown ); ?> 26 | render_row(__( 'Priority', INCSUB_SUPPORT_LANG_DOMAIN ), $priorities_dropdown ); ?> 27 | 28 | 29 | 30 | 31 | 43 | render_row(__( 'Ticket Responsibility', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 44 | 45 | 46 | 47 | 48 | ticket_id ) ): ?> 49 | 50 | 53 | 54 | render_row(__( "Close Ticket?", INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 55 | 56 | 57 | 58 | ticket_id ); ?> 59 |
60 |

61 | 62 |

63 | 64 |
65 | 66 |
67 | 68 | 82 | -------------------------------------------------------------------------------- /admin/views/edit-ticket-update-metabox.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 11 | 12 | 13 | ticket_id ); ?> 14 | 15 |
16 | 17 |
18 |
19 |
20 |
21 | -------------------------------------------------------------------------------- /admin/views/network-faq-categories.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 |

5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 |
13 | display(); ?> 14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |

22 |
23 | 24 |
25 | 26 |
27 |

28 |
29 | 30 |
31 |
32 |
33 |
34 |
-------------------------------------------------------------------------------- /admin/views/network-faqs.php: -------------------------------------------------------------------------------- 1 |
2 | search_box( __( 'Search FAQs', INCSUB_SUPPORT_LANG_DOMAIN ), 's' ); ?> 3 | display(); ?> 4 |
-------------------------------------------------------------------------------- /admin/views/network-settings-front.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

5 |
6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | /> 14 | render_row( __( 'Activate Front End', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 15 |
16 | 17 |
18 | 19 | 20 | 21 | /> 22 | render_row( __( 'Use Support System styles', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 23 | 24 | 25 | 26 | 27 | 28 | render_row( __( 'Blog ID', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 29 | 30 | 31 | 32 | render_row( __( 'Support Page', INCSUB_SUPPORT_LANG_DOMAIN ), $support_pages_dropdown ); ?> 33 | render_row( __( 'Submit new ticket Page', INCSUB_SUPPORT_LANG_DOMAIN ), $submit_ticket_pages_dropdown ); ?> 34 | render_row( __( 'FAQs Page', INCSUB_SUPPORT_LANG_DOMAIN ), $faqs_pages_dropdown ); ?> 35 | 36 |
37 | 38 | 39 |
40 | 41 | 42 | 43 | render_submit_block(); ?> 44 |
45 | 59 | 95 | -------------------------------------------------------------------------------- /admin/views/network-settings-general.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

5 |
6 | 7 | 8 | 9 |
10 | 11 | 14 | 15 | 16 | render_row( __( 'Support menu name', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); 18 | 19 | ob_start(); 20 | ?> 21 | 22 | 23 | render_row( __( 'Support from name', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); 25 | 26 | ob_start(); 27 | ?> 28 | 29 | 30 | render_row( __( 'Support from e-mail', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); 32 | 33 | ob_start(); 34 | ?> 35 | 36 | 37 | render_row( __( 'Main Administrator', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 38 |
39 | 40 |

41 | 42 | 43 | 44 | 45 | $value ): if( $key == 'support-guest' ) continue; ?> 46 | 49 | 50 | 51 | render_row( __( 'User roles that can open/see tickets.', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); 52 | 53 | ob_start(); 54 | ?> 55 | $value ): ?> 56 | 59 | 60 | 61 | render_row( __( 'User roles that can see the FAQs (uncheck all if you want to disable this feature)', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 62 | 63 |
64 | 65 | 66 |

67 | 68 | 69 | 74 | render_row( __( 'Privacy', INCSUB_SUPPORT_LANG_DOMAIN ), ob_get_clean() ); ?> 75 |
76 | 77 | 78 | 79 | 80 | render_submit_block(); ?> 81 |
-------------------------------------------------------------------------------- /admin/views/network-settings-tabs.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 |

10 | -------------------------------------------------------------------------------- /admin/views/network-ticket-categories.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 | display(); ?> 12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |

20 |
21 | 22 |
23 | 24 |
25 |

26 |
27 |
28 | 29 | 30 |

31 |
32 | 33 |
34 |
35 |
36 |
37 |
-------------------------------------------------------------------------------- /admin/views/network-tickets.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | -------------------------------------------------------------------------------- /admin/views/ticket-status-links.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /admin/views/tickets-table-form.php: -------------------------------------------------------------------------------- 1 |
2 | search_box( __( 'Search tickets', INCSUB_SUPPORT_LANG_DOMAIN ), 's' ); ?> 3 | display(); ?> 4 |
-------------------------------------------------------------------------------- /admin/views/welcome.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 |
5 | 6 |
7 | 8 |
9 | 10 |

11 | 12 | 13 |

14 | 15 |
16 |
17 |
18 |

19 |
20 |
21 |
22 | 23 |
24 |
25 |
26 |

Foundation 5.', INCSUB_SUPPORT_LANG_DOMAIN ), 'http://foundation.zurb.com/' ); ?>

27 |

28 |

Pro Sites integration, which allows any kind of Pro user with any assigned level to see your FAQs!', INCSUB_SUPPORT_LANG_DOMAIN ); ?>

29 |
30 |
31 | 32 |
33 |
34 |
35 | 36 |
37 | 38 |
39 |
40 |

41 | 42 |

43 |
44 |
45 |

46 | 47 |

48 |
49 |
50 |

51 |

52 |
53 |
54 | 55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 | -------------------------------------------------------------------------------- /assets/css/admin-bar.css: -------------------------------------------------------------------------------- 1 | #wpadminbar #wp-admin-bar-support-system-edit-ticket > .ab-item:before { 2 | content: "\f468"; 3 | top: 2px; 4 | } 5 | 6 | #wpadminbar #wp-admin-bar-support-system-edit-ticket { 7 | cursor:pointer; 8 | } -------------------------------------------------------------------------------- /assets/css/single-ticket-menu.css: -------------------------------------------------------------------------------- 1 | th#poster { 2 | width:200px; 3 | vertical-align:middle; 4 | } 5 | th#message { 6 | width:65%; 7 | } 8 | th#date { 9 | width:15%; 10 | } 11 | th#create_faq { 12 | width:10%; 13 | } 14 | td.column-message h4 { 15 | margin-top:0; 16 | } 17 | -------------------------------------------------------------------------------- /assets/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/assets/images/ajax-loader.gif -------------------------------------------------------------------------------- /assets/images/fi-minus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /assets/images/fi-plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /assets/images/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/assets/images/icon32.png -------------------------------------------------------------------------------- /assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/assets/images/icons.png -------------------------------------------------------------------------------- /assets/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/assets/images/spinner.gif -------------------------------------------------------------------------------- /assets/images/staff.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/assets/images/staff.gif -------------------------------------------------------------------------------- /assets/images/user.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/support-system/452011e6deb62f408b08849c5c5571feefbc1288/assets/images/user.gif -------------------------------------------------------------------------------- /assets/js/foundation-init.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | $(document).foundation(); 3 | }); -------------------------------------------------------------------------------- /assets/js/settings.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | $( '#fetch_imap' ).change( function() { 3 | if ( $(this).val() == 'enabled' ) 4 | $('.imap-settings').attr('disabled',false); 5 | else 6 | $('.imap-settings').attr('disabled',true); 7 | }); 8 | 9 | var pro_sites_check = $('#pro_sites'); 10 | incsub_support_toggle_level_select( pro_sites_check ); 11 | pro_sites_check.change( function() { 12 | incsub_support_toggle_level_select( $(this) ); 13 | }); 14 | 15 | var pro_sites_check_faq = $('#pro_sites_faq'); 16 | incsub_support_toggle_level_select( pro_sites_check_faq ); 17 | pro_sites_check_faq.change( function() { 18 | incsub_support_toggle_level_select( $(this) ); 19 | }); 20 | 21 | function incsub_support_toggle_level_select( element ) { 22 | var select_name = element.attr('name') + '_levels'; 23 | if ( ! element.is(':checked') ) 24 | $('select[name="' + select_name + '"]').attr('disabled',true); 25 | else 26 | $('select[name="' + select_name + '"]').attr('disabled',false); 27 | } 28 | }); -------------------------------------------------------------------------------- /assets/js/support-system-init.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | $('#support-system').support_system({ 3 | attachments: { 4 | container_selector: '.support-system-attachments', 5 | button_text: support_system_i18n.button_text, 6 | button_class: 'button tiny success', 7 | remove_file_title: support_system_i18n.remove_file_title, 8 | remove_link_class: "button tiny alert", 9 | remove_link_text: support_system_i18n.remove_link_text, 10 | description: support_system_i18n.desc 11 | } 12 | }); 13 | 14 | }); -------------------------------------------------------------------------------- /assets/js/support-system.min.js: -------------------------------------------------------------------------------- 1 | !function(t,e,i,s){"use strict";e.Support_System={name:"Support System",version:"2.0",libs:{},init:function(t,e){this.scope=t||this.scope;for(var i in this.libs)this.init_lib(i,e);return t},init_lib:function(e,i){return this.libs.hasOwnProperty(e)?i&&i.hasOwnProperty(e)?("undefined"!=typeof this.libs[e].settings?t.extend(!0,this.libs[e].settings,i[e]):"undefined"!=typeof this.libs[e].defaults&&t.extend(!0,this.libs[e].defaults,i[e]),this.libs[e].init.apply(this.libs[e],[this.scope,i[e]])):(i=i instanceof Array?i:new Array(i),this.libs[e].init.apply(this.libs[e],i)):function(){}}},t.fn.support_system=function(){var t=Array.prototype.slice.call(arguments,0);return this.each(function(){return Support_System.init.apply(Support_System,[this].concat(t)),this})}}(jQuery,window,window.document),function(t,e,i,s){Support_System.libs.filter={name:"Support System Filter",version:"2.0",init:function(){var e=t('input[name="support-system-submit-filter"]'),i=t(".cat-id"),s=t("#support-system-filter");return s.length&&i.length&&e.length?(i.change(function(e){e.preventDefault(),$this=t(this),$this.closest("form").submit()}),void e.hide()):function(){}}}}(jQuery,window,window.document),function(t,e,i,s){Support_System.libs.attachments={name:"Support System Attachments",version:"2.0",defaults:{container_selector:"",button_text:"Add files...",button_class:"",first_slot:0,slot_name:"support-attachment",current_files:[],files_list_id:"support-attachments-list",remove_file_title:"Remove file",remove_link_class:"",remove_link_text:"[x]",description:""},init:function(e,i){var s=this;this.settings=this.settings||t.extend({},this.defaults,i);var n=this.settings,a=t(this.settings.container_selector);if(!a.length)return!1;var r=n.first_slot;return a.each(function(){var e=t("