Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 295
0.00% covered (danger)
0.00%
0 / 9
CRAP
n/a
0 / 0
zeroBSCRM_render_customerslist_page
0.00% covered (danger)
0.00%
0 / 41
0.00% covered (danger)
0.00%
0 / 1
12
zeroBSCRM_render_companyslist_page
0.00% covered (danger)
0.00%
0 / 26
0.00% covered (danger)
0.00%
0 / 1
2
zeroBSCRM_render_quoteslist_page
0.00% covered (danger)
0.00%
0 / 36
0.00% covered (danger)
0.00%
0 / 1
2
zeroBSCRM_render_invoiceslist_page
0.00% covered (danger)
0.00%
0 / 33
0.00% covered (danger)
0.00%
0 / 1
2
zeroBSCRM_render_transactionslist_page
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 1
2
zeroBSCRM_render_formslist_page
0.00% covered (danger)
0.00%
0 / 32
0.00% covered (danger)
0.00%
0 / 1
6
zeroBSCRM_render_segmentslist_page
0.00% covered (danger)
0.00%
0 / 47
0.00% covered (danger)
0.00%
0 / 1
12
zeroBSCRM_render_quotetemplateslist_page
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 1
2
zeroBSCRM_render_tasks_list_page
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 1
2
1<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase
2
3/*
4 * Jetpack CRM
5 * https://jetpackcrm.com
6 * V1.0
7 *
8 * Copyright 2020 Automattic
9 *
10 * Date: 26/05/16
11 */
12
13// prevent direct access
14if ( ! defined( 'ZEROBSCRM_PATH' ) ) {
15    exit( 0 );
16}
17
18/**
19 * Renders the html for the contact list.
20 *
21 * @return void
22 */
23function zeroBSCRM_render_customerslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
24    global $zbs;
25
26    // has no sync ext? Sell them
27    $upsell_box_html = '';
28
29    // extra_js:
30    $status_array = $zbs->settings->get( 'customisedfields' )['customers']['status'];
31    $statuses     = is_array( $status_array ) && isset( $status_array[1] ) ? explode( ',', $status_array[1] ) : array();
32    $extra_js     = 'var zbsStatusesForBulkActions = ' . wp_json_encode( $statuses ) . ';';
33
34    // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
35    // Messages:
36    // All messages need params to match this func:
37    // ... zeroBSCRM_UI2_messageHTML($msgClass='',$msgHeader='',$msg='',$iconClass='',$id='')
38    $messages = array();
39
40    $list = new zeroBSCRM_list(
41        array(
42
43            'objType'     => 'customer',
44            'singular'    => esc_html__( 'Contact', 'zero-bs-crm' ),
45            'plural'      => esc_html__( 'Contacts', 'zero-bs-crm' ),
46            'tag'         => 'zerobscrm_customertag',
47            'postType'    => 'zerobs_customer',
48            'postPage'    => 'manage-customers',
49            'langLabels'  => array(
50
51                // bulk action labels
52                'deletecontacts'       => esc_html__( 'Delete Contact(s)', 'zero-bs-crm' ),
53                'merge'                => esc_html__( 'Merge Contacts', 'zero-bs-crm' ),
54                'export'               => esc_html__( 'Export Contact(s)', 'zero-bs-crm' ),
55                'changestatus'         => esc_html__( 'Change Status', 'zero-bs-crm' ),
56
57                // bulk actions - change status
58                'statusupdated'        => esc_html__( 'Statuses Updated', 'zero-bs-crm' ),
59                'statusnotupdated'     => esc_html__( 'Could not update statuses!', 'zero-bs-crm' ),
60
61                // bulk actions - contact deleting
62                'andthese'             => esc_html__( 'Shall I also delete the associated Invoices, Quotes, Transactions, and Tasks?', 'zero-bs-crm' ),
63                'contactsdeleted'      => esc_html__( 'Your contact(s) have been deleted.', 'zero-bs-crm' ),
64                'notcontactsdeleted'   => esc_html__( 'Your contact(s) could not be deleted.', 'zero-bs-crm' ),
65
66                // bulk actions - add/remove tags
67                /* translators: placeholder is a link to add a new object tag */
68                'notags'               => wp_kses( sprintf( __( 'You do not have any contact tags. Do you want to <a target="_blank" href="%s">add a tag</a>?', 'zero-bs-crm' ), jpcrm_esc_link( 'tags', -1, 'zerobs_customer', false, 'contact' ) ), $zbs->acceptable_restricted_html ),
69
70                // bulk actions - merge 2 records
71                'areyousurethesemerge' => esc_html__( 'Are you sure you want to merge these two contacts into one record? There is no way to undo this action.', 'zero-bs-crm' ) . '<br />',
72                'whichdominant'        => esc_html__( 'Which is the "master" record (main record)?', 'zero-bs-crm' ),
73
74                'contactsmerged'       => esc_html__( 'Contacts Merged', 'zero-bs-crm' ),
75                'contactsnotmerged'    => esc_html__( 'Contacts could not be successfully merged', 'zero-bs-crm' ),
76
77                // tel
78                'telhome'              => esc_html__( 'Home', 'zero-bs-crm' ),
79                'telwork'              => esc_html__( 'Work', 'zero-bs-crm' ),
80                'telmob'               => esc_html__( 'Mobile', 'zero-bs-crm' ),
81
82            ),
83            'bulkActions' => array( 'changestatus', 'delete', 'addtag', 'removetag', 'merge', 'export' ),
84            'unsortables' => array( 'tagged', 'editlink', 'phonelink' ),
85            'extraBoxes'  => $upsell_box_html,
86            'extraJS'     => $extra_js,
87            'messages'    => $messages,
88        )
89    );
90
91    $list->drawListView();
92}
93
94/**
95 * Renders the html for the companies list.
96 *
97 * @return void
98 */
99function zeroBSCRM_render_companyslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
100
101    global $zbs;
102
103    $list = new zeroBSCRM_list(
104        array(
105
106            'objType'     => 'company',
107            'singular'    => esc_html( jpcrm_label_company() ),
108            'plural'      => esc_html( jpcrm_label_company( true ) ),
109            'tag'         => 'zerobscrm_companytag',
110            'postType'    => 'zerobs_company',
111            'postPage'    => 'manage-companies',
112            'langLabels'  => array(
113
114                // bulk action labels
115                /* translators: placeholder is the company label */
116                'deletecompanys'     => esc_html( sprintf( __( 'Delete %s(s)', 'zero-bs-crm' ), jpcrm_label_company() ) ),
117                'addtags'            => esc_html__( 'Add tag(s)', 'zero-bs-crm' ),
118                'removetags'         => esc_html__( 'Remove tag(s)', 'zero-bs-crm' ),
119                'export'             => esc_html__( 'Export', 'zero-bs-crm' ),
120
121                // bulk actions - company deleting
122                'andthese'           => esc_html__( 'Shall I also delete the associated Contacts, Invoices, Quotes, Transactions, and Tasks? (This cannot be undone!)', 'zero-bs-crm' ),
123                'companysdeleted'    => esc_html__( 'Your company(s) have been deleted.', 'zero-bs-crm' ),
124                'notcompanysdeleted' => esc_html__( 'Your company(s) could not be deleted.', 'zero-bs-crm' ),
125
126                // bulk actions - add/remove tags
127                /* translators: placeholder is a link to add a new object tag */
128                'notags'             => wp_kses( sprintf( __( 'You do not have any company tags. Do you want to <a target="_blank" href="%s">add a tag</a>?', 'zero-bs-crm' ), jpcrm_esc_link( 'tags', -1, 'zerobs_company', false, 'company' ) ), $zbs->acceptable_restricted_html ),
129
130            ),
131            'bulkActions' => array( 'delete', 'addtag', 'removetag', 'export' ),
132            // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
133            // default 'sortables'     => array('id'),
134            // default 'unsortables'   => array('tagged','latestlog','editlink','phonelink')
135        )
136    );
137
138    $list->drawListView();
139}
140
141/**
142 * Renders the html for the quotes list.
143 *
144 * @return void
145 */
146function zeroBSCRM_render_quoteslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
147
148    global $zbs;
149    $list = new zeroBSCRM_list(
150        array(
151
152            'objType'     => 'quote',
153            'singular'    => esc_html__( 'Quote', 'zero-bs-crm' ),
154            'plural'      => esc_html__( 'Quotes', 'zero-bs-crm' ),
155            'tag'         => '',
156            'postType'    => 'zerobs_quote',
157            'postPage'    => 'manage-quotes',
158            'langLabels'  => array(
159
160                'markaccepted'             => esc_html__( 'Mark Accepted', 'zero-bs-crm' ),
161                'markunaccepted'           => esc_html__( 'Unmark Accepted', 'zero-bs-crm' ),
162                'delete'                   => esc_html__( 'Delete Quote(s)', 'zero-bs-crm' ),
163                'export'                   => esc_html__( 'Export Quote(s)', 'zero-bs-crm' ),
164                'andthese'                 => esc_html__( 'Shall I also delete the associated Invoices, Quotes, Transactions, and Tasks?', 'zero-bs-crm' ),
165                'quotesdeleted'            => esc_html__( 'Your quote(s) have been deleted.', 'zero-bs-crm' ),
166                'notquotesdeleted'         => esc_html__( 'Your quote(s) could not be deleted.', 'zero-bs-crm' ),
167                'acceptareyousurequotes'   => esc_html__( 'Are you sure you want to mark these quotes as accepted?', 'zero-bs-crm' ),
168                'acceptdeleted'            => esc_html__( 'Quote(s) Accepted', 'zero-bs-crm' ),
169                'acceptquotesdeleted'      => esc_html__( 'Your quote(s) have been marked accepted.', 'zero-bs-crm' ),
170                'acceptnotdeleted'         => esc_html__( 'Could not mark accepted!', 'zero-bs-crm' ),
171                'acceptnotquotesdeleted'   => esc_html__( 'Your quote(s) could not be marked accepted.', 'zero-bs-crm' ),
172                'unacceptareyousurethese'  => esc_html__( 'Are you sure you want to mark these quotes as unaccepted?', 'zero-bs-crm' ),
173                'unacceptdeleted'          => esc_html__( 'Quote(s) Unaccepted', 'zero-bs-crm' ),
174                'unacceptquotesdeleted'    => esc_html__( 'Your quote(s) have been marked unaccepted.', 'zero-bs-crm' ),
175                'unacceptnotdeleted'       => esc_html__( 'Could not mark unaccepted!', 'zero-bs-crm' ),
176                'unacceptnotquotesdeleted' => esc_html__( 'Your quote(s) could not be marked unaccepted.', 'zero-bs-crm' ),
177                /* translators: placeholder is a link to add a new object tag */
178                'notags'                   => wp_kses( sprintf( __( 'You do not have any quote tags. Do you want to <a target="_blank" href="%s">add a tag</a>?', 'zero-bs-crm' ), jpcrm_esc_link( 'tags', -1, 'zerobs_quote', false, 'quote' ) ), $zbs->acceptable_restricted_html ),
179
180            ),
181            'bulkActions' => array( 'markaccepted', 'markunaccepted', 'addtag', 'removetag', 'delete', 'export' ),
182
183            // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
184            // default 'sortables'     => array('id'),
185            // default 'unsortables'   => array('tagged','latestlog','editlink','phonelink')
186        )
187    );
188
189    $list->drawListView();
190}
191
192/**
193 * Renders the html for the invoices list.
194 *
195 * @return void
196 */
197function zeroBSCRM_render_invoiceslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
198    global $zbs;
199
200    $upsell_box_html = '';
201
202    $list = new zeroBSCRM_list(
203        array(
204            'objType'     => 'invoice',
205            'singular'    => esc_html__( 'Invoice', 'zero-bs-crm' ),
206            'plural'      => esc_html__( 'Invoices', 'zero-bs-crm' ),
207            'tag'         => '',
208            'postType'    => 'zerobs_invoice',
209            'postPage'    => 'manage-invoices',
210            'langLabels'  =>
211                array(
212                    // bulk action labels
213                    'delete'                   => esc_html__( 'Delete Invoice(s)', 'zero-bs-crm' ),
214                    'export'                   => esc_html__( 'Export Invoice(s)', 'zero-bs-crm' ),
215
216                    // bulk actions - invoice deleting
217                    'invoicesdeleted'          => esc_html__( 'Your invoice(s) have been deleted.', 'zero-bs-crm' ),
218                    'notinvoicesdeleted'       => esc_html__( 'Your invoice(s) could not be deleted.', 'zero-bs-crm' ),
219
220                    // bulk actions - invoice status update
221                    'statusareyousurethese'    => esc_html__( 'Are you sure you want to change the status on marked invoice(s)?', 'zero-bs-crm' ),
222                    'statusupdated'            => esc_html__( 'Invoice(s) Updated', 'zero-bs-crm' ),
223                    'statusinvoicesupdated'    => esc_html__( 'Your invoice(s) have been updated.', 'zero-bs-crm' ),
224                    'statusnotupdated'         => esc_html__( 'Could not update invoice!', 'zero-bs-crm' ),
225                    'statusnotinvoicesupdated' => esc_html__( 'Your invoice(s) could not be updated', 'zero-bs-crm' ),
226                    'statusdraft'              => esc_html__( 'Draft', 'zero-bs-crm' ),
227                    'statusunpaid'             => esc_html__( 'Unpaid', 'zero-bs-crm' ),
228                    'statuspaid'               => esc_html__( 'Paid', 'zero-bs-crm' ),
229                    'statusoverdue'            => esc_html__( 'Overdue', 'zero-bs-crm' ),
230                    'statusdeleted'            => esc_html__( 'Deleted', 'zero-bs-crm' ),
231
232                    // bulk actions - add/remove tags
233                    /* translators: placeholder is a link to add a new object tag */
234                    'notags'                   => wp_kses( sprintf( __( 'You do not have any invoice tags. Do you want to <a target="_blank" href="%s">add a tag</a>?', 'zero-bs-crm' ), jpcrm_esc_link( 'tags', -1, 'zerobs_invoice', false, 'invoice' ) ), $zbs->acceptable_restricted_html ),
235                ),
236            'bulkActions' => array( 'changestatus', 'addtag', 'removetag', 'delete', 'export' ),
237            'extraBoxes'  => $upsell_box_html,
238        )
239    );
240
241    $list->drawListView();
242}
243
244/**
245 * Renders the html for the transactions list.
246 *
247 * @return void
248 */
249function zeroBSCRM_render_transactionslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
250
251    global $zbs;
252    $list = new zeroBSCRM_list(
253        array(
254
255            'objType'     => 'transaction',
256            'singular'    => esc_html__( 'Transaction', 'zero-bs-crm' ),
257            'plural'      => esc_html__( 'Transactions', 'zero-bs-crm' ),
258            'tag'         => 'zerobscrm_transactiontag',
259            'postType'    => 'zerobs_transaction',
260            'postPage'    => 'manage-transactions',
261            'langLabels'  => array(
262
263                // bulk action labels
264                'delete'                  => esc_html__( 'Delete Transaction(s)', 'zero-bs-crm' ),
265                'export'                  => esc_html__( 'Export Transaction(s)', 'zero-bs-crm' ),
266
267                // bulk actions - add/remove tags
268                /* translators: placeholder is a link to add a new object tag */
269                'notags'                  => wp_kses( sprintf( __( 'You do not have any transaction tags. Do you want to <a target="_blank" href="%s">add a tag</a>?', 'zero-bs-crm' ), jpcrm_esc_link( 'tags', -1, 'zerobs_transaction', false, 'transaction' ) ), $zbs->acceptable_restricted_html ),
270
271                // statuses
272                'trans_status_cancelled'  => esc_html__( 'Cancelled', 'zero-bs-crm' ),
273                'trans_status_hold'       => esc_html__( 'Hold', 'zero-bs-crm' ),
274                'trans_status_pending'    => esc_html__( 'Pending', 'zero-bs-crm' ),
275                'trans_status_processing' => esc_html__( 'Processing', 'zero-bs-crm' ),
276                'trans_status_refunded'   => esc_html__( 'Refunded', 'zero-bs-crm' ),
277                'trans_status_failed'     => esc_html__( 'Failed', 'zero-bs-crm' ),
278                'trans_status_completed'  => esc_html__( 'Completed', 'zero-bs-crm' ),
279                'trans_status_succeeded'  => esc_html__( 'Succeeded', 'zero-bs-crm' ),
280
281            ),
282            'bulkActions' => array( 'addtag', 'removetag', 'delete', 'export' ),
283            'sortables'   => array( 'id' ),
284            'unsortables' => array( 'tagged', 'latestlog', 'editlink', 'phonelink' ),
285        )
286    );
287
288    $list->drawListView();
289}
290
291/**
292 * Renders the html for the forms list.
293 *
294 * @return void
295 */
296function zeroBSCRM_render_formslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
297
298    // has no sync ext? Sell them
299    $upsell_box_html = '';
300
301    // has sync ext? Give feedback
302    if ( ! zeroBSCRM_hasPaidExtensionActivated() ) {
303
304        ##WLREMOVE
305        // first build upsell box html
306        $upsell_box_html  = '<!-- Forms PRO box --><div class="">';
307        $upsell_box_html .= '<h4>' . esc_html__( 'Need More Complex Forms?', 'zero-bs-crm' ) . '</h4>';
308
309        $up_title  = esc_html__( 'Fully Flexible Forms', 'zero-bs-crm' );
310        $up_desc   = esc_html__( 'Jetpack CRM forms cover simple use contact and subscription forms, but if you need more we suggest using a form plugin like Contact Form 7 or Gravity Forms:', 'zero-bs-crm' );
311        $up_button = esc_html__( 'See Full Form Options', 'zero-bs-crm' );
312        $up_target = 'https://jetpackcrm.com/feature/forms/#benefit';
313
314        $upsell_box_html .= zeroBSCRM_UI2_squareFeedbackUpsell( $up_title, $up_desc, $up_button, $up_target );
315
316        $upsell_box_html .= '</div><!-- / Inv Forms box -->';
317        ##/WLREMOVE
318    }
319
320    $list = new zeroBSCRM_list(
321        array(
322
323            'objType'     => 'form',
324            'singular'    => esc_html__( 'Form', 'zero-bs-crm' ),
325            'plural'      => esc_html__( 'Forms', 'zero-bs-crm' ),
326            'tag'         => '',
327            'postType'    => 'zerobs_form',
328            'postPage'    => 'manage-forms',
329            'langLabels'  => array(
330
331                'naked'           => esc_html__( 'Naked', 'zero-bs-crm' ),
332                'cgrab'           => esc_html__( 'Content Grab', 'zero-bs-crm' ),
333                'simple'          => esc_html__( 'Simple', 'zero-bs-crm' ),
334
335                // bulk action labels
336                'delete'          => esc_html__( 'Delete Form(s)', 'zero-bs-crm' ),
337                'export'          => esc_html__( 'Export Form(s)', 'zero-bs-crm' ),
338
339                // bulk actions - deleting
340                'formsdeleted'    => esc_html__( 'Your form(s) have been deleted.', 'zero-bs-crm' ),
341                'notformsdeleted' => esc_html__( 'Your form(s) could not be deleted.', 'zero-bs-crm' ),
342
343            ),
344            'bulkActions' => array( 'delete' ),
345            // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
346            // default 'sortables'     => array('id'),
347            // default 'unsortables'   => array('tagged','latestlog','editlink','phonelink')
348            'extraBoxes'  => $upsell_box_html,
349        )
350    );
351
352    $list->drawListView();
353}
354
355/**
356 * Renders the html for the segments list.
357 *
358 * @return void
359 */
360function zeroBSCRM_render_segmentslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
361
362    global $zbs;
363
364    // Check that our segment conditions are all still available
365    // (checking here allows us to expose errors on the list view if there are any)
366    jpcrm_segments_compare_available_conditions_to_prev();
367
368    // has no sync ext? Sell them
369    $upsell_box_html = '';
370
371    if ( ! zeroBSCRM_isExtensionInstalled( 'advancedsegments' ) ) {
372
373        // first build upsell box html
374        $upsell_box_html  = '<div class="">';
375        $upsell_box_html .= '<h4>' . esc_html__( 'Using Segments?', 'zero-bs-crm' ) . '</h4>';
376
377        $up_title  = esc_html__( 'Segment like a PRO', 'zero-bs-crm' );
378        $up_desc   = esc_html__( 'Did you know that we\'ve made segments more advanced?', 'zero-bs-crm' );
379        $up_button = esc_html__( 'See Advanced Segments', 'zero-bs-crm' );
380        $up_target = $zbs->urls['advancedsegments'];
381
382        $upsell_box_html .= zeroBSCRM_UI2_squareFeedbackUpsell( $up_title, $up_desc, $up_button, $up_target );
383
384        $upsell_box_html .= '</div>';
385
386    } else {
387
388        // later this can point to https://kb.jetpackcrm.com/knowledge-base/how-to-get-customers-into-zero-bs-crm/
389
390        $upsell_box_html  = '<div class="">';
391        $upsell_box_html .= '<h4>' . esc_html__( 'Got Feedback?', 'zero-bs-crm' ) . ':</h4>';
392
393        $up_title  = esc_html__( 'Enjoying segments?', 'zero-bs-crm' );
394        $up_desc   = esc_html__( 'As we grow Jetpack CRM, we\'re looking for feedback!', 'zero-bs-crm' );
395        $up_button = esc_html__( 'Send Feedback', 'zero-bs-crm' );
396        $up_target = "mailto:hello@jetpackcrm.com?subject='Segments%20Feedback'";
397
398        $upsell_box_html .= zeroBSCRM_UI2_squareFeedbackUpsell( $up_title, $up_desc, $up_button, $up_target );
399
400        $upsell_box_html .= '</div>';
401
402    }
403
404    // pass this for filter links
405    $extra_js = '';
406    if ( zeroBSCRM_getSetting( 'filtersfromsegments' ) == '1' ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
407        $extra_js = " var zbsSegmentViewStemURL = '" . jpcrm_esc_link( $zbs->slugs['managecontacts'] ) . '&quickfilters=segment_' . "';";
408    }
409
410    $list = new zeroBSCRM_list(
411        array(
412
413            'objType'     => 'segment',
414            'singular'    => esc_html__( 'Segment', 'zero-bs-crm' ),
415            'plural'      => esc_html__( 'Segments', 'zero-bs-crm' ),
416            'tag'         => '',
417            'postType'    => 'segment',
418            'postPage'    => $zbs->slugs['segments'],
419            'langLabels'  => array(
420
421                // compiled language
422                'lastCompiled'       => esc_html__( 'Last Compiled', 'zero-bs-crm' ),
423                'notCompiled'        => esc_html__( 'Not Compiled', 'zero-bs-crm' ),
424
425                // bulk action labels
426                'deletesegments'     => esc_html__( 'Delete Segment(s)', 'zero-bs-crm' ),
427                'export'             => esc_html__( 'Export Segment(s)', 'zero-bs-crm' ),
428
429                // bulk actions - segment deleting
430                'segmentsdeleted'    => esc_html__( 'Your segment(s) have been deleted.', 'zero-bs-crm' ),
431                'notsegmentsdeleted' => esc_html__( 'Your segment(s) could not be deleted.', 'zero-bs-crm' ),
432
433                // export segment
434                'exportcsv'          => esc_html__( 'Export .CSV', 'zero-bs-crm' ),
435
436            ),
437            'bulkActions' => array( 'delete' ),
438            // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
439            // 'sortables'   => array('id'),
440            'unsortables' => array( 'audiencecount', 'action', 'added' ),
441            'extraBoxes'  => $upsell_box_html,
442            'extraJS'     => $extra_js,
443        )
444    );
445
446    $list->drawListView();
447}
448
449/**
450 * Renders the html for the quote templates list.
451 *
452 * @return void
453 */
454function zeroBSCRM_render_quotetemplateslist_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
455
456    // has no sync ext? Sell them
457    $upsell_box_html = '';
458
459    $list = new zeroBSCRM_list(
460        array(
461
462            'objType'     => 'quotetemplate',
463            'singular'    => esc_html__( 'Quote Template', 'zero-bs-crm' ),
464            'plural'      => esc_html__( 'Quote Templates', 'zero-bs-crm' ),
465            'tag'         => '',
466            'postType'    => 'zerobs_quo_template',
467            'postPage'    => 'manage-quote-templates',
468            'langLabels'  => array(
469
470                // bulk action labels
471                'delete'                   => esc_html__( 'Delete Quote Template(s)', 'zero-bs-crm' ),
472                'export'                   => esc_html__( 'Export Quote Template(s)', 'zero-bs-crm' ),
473
474                // for listview
475                'defaulttemplate'          => esc_html__( 'Default Template', 'zero-bs-crm' ),
476                'deletetemplate'           => esc_html__( 'Delete Template', 'zero-bs-crm' ),
477
478                // bulk actions - quote template deleting
479                'quotetemplatesdeleted'    => esc_html__( 'Your Quote template(s) have been deleted.', 'zero-bs-crm' ),
480                'notquotetemplatesdeleted' => esc_html__( 'Your Quote template(s) could not be deleted.', 'zero-bs-crm' ),
481
482            ),
483            'bulkActions' => array( 'delete' ),
484            'extraBoxes'  => $upsell_box_html,
485        )
486    );
487
488    $list->drawListView();
489}
490
491/**
492 * Renders the html for the tasks list.
493 *
494 * @return void
495 */
496function zeroBSCRM_render_tasks_list_page() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
497
498    // has no sync ext? Sell them
499    $upsell_box_html = '';
500
501    $list = new zeroBSCRM_list(
502        array(
503
504            'objType'     => 'event',
505            'singular'    => esc_html__( 'Task', 'zero-bs-crm' ),
506            'plural'      => esc_html__( 'Tasks', 'zero-bs-crm' ),
507            'tag'         => '',
508            'postType'    => 'zerobs_event',
509            'postPage'    => 'manage-tasks-list',
510            'langLabels'  => array(
511
512                // Status
513                'incomplete'                  => esc_html__( 'Incomplete', 'zero-bs-crm' ),
514                'complete'                    => esc_html__( 'Complete', 'zero-bs-crm' ),
515
516                // bulk action labels
517                'delete'                      => esc_html__( 'Delete Task(s)', 'zero-bs-crm' ),
518                'markcomplete'                => esc_html__( 'Mark Task(s) Completed', 'zero-bs-crm' ),
519                'markincomplete'              => esc_html__( 'Mark Task(s) Incomplete', 'zero-bs-crm' ),
520
521                // bulk actions - task actions
522                'tasks_deleted'               => esc_html__( 'Your Task(s) have been deleted.', 'zero-bs-crm' ),
523                'tasks_not_deleted'           => esc_html__( 'Your Task(s) could not be deleted.', 'zero-bs-crm' ),
524                'areyousure_tasks_completed'  => esc_html__( 'Are you sure you want to mark these tasks as completed?', 'zero-bs-crm' ),
525                'areyousure_tasks_incomplete' => esc_html__( 'Are you sure you want to mark these tasks as incomplete?', 'zero-bs-crm' ),
526                'tasks_marked'                => esc_html__( 'Your Task(s) have been updated.', 'zero-bs-crm' ),
527                'tasks_not_marked'            => esc_html__( 'Your Task(s) could not be updated.', 'zero-bs-crm' ),
528
529            ),
530            'bulkActions' => array( 'addtag', 'removetag', 'delete', 'markcomplete', 'markincomplete' ),
531            'unsortables' => array( 'action', 'remind', 'company', 'contact', 'showcal' ),
532            'extraBoxes'  => $upsell_box_html,
533        )
534    );
535
536    $list->drawListView();
537}