Exemplo n.º 1
0
 function getPresentOrderTotalAndCurrency($order_id)
 {
     $currency_id = modApiFunc("Localization", "whichCurrencySendOrderToPaymentShippingGatewayIn", $order_id, $this->getUid());
     $currency = modApiFunc("Localization", "getCurrencyCodeById", $currency_id);
     $order = modApiFunc('Checkout', 'getOrderInfo', $order_id, $currency_id);
     return array('total' => floatval($order['Total']), 'curr' => $currency, 'msg' => getMsg('CHCKT', 'PAYMENT_STATUS_SUSPICIOUS'));
 }
 function onAction()
 {
     global $application;
     $emails_keys = modApiFunc('Request', 'getValueByKey', 'emails');
     $emails_topics = modApiFunc('Request', 'getValueByKey', 'topic');
     $customer_id = modApiFunc('Request', 'getValueByKey', 'customer_id');
     if (!is_array($emails_topics)) {
         $emails_topics = array();
     }
     foreach (array_keys($emails_keys) as $email) {
         $topics = @$emails_topics[$email];
         if (!is_array($topics)) {
             $topics = array();
         }
         modApiFunc('Subscriptions', 'changeSubscriptions', $email, $topics);
         $params = array('customer_id' => $customer_id, 'email' => $email);
         execQuery('SUBSCR_LINK_SUBSCRIPTION_TO_CUSTOMER', $params);
     }
     $messages['MESSAGES'][] = getMsg('SYS', 'SUBSCRIPTIONS_UPDATED');
     modApiFunc('Session', 'set', 'AplicationSettingsMessages', $messages);
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setKey('page_view', modApiFunc('Request', 'getValueByKey', 'page_view'));
     $request->setKey('customer_id', $customer_id);
     $application->redirect($request);
 }
Exemplo n.º 3
0
function about_content()
{
    global $mos;
    global $nav_lang;
    if (!isset($_REQUEST['mod'])) {
        return;
    }
    $mod = $_REQUEST['mod'];
    $fa = $mos . '/etc/about/' . $mod . '.' . $nav_lang . '.html';
    if (file_exists($fa)) {
        readfile($fa);
        return;
    }
    $fa = $mos . '/etc/about/' . $mod . '.en.html';
    if (file_exists($fa)) {
        readfile($fa);
        return;
    }
    $fa = $mos . '/etc/about/' . $mod . '.ru.html';
    if (file_exists($fa)) {
        readfile($fa);
    } else {
        echo getMsg('coreNoAbout');
    }
}
 function onAction()
 {
     $errors = array();
     $topics = modApiFunc('Request', 'getValueByKey', 'topic');
     if ($topics && is_array($topics)) {
         $this->key = modApiFunc('Request', 'getValueByKey', 'key_unsubscribe');
         $this->rec = modApiFunc('Newsletter', 'getUnsubscribeRecord', $this->key);
         if ($this->rec) {
             $email = modApiFunc('Subscriptions', 'getEmailById', $this->rec['email_id']);
             if ($email) {
                 modApiFunc('Subscriptions', 'unsubscribeEmails', $topics, $email);
             } else {
                 $errors[] = getMsg('SUBSCR', 'ERROR_UNSUBSCRIBE_GENERAL');
             }
         } else {
             $errors[] = getMsg('SUBSCR', 'ERROR_UNSUBSCRIBE_GENERAL');
         }
     } else {
         $errors[] = getMsg('SUBSCR', 'ERROR_UNSUBSCRIBE_NO_TOPICS');
     }
     $SessionPost['ViewState']['ErrorsArray'] = $errors;
     $SessionPost['ViewState']['Stage'] = 'finish';
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     global $application;
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $application->redirect($request);
 }
Exemplo n.º 5
0
 function getTag($tag)
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Local_PaymentMethodName':
             $ModuleInfo = modApiFunc($this->ModuleAPIClassName, "getInfo");
             $value = $ModuleInfo['Name'];
             break;
         case 'Local_PaymentMethodMessage':
             $cost = modApiFunc($this->ModuleAPIClassName, "getPerOrderPaymentModuleShippingFee");
             if (!empty($cost)) {
                 $value = getMsg("PM_COD", "MODULE_PER_ORDER_SHIPPING_FEE_CZ_TEXT");
                 $value = str_replace("{cost}", modApiFunc("Localization", "currency_format", $cost), $value);
             } else {
                 $value = "";
             }
             break;
             //                $ModuleInfo = modApiFunc($this->ModuleAPIClassName, "getInfo");
             //                $value = "<b>" . $ModuleInfo['Description'] . "</b>";
             //                break;
         //                $ModuleInfo = modApiFunc($this->ModuleAPIClassName, "getInfo");
         //                $value = "<b>" . $ModuleInfo['Description'] . "</b>";
         //                break;
         default:
             break;
     }
     return $value;
 }
 function outputTaxNamesList()
 {
     global $application;
     $retval = "";
     if ($this->TaxNamesList == NULL) {
         $retval .= modApiFunc('TmplFiller', 'fill', "taxes/tax-settings/", "tax_name_item_na.tpl.html", array());
         for ($i = 0; $i < $this->maxRows - 1; $i++) {
             $retval .= modApiFunc('TmplFiller', 'fill', "taxes/tax-settings/", "tax_name_item_empty.tpl.html", array());
         }
     } else {
         $n = sizeof($this->TaxNamesList);
         $i = 1;
         foreach ($this->TaxNamesList as $TaxNameInfo) {
             $TaxNameInfo['included_into_price'] = $TaxNameInfo['included_into_price'] == "true" ? "<i>(" . getMsg('SYS', 'TAX_NAMES_HEADER_003') . ")</i>" : "";
             if ($TaxNameInfo['NeedsAddress'] == DB_TRUE) {
                 $TaxNameInfo['Address'] = $this->MessageResources->getMessage($TaxNameInfo['Address']);
             } else {
                 $TaxNameInfo['Address'] = $this->MessageResources->getMessage('TAX_ADDRESS_NAME_1025');
             }
             $TaxNameInfo['I'] = $i;
             $TaxNameInfo['Name'] = prepareHTMLDisplay($TaxNameInfo['Name']);
             $this->_Template_Contents = $TaxNameInfo;
             $application->registerAttributes($this->_Template_Contents);
             $retval .= modApiFunc('TmplFiller', 'fill', "taxes/tax-settings/", "tax_name_item.tpl.html", array());
             $i++;
         }
         if ($n < $this->maxRows) {
             for ($i = 0; $i < $this->maxRows - $n; $i++) {
                 $retval .= modApiFunc('TmplFiller', 'fill', "taxes/tax-settings/", "tax_name_item_empty.tpl.html", array());
             }
         }
     }
     return $retval;
 }
 /**
  * Outputs a list of specified views.
  */
 function outputNotificationsList()
 {
     global $application;
     $retval = "";
     $list = modApiFunc("Notifications", "getNotificationsList");
     $n = sizeof($list);
     if ($n == 0) {
         $retval .= modApiFunc('TmplFiller', 'fill', "notifications/list/", "item_na.tpl.html", array());
         $n++;
     } else {
         $i = 0;
         foreach ($list as $item) {
             $request = new Request();
             $request->setView('NotificationInfo');
             $request->setAction('SetCurrentNotification');
             $request->setKey('n_id', $item['Id']);
             $Info_Link = $request->getURL();
             $item['I'] = $i;
             $item['InfoLink'] = $Info_Link;
             $item['Active'] = $item['Active'] == 'checked' ? getMsg('NTFCTN', 'NTFCTN_INFO_YES_LABEL') : getMsg('NTFCTN', 'NTFCTN_INFO_NO_LABEL');
             $item['From_addr'] = modApiFunc("Notifications", "getExtendedEmail", $item['From_addr'], $item['Email_Code'], false, !empty($item['Admin_ID']) ? $item['Admin_ID'] : NULL);
             $this->_Template_Contents = $item;
             $application->registerAttributes($this->_Template_Contents);
             $retval .= modApiFunc('TmplFiller', 'fill', "notifications/list/", "item.tpl.html", array());
             $i++;
         }
     }
     for ($i = 0; $i < 10 - $n; $i++) {
         $retval .= modApiFunc('TmplFiller', 'fill', "notifications/list/", "item_empty.tpl.html", array());
     }
     return $retval;
 }
Exemplo n.º 8
0
 function output($group_id_range_from = 0, $group_id_range_to = 999999, $group_title)
 {
     $groups = modApiFunc('Reports', 'getReportGroups');
     $current_group_id = (int) modApiFunc('Request', 'getValueByKey', 'report_group_id');
     if ($current_group_id !== null and isset($groups[$current_group_id])) {
         $current_group_id = (int) $current_group_id;
     } else {
         reset($groups);
         $current_group_id = array_keys($groups);
         $current_group_id = $current_group_id[0];
     }
     $links = '';
     foreach ($groups as $grp_id => $grp) {
         if ($grp_id < $group_id_range_from or $grp_id > $group_id_range_to) {
             continue;
         }
         $data = array();
         $data['LinkName'] = $grp['GROUP_NAME'];
         $data['LinkDescription'] = $grp['GROUP_DESCRIPTION'];
         $request = new Request();
         $request->setView(CURRENT_REQUEST_URL);
         $request->setKey('report_group_id', $grp_id);
         $data['LinkHref'] = $request->getURL();
         if ($current_group_id === $grp_id and $current_group_id >= $group_id_range_from and $current_group_id <= $group_id_range_to) {
             $links .= $this->_TmplFiller->fill("", "group-link-selected.tpl.html", $data);
         } else {
             $links .= $this->_TmplFiller->fill("", "group-link.tpl.html", $data);
         }
     }
     return $this->_TmplFiller->fill("", "container.tpl.html", array('ReportGroupLinks' => $links, 'Title' => getMsg('RPTS', $group_title)));
 }
 /**
  *
  */
 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $instance = $request->getValueByKey('instance');
     $log_clear_type = $request->getValueByKey('log_clear_type');
     $value = '';
     switch ($instance) {
         case 'cache':
             CCacheFactory::clearAll();
             $value = getMsg("SYS", "MSG_CACHE_CLEARED");
             if (APC_EXTENSION_LOADED) {
                 apc_clear_cache("user");
             }
             break;
         case 'timeline':
             modApiFunc('Timeline', 'clearTimeline', $log_clear_type);
             $timeline = modApiFunc('Timeline', 'getTimelineRecsCount');
             if ($timeline == 0) {
                 $value = getMsg("SYS", "ADMIN_PHP_FILES_NO_LOG_RECORDS");
             } else {
                 $value = $timeline . getMsg("SYS", "ADMIN_PHP_FILES_LOG_RECORDS");
             }
             break;
         default:
             break;
     }
     return $value;
 }
 function outputResultMessage()
 {
     global $application;
     if (modApiFunc("Session", "is_set", "ResultMessage")) {
         $msg = modApiFunc("Session", "get", "ResultMessage");
         modApiFunc("Session", "un_set", "ResultMessage");
         $template_contents = array("ResultMessage" => getMsg('RP', $msg));
         $this->_Template_Contents = $template_contents;
         $application->registerAttributes($this->_Template_Contents);
         $this->mTmplFiller =& $application->getInstance('TmplFiller');
         return $this->mTmplFiller->fill("related_products/misc/", "result-message.tpl.html", array());
     } elseif (modApiFunc("Session", "is_set", "Errors")) {
         $return_html_code = "";
         $errors = modApiFunc("Session", "get", "Errors");
         modApiFunc("Session", "un_set", "Errors");
         foreach ($errors as $ekey => $eval) {
             $template_contents = array("ErrorMessage" => getMsg('RP', $eval));
             $this->_Template_Contents = $template_contents;
             $application->registerAttributes($this->_Template_Contents);
             $this->mTmplFiller =& $application->getInstance('TmplFiller');
             $return_html_code .= $this->mTmplFiller->fill("related_products/misc/", "error-message.tpl.html", array());
         }
         return $return_html_code;
     } else {
         return "";
     }
 }
 /**
  * Deletes tax rate by zip set.
  */
 function onAction()
 {
     global $application;
     $SessionPost = array();
     $SessionPost = $_POST;
     $Errors = array();
     $Result = array();
     $request = new Request();
     $request->setView("PopupWindow");
     $updateSid = $request->getValueByKey("updateSid", 0);
     if ($updateSid) {
         $request->setKey("updateSid", $updateSid);
     }
     $description = '';
     if (isset($_POST['file_description'])) {
         $description = prepareHTMLDisplay(trim($_POST['file_description']));
     }
     if ($description == '') {
         $SessionPost['Errors'][] = getMsg("TAX_ZIP", "ADD_NEW_SET_EMPTY_FILE_DESCRIPTION_ERROR");
         modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
         $request->setKey("page_view", "TaxRateByZip_AddNewSet");
         $application->redirect($request);
         return;
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $sid = modApiFunc("TaxRateByZip", "addSetToDB", $description, $_POST["csv_file_name"]);
     $request->setKey("page_view", "TaxRatesImportView");
     $request->setKey("sid", $sid);
     $application->redirect($request);
 }
 function onAction()
 {
     global $application;
     $this->topics = modApiFunc('Request', 'getValueByKey', 'topic');
     if (empty($this->topics)) {
         $this->topics = array();
     }
     $SessionPost = array();
     $this->email = trim(modApiFunc('Request', 'getValueByKey', 'email'));
     if (modApiFunc('Users', 'isValidEmail', $this->email)) {
         if (modApiFunc('Subscriptions', 'canClientUnsubscribe')) {
             $ViewState = $this->changeSubscriptions();
         } else {
             $ViewState = $this->addSubscriptions();
         }
         $SessionPost['ViewState'] = $ViewState;
         if ($this->signed_in) {
             $params = array('account' => $this->account, 'email' => $this->email);
             execQuery('SUBSCR_LINK_SUBSCRIPTION_TO_CUSTOMER', $params);
         } else {
             modApiFunc('Subscriptions', 'setCustomerSubscribedEmail', $this->email);
         }
     } else {
         $SessionPost['ViewState']['ErrorsArray'][] = getMsg('SUBSCR', 'ERROR_SUBSCR_INVALID_EMAIL');
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $r = new Request();
     $r->setView(CURRENT_REQUEST_URL);
     $r->setAnchor('subscribe_box');
     $application->redirect($r);
 }
Exemplo n.º 13
0
 /**
  *
  * Params_Verify
  * @param string $v  this is value
  * @param string $code this is md5code string
  */
 public function Params_Verify($v = '', $code = '')
 {
     //截取前五位
     $md5_str = md5($v . C('PARAMS_AUTH_CODE'));
     if (substr($md5_str, 0, 6) != $code) {
         return getMsg('Illegal request');
     }
 }
Exemplo n.º 14
0
function info_body()
{
    $id = 1;
    function showInfo($cmd)
    {
        global $id;
        ?>
<div class="info_frame">
<a href="#" onclick="look('l_<?php 
        echo $id;
        ?>
','t_<?php 
        echo $id;
        ?>
')"><div id="t_<?php 
        echo $id;
        ?>
" class="info_topic"><?php 
        echo $cmd;
        ?>
</div></a>
<div id="l_<?php 
        echo $id;
        ?>
" class="info_list"><pre>
<?php 
        exec($cmd, $lines);
        foreach ($lines as $s) {
            echo "{$s}\n";
        }
        $id += 1;
        ?>
</pre></div></div><br />
<?php 
    }
    ?>
<div id="container">
<h3><?php 
    echo getMsg('coreInfo');
    ?>
</h3>
<?php 
    showInfo("/bin/uname -a");
    showInfo("cat /proc/cpuinfo");
    showInfo("cat /proc/meminfo");
    showInfo("/sbin/lsmod");
    showInfo("/bin/ps -w");
    showInfo("/bin/dmesg");
    showInfo("/bin/busybox");
    showInfo("cat /proc/mounts");
    showInfo("/bin/df -h");
    showInfo("/sbin/fdisk -l");
    showInfo("/sbin/ifconfig");
    showInfo("/sbin/route");
    showInfo("cat /etc/resolv.conf");
    showInfo("set");
    echo "</div>\n";
}
 function out_AttrsGroup($group_name)
 {
     global $application;
     $template_contents = array('GroupName' => getMsg('CA', 'PIG_' . _ml_strtoupper($group_name)), 'GroupAttrs' => $this->out_Attributes($group_name));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("customer_account/export_customers/", "group-container.tpl.html", array());
 }
 /**
  *               -
  *
  * @param array $settings -        settings
  * @param ref array of strings $warnings -                      ,
  * @param ref array of strings $errors -              ,
  */
 function initWork($settings)
 {
     $this->clearWork();
     $this->_settings = array('out_file' => $settings['out_file'], "sid" => $settings["sid"], "updateSid" => $settings["updateSid"], 'headers' => $settings['headers'], 'csv_delimiter' => ',', "total_string_number" => 0, "valid_string_number" => 0);
     $_SESSION["rates_import_data"] = array();
     modApiFunc("TaxRateByZip", "clearSetInDB", $this->_settings["sid"]);
     $this->_messages = getMsg('TAX_ZIP', 'IMPORT_SET_STARTING_IMPORT');
     $this->_process_info['status'] = 'INITED';
 }
Exemplo n.º 17
0
 function initQuery($params)
 {
     $tables = Timeline::getTables();
     $c = $tables['timeline']['columns'];
     $this->addSelectField($c['type'], 'types');
     $this->WhereValue($c['type'], DB_NEQ, getMsg('TL', 'TL_CATTREE_TITLE'));
     $this->SelectOrder($c['type']);
     $this->SelectGroup($c['type']);
 }
 function setColumns()
 {
     switch (_ml_strtolower($this->__render_class_name)) {
         default:
             $this->__render_settings->setColumnList(array('date', 'items_sold', 'product_views', 'cr_views_sold'));
             $this->__render_settings->setColumnHeaders(array('date' => getMsg('RPTS', 'DATE'), 'items_sold' => getMsg('RPTS', 'ITEMS_SOLD'), 'product_views' => getMsg('RPTS', 'PRODUCT_VIEWS'), 'cr_views_sold' => getMsg('RPTS', 'RATE_VIEWS_VS_ITEMS_SOLD')));
             $this->__render_settings->setColumnUnits(array('date' => '', 'items_sold' => getMsg('RPTS', 'ITEMS_SOLD_UNIT'), 'product_views' => getMsg('RPTS', 'PRODUCT_VIEWS_UNIT'), 'cr_views_sold' => getMsg('RPTS', 'RATE_VIEWS_VS_ITEMS_SOLD_UNIT')));
             break;
     }
 }
Exemplo n.º 19
0
 function renderMessages($messages, $tpl)
 {
     $this->__msg = '';
     foreach ($messages as $msg) {
         $this->__msg .= getMsg("SYS", $msg) . "<br>";
     }
     $html = modApiFunc('TmplFiller', 'fill', "configuration/setting-param-list/", $tpl, array());
     $this->__msg = '';
     return $html;
 }
Exemplo n.º 20
0
 function output()
 {
     global $application;
     $fargs = func_get_args();
     $template_contents = array('ParentBlock' => $fargs[0], 'ParentField' => $fargs[1], 'Local_FSBrowser' => getFSBrowser('FS', $this->fsbrowser_tag . $fargs[1], $this->fsbrowser_file_tag . $fargs[1]), 'PostJScode' => $fargs[2], 'SelectorType' => empty($fargs[3]) ? "" : $fargs[3], 'MsgAboutFileSize' => getMsg('SH', 'MSG_ABOUT_MAX_FILE_SIZE', modApiFunc('Localization', 'formatFileSize', modApiFunc('Shell', 'getMaxUploadSize'))));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("shell/" . $this->template_folder . "/", "container.tpl.html", array());
 }
 function setColumns()
 {
     switch (_ml_strtolower($this->__render_class_name)) {
         default:
             $this->__render_settings->setColumnList(array('date', 'items_sold', 'product_added_to_cart_qty', 'cr_added_sold'));
             $this->__render_settings->setColumnHeaders(array('date' => getMsg('RPTS', 'DATE'), 'items_sold' => getMsg('RPTS', 'ITEMS_SOLD'), 'product_added_to_cart_qty' => getMsg('RPTS', 'ITEMS_ADDED_TO_CART'), 'cr_added_sold' => getMsg('RPTS', 'RATE_CART_VS_ITEMS_SOLD')));
             $this->__render_settings->setColumnUnits(array('date' => '', 'items_sold' => getMsg('RPTS', 'ITEMS_SOLD_UNIT'), 'product_added_to_cart_qty' => getMsg('RPTS', 'ITEMS_ADDED_TO_CART_UNIT'), 'cr_added_sold' => getMsg('RPTS', 'RATE_CART_VS_ITEMS_SOLD_UNIT')));
             break;
     }
 }
 function out_ListColumnHeader($header_name)
 {
     global $application;
     switch ($header_name) {
         case 'name':
             $column_lang_code = 'LBL_NAME';
             break;
     }
     $column_name = getMsg('CA', $column_lang_code);
     return $column_name;
 }
 function outputBestsellersProducts()
 {
     $hbs_links = modApiFunc('Bestsellers_API', 'getHardBSLinksForCategory', $this->category_id);
     $sbs_links = modApiFunc('Bestsellers_API', 'getStatBSLinksForCategory', $this->category_id);
     $links = array_unique(array_merge($hbs_links, $sbs_links));
     if (sizeof($links) == 0) {
         return '<p class="text-center bold">' . getMsg('CTL', 'CTG_RVW_NO_BSTS') . '</p>';
     }
     $per_line = modApiFunc('Configuration', 'getValue', SYSCONFIG_BS_PER_LINE);
     return $this->outputLinkedProducts($links, $per_line);
 }
 /**
  * Rmoves the product from the wishlist.
  */
 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $wl_id = $request->getValueByKey('wl_id');
     modApiFunc('Wishlist', 'removeFromWishlist', $wl_id);
     modApiFunc('Session', 'set', 'WishlistResultMessage', getMsg('CZ', 'WL_ITEM_REMOVED'));
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $application->redirect($request);
 }
Exemplo n.º 25
0
 function output()
 {
     global $application;
     $settings = modApiFunc('Quick_Books', 'getSettings');
     $op_as_inv_select = array("select_name" => "qbs[OP_AS_INV]", "selected_value" => $settings['OP_AS_INV'], 'class' => 'form-control input-sm input-xsmall', "values" => array(array('value' => 'Y', 'contents' => getMsg('QB', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('QB', 'LBL_NO'))));
     $template_contents = array("TrnsClassField" => HtmlForm::genInputTextField('255', 'qbs[TRNS_CLASS]', '70', $settings['TRNS_CLASS']), "AccTaxField" => HtmlForm::genInputTextField('255', 'qbs[ACC_TAX]', '70', $settings['ACC_TAX']), "AccProductField" => HtmlForm::genInputTextField('255', 'qbs[ACC_PRODUCT]', '70', $settings['ACC_PRODUCT']), "AccShippingField" => HtmlForm::genInputTextField('255', 'qbs[ACC_SHIPPING]', '70', $settings['ACC_SHIPPING']), "AccInventoryField" => HtmlForm::genInputTextField('255', 'qbs[ACC_INVENTORY]', '70', $settings['ACC_INVENTORY']), "AccGlobalDiscountField" => HtmlForm::genInputTextField('255', 'qbs[ACC_GLOBAL_DISCOUNT]', '70', $settings['ACC_GLOBAL_DISCOUNT']), "AccPromoCodeDiscountField" => HtmlForm::genInputTextField('255', 'qbs[ACC_PROMOCODE_DISCOUNT]', '70', $settings['ACC_PROMOCODE_DISCOUNT']), "AccQuantityDiscountField" => HtmlForm::genInputTextField('255', 'qbs[ACC_QUANTITY_DISCOUNT]', '70', $settings['ACC_QUANTITY_DISCOUNT']), "OpAsInvField" => HtmlForm::genDropdownSingleChoice($op_as_inv_select), "MinQISField" => HtmlForm::genInputTextField('255', 'qbs[MIN_QIS]', '70', $settings['MIN_QIS']), "AccCOGSField" => HtmlForm::genInputTextField('255', 'qbs[ACC_COGS]', '70', $settings['ACC_COGS']), "OrdersPrefixField" => HtmlForm::genInputTextField('255', 'qbs[QB_ORDERS_PREFIX]', '70', $settings['QB_ORDERS_PREFIX']), "ResultMessage" => $this->outputResultMessage());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("quick_books/settings/", "container.tpl.html", array());
 }
Exemplo n.º 26
0
 function outputAcceptedCurrenciesRule($options_values, $selected_value)
 {
     $options = array();
     foreach ($options_values as $rule) {
         $options[] = array("value" => $rule['rule_name'], "contents" => getMsg('SYS', $rule['rule_name']));
     }
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $value = $HtmlForm1->genDropdownSingleChoice(array("onChange" => "try{accepted_currencies_rule_onchange();} catch(ex) {};", "select_name" => "pm_sm_accepted_currencies_rule", "class" => "input-large", "values" => $options, "selected_value" => $selected_value, "id" => "pm_sm_accepted_currencies_rule"));
     return $value;
 }
 /**
  * The main function to output the viewer content.
  */
 function output()
 {
     global $application;
     $def_lng = modApiFunc('MultiLang', 'getDefaultLanguage');
     $request =& $application->getInstance('Request');
     $new_lng = $request->getValueByKey('target');
     if (!modApiFunc('MultiLang', 'checkLanguage', $new_lng, false)) {
         // incorrect language -> forcing redirect to language list
         $req_to_redirect = new Request();
         $req_to_redirect->setView('LanguageList');
         $application->redirect($req_to_redirect);
     }
     $this->_data['old_lng'] = modApiFunc('MultiLang', '_readLanguageNumber', $def_lng);
     $this->_data['new_lng'] = modApiFunc('MultiLang', '_readLanguageNumber', $new_lng);
     // getting the number of new language records
     $this->_data['new_total'] = modApiFunc('MultiLang', 'getTotalLanguageRecordNumber', $this->_data['new_lng']);
     if ($this->_data['old_lng'] <= 0 && $this->_data['new_total'] <= 0 || $this->_data['old_lng'] == $this->_data['new_lng']) {
         // no old language and no new language data -> nothing to do...
         // old language = new language -> nothing to do
         modApiFunc('MultiLang', '_changeDefaultLanguage', $new_lng);
         exit("<script>window.location.replace('store_settings_languages.php');</script>");
     }
     // getting the language names
     if ($this->_data['old_lng'] > 0) {
         $tmp = modApiFunc('MultiLang', 'getLanguageList', false, $def_lng);
         $this->_data['old_lng_name'] = $tmp[0]['lng_name'];
     } else {
         $this->_data['old_lng_name'] = getMsg('ML', 'ML_DEFAULT');
     }
     $tmp = modApiFunc('MultiLang', 'getLanguageList', false, $new_lng);
     $this->_data['new_lng_name'] = $tmp[0]['lng_name'];
     // getting the number of records for all multilang labels
     if ($this->_data['old_lng']) {
         $this->_data['old'] = modApiFunc('MultiLang', 'getAllMLRecordNumbers');
     } else {
         $this->_data['old'] = array();
     }
     // getting the number of multlang records
     $this->_data['new'] = modApiFunc('MultiLang', 'getLanguageRecordNumbers', $this->_data['new_lng']);
     // getting the sum
     $this->_data['old_total'] = 0;
     foreach ($this->_data['old'] as $class => $tables) {
         foreach ($tables as $table => $fields) {
             foreach ($fields as $field => $value) {
                 $this->_data['old_total'] += $value;
             }
         }
     }
     $template_contents = array('CurrentDefLng' => $this->_data['old_lng_name'], 'DesiredDefLng' => $this->_data['new_lng_name'], 'DesiredLngCode' => $new_lng, 'TotalNewRecords' => $this->_data['new_total'], 'TotalOldRecords' => $this->_data['old_total'], 'NewDetails' => $this->outputDetails('new'), 'OldDetails' => $this->outputDetails('old'));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill('multilang/change_default_language/', 'container.tpl.html', array());
 }
Exemplo n.º 28
0
function rss_keyboard_menu_content()
{
    global $keyboards;
    include 'rss_view_popup.php';
    $view = new rssSkinPopupView();
    $view->topTitle = getMsg('coreKbdSel');
    foreach ($keyboards as $id => $kbd) {
        $view->items[] = array('title' => $kbd['title'], 'action' => 'ret', 'link' => getMosUrl() . "?page=xml_keyboard&amp;lang={$id}");
    }
    $view->items[] = array('title' => getMsg('coreCmCancel'), 'action' => 'ret', 'link' => '');
    $view->showRss();
}
 function setColumns()
 {
     switch (_ml_strtolower($this->__render_class_name)) {
         case 'creportrenderflattable':
             $this->__render_settings->setColumnList(array('os_name', 'number', 'percent', 'bar'));
             $this->__render_settings->setColumnHeaders(array('os_name' => getMsg('RPTS', 'OS'), 'percent' => getMsg('RPTS', 'PERCENT'), 'number' => getMsg('RPTS', 'OS_QTY'), 'bar' => ''));
             break;
         default:
             $this->__render_settings->setColumnList(array('os_name', 'number', 'percent'));
             $this->__render_settings->setColumnHeaders(array('os_name' => getMsg('RPTS', 'OS'), 'percent' => getMsg('RPTS', 'PERCENT'), 'number' => getMsg('RPTS', 'OS_QTY')));
             break;
     }
 }
 function setColumns()
 {
     switch (_ml_strtolower($this->__render_class_name)) {
         case 'creportrenderflattable':
             $this->__render_settings->setColumnList(array('page_url', 'view_number', 'percent', 'bar'));
             $this->__render_settings->setColumnHeaders(array('page_url' => getMsg('RPTS', 'PAGE_URL'), 'view_number' => getMsg('RPTS', 'PAGE_VIEWS'), 'percent' => getMsg('RPTS', 'PERCENT'), 'bar' => ''));
             break;
         default:
             $this->__render_settings->setColumnList(array('page_url', 'view_number', 'percent'));
             $this->__render_settings->setColumnHeaders(array('page_url' => getMsg('RPTS', 'PAGE_URL'), 'view_number' => getMsg('RPTS', 'PAGE_VIEWS'), 'percent' => getMsg('RPTS', 'PERCENT'), 'percent' => '%'));
             break;
     }
 }