Example #1
0
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or   |
// | modify it under the terms of the GNU General Public License as  |
// | published by the Free Software Foundation, either version 3 of  |
// | the License, or any later version.                              |
// |                                                                 |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of  |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   |
// | GNU General Public License for more details.                    |
// +-----------------------------------------------------------------+
//  Path: /modules/shipping/methods/table/label_mgr/pre_process.php
//
$shipping_module = 'table';
/**************  include page specific files    *********************/
load_method_language(DEFAULT_MOD_DIR, $shipping_module);
require DIR_FS_WORKING . 'functions/shipping.php';
require DIR_FS_WORKING . 'classes/shipping.php';
require DIR_FS_WORKING . 'methods/' . $shipping_module . '/' . $shipping_module . '.php';
/**************   page specific initialization  *************************/
$error = false;
$sInfo = new shipment();
// load defaults
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
        $sInfo->purchase_invoice_id = db_prepare_input($_POST['purchase_invoice_id']);
        $sInfo->ship_method = db_prepare_input($_POST['ship_method']);
        $sInfo->ship_date = gen_db_date($_POST['ship_date']);
        $sInfo->deliver_date = gen_db_date($_POST['deliver_date']);
        $sInfo->tracking_id = db_prepare_input($_POST['tracking_id']);
Example #2
0
 function loadShippingMethods()
 {
     global $shipping_defaults;
     $method_array = array();
     // load standard shipping methods
     $methods = scandir(DIR_FS_MODULES . 'shipping/methods/');
     foreach ($methods as $method) {
         if ($method != '.' && $method != '..' && defined('MODULE_SHIPPING_' . strtoupper($method) . '_STATUS')) {
             $method_array[] = $method;
         }
     }
     $output = array();
     $choices = array_keys($shipping_defaults['service_levels']);
     if (sizeof($method_array) > 0) {
         foreach ($method_array as $method) {
             load_method_language(DIR_FS_MODULES . 'shipping/methods/', $method);
             $output[$method]['title'] = constant('MODULE_SHIPPING_' . strtoupper($method) . '_TEXT_TITLE');
             foreach ($choices as $value) {
                 $output[$method][$value] = defined($method . '_' . $value) ? constant($method . '_' . $value) : "";
             }
         }
     }
     return $output;
 }
 /**
  * Set the language for error messages.
  * Returns false if it cannot load the language file.
  * The default language is English.
  * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
  * @param string $lang_path Path to the language file directory, with trailing separator (slash)
  * @return bool
  * @access public
  */
 public function setLanguage($langcode = 'en', $lang_path = 'language/')
 {
     //Define full set of translatable strings
     load_method_language(DIR_FS_MODULES . 'phreedom/includes/PHPMailer');
     $PHPMAILER_LANG = array('authenticate' => PHPMAILER_AUTH, 'connect_host' => PHPMAILER_CH, 'data_not_accepted' => PHPMAILER_DNA, 'encoding' => PHPMAILER_ENC, 'empty_message' => PHPMAILER_EMP_MSG, 'execute' => PHPMAILER_EXE, 'file_access' => PHPMAILER_FA, 'file_open' => PHPMAILER_FO, 'from_failed' => PHPMAILER_FFAIL, 'invalid_address' => PHPMAILER_INV_ADD, 'instantiate' => PHPMAILER_INST, 'provide_address' => PHPMAILER_PA, 'mailer_not_supported' => PHPMAILER_MNS, 'recipients_failed' => PHPMAILER_RFAIL, 'signing' => PHPMAILER_SIGN, 'smtp_connect_failed' => PHPMAILER_CONN_FAILT, 'smtp_error' => PHPMAILER_SMTP_ERR, 'variable_set' => PHPMAILER_VAR_SET);
     /*
             //Overwrite language-specific strings.
             //This way we'll never have missing translations - no more "language string failed to load"!
             $l = true;
             $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
             if ($langcode != 'en') { //There is no English translation file
                 //Make sure language file path is readable
                 if (!is_readable($lang_file)) {
                     $l = false;
                 } else {
                     $l = include $lang_file;
                 }
             }*/
     $this->language = $PHPMAILER_LANG;
     //        return ($l == true); //Returns false if language not found
     return true;
     // ******************** BOF - Modified by PhreeBooks ********************
 }
