Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 299 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | /* |
| 3 | * Jetpack CRM |
| 4 | * https://jetpackcrm.com |
| 5 | */ |
| 6 | |
| 7 | /* |
| 8 | ====================================================== |
| 9 | Breaking Checks ( stops direct access ) |
| 10 | ====================================================== */ |
| 11 | if ( ! defined( 'ZEROBSCRM_PATH' ) ) { |
| 12 | exit( 0 ); |
| 13 | } |
| 14 | /* |
| 15 | ====================================================== |
| 16 | / Breaking Checks |
| 17 | ====================================================== */ |
| 18 | |
| 19 | /* |
| 20 | ================================================================================ |
| 21 | |
| 22 | Define the key the config model will use to store the config in wp options |
| 23 | |
| 24 | ================================================================================*/ |
| 25 | |
| 26 | global $zeroBSCRM_Conf_Setup, $zbs; |
| 27 | |
| 28 | $zeroBSCRM_Conf_Setup = array( |
| 29 | |
| 30 | // Define the key the config model will use to store the config in wp options |
| 31 | 'conf_key' => 'zerobscrmsettings', |
| 32 | |
| 33 | // Define the version of config (update as this file updated - any string) |
| 34 | 'conf_ver' => 'v2.2//29.06.2017', |
| 35 | |
| 36 | // Define the plugin name, ver and db ver (meta data stored in option) |
| 37 | 'conf_plugin' => 'zeroBSCRM', |
| 38 | 'conf_pluginver' => false, // catch ver for now, and set up automatically in core |
| 39 | 'conf_plugindbver' => false, // catch ver for now, and set up automatically in core |
| 40 | |
| 41 | // Added DMZ Config (this stores all dmz config settings) |
| 42 | 'conf_dmzkey' => 'zbscrm_dmz', |
| 43 | |
| 44 | // Protected conf settings, these don't get flushed when restoring defaults |
| 45 | // NOTE: They can still be edited via usual edit funcs |
| 46 | 'conf_protected' => array( |
| 47 | 'whlang', |
| 48 | 'customfields', |
| 49 | 'customisedfields', |
| 50 | ), |
| 51 | |
| 52 | ); |
| 53 | |
| 54 | /* |
| 55 | ================================================================================ |
| 56 | |
| 57 | Define default config model that will be loaded on every new init of settings |
| 58 | ... or when a user resets their settings |
| 59 | |
| 60 | ================================================================================*/ |
| 61 | |
| 62 | // Only declared here, then gets shuttled into $zeroBSCRM_Conf_Setup |
| 63 | // ... left separate for ease of reading |
| 64 | // global $zeroBSCRM_Conf_Def; |
| 65 | $zeroBSCRM_Conf_Def = array( |
| 66 | |
| 67 | 'settingsinstalled' => 1, // check, DO NOT REMOVE (WH) |
| 68 | 'migrations' => array(), // store a list of migrations that have run |
| 69 | |
| 70 | /* === General === */ |
| 71 | |
| 72 | /* WordPress Menu Layout */ |
| 73 | 'menulayout' => 2, // slimline |
| 74 | |
| 75 | /* General Settings */ |
| 76 | 'showprefix' => 1, |
| 77 | 'showaddress' => 1, |
| 78 | 'secondaddress' => 1, |
| 79 | 'secondaddresslabel' => __( 'Second Address', 'zero-bs-crm' ), |
| 80 | 'countries' => 1, |
| 81 | 'perusercustomers' => 0, |
| 82 | 'usercangiveownership' => 0, |
| 83 | 'taskownership' => 0, |
| 84 | 'clicktocall' => 0, |
| 85 | 'clicktocalltype' => 1, // 1 = tel: , 2 = callto: |
| 86 | 'objnav' => -1, |
| 87 | 'usesocial' => 1, |
| 88 | 'useaka' => 1, |
| 89 | 'avatarmode' => 1, // 1 = gravatar only, 2 = custom imgs, 3 = none |
| 90 | |
| 91 | /* WordPress Override Mode */ |
| 92 | 'wptakeovermode' => 0, |
| 93 | 'wptakeovermodeforall' => 0, |
| 94 | 'loginlogourl' => '', |
| 95 | 'customheadertext' => '', |
| 96 | 'killfrontend' => 0, |
| 97 | 'shareessentials' => 1, |
| 98 | 'showpoweredby_public' => 0, |
| 99 | 'showpoweredby_admin' => 1, |
| 100 | |
| 101 | /* File Attachment Settings */ |
| 102 | 'filetypesupload' => array( |
| 103 | 'pdf' => 1, |
| 104 | 'doc' => 0, |
| 105 | 'docx' => 0, |
| 106 | 'ppt' => 0, |
| 107 | 'pptx' => 0, |
| 108 | 'xls' => 0, |
| 109 | 'xlsx' => 0, |
| 110 | 'csv' => 0, |
| 111 | 'png' => 0, |
| 112 | 'jpg' => 0, |
| 113 | 'jpeg' => 0, |
| 114 | 'gif' => 0, |
| 115 | 'mp3' => 0, |
| 116 | 'txt' => 0, |
| 117 | 'zip' => 0, |
| 118 | 'all' => 0, |
| 119 | ), |
| 120 | |
| 121 | /* Auto-logging Settings */ |
| 122 | 'autolog_customer_new' => 1, |
| 123 | 'autolog_company_new' => 1, |
| 124 | 'autolog_quote_new' => 1, |
| 125 | 'autolog_quote_accepted' => 1, |
| 126 | 'autolog_invoice_new' => 1, |
| 127 | 'autolog_transaction_new' => 1, |
| 128 | 'autolog_event_new' => 1, |
| 129 | 'autolog_clientportal_new' => 1, |
| 130 | 'autolog_customer_statuschange' => 0, |
| 131 | 'autolog_mailcampaigns_send' => 1, |
| 132 | 'autolog_mailcampaigns_open' => 1, |
| 133 | 'autolog_mailcampaigns_click' => 1, |
| 134 | 'autolog_mailcampaigns_unsubscribe' => 1, |
| 135 | |
| 136 | /* === Business Info === */ |
| 137 | 'businessname' => '', |
| 138 | 'invoicelogourl' => '', |
| 139 | 'businessyourname' => '', |
| 140 | 'businessyouremail' => '', |
| 141 | 'businessyoururl' => '', |
| 142 | 'businesstel' => '', |
| 143 | 'twitter' => '', |
| 144 | 'facebook' => '', |
| 145 | 'linkedin' => '', |
| 146 | |
| 147 | /* === Custom Fields === */ |
| 148 | 'customfields' => array( |
| 149 | 'customers' => array( |
| 150 | array( 'select', 'Source', 'Google,Word of mouth,Local Newspaper' ), |
| 151 | ), |
| 152 | 'companies' => array(), |
| 153 | 'quotes' => array(), |
| 154 | 'invoices' => array(), |
| 155 | 'transactions' => array(), |
| 156 | 'addresses' => array(), |
| 157 | 'customersfiles' => array(), |
| 158 | ), |
| 159 | |
| 160 | /* === Field Sorts === */ |
| 161 | 'fieldsorts' => array( |
| 162 | 'address' => array(), |
| 163 | 'customer' => array(), |
| 164 | 'company' => array(), |
| 165 | ), |
| 166 | 'fieldhides' => array( |
| 167 | 'address' => array(), |
| 168 | 'customer' => array(), |
| 169 | 'company' => array(), |
| 170 | ), |
| 171 | |
| 172 | /* |
| 173 | === Field Options === */ |
| 174 | // 'customisedfields' contains additional settings spread across multiple tabs |
| 175 | 'showid' => 1, |
| 176 | 'fieldoverride' => -1, // allow fields with data to be overriden to blank (api/forms) |
| 177 | 'customfieldsearch' => -1, |
| 178 | 'filtersfromstatus' => 1, // show quickfilters for all statuses |
| 179 | 'filtersfromsegments' => 1, // show quickfilters for all segments |
| 180 | 'defaultstatus' => 'Lead', |
| 181 | 'zbsfunnel' => 'Lead,Customer', |
| 182 | |
| 183 | /* === Locale === */ |
| 184 | 'currency' => array( |
| 185 | 'chr' => '$', |
| 186 | 'strval' => 'USD', |
| 187 | ), |
| 188 | 'currency_position' => 0, // left |
| 189 | 'currency_format_thousand_separator' => ',', |
| 190 | 'currency_format_decimal_separator' => '.', |
| 191 | 'currency_format_number_of_decimals' => 2, |
| 192 | |
| 193 | /* === List View === */ |
| 194 | 'quickfiltersettings' => array( |
| 195 | 'notcontactedinx' => 30, |
| 196 | 'olderthanx' => 30, |
| 197 | ), |
| 198 | 'allowinlineedits' => -1, |
| 199 | 'show_totals_table' => 1, |
| 200 | /* |
| 201 | === Tax === */ |
| 202 | // nothing here by default |
| 203 | |
| 204 | /* === CRM License === */ |
| 205 | 'licensingcount' => 0, // stores how many api_requests made |
| 206 | 'licensingerror' => false, // stores any api_request errors hit |
| 207 | 'license_key' => array( |
| 208 | 'key' => '', |
| 209 | ), |
| 210 | |
| 211 | /* |
| 212 | === Companies === */ |
| 213 | // 'customisedfields' contains additional settings spread across multiple tabs |
| 214 | 'coororg' => 'co', |
| 215 | |
| 216 | /* === Quotes === */ |
| 217 | 'usequotebuilder' => 1, |
| 218 | 'quote_pdf_template' => '', |
| 219 | |
| 220 | /* === Invoicing === */ |
| 221 | 'reftype' => 'autonumber', |
| 222 | 'defaultref' => '', |
| 223 | 'refprefix' => '', |
| 224 | 'refnextnum' => 1, |
| 225 | 'refsuffix' => '', |
| 226 | 'invtax' => 0, |
| 227 | 'invdis' => 0, |
| 228 | 'invpandp' => 0, |
| 229 | 'inv_pdf_template' => '', |
| 230 | 'inv_portal_template' => '', |
| 231 | 'reflabel' => __( 'Reference:', 'zero-bs-crm' ), |
| 232 | 'businessextra' => '', |
| 233 | 'paymentinfo' => '', |
| 234 | 'invid' => 0, |
| 235 | 'invcustomfields' => '', |
| 236 | 'contactcustomfields' => '', |
| 237 | 'companycustomfields' => '', |
| 238 | 'statementextra' => '', |
| 239 | 'statement_pdf_template' => '', |
| 240 | 'paythanks' => '', |
| 241 | 'invfromemail' => '', // not used |
| 242 | 'invfromname' => '', // not used |
| 243 | |
| 244 | /* |
| 245 | === Transactions === */ |
| 246 | // 'customisedfields' contains additional settings spread across multiple tabs |
| 247 | 'shippingfortransactions' => -1, |
| 248 | 'paiddatestransaction' => -1, |
| 249 | 'transinclude_status' => array( 'Succeeded', 'Completed', 'Failed', 'Refunded', 'Processing', 'Pending', 'Hold', 'Draft' ), |
| 250 | 'transaction_fee' => -1, |
| 251 | 'transaction_tax' => -1, |
| 252 | 'transaction_discount' => -1, |
| 253 | 'transaction_net' => -1, |
| 254 | |
| 255 | /* === Forms === */ |
| 256 | 'usegcaptcha' => 0, |
| 257 | 'gcaptchasitekey' => '', |
| 258 | 'gcaptchasitesecret' => '', |
| 259 | |
| 260 | /* === Client Portal === */ |
| 261 | 'portalpage' => 0, |
| 262 | 'easyaccesslinks' => 0, |
| 263 | 'portalusers' => 0, |
| 264 | 'portalusers_status' => 'all', |
| 265 | 'portalusers_extrarole' => '', |
| 266 | 'portal_hidefields' => 'status,email', // csv of fieldkeys to hide from edits on portal 'Your details' |
| 267 | 'fileview' => 'table', // I don't think this one is used |
| 268 | 'cpp_fileview' => 'listview', // This should be fully moved to Client Portal Pro |
| 269 | 'zbs_portal_email_content' => '', // not used |
| 270 | |
| 271 | /* |
| 272 | === API Settings === */ |
| 273 | // nothing here by default |
| 274 | |
| 275 | /* === Mail Settings === */ |
| 276 | 'emailtracking' => 1, |
| 277 | 'directmsgfrom' => 1, // fname lname @ crm_name (e.g. John Doe @ MyWebsite) |
| 278 | 'mailignoresslmismatch' => -1, // makes phpmailer ignore ssl mismatches :) |
| 279 | 'unsub' => 'Click to unsubscribe: ##UNSUB-LINK##', |
| 280 | 'unsubpage' => -1, // this is the id of wp page where our unsub shortcode should be |
| 281 | 'unsubmsg' => 'You have been successfully unsubscribed.', |
| 282 | |
| 283 | /* === Mail Delivery === */ |
| 284 | 'smtpaccs' => array(), |
| 285 | 'smtpkey' => '', // enc key |
| 286 | |
| 287 | /* === OAuth Connections === */ |
| 288 | 'oauth_tokens' => array(), |
| 289 | |
| 290 | // } ======= Customise Fields |
| 291 | 'customisedfields' => array( |
| 292 | |
| 293 | // NOTE: Any changes here need to be reflected in admin pages (For now) |
| 294 | // search #UPDATECUSTOMFIELDDEFAULTS |
| 295 | |
| 296 | 'customers' => array( |
| 297 | // Allow people to order base fields + also modified some... via this |
| 298 | // Can remove this and will revert to default |
| 299 | // Currently: showhide, value (for now) |
| 300 | // Remember, this'll effect other areas of the CRM |
| 301 | 'status' => array( |
| 302 | 1, |
| 303 | 'Lead,Customer,Refused,Cancelled by Customer,Cancelled by Us (Pre-Quote),Cancelled by Us (Post-Quote)', |
| 304 | ), |
| 305 | 'prefix' => array( |
| 306 | 1, |
| 307 | 'Mr,Mrs,Ms,Miss,Mx,Dr,Prof,Mr & Mrs', |
| 308 | ), |
| 309 | ), |
| 310 | |
| 311 | // transaction statuses.. |
| 312 | 'transactions' => array( |
| 313 | // Allow people to order base fields + also modified some... via this |
| 314 | // Can remove this and will revert to default |
| 315 | // Currently: showhide, value (for now) |
| 316 | // Remember, this'll effect other areas of the CRM |
| 317 | |
| 318 | // Note: Changes here should be reflected in `transinclude_status` as well |
| 319 | 'status' => array( |
| 320 | 1, |
| 321 | 'Succeeded,Completed,Failed,Refunded,Processing,Pending,Hold,Cancelled,Deleted,Draft', |
| 322 | ), |
| 323 | ), |
| 324 | |
| 325 | 'companies' => array( |
| 326 | // Allow people to order base fields + also modified some... via this |
| 327 | // Can remove this and will revert to default |
| 328 | // Currently: showhide, value (for now) |
| 329 | // Remember, this'll effect other areas of the CRM |
| 330 | 'status' => array( |
| 331 | 1, |
| 332 | 'Lead,Customer,Refused', |
| 333 | ), |
| 334 | ), |
| 335 | 'quotes' => array(), |
| 336 | 'invoices' => array(), |
| 337 | |
| 338 | ), |
| 339 | // } ======= / Customise Fields |
| 340 | |
| 341 | // } ======= Free Extensions Settings |
| 342 | 'feat_quotes' => 1, |
| 343 | 'feat_invs' => 1, |
| 344 | 'feat_forms' => 1, |
| 345 | 'feat_pdfinv' => 1, |
| 346 | 'feat_csvimporterlite' => 1, |
| 347 | 'feat_portal' => 1, |
| 348 | 'feat_custom_fields' => 1, |
| 349 | 'feat_api' => 0, |
| 350 | 'feat_calendar' => 1, |
| 351 | 'feat_transactions' => 1, |
| 352 | 'feat_jetpackforms' => 1, |
| 353 | 'companylevelcustomers' => 1, // b2b mode |
| 354 | // } ======= / Free Extensions Settings |
| 355 | |
| 356 | // } ====== Invoicing Pro |
| 357 | // these should be in the extension... |
| 358 | 'invpro_pay' => 2, // default to PayPal |
| 359 | 'stripe_sk' => '', |
| 360 | 'stripe_pk' => '', |
| 361 | 'ppbusinessemail' => '', |
| 362 | // } ====== / Invoicing Pro |
| 363 | |
| 364 | // } ======= PDF Settings |
| 365 | 'pdf_fonts_installed' => 1, |
| 366 | 'pdf_extra_fonts_installed' => array(), |
| 367 | // } ======= / PDF Settings |
| 368 | |
| 369 | // } ======= Customer View Layout v2.0 |
| 370 | 'customviews2' => array( |
| 371 | |
| 372 | // } These use the zbs default funcs but can be overriden :) |
| 373 | 'customer' => array( |
| 374 | 'id' => array( 'ID' ), |
| 375 | 'nameavatar' => array( __( 'Name and Avatar', 'zero-bs-crm' ) ), |
| 376 | 'status' => array( 'Status' ), |
| 377 | 'totalvalue' => array( 'Total Value' ), |
| 378 | 'added' => array( 'Added' ), |
| 379 | ), |
| 380 | |
| 381 | 'company' => array( |
| 382 | 'id' => array( 'ID' ), |
| 383 | 'name' => array( __( 'Name', 'zero-bs-crm' ) ), |
| 384 | 'status' => array( __( 'Status', 'zero-bs-crm' ) ), |
| 385 | 'contacts' => array( __( 'Contacts', 'zero-bs-crm' ) ), |
| 386 | 'added' => array( __( 'Added', 'zero-bs-crm' ) ), |
| 387 | 'editlink' => array( __( 'Edit', 'zero-bs-crm' ) ), |
| 388 | ), |
| 389 | |
| 390 | 'quote' => array( |
| 391 | 'id' => array( 'ID' ), |
| 392 | 'title' => array( 'Quote Title' ), |
| 393 | 'customer' => array( 'Contact' ), |
| 394 | 'status' => array( 'Status' ), |
| 395 | 'value' => array( __( 'Quote Value', 'zero-bs-crm' ) ), |
| 396 | 'editlink' => array( __( 'Edit', 'zero-bs-crm' ) ), |
| 397 | ), |
| 398 | |
| 399 | 'invoice' => array( |
| 400 | 'id' => array( 'ID' ), |
| 401 | 'ref' => array( 'Reference' ), |
| 402 | 'customer' => array( 'Contact' ), |
| 403 | 'status' => array( 'Status' ), |
| 404 | 'value' => array( __( 'Value', 'zero-bs-crm' ) ), |
| 405 | 'editlink' => array( __( 'Edit', 'zero-bs-crm' ) ), |
| 406 | ), |
| 407 | |
| 408 | 'form' => array( |
| 409 | 'id' => array( 'ID' ), |
| 410 | 'title' => array( 'Title' ), |
| 411 | 'style' => array( __( 'Style', 'zero-bs-crm' ) ), |
| 412 | 'views' => array( __( 'Views', 'zero-bs-crm' ) ), |
| 413 | 'conversions' => array( __( 'Conversions', 'zero-bs-crm' ) ), |
| 414 | 'added' => array( __( 'Added', 'zero-bs-crm' ) ), |
| 415 | 'editlink' => array( __( 'Edit', 'zero-bs-crm' ) ), |
| 416 | ), |
| 417 | |
| 418 | 'event' => array( |
| 419 | 'id' => array( 'ID' ), |
| 420 | 'title' => array( __( 'Name', 'zero-bs-crm' ) ), |
| 421 | 'desc' => array( __( 'Description', 'zero-bs-crm' ) ), |
| 422 | 'start' => array( __( 'Starting', 'zero-bs-crm' ) ), |
| 423 | 'end' => array( __( 'Finishing', 'zero-bs-crm' ) ), |
| 424 | 'status' => array( __( 'Status', 'zero-bs-crm' ) ), |
| 425 | 'assigned' => array( __( 'Assigned To', 'zero-bs-crm' ) ), |
| 426 | 'action' => array( __( 'Action', 'zero-bs-crm' ) ), |
| 427 | ), |
| 428 | |
| 429 | 'transaction' => array( |
| 430 | 'id' => array( 'ID' ), |
| 431 | 'customer' => array( __( 'Contact', 'zero-bs-crm' ) ), |
| 432 | 'status' => array( __( 'Status', 'zero-bs-crm' ) ), |
| 433 | 'total' => array( __( 'Value', 'zero-bs-crm' ) ), |
| 434 | 'item' => array( __( 'Item', 'zero-bs-crm' ) ), |
| 435 | 'added' => array( __( 'Added', 'zero-bs-crm' ) ), |
| 436 | 'editlink' => array( __( 'Edit Link', 'zero-bs-crm' ) ), |
| 437 | ), |
| 438 | |
| 439 | 'segment' => array( |
| 440 | 'id' => array( 'ID' ), |
| 441 | 'name' => array( 'Name' ), |
| 442 | 'audiencecount' => array( 'Contact Count' ), |
| 443 | 'action' => array( 'Action' ), |
| 444 | ), |
| 445 | |
| 446 | ), |
| 447 | // } ======= / Customer View Layout v2.0 |
| 448 | |
| 449 | // } ======= Screenoptions (generic) |
| 450 | // Likely not used? |
| 451 | 'company_view_docs_columns' => array( |
| 452 | 'transactions' => array( 'date', 'id', 'total', 'status' ), |
| 453 | ), |
| 454 | // } ======= / Screenoptions (generic) |
| 455 | |
| 456 | ); |
| 457 | |
| 458 | // Move defaults arr into main config |
| 459 | $zeroBSCRM_Conf_Setup['conf_defaults'] = $zeroBSCRM_Conf_Def; |