function _acf_post_submitbox_start() { if (!SI_Controller::is_si_admin()) { return; } ?> <script type="text/javascript"> (function($){ acf.add_action('submit', function( $el ){ $('input[type="submit"]').removeClass('disabled button-disabled button-primary-disabled'); }); })(jQuery); </script> <?php }
public static function head_scripts() { global $wp_scripts; ?> <link rel="stylesheet" id="open-sans-css" href="//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext" type="text/css" media="all"> <link rel="stylesheet" id="dashicons-css" href="<?php echo site_url(); ?> /wp-includes/css/dashicons.min.css" type="text/css" media="all"> <link rel="stylesheet" id="qtip-css" href="<?php echo SI_RESOURCES; ?> admin/plugins/qtip/jquery.qtip.min.css" type="text/css" media=""> <link rel="stylesheet" id="dropdown-css" href="<?php echo SI_RESOURCES; ?> admin/plugins/dropdown/jquery.dropdown.css" type="text/css" media=""> <link rel="stylesheet" id="sprout_doc_style-css" href="<?php echo SI_RESOURCES; ?> front-end/css/sprout-invoices.style.css" type="text/css" media="all"> <?php SI_Customizer::inject_css(); ?> <?php self::load_custom_stylesheet(); ?> <script type="text/javascript" src="<?php echo site_url(); ?> /wp-includes/js/jquery/jquery.js"></script> <script type="text/javascript" src="<?php echo site_url(); ?> /wp-includes/js/jquery/jquery-migrate.min.js"></script> <script type="text/javascript" src="<?php echo SI_RESOURCES; ?> admin/plugins/qtip/jquery.qtip.min.js"></script> <script type="text/javascript" src="<?php echo SI_RESOURCES; ?> admin/plugins/dropdown/jquery.dropdown.min.js"></script> <script type="text/javascript" src="<?php echo SI_RESOURCES; ?> front-end/js/sprout-invoices.js"></script> <script type="text/javascript"> /* <![CDATA[ */ var si_js_object = <?php echo wp_json_encode(SI_Controller::get_localized_js()); ?> ; /* ]]> */ </script> <?php }
public static function frontend_enqueue() { wp_enqueue_style('si_embeds'); wp_enqueue_script('si_embeds'); wp_localize_script('si_embeds', 'si_js_object', SI_Controller::get_localized_js()); }
/** * Load the SI application * (function called at the bottom of this page) * * @package Sprout_Invoices * @return void */ function sprout_invoices_load() { if (class_exists('Sprout_Invoices')) { error_log('** Sprout_Invoices Already Loaded **'); return; // already loaded, or a name collision } do_action('sprout_invoices_preload'); ////////// // Load // ////////// // Master class require_once SI_PATH . '/Sprout_Invoices.class.php'; // base classes require_once SI_PATH . '/models/_Model.php'; require_once SI_PATH . '/controllers/_Controller.php'; do_action('si_require_base_classes'); // models require_once SI_PATH . '/models/Client.php'; require_once SI_PATH . '/models/Estimate.php'; require_once SI_PATH . '/models/Invoice.php'; require_once SI_PATH . '/models/Notification.php'; require_once SI_PATH . '/models/Payment.php'; require_once SI_PATH . '/models/Record.php'; // Premium models require_once SI_PATH . '/models/Project.php'; // i18n require_once SI_PATH . '/controllers/i18n/Countries_States.php'; require_once SI_PATH . '/controllers/i18n/Locales.php'; do_action('si_require_model_classes'); ///////////////// // Controllers // ///////////////// // settings require_once SI_PATH . '/controllers/admin/Settings.php'; if (!class_exists('SA_Settings_API')) { require_once SI_PATH . '/controllers/admin/Settings_API.php'; } require_once SI_PATH . '/controllers/admin/Capabilities.php'; require_once SI_PATH . '/controllers/admin/Help.php'; // json api require_once SI_PATH . '/controllers/api/JSON_API.php'; // checkouts require_once SI_PATH . '/controllers/checkout/Checkouts.php'; // clients require_once SI_PATH . '/controllers/clients/Clients.php'; // developer logs require_once SI_PATH . '/controllers/developer/Logs.php'; // Estimates require_once SI_PATH . '/controllers/estimates/Estimate_Submission.php'; if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/estimates/Estimate_Submission_Premium.php')) { require_once SI_PATH . '/controllers/estimates/Estimate_Submission_Premium.php'; } require_once SI_PATH . '/controllers/estimates/Estimates.php'; require_once SI_PATH . '/controllers/estimates/Estimates_Admin.php'; require_once SI_PATH . '/controllers/estimates/Estimates_Edit.php'; require_once SI_PATH . '/controllers/estimates/Estimates_Records.php'; require_once SI_PATH . '/controllers/estimates/Estimates_Template.php'; if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/estimates/Estimates_Premium.php')) { require_once SI_PATH . '/controllers/estimates/Estimates_Premium.php'; } // invoices require_once SI_PATH . '/controllers/invoices/Invoices.php'; require_once SI_PATH . '/controllers/invoices/Invoices_Admin.php'; require_once SI_PATH . '/controllers/invoices/Invoices_Edit.php'; require_once SI_PATH . '/controllers/invoices/Invoices_Records.php'; require_once SI_PATH . '/controllers/invoices/Invoices_Template.php'; require_once SI_PATH . '/controllers/invoices/Invoices_Deposit.php'; if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/invoices/Invoices_Premium.php')) { require_once SI_PATH . '/controllers/invoices/Invoices_Premium.php'; } // Line Items require_once SI_PATH . '/controllers/line-items/Line_Items.php'; // notifications require_once SI_PATH . '/controllers/notifications/Notifications_Control.php'; require_once SI_PATH . '/controllers/notifications/Notifications.php'; if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/notifications/Notifications_Premium.php')) { require_once SI_PATH . '/controllers/notifications/Notifications_Premium.php'; } require_once SI_PATH . '/controllers/notifications/Notifications_Admin_Table.php'; // payment processing require_once SI_PATH . '/controllers/payment-processing/Payment_Processors.php'; require_once SI_PATH . '/controllers/payment-processing/Credit_Card_Processors.php'; require_once SI_PATH . '/controllers/payment-processing/Offsite_Processors.php'; // payment processors if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_EC.php')) { require_once SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_EC.php'; } if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_Pro.php')) { require_once SI_PATH . '/controllers/payment-processing/processors/SI_Paypal_Pro.php'; } require_once SI_PATH . '/controllers/payment-processing/processors/SI_Checks.php'; require_once SI_PATH . '/controllers/payment-processing/processors/SI_Admin_Payment.php'; do_action('si_payment_processors_loaded'); // payments require_once SI_PATH . '/controllers/payments/Payments.php'; require_once SI_PATH . '/controllers/payments/Payments_Admin_Table.php'; // Projects require_once SI_PATH . '/controllers/projects/Projects.php'; if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/projects/Projects_Premium.php')) { require_once SI_PATH . '/controllers/projects/Projects_Premium.php'; } // internal records require_once SI_PATH . '/controllers/records/Internal_Records.php'; require_once SI_PATH . '/controllers/records/Records_Admin_Table.php'; // reporting require_once SI_PATH . '/controllers/reporting/Dashboard.php'; require_once SI_PATH . '/controllers/reporting/Reporting.php'; if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/reporting/Reporting_Premium.php')) { require_once SI_PATH . '/controllers/reporting/Reporting_Premium.php'; } require_once SI_PATH . '/controllers/templating/Templating.php'; require_once SI_PATH . '/controllers/templating/Customizer.php'; // updates if (!SI_FREE_TEST && file_exists(SI_PATH . '/controllers/updates/Updates.php')) { require_once SI_PATH . '/controllers/updates/Updates.php'; } if (file_exists(SI_PATH . '/controllers/updates/Free_License.php')) { require_once SI_PATH . '/controllers/updates/Free_License.php'; } // importers require_once SI_PATH . '/importers/Importer.php'; require_once SI_PATH . '/importers/Freshbooks.php'; require_once SI_PATH . '/importers/Harvest.php'; require_once SI_PATH . '/importers/WP-Invoice.php'; require_once SI_PATH . '/importers/CSV.php'; do_action('si_importers_loaded'); // Fix others problems require_once SI_PATH . '/controllers/compat/Compatibility.php'; // all done do_action('si_require_controller_classes'); // Template tags require_once SI_PATH . '/template-tags/estimates.php'; require_once SI_PATH . '/template-tags/clients.php'; require_once SI_PATH . '/template-tags/forms.php'; require_once SI_PATH . '/template-tags/invoices.php'; require_once SI_PATH . '/template-tags/line-items.php'; require_once SI_PATH . '/template-tags/projects.php'; require_once SI_PATH . '/template-tags/ui.php'; require_once SI_PATH . '/template-tags/utility.php'; require_once SI_PATH . '/template-tags/docs.php'; // l18n require_once SI_PATH . '/languages/SI_l10n.php'; require_once SI_PATH . '/languages/SI_Strings.php'; // i18n & l10n SI_l10n::init(); SI_Strings::load_additional_strings(); SI_Locales::init(); SI_Countries_States::init(); /////////////////// // init() models // /////////////////// do_action('si_models_init'); SI_Post_Type::init(); // _Model SI_Record::init(); SI_Notification::init(); SI_Invoice::init(); SI_Estimate::init(); SI_Client::init(); SI_Payment::init(); SI_Project::init(); ///////////////////////// // init() controllers // ///////////////////////// do_action('si_controllers_init'); SI_Controller::init(); SA_Settings_API::init(); SI_Templating_API::init(); SI_Customizer::init(); SI_Admin_Capabilities::init(); // updates if (!SI_FREE_TEST && class_exists('SI_Updates')) { SI_Updates::init(); } if (class_exists('SI_Free_License')) { SI_Free_License::init(); } // api SI_JSON_API::init(); // reports SI_Dashboard::init(); SI_Reporting::init(); if (!SI_FREE_TEST && class_exists('SI_Reporting_Premium')) { SI_Reporting_Premium::init(); } // records and logs SI_Internal_Records::init(); SI_Dev_Logs::init(); // settings SI_Admin_Settings::init(); // payments and processing SI_Payment_Processors::init(); SI_Payments::init(); // notifications SI_Notifications::init(); // Hooks come before parent class. if (!SI_FREE_TEST && class_exists('SI_Notifications_Premium')) { SI_Notifications_Premium::init(); } SI_Notifications_Control::init(); // clients SI_Clients::init(); // estimates SI_Estimates::init(); if (!SI_FREE_TEST && class_exists('SI_Estimates_Premium')) { SI_Estimates_Premium::init(); } if (!SI_FREE_TEST && class_exists('SI_Estimates_Submission_Premium')) { SI_Estimates_Submission_Premium::init(); } SI_Estimate_Submissions::init(); SI_Estimates_Admin::init(); SI_Estimates_Edit::init(); SI_Estimates_Template::init(); SI_Estimates_Records::init(); // checkouts SI_Checkouts::init(); // invoices SI_Invoices::init(); SI_Invoices_Admin::init(); SI_Invoices_Edit::init(); SI_Invoices_Template::init(); SI_Invoices_Records::init(); SI_Invoices_Deposit::init(); if (!SI_FREE_TEST && class_exists('SI_Invoices_Premium')) { SI_Invoices_Premium::init(); } // Line items SI_Line_Items::init(); // projects SI_Projects::init(); if (!SI_FREE_TEST && class_exists('SI_Projects_Premium')) { SI_Projects_Premium::init(); } // importer SI_Importer::init(); // help SI_Help::init(); // Compat SI_Compatibility::init(); // addons require_once SI_PATH . '/add-ons/Addons.php'; require_once SI_PATH . '/add-ons/updates/edd_plugin_updater.class.php'; SA_Addons::init(); do_action('sprout_invoices_loaded'); }
public static function maybe_get_item() { if (!current_user_can('publish_sprout_invoices')) { wp_send_json_error(array('message' => __('User cannot create an item!', 'sprout-invoices'))); } $time = array(); if (isset($_REQUEST['time']) && is_array($_REQUEST['time'])) { $time = $_REQUEST['time']; } if (!$time) { wp_send_json_error(array('message' => __('No time given!', 'sprout-invoices'))); } $item_data = array('type' => self::LINE_ITEM_TYPE, 'desc' => $time['description'], 'rate' => $time['activity_rate'], 'qty' => $time['qty'], 'tax' => $time['activity_tax'], 'sku' => $time['activity_id'], 'time_id' => $time['id']); ob_start(); SI_Controller::load_view('admin/sections/line-item-options', array('columns' => SI_Line_Items::line_item_columns('time'), 'item_data' => $item_data, 'has_children' => false, 'items' => array(), 'position' => 0, 'children' => array()), false); $option = ob_get_clean(); $view = sprintf('<li id="line_item_loaded_%1$s" class="item line_item_type_%1$s" data-id="0">%2$s</li>', $item_data['type'], $option); $response = array('option' => $view, 'type' => $item_data['type']); wp_send_json_success($response); }
public static function load_addon_view_to_string($view, $args, $allow_theme_override = true) { ob_start(); SI_Controller::load_addon_view($view, $args, $allow_theme_override); return ob_get_clean(); }
function si_display_messages($type = '') { print SI_Controller::display_messages($type); }
public static function load_messages() { $user_id = get_current_user_id(); $messages = false; if (!$user_id) { if (isset($_SERVER['REMOTE_ADDR'])) { $messages = get_transient('si_messaging_for_' . $_SERVER['REMOTE_ADDR']); } } else { global $blog_id; $messages = get_user_meta($user_id, $blog_id . '_' . self::MESSAGE_META_KEY, true); } if ($messages) { self::$messages = $messages; } else { self::$messages = array(); } }
public static function maybe_get_item() { if (!current_user_can('publish_sprout_invoices')) { wp_send_json_error(array('message' => __('User cannot create an item!', 'sprout-invoices'))); } $item_id = 0; if (isset($_REQUEST['item_id'])) { $item_id = (int) $_REQUEST['item_id']; } if (!$item_id) { wp_send_json_error(array('message' => __('No item given!', 'sprout-invoices'))); } $item = SI_Item::get_instance($item_id); $item_data = array('type' => $item->get_type(), 'desc' => $item->get_content(), 'rate' => $item->get_default_rate(), 'qty' => $item->get_default_qty(), 'tax' => $item->get_default_percentage(), 'sku' => $item->get_default_sku(), 'title' => $item->get_title()); ob_start(); SI_Controller::load_view('admin/sections/line-item-options', array('columns' => SI_Line_Items::line_item_columns($item_data['type']), 'item_data' => $item_data, 'has_children' => false, 'items' => array(), 'position' => 0, 'children' => array()), false); $option = ob_get_clean(); $view = sprintf('<li id="line_item_loaded_%1$s" class="item line_item_type_%1$s" data-id="0">%2$s</li>', $item_data['type'], $option); $response = array('option' => $view, 'type' => $item_data['type']); wp_send_json_success($response); }
?> > <head> <meta charset="<?php bloginfo('charset'); ?> " /> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11" /> <?php wp_head(); ?> <script type="text/javascript"> /* <![CDATA[ */ var si_js_object = <?php echo wp_json_encode(SI_Controller::get_localized_js()); ?> ; /* ]]> */ </script> <meta name="robots" content="noindex, nofollow" /> </head> <body id="time_tracker" <?php body_class(); ?> > <div id="outer_doc_wrap"> <div id="time_tracker_wrap"> <div class="front_end_form clearfix">