Example #4
0
echo TEXT_SHOW;
?>
</th>
		<th><?php 
echo TEXT_TITLE;
?>
</th>
		<th><?php 
echo TEXT_DESCRIPTION;
?>
</th>
	  </tr>
	</thead>
	<tbody class="ui-widget-content">
<?php 
$odd = true;
foreach ($dashboards as $dashboard) {
    load_method_language(DIR_FS_MODULES . $dashboard['module_id'] . '/dashboards/', $dashboard['dashboard_id']);
    require_once DIR_FS_MODULES . $dashboard['module_id'] . '/dashboards/' . $dashboard['dashboard_id'] . '/' . $dashboard['dashboard_id'] . '.php';
    $dashboard = new $dashboard['dashboard_id']();
    echo $dashboard->pre_install($odd, $my_profile);
    // returns nothing if user isn't valid.
    if ($dashboard->valid_user) {
        $odd = !$odd;
    }
    //so only update if user is valid.
}
?>
    </tbody>
  </table>
</form>
function load_specific_method($module, $method)
{
    $method_dir = DIR_FS_MODULES . $module . '/methods/';
    load_method_language($method_dir, $method);
    if (file_exists($method_dir . $method . '/' . $method . '.php')) {
        require_once $method_dir . $method . '/' . $method . '.php';
    }
    return $method;
}
Example #6
0
//
define('DEFAULT_MOD_DIR', DIR_FS_MODULES . 'shipping/methods/');
$security_level = validate_user(0, true);
/**************  include page specific files  *********************/
gen_pull_language('contacts');
require_once DIR_FS_WORKING . 'defaults.php';
require_once DIR_FS_WORKING . 'functions/shipping.php';
require_once DIR_FS_WORKING . 'classes/shipping.php';
/**************   page specific initialization  *************************/
$error = false;
$pkg = new shipment();
$methods = array();
$files = scandir(DEFAULT_MOD_DIR);
foreach ($files as $choice) {
    if (defined('MODULE_SHIPPING_' . strtoupper($choice) . '_STATUS')) {
        load_method_language(DEFAULT_MOD_DIR, $choice);
        $methods[] = $choice;
    }
}
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/popup_shipping/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'rates':
        // overwrite the defaults with data from the form
        reset($_POST);
        while (list($key, $value) = each($_POST)) {
            $pkg->{$key} = db_prepare_input($value);
Example #7
0
if (substr($_REQUEST['action'], 0, 8) == 'install_') {
    $method = substr($_REQUEST['action'], 8);
    $_REQUEST['action'] = 'install';
} elseif (substr($_REQUEST['action'], 0, 7) == 'remove_') {
    $method = substr($_REQUEST['action'], 7);
    $_REQUEST['action'] = 'remove';
} elseif (substr($_REQUEST['action'], 0, 7) == 'signup_') {
    $method = substr($_REQUEST['action'], 7);
    $_REQUEST['action'] = 'signup';
}
// load the available methods
$methods = array();
$contents = scandir($method_dir);
foreach ($contents as $choice) {
    if ($choice != '.' && $choice != '..') {
        load_method_language($method_dir, $choice);
        $methods[] = $choice;
    }
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'install':
        validate_security($security_level, 4);
        require_once $method_dir . $method . '/' . $method . '.php';
        $properties = new $method();
        write_configure('MODULE_SHIPPING_' . strtoupper($method) . '_STATUS', '1');
        foreach ($properties->keys() as $key) {
            write_configure($key['key'], $key['default']);
        }
        if (method_exists($properties, 'install')) {
            $properties->install();
Example #8
0
    if ($cp_boxes->fields['column_id'] != $column) {
        while ($cp_boxes->fields['column_id'] != $column) {
            $column++;
            echo '      </div>' . chr(10);
            echo '    </td>' . chr(10);
            echo '    <td width="33%" valign="top">' . chr(10);
            echo '      <div id="col_' . $column . '" style="position:relative;">' . chr(10);
        }
    }
    $dashboard = $cp_boxes->fields['dashboard_id'];
    $module_id = $cp_boxes->fields['module_id'];
    $column_id = $cp_boxes->fields['column_id'];
    $row_id = $cp_boxes->fields['row_id'];
    $params = unserialize($cp_boxes->fields['params']);
    if (file_exists(DIR_FS_MODULES . "{$module_id}/dashboards/{$dashboard}/{$dashboard}.php")) {
        load_method_language(DIR_FS_MODULES . "{$module_id}/dashboards/{$dashboard}");
        require_once DIR_FS_MODULES . "{$module_id}/dashboards/{$dashboard}/{$dashboard}.php";
        $new_box = new $dashboard();
        $new_box->menu_id = $menu_id;
        $new_box->module_id = $module_id;
        $new_box->column_id = $cp_boxes->fields['column_id'];
        $new_box->row_id = $cp_boxes->fields['row_id'];
        echo $new_box->Output($params);
    }
    $cp_boxes->MoveNext();
}
while (MAX_CP_COLUMNS != $column) {
    // fill remaining columns with blank space
    $column++;
    echo '      </div>' . chr(10);
    echo '    </td>' . chr(10);
Example #9
0
// +-----------------------------------------------------------------+
// |                   PhreeBooks Open Source ERP                    |
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft      (www.PhreeSoft.com)       |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or   |
// | modify it under the terms of the GNU General Public License as  |
// | published by the Free Software Foundation, either version 3 of  |
// | the License, or any later version.                              |
// |                                                                 |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of  |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   |
// | GNU General Public License for more details.                    |
// +-----------------------------------------------------------------+
//  Path: /modules/shipping/pages/popup_label_mgr/pre_process.php
//
$security_level = validate_user(SECURITY_ID_SHIPPING_MANAGER);
/**************   page specific initialization  *************************/
gen_pull_language('contacts');
require_once DIR_FS_WORKING . 'defaults.php';
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/popup_label_mgr/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
$method = $_GET['method'];
$cal_ship = array('name' => 'dateShipped', 'form' => 'label_mgr', 'fieldname' => 'ship_date', 'imagename' => 'deliver_date', 'default' => isset($sInfo->ship_date) ? gen_locale_date($sInfo->ship_date) : date(DATE_FORMAT), 'params' => array('align' => 'left'));
$cal_exp = array('name' => 'dateExpected', 'form' => 'label_mgr', 'fieldname' => 'deliver_date', 'imagename' => 'btn_date_2', 'default' => isset($sInfo->deliver_date) ? gen_locale_date($sInfo->deliver_date) : date(DATE_FORMAT), 'params' => array('align' => 'left'));
load_method_language(DIR_FS_MODULES . 'shipping/methods/', $method);
include_once DIR_FS_MODULES . 'shipping/methods/' . $method . '/label_mgr/pre_process.php';
Example #10
0
// | This program is free software: you can redistribute it and/or   |
// | modify it under the terms of the GNU General Public License as  |
// | published by the Free Software Foundation, either version 3 of  |
// | the License, or any later version.                              |
// |                                                                 |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of  |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   |
// | GNU General Public License for more details.                    |
// +-----------------------------------------------------------------+
//  Path: /modules/shipping/methods/fedex_v7/generate_sample.php
//
/**************   Check user security   *****************************/
// none
/**************  include page specific files    *********************/
load_method_language(DIR_FS_WORKING . 'methods/', 'fedex_v7');
require DIR_FS_WORKING . 'defaults.php';
require DIR_FS_WORKING . 'functions/shipping.php';
require DIR_FS_WORKING . 'classes/shipping.php';
require DIR_FS_MODULES . 'phreedom/classes/backup.php';
require DIR_FS_WORKING . 'methods/fedex_v7/fedex_v7.php';
require DIR_FS_WORKING . 'methods/fedex_v7/sample_data.php';
/**************   page specific initialization  *************************/
$error = false;
$backup = new backup();
$backup->source_dir = DIR_FS_MY_FILES . $_SESSION['company'] . '/temp/fedex_qual/';
$backup->dest_dir = DIR_FS_MY_FILES . 'backups/';
$backup->dest_file = 'fedex_qual.zip';
/***************   Act on the action request   *************************/
// retrieve the sample ship to addresses and query FEDEX_V7
$count = 1;
Example #11
0
$sel_language = build_lang_list();
$sel_translated = build_trans_list();
$include_header = true;
$include_footer = false;
$include_template = 'template_main.php';
switch ($_REQUEST['action']) {
    case 'new':
        $include_template = 'template_new.php';
        define('PAGE_TITLE', TEXT_NEW_TRANSLATION);
        break;
    case 'edit':
    case 'filter':
        if (strpos($mod, '-') !== false) {
            // it's a module, load that language file
            $parts = explode('-', $mod);
            load_method_language(DIR_FS_MODULES . $parts[0] . '/methods/', $parts[1]);
        } else {
            gen_pull_language($mod);
            gen_pull_language($mod, 'admin');
        }
        $heading_array = array(TEXT_TRANSLATED, TEXT_TRANSLATION, TEXT_DEFAULT_TRANSLATION, TEXT_CONSTANT);
        $result = html_heading_bar(array(), $heading_array);
        $list_header = $result['html_code'];
        if ($mod) {
            $criteria[] = "module = '" . $mod . "'";
        }
        if ($lang) {
            $criteria[] = "language = '" . $lang . "'";
        }
        if ($ver) {
            $criteria[] = "version = '" . $ver . "'";
Example #12
0
    if (!($handle = @fopen($file_name, 'w'))) {
        $messageStack->add('Cannot open file (' . $file_name . ')', 'error');
        return false;
    }
    if (@fwrite($handle, $data) === false) {
        $messageStack->add('Cannot write to file (' . $file_name . ')', 'error');
        return false;
    }
    fclose($handle);
    return true;
}
/**************   Check user security   *****************************/
// none
/**************  include page specific files    *********************/
gen_pull_language('phreedom', 'admin');
load_method_language(DIR_FS_MODULES . 'shipping/methods/', 'fedex_v7');
require DIR_FS_WORKING . 'defaults.php';
require DIR_FS_WORKING . 'functions/shipping.php';
require DIR_FS_WORKING . 'classes/shipping.php';
require DIR_FS_MODULES . 'phreedom/classes/backup.php';
require DIR_FS_WORKING . 'methods/fedex_v7/fedex_v7.php';
require DIR_FS_WORKING . 'pages/fedex_v7_qualify/sample_data.php';
/**************   page specific initialization  *************************/
$error = false;
$backup = new backup();
$backup->source_dir = DIR_FS_MY_FILES . $_SESSION['company'] . '/temp/fedex_qual/';
$backup->dest_dir = DIR_FS_MY_FILES . 'backups/';
$backup->dest_file = 'fedex_qual.zip';
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'go':
Example #13
0
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or   |
// | modify it under the terms of the GNU General Public License as  |
// | published by the Free Software Foundation, either version 3 of  |
// | the License, or any later version.                              |
// |                                                                 |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of  |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   |
// | GNU General Public License for more details.                    |
// +-----------------------------------------------------------------+
//  Path: /modules/shipping/methods/endicia/signup.php
//
gen_pull_language('contacts');
gen_pull_language('payment');
load_method_language($mod_dir . $method);
$output = array('width' => '400', 'action' => 'changePassPhrase', 'method' => $method);
$html = '<h1>' . ENDICIA_CHANGE_PASSPHRASE . '</h1>' . "\n";
$html .= '<table class="ui-widget" style="margin-left:auto;margin-right:auto">' . "\n";
$html .= ' <thead class="ui-widget-header"><tr><th colspan="2">' . '&nbsp;' . '</th></tr></thead>' . "\n";
$html .= ' <tbody class="ui-widget-content">' . "\n";
$html .= '  <tr>' . "\n";
$html .= '   <td colspan="2">' . SHIPPING_ENDICIA_PASSPHRASE_CHANGE_DESC . '</td>' . "\n";
$html .= '  </tr>' . "\n";
$html .= '  <tr>' . "\n";
$html .= '   <td>' . TEXT_PASSPHRASE_NOW . '</td>' . "\n";
$html .= '   <td>' . html_password_field('pass_phrase_current', '', true) . '</td>' . "\n";
$html .= '  </tr>' . "\n";
$html .= '  <tr>' . "\n";
$html .= '   <td>' . TEXT_PASSPHRASE . '</td>' . "\n";
$html .= '   <td>' . html_password_field('pass_phrase_new', '', true) . '</td>' . "\n";