function sa_load_si_approveme_addon()
{
    if (class_exists('ApproveMe_Controller')) {
        return;
    }
    require_once 'inc/Approveme_Controller.php';
    require_once 'inc/Approveme_Settings.php';
    ApproveMe_Controller::init();
    // init sub classes
    ApproveMe_Settings::init();
}
 public static function init()
 {
     self::$agreement_doc = self::get_agreement_doc();
     self::$agreement_doc_estimates = self::get_agreement_doc_estimates();
     if (is_admin()) {
         // register settings
         self::register_settings();
         // meta boxes
         add_action('doc_information_meta_box_client_row_last', array(__CLASS__, 'add_agreement_option'));
         add_action('si_save_line_items_meta_box', array(__CLASS__, 'save_agreement_selection'));
     }
 }
 public static function get_doc_agreement_id($doc_id = 0)
 {
     $default = get_post_meta($doc_id, self::DOC_ID_META, true);
     if ('' === $default) {
         if (SI_Estimate::POST_TYPE === get_post_type($doc_id)) {
             $default = ApproveMe_Settings::get_agreement_doc_estimates();
         } else {
             $default = ApproveMe_Settings::get_agreement_doc();
         }
     }
     return $default;
 }