Skip to content
Browse files

Merge branch 'master' of git://github.com/osCommerce/oscommerce

Conflicts:
	osCommerce/OM/Core/Site/Admin/languages/en_US.php

Note: I use my sortcut icon_titles

Signed-off-by: Gergely <t-gely@freemail.hu>
  • Loading branch information...
2 parents acc2a6d + 4d3da12 commit 62e6d8b82299a05424d3dd26ebdfbc545f40fe6b @tgely committed Sep 4, 2010
Showing with 2,019 additions and 961 deletions.
  1. +5 −1 includes/functions/html_output.php
  2. +22 −0 osCommerce/OM/Core/Database.php
  3. +26 −0 osCommerce/OM/Core/Database/mysql.php
  4. +4 −8 osCommerce/OM/Core/Site/Admin/Application/Administrators/Administrators.php
  5. +6 −5 osCommerce/OM/Core/Site/Admin/Application/Administrators/{RPC.php → RPC/GetAll.php}
  6. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Administrators/pages/main.php
  7. +7 −19 osCommerce/OM/Core/Site/Admin/Application/Configuration/Configuration.php
  8. +33 −0 osCommerce/OM/Core/Site/Admin/Application/Configuration/RPC/GetAll.php
  9. +6 −21 osCommerce/OM/Core/Site/Admin/Application/Configuration/{RPC.php → RPC/GetAllEntries.php}
  10. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Configuration/pages/entries.php
  11. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Configuration/pages/main.php
  12. +10 −26 osCommerce/OM/Core/Site/Admin/Application/Countries/Countries.php
  13. +0 −52 osCommerce/OM/Core/Site/Admin/Application/Countries/RPC.php
  14. +37 −0 osCommerce/OM/Core/Site/Admin/Application/Countries/RPC/GetAll.php
  15. +33 −0 osCommerce/OM/Core/Site/Admin/Application/Countries/RPC/GetAllZones.php
  16. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Countries/pages/main.php
  17. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Countries/pages/zones.php
  18. +4 −8 osCommerce/OM/Core/Site/Admin/Application/CreditCards/CreditCards.php
  19. +6 −5 osCommerce/OM/Core/Site/Admin/Application/CreditCards/{RPC.php → RPC/GetAll.php}
  20. +1 −1 osCommerce/OM/Core/Site/Admin/Application/CreditCards/pages/main.php
  21. +4 −8 osCommerce/OM/Core/Site/Admin/Application/Currencies/Currencies.php
  22. +6 −5 osCommerce/OM/Core/Site/Admin/Application/Currencies/{RPC.php → RPC/GetAll.php}
  23. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Currencies/pages/main.php
  24. +6 −5 osCommerce/OM/Core/Site/Admin/Application/ErrorLog/{RPC.php → RPC/GetAll.php}
  25. +1 −1 osCommerce/OM/Core/Site/Admin/Application/ErrorLog/pages/main.php
  26. +18 −48 osCommerce/OM/Core/Site/Admin/Application/Languages/Languages.php
  27. +0 −68 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC.php
  28. +37 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC/GetAll.php
  29. +33 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC/GetDefinitionGroups.php
  30. +33 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC/GetDefinitions.php
  31. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions.php
  32. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/groups.php
  33. +1 −1 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/main.php
  34. +3 −3 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/Action/Install/Process.php
  35. +33 −0 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/RPC/GetInstalled.php
  36. +33 −0 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/RPC/GetUninstalled.php
  37. +1 −1 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/pages/install.php
  38. +1 −1 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/pages/main.php
  39. +21 −0 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/Action/PHPInfo.php
  40. +28 −0 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/Controller.php
  41. +33 −0 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/RPC/GetAll.php
  42. +91 −0 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/ServerInfo.php
  43. +96 −0 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/pages/main.php
  44. +0 −54 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/RPC.php
  45. +37 −0 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/RPC/GetAll.php
  46. +33 −0 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/RPC/GetAllEntries.php
  47. +10 −18 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/TaxClasses.php
  48. +1 −1 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/pages/entries.php
  49. +1 −1 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/pages/main.php
  50. +0 −54 osCommerce/OM/Core/Site/Admin/Application/ZoneGroups/RPC.php
  51. +37 −0 osCommerce/OM/Core/Site/Admin/Application/ZoneGroups/RPC/GetAll.php
  52. +33 −0 osCommerce/OM/Core/Site/Admin/Application/ZoneGroups/RPC/GetAllEntries.php
  53. +10 −18 osCommerce/OM/Core/Site/Admin/Application/ZoneGroups/ZoneGroups.php
  54. +1 −1 osCommerce/OM/Core/Site/Admin/Application/ZoneGroups/pages/entries.php
  55. +1 −1 osCommerce/OM/Core/Site/Admin/Application/ZoneGroups/pages/main.php
  56. +0 −74 osCommerce/OM/Core/Site/Admin/Application/server_info/pages/main.php
  57. +0 −57 osCommerce/OM/Core/Site/Admin/Application/server_info/server_info.php
  58. +0 −28 osCommerce/OM/Core/Site/Admin/Module/Access/server_info.php
  59. +23 −26 osCommerce/OM/Core/Site/Admin/Module/Payment/COD.php
  60. +143 −0 osCommerce/OM/Core/Site/Admin/Module/Payment/PayPalExpressCheckout.php
  61. +42 −16 osCommerce/OM/Core/Site/Admin/{Payment.php → PaymentModuleAbstract.php}
  62. +0 −32 osCommerce/OM/Core/Site/Admin/includes/functions/general.php
  63. +8 −7 osCommerce/OM/Core/Site/Admin/languages/en_US/{server_info.php → ServerInfo.php}
  64. +47 −34 osCommerce/OM/Core/Site/RPC/Controller.php
  65. +40 −0 osCommerce/OM/Core/Site/Setup/Application/Install/RPC/DBCheck.php
  66. +3 −58 osCommerce/OM/Core/Site/Setup/Application/Install/{RPC.php → RPC/DBImport.php}
  67. +45 −0 osCommerce/OM/Core/Site/Setup/Application/Install/RPC/DBImportSample.php
  68. +2 −2 osCommerce/OM/Core/Site/Setup/Application/Install/pages/step_1.php
  69. +1 −1 osCommerce/OM/Core/Site/Setup/Application/Install/pages/step_2.php
  70. +79 −0 osCommerce/OM/Core/Site/Shop/Application/Cart/RPC/PayPal.php
  71. +149 −0 osCommerce/OM/Core/Site/Shop/Application/Cart/RPC/PayPal/ExpressCheckoutInstantUpdate.php
  72. +1 −1 osCommerce/OM/Core/Site/Shop/Application/Checkout/Action/Billing.php
  73. +3 −4 osCommerce/OM/Core/Site/Shop/Application/Checkout/Action/Billing/Process.php
  74. +2 −15 osCommerce/OM/Core/Site/Shop/Application/Checkout/Action/Process.php
  75. +6 −5 osCommerce/OM/Core/Site/Shop/Application/Checkout/Controller.php
  76. +10 −6 osCommerce/OM/Core/Site/Shop/Application/Checkout/pages/main.php
  77. +20 −0 osCommerce/OM/Core/Site/Shop/Languages/en_US/modules/payment/PayPalExpressCheckout.xml
  78. +4 −15 osCommerce/OM/Core/Site/Shop/Module/Payment/COD.php
  79. +408 −0 osCommerce/OM/Core/Site/Shop/Module/Payment/PayPalExpressCheckout.php
  80. +13 −5 osCommerce/OM/Core/Site/Shop/Module/ProductType/RequireBilling.php
  81. +1 −1 osCommerce/OM/Core/Site/Shop/Order.php
  82. +37 −131 osCommerce/OM/Core/Site/Shop/Payment.php
  83. +81 −0 osCommerce/OM/Core/Site/Shop/PaymentModuleAbstract.php
  84. BIN public/sites/Admin/images/applications/16/serverinfo.png
  85. BIN public/sites/Admin/images/applications/32/serverinfo.png
View
6 includes/functions/html_output.php
@@ -611,7 +611,11 @@ function osc_draw_button($params) {
$button = '<button id="button' . $button_counter . '" type="' . osc_output_string($params['type']) . '"';
if ( isset($params['href']) ) {
- $button .= ' onclick="document.location.href=\'' . $params['href'] . '\';"';
+ if ( isset($params['newwindow']) ) {
+ $button .= ' onclick="window.open(\'' . $params['href'] . '\');"';
+ } else {
+ $button .= ' onclick="document.location.href=\'' . $params['href'] . '\';"';
+ }
}
if ( isset($params['params']) ) {
View
22 osCommerce/OM/Core/Database.php
@@ -396,6 +396,28 @@ function next() {
return $this->result;
}
+ function getAll() {
+ if ($this->cache_read === true) { // HPDL test cached results
+ $this->result = $this->cache_data;
+ } else {
+ if (!isset($this->query_handler)) {
+ $this->execute();
+ }
+
+ $this->result = $this->db_class->getAll($this->query_handler);
+
+ if ( is_null($this->result) ) {
+ $this->result = array();
+ }
+
+ if (isset($this->cache_key)) {
+ $this->cache_data = $this->result;
+ }
+ }
+
+ return $this->result;
+ }
+
function freeResult() {
if ($this->cache_read === false) {
if (preg_match('/^SELECT/i', $this->sql_query)) {
View
26 osCommerce/OM/Core/Database/mysql.php
@@ -182,6 +182,10 @@ function next($resource) {
return $this->_fetch_assoc($resource);
}
+ function getAll($resource) {
+ return $this->_fetch_all($resource);
+ }
+
function freeResult($resource) {
return $this->_free_result($resource);
}
@@ -410,6 +414,28 @@ function _fetch_assoc($resource) {
return mysql_fetch_assoc($resource);
}
+ function _fetch_all($resource) {
+ if ( $this->use_mysqli === true ) {
+ static $can_fetch_all;
+
+ if ( !isset($can_fetch_all) ) {
+ $can_fetch_all = function_exists('mysqli_fetch_all');
+ }
+
+ if ( $can_fetch_all === true ) {
+ return mysqli_fetch_all($resource, MYSQLI_ASSOC);
+ }
+ }
+
+ $result = array();
+
+ while ( $data = $this->_fetch_assoc($resource) ) {
+ $result[] = $data;
+ }
+
+ return $result;
+ }
+
function _free_result($resource) {
if ( $this->use_mysqli === true ) {
return mysqli_free_result($resource);
View
12 osCommerce/OM/Core/Site/Admin/Application/Administrators/Administrators.php
@@ -49,7 +49,7 @@ public static function getAll($pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
$Qadmins = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_administrators order by user_name');
@@ -59,9 +59,7 @@ public static function getAll($pageset = 1) {
$Qadmins->execute();
- while ( $Qadmins->next() ) {
- $result['entries'][] = $Qadmins->toArray();
- }
+ $result['entries'] = $Qadmins->getAll();
$result['total'] = $Qadmins->getBatchSize();
@@ -75,7 +73,7 @@ public static function find($search, $pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
$Qadmins = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_administrators where (user_name like :user_name) order by user_name');
$Qadmins->bindValue(':user_name', '%' . $search . '%');
@@ -86,9 +84,7 @@ public static function find($search, $pageset = 1) {
$Qadmins->execute();
- while ( $Qadmins->next() ) {
- $result['entries'][] = $Qadmins->toArray();
- }
+ $result['entries'] = $Qadmins->getAll();
$result['total'] = $Qadmins->getBatchSize();
View
11 .../Admin/Application/Administrators/RPC.php → ...Application/Administrators/RPC/GetAll.php
@@ -8,12 +8,13 @@
as published by the Free Software Foundation.
*/
- namespace osCommerce\OM\Core\Site\Admin\Application\Administrators;
+ namespace osCommerce\OM\Core\Site\Admin\Application\Administrators\RPC;
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
+ use osCommerce\OM\Core\Site\Admin\Application\Administrators\Administrators;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
- class RPC {
- public static function getAll() {
+ class GetAll {
+ public static function execute() {
if ( !isset($_GET['search']) ) {
$_GET['search'] = '';
}
@@ -28,7 +29,7 @@ public static function getAll() {
$result = Administrators::getAll($_GET['page']);
}
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
echo json_encode($result);
}
View
2 osCommerce/OM/Core/Site/Admin/Application/Administrators/pages/main.php
@@ -70,7 +70,7 @@
}
var dataTableName = 'administratorsDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getAll'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
var adminEditLink = '<?php echo OSCOM::getLink(null, null, 'Save&id=ADMINID'); ?>';
var adminEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
View
26 osCommerce/OM/Core/Site/Admin/Application/Configuration/Configuration.php
@@ -41,18 +41,12 @@ public static function get($id, $key = null) {
public static function getAll() {
$OSCOM_Database = Registry::get('Database');
- $Qgroups = $OSCOM_Database->query('select configuration_group_id, configuration_group_title from :table_configuration_group where visible = 1 order by sort_order, configuration_group_title');
- $Qgroups->execute();
-
- $result = array('entries' => array());
+ $result = array();
- while ( $Qgroups->next() ) {
- $Qentries = $OSCOM_Database->query('select count(*) as total_entries from :table_configuration where configuration_group_id = :configuration_group_id');
- $Qentries->bindInt(':configuration_group_id', $Qgroups->valueInt('configuration_group_id'));
- $Qentries->execute();
+ $Qgroups = $OSCOM_Database->query('select cg.configuration_group_id, cg.configuration_group_title, count(c.configuration_id) as total_entries from :table_configuration_group cg, :table_configuration c where cg.visible = 1 and cg.configuration_group_id = c.configuration_group_id group by cg.configuration_group_id order by cg.sort_order, cg.configuration_group_title');
+ $Qgroups->execute();
- $result['entries'][] = array_merge($Qgroups->toArray(), $Qentries->toArray());
- }
+ $result['entries'] = $Qgroups->getAll();
$result['total'] = $Qgroups->numberOfRows();
@@ -62,20 +56,14 @@ public static function getAll() {
public static function find($search) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
- $Qgroups = $OSCOM_Database->query('select distinct g.configuration_group_id, g.configuration_group_title from :table_configuration c, :table_configuration_group g where (c.configuration_key like :configuration_key or c.configuration_value like :configuration_value) and c.configuration_group_id = g.configuration_group_id and g.visible = 1 order by g.sort_order, g.configuration_group_title');
+ $Qgroups = $OSCOM_Database->query('select distinct cg.configuration_group_id, cg.configuration_group_title, count(c.configuration_id) as total_entries from :table_configuration_group cg, :table_configuration c where (c.configuration_key like :configuration_key or c.configuration_value like :configuration_value) and c.configuration_group_id = cg.configuration_group_id and cg.visible = 1 group by cg.configuration_group_id order by cg.sort_order, cg.configuration_group_title');
$Qgroups->bindValue(':configuration_key', '%' . $search . '%');
$Qgroups->bindValue(':configuration_value', '%' . $search . '%');
$Qgroups->execute();
- while ( $Qgroups->next() ) {
- $Qentries = $OSCOM_Database->query('select count(*) as total_entries from :table_configuration where configuration_group_id = :configuration_group_id');
- $Qentries->bindInt(':configuration_group_id', $Qgroups->valueInt('configuration_group_id'));
- $Qentries->execute();
-
- $result['entries'][] = array_merge($Qgroups->toArray(), $Qentries->toArray());
- }
+ $result['entries'] = $Qgroups->getAll();
$result['total'] = $Qgroups->numberOfRows();
View
33 osCommerce/OM/Core/Site/Admin/Application/Configuration/RPC/GetAll.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\Configuration\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\Configuration\Configuration;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetAll {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = Configuration::find($_GET['search']);
+ } else {
+ $result = Configuration::getAll();
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
27 ...e/Admin/Application/Configuration/RPC.php → ...ation/Configuration/RPC/GetAllEntries.php
@@ -8,28 +8,13 @@
as published by the Free Software Foundation.
*/
- namespace osCommerce\OM\Core\Site\Admin\Application\Configuration;
+ namespace osCommerce\OM\Core\Site\Admin\Application\Configuration\RPC;
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
+ use osCommerce\OM\Core\Site\Admin\Application\Configuration\Configuration;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
- class RPC {
- public static function getAll() {
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !empty($_GET['search']) ) {
- $result = Configuration::find($_GET['search']);
- } else {
- $result = Configuration::getAll();
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
-
- public static function getAllEntries() {
+ class GetAllEntries {
+ public static function execute() {
if ( !isset($_GET['search']) ) {
$_GET['search'] = '';
}
@@ -40,7 +25,7 @@ public static function getAllEntries() {
$result = Configuration::getAllEntries($_GET['id']);
}
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
echo json_encode($result);
}
View
2 osCommerce/OM/Core/Site/Admin/Application/Configuration/pages/entries.php
@@ -71,7 +71,7 @@
}
var dataTableName = 'configurationDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'id=' . $_GET['id'] . '&action=getAllEntries'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAllEntries&id=' . $_GET['id']); ?>';
var configEditLink = '<?php echo OSCOM::getLink(null, null, 'EntrySave&id=' . (int)$_GET['id'] . '&pID=CONFIGID'); ?>';
var configEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
View
2 osCommerce/OM/Core/Site/Admin/Application/Configuration/pages/main.php
@@ -65,7 +65,7 @@
}
var dataTableName = 'configurationDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getAll'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
var groupLink = '<?php echo OSCOM::getLink(null, null, 'id=GROUPID'); ?>';
var groupLinkIcon = '<?php echo osc_icon('folder.png'); ?>';
View
36 osCommerce/OM/Core/Site/Admin/Application/Countries/Countries.php
@@ -40,23 +40,17 @@ public static function getAll($pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
- $Qcountries = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_countries order by countries_name');
+ $Qcountries = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS c.*, count(z.zone_id) as total_zones from :table_countries c, :table_zones z where c.countries_id = z.zone_country_id group by c.countries_id order by c.countries_name');
if ( $pageset !== -1 ) {
$Qcountries->setBatchLimit($pageset, MAX_DISPLAY_SEARCH_RESULTS);
}
$Qcountries->execute();
- while ( $Qcountries->next() ) {
- $Qzones = $OSCOM_Database->query('select count(*) as total_zones from :table_zones where zone_country_id = :zone_country_id');
- $Qzones->bindInt(':zone_country_id', $Qcountries->valueInt('countries_id'));
- $Qzones->execute();
-
- $result['entries'][] = array_merge($Qcountries->toArray(), $Qzones->toArray());
- }
+ $result['entries'] = $Qcountries->getAll();
$result['total'] = $Qcountries->getBatchSize();
@@ -70,9 +64,9 @@ public static function find($search, $pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
- $Qcountries = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS c.* from :table_countries c left join :table_zones z on (z.zone_country_id = c.countries_id) where (c.countries_name like :countries_name or c.countries_iso_code_2 like :countries_iso_code_2 or c.countries_iso_code_3 like :countries_iso_code_3 or z.zone_name like :zone_name or z.zone_code like :zone_code) group by c.countries_id order by c.countries_name');
+ $Qcountries = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS c.*, count(z.zone_id) as total_zones from :table_countries c, :table_zones z where (c.countries_name like :countries_name or c.countries_iso_code_2 like :countries_iso_code_2 or c.countries_iso_code_3 like :countries_iso_code_3 or z.zone_name like :zone_name or z.zone_code like :zone_code) and c.countries_id = z.zone_country_id group by c.countries_id order by c.countries_name');
$Qcountries->bindValue(':countries_name', '%' . $search . '%');
$Qcountries->bindValue(':countries_iso_code_2', '%' . $search . '%');
$Qcountries->bindValue(':countries_iso_code_3', '%' . $search . '%');
@@ -85,13 +79,7 @@ public static function find($search, $pageset = 1) {
$Qcountries->execute();
- while ( $Qcountries->next() ) {
- $Qzones = $OSCOM_Database->query('select count(*) as total_zones from :table_zones where zone_country_id = :zone_country_id');
- $Qzones->bindInt(':zone_country_id', $Qcountries->valueInt('countries_id'));
- $Qzones->execute();
-
- $result['entries'][] = array_merge($Qcountries->toArray(), $Qzones->toArray());
- }
+ $result['entries'] = $Qcountries->getAll();
$result['total'] = $Qcountries->getBatchSize();
@@ -101,17 +89,15 @@ public static function find($search, $pageset = 1) {
public static function findZones($search, $country_id) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
$Qzones = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_zones where zone_country_id = :zone_country_id and (zone_name like :zone_name or zone_code like :zone_code) order by zone_name');
$Qzones->bindInt(':zone_country_id', $country_id);
$Qzones->bindValue(':zone_name', '%' . $search . '%');
$Qzones->bindValue(':zone_code', '%' . $search . '%');
$Qzones->execute();
- while ( $Qzones->next() ) {
- $result['entries'][] = $Qzones->toArray();
- }
+ $result['entries'] = $Qzones->getAll();
$result['total'] = $Qzones->numberOfRows();
@@ -131,15 +117,13 @@ public static function getZone($id) {
public static function getAllZones($country_id) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
$Qzones = $OSCOM_Database->query('select * from :table_zones where zone_country_id = :zone_country_id order by zone_name');
$Qzones->bindInt(':zone_country_id', $country_id);
$Qzones->execute();
- while ( $Qzones->next() ) {
- $result['entries'][] = $Qzones->toArray();
- }
+ $result['entries'] = $Qzones->getAll();
$result['total'] = $Qzones->numberOfRows();
View
52 osCommerce/OM/Core/Site/Admin/Application/Countries/RPC.php
@@ -1,52 +0,0 @@
-<?php
-/*
- osCommerce Online Merchant $osCommerce-SIG$
- Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License v2 (1991)
- as published by the Free Software Foundation.
-*/
-
- namespace osCommerce\OM\Core\Site\Admin\Application\Countries;
-
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
-
- class RPC {
- public static function getAll() {
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !isset($_GET['page']) || !is_numeric($_GET['page']) ) {
- $_GET['page'] = 1;
- }
-
- if ( !empty($_GET['search']) ) {
- $result = Countries::find($_GET['search'], $_GET['page']);
- } else {
- $result = Countries::getAll($_GET['page']);
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
-
- public static function getAllZones() {
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !empty($_GET['search']) ) {
- $result = Countries::findZones($_GET['search'], $_GET['id']);
- } else {
- $result = Countries::getAllZones($_GET['id']);
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
- }
-?>
View
37 osCommerce/OM/Core/Site/Admin/Application/Countries/RPC/GetAll.php
@@ -0,0 +1,37 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\Countries\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\Countries\Countries;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetAll {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !isset($_GET['page']) || !is_numeric($_GET['page']) ) {
+ $_GET['page'] = 1;
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = Countries::find($_GET['search'], $_GET['page']);
+ } else {
+ $result = Countries::getAll($_GET['page']);
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
33 osCommerce/OM/Core/Site/Admin/Application/Countries/RPC/GetAllZones.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\Countries\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\Countries\Countries;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetAllZones {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = Countries::findZones($_GET['search'], $_GET['id']);
+ } else {
+ $result = Countries::getAllZones($_GET['id']);
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
2 osCommerce/OM/Core/Site/Admin/Application/Countries/pages/main.php
@@ -72,7 +72,7 @@
}
var dataTableName = 'countryDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getAll'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
var countryLink = '<?php echo OSCOM::getLink(null, null, 'id=COUNTRYID'); ?>';
var countryLinkIcon = '<?php echo osc_icon('folder.png'); ?>';
View
2 osCommerce/OM/Core/Site/Admin/Application/Countries/pages/zones.php
@@ -71,7 +71,7 @@
}
var dataTableName = 'countryZonesDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'id=' . $_GET['id'] . '&action=getAllZones'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAllZones&id=' . $_GET['id']); ?>';
var zoneEditLink = '<?php echo OSCOM::getLink(null, null, 'ZoneSave&id=' . $_GET['id'] . '&zID=ZONEID'); ?>';
var zoneEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
View
12 osCommerce/OM/Core/Site/Admin/Application/CreditCards/CreditCards.php
@@ -31,7 +31,7 @@ public static function getAll($pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
$Qcc = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_credit_cards order by sort_order, credit_card_name');
@@ -41,9 +41,7 @@ public static function getAll($pageset = 1) {
$Qcc->execute();
- while ( $Qcc->next() ) {
- $result['entries'][] = $Qcc->toArray();
- }
+ $result['entries'] = $Qcc->getAll();
$result['total'] = $Qcc->getBatchSize();
@@ -57,7 +55,7 @@ public static function find($search, $pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
$Qcc = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_credit_cards where (credit_card_name like :credit_card_name) order by credit_card_name');
$Qcc->bindValue(':credit_card_name', '%' . $search . '%');
@@ -68,9 +66,7 @@ public static function find($search, $pageset = 1) {
$Qcc->execute();
- while ( $Qcc->next() ) {
- $result['entries'][] = $Qcc->toArray();
- }
+ $result['entries'] = $Qcc->getAll();
$result['total'] = $Qcc->getBatchSize();
View
11 ...ite/Admin/Application/CreditCards/RPC.php → ...in/Application/CreditCards/RPC/GetAll.php
@@ -8,12 +8,13 @@
as published by the Free Software Foundation.
*/
- namespace osCommerce\OM\Core\Site\Admin\Application\CreditCards;
+ namespace osCommerce\OM\Core\Site\Admin\Application\CreditCards\RPC;
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
+ use osCommerce\OM\Core\Site\Admin\Application\CreditCards\CreditCards;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
- class RPC {
- public static function getAll() {
+ class GetAll {
+ public static function execute() {
if ( !isset($_GET['search']) ) {
$_GET['search'] = '';
}
@@ -28,7 +29,7 @@ public static function getAll() {
$result = CreditCards::getAll($_GET['page']);
}
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
echo json_encode($result);
}
View
2 osCommerce/OM/Core/Site/Admin/Application/CreditCards/pages/main.php
@@ -71,7 +71,7 @@
}
var dataTableName = 'ccDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getAll'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
var ccEditLink = '<?php echo OSCOM::getLink(null, null, 'Save&id=CCID'); ?>';
var ccEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
View
12 osCommerce/OM/Core/Site/Admin/Application/Currencies/Currencies.php
@@ -54,7 +54,7 @@ public static function getAll($pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
$Qcurrencies = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_currencies order by title');
@@ -64,9 +64,7 @@ public static function getAll($pageset = 1) {
$Qcurrencies->execute();
- while ( $Qcurrencies->next() ) {
- $result['entries'][] = $Qcurrencies->toArray();
- }
+ $result['entries'] = $Qcurrencies->getAll();
$result['total'] = $Qcurrencies->getBatchSize();
@@ -80,7 +78,7 @@ public static function find($search, $pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
$Qcurrencies = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_currencies where (title like :title or code like :code or symbol_left like :symbol_left or symbol_right like :symbol_right) order by title');
$Qcurrencies->bindValue(':title', '%' . $search . '%');
@@ -94,9 +92,7 @@ public static function find($search, $pageset = 1) {
$Qcurrencies->execute();
- while ( $Qcurrencies->next() ) {
- $result['entries'][] = $Qcurrencies->toArray();
- }
+ $result['entries'] = $Qcurrencies->getAll();
$result['total'] = $Qcurrencies->getBatchSize();
View
11 ...Site/Admin/Application/Currencies/RPC.php → ...min/Application/Currencies/RPC/GetAll.php
@@ -8,12 +8,13 @@
as published by the Free Software Foundation.
*/
- namespace osCommerce\OM\Core\Site\Admin\Application\Currencies;
+ namespace osCommerce\OM\Core\Site\Admin\Application\Currencies\RPC;
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
+ use osCommerce\OM\Core\Site\Admin\Application\Currencies\Currencies;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
- class RPC {
- public static function getAll() {
+ class GetAll {
+ public static function execute() {
if ( !isset($_GET['search']) ) {
$_GET['search'] = '';
}
@@ -28,7 +29,7 @@ public static function getAll() {
$result = Currencies::getAll($_GET['page']);
}
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
echo json_encode($result);
}
View
2 osCommerce/OM/Core/Site/Admin/Application/Currencies/pages/main.php
@@ -72,7 +72,7 @@
}
var dataTableName = 'currenciesDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getAll'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
var cEditLink = '<?php echo OSCOM::getLink(null, null, 'Save&id=CID'); ?>';
var cEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
View
11 ...e/Site/Admin/Application/ErrorLog/RPC.php → ...Admin/Application/ErrorLog/RPC/GetAll.php
@@ -8,12 +8,13 @@
as published by the Free Software Foundation.
*/
- namespace osCommerce\OM\Core\Site\Admin\Application\ErrorLog;
+ namespace osCommerce\OM\Core\Site\Admin\Application\ErrorLog\RPC;
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
+ use osCommerce\OM\Core\Site\Admin\Application\ErrorLog\ErrorLog;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
- class RPC {
- public static function getAll() {
+ class GetAll {
+ public static function execute() {
if ( !isset($_GET['search']) ) {
$_GET['search'] = '';
}
@@ -28,7 +29,7 @@ public static function getAll() {
$result = ErrorLog::getAll($_GET['page']);
}
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
echo json_encode($result);
}
View
2 osCommerce/OM/Core/Site/Admin/Application/ErrorLog/pages/main.php
@@ -64,7 +64,7 @@
}
var dataTableName = 'errorLogDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getAll'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
var osC_DataTable = new osC_DataTable();
osC_DataTable.load();
View
66 osCommerce/OM/Core/Site/Admin/Application/Languages/Languages.php
@@ -62,23 +62,17 @@ public static function getAll($pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
- $Qlanguages = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS * from :table_languages order by sort_order, name');
+ $Qlanguages = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS l.*, count(ld.id) as total_definitions from :table_languages l, :table_languages_definitions ld where l.languages_id = ld.languages_id group by l.languages_id order by l.sort_order, l.name');
if ( $pageset !== -1 ) {
$Qlanguages->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
}
$Qlanguages->execute();
- while ( $Qlanguages->next() ) {
- $Qdef = $OSCOM_Database->query('select count(*) as total_definitions from :table_languages_definitions where languages_id = :languages_id');
- $Qdef->bindInt(':languages_id', $Qlanguages->valueInt('languages_id'));
- $Qdef->execute();
-
- $result['entries'][] = array_merge($Qlanguages->toArray(), $Qdef->toArray());
- }
+ $result['entries'] = $Qlanguages->getAll();
$result['total'] = $Qlanguages->getBatchSize();
@@ -92,9 +86,9 @@ public static function find($search, $pageset = 1) {
$pageset = 1;
}
- $result = array('entries' => array());
+ $result = array();
- $Qlanguages = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS l.* from :table_languages l left join :table_languages_definitions ld on (l.languages_id = ld.languages_id) where (l.name like :name or l.code like :code or ld.definition_key like :definition_key or ld.definition_value like :definition_value) group by l.languages_id order by l.name');
+ $Qlanguages = $OSCOM_Database->query('select SQL_CALC_FOUND_ROWS l.*, count(ld.id) as total_definitions from :table_languages l, :table_languages_definitions ld where l.languages_id = ld.languages_id and (l.name like :name or l.code like :code or ld.definition_key like :definition_key or ld.definition_value like :definition_value) group by l.languages_id order by l.name');
$Qlanguages->bindValue(':name', '%' . $search . '%');
$Qlanguages->bindValue(':code', '%' . $search . '%');
$Qlanguages->bindValue(':definition_key', '%' . $search . '%');
@@ -106,13 +100,7 @@ public static function find($search, $pageset = 1) {
$Qlanguages->execute();
- while ( $Qlanguages->next() ) {
- $Qdef = $OSCOM_Database->query('select count(*) as total_definitions from :table_languages_definitions where languages_id = :languages_id');
- $Qdef->bindInt(':languages_id', $Qlanguages->valueInt('languages_id'));
- $Qdef->execute();
-
- $result['entries'][] = array_merge($Qlanguages->toArray(), $Qdef->toArray());
- }
+ $result['entries'] = $Qlanguages->getAll();
$result['total'] = $Qlanguages->getBatchSize();
@@ -122,15 +110,13 @@ public static function find($search, $pageset = 1) {
public static function getDefinitionGroup($group) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
$Qgroup = $OSCOM_Database->query('select languages_id, count(*) as total_entries from :table_languages_definitions where content_group = :content_group group by languages_id');
$Qgroup->bindValue(':content_group', $group);
$Qgroup->execute();
- while ( $Qgroup->next() ) {
- $result['entries'][] = $Qgroup->toArray();
- }
+ $result['entries'] = $Qgroup->getAll();
$result['total'] = $Qgroup->numberOfRows();
@@ -140,15 +126,13 @@ public static function getDefinitionGroup($group) {
public static function getDefinitionGroups($language_id) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
$Qgroups = $OSCOM_Database->query('select distinct content_group, count(*) as total_entries from :table_languages_definitions where languages_id = :languages_id group by content_group order by content_group');
$Qgroups->bindInt(':languages_id', $language_id);
$Qgroups->execute();
- while ( $Qgroups->next() ) {
- $result['entries'][] = $Qgroups->toArray();
- }
+ $result['entries'] = $Qgroups->getAll();
$result['total'] = $Qgroups->numberOfRows();
@@ -165,31 +149,21 @@ public static function isDefinitionGroup($language_id, $group) {
$result = false;
- if ( $Qgroup->numberOfRows() === 1 ) {
- $result = true;
- }
-
- return $result;
+ return ( $Qgroup->numberOfRows() === 1 );
}
public static function findDefinitionGroups($language_id, $search) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
- $Qgroups = $OSCOM_Database->query('select distinct content_group from :table_languages_definitions where languages_id = :languages_id and (definition_key like :definition_key or definition_value like :definition_value) group by content_group order by content_group');
+ $Qgroups = $OSCOM_Database->query('select distinct content_group, count(*) as total_entries from :table_languages_definitions where languages_id = :languages_id and (definition_key like :definition_key or definition_value like :definition_value) group by content_group order by content_group');
$Qgroups->bindInt(':languages_id', $language_id);
$Qgroups->bindValue(':definition_key', '%' . $search . '%');
$Qgroups->bindValue(':definition_value', '%' . $search . '%');
$Qgroups->execute();
- while ( $Qgroups->next() ) {
- $Qtotal = $OSCOM_Database->query('select count(*) as total_entries from :table_languages_definitions where content_group = :content_group');
- $Qtotal->bindValue(':content_group', $Qgroups->value('content_group'));
- $Qtotal->execute();
-
- $result['entries'][] = array_merge($Qgroups->toArray(), $Qtotal->toArray());
- }
+ $result['entries'] = $Qgroups->getAll();
$result['total'] = $Qgroups->numberOfRows();
@@ -228,7 +202,7 @@ public static function getDefinition($id) {
public static function getDefinitions($language_id, $group) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
$Qdefs = $OSCOM_Database->query('select * from :table_languages_definitions where languages_id = :languages_id and');
@@ -244,9 +218,7 @@ public static function getDefinitions($language_id, $group) {
$Qdefs->bindInt(':languages_id', $language_id);
$Qdefs->execute();
- while ( $Qdefs->next() ) {
- $result['entries'][] = $Qdefs->toArray();
- }
+ $result['entries'] = $Qdefs->getAll();
$result['total'] = $Qdefs->numberOfRows();
@@ -256,7 +228,7 @@ public static function getDefinitions($language_id, $group) {
public static function findDefinitions($language_id, $group, $search) {
$OSCOM_Database = Registry::get('Database');
- $result = array('entries' => array());
+ $result = array();
$Qdefs = $OSCOM_Database->query('select * from :table_languages_definitions where languages_id = :languages_id and content_group = :content_group and (definition_key like :definition_key or definition_value like :definition_value) order by definition_key');
$Qdefs->bindInt(':languages_id', $language_id);
@@ -265,9 +237,7 @@ public static function findDefinitions($language_id, $group, $search) {
$Qdefs->bindValue(':definition_value', '%' . $search . '%');
$Qdefs->execute();
- while ( $Qdefs->next() ) {
- $result['entries'][] = $Qdefs->toArray();
- }
+ $result['entries'] = $Qdefs->getAll();
$result['total'] = $Qdefs->numberOfRows();
View
68 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC.php
@@ -1,68 +0,0 @@
-<?php
-/*
- osCommerce Online Merchant $osCommerce-SIG$
- Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License v2 (1991)
- as published by the Free Software Foundation.
-*/
-
- namespace osCommerce\OM\Core\Site\Admin\Application\Languages;
-
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
-
- class RPC {
- public static function getAll() {
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !isset($_GET['page']) || !is_numeric($_GET['page']) ) {
- $_GET['page'] = 1;
- }
-
- if ( !empty($_GET['search']) ) {
- $result = Languages::find($_GET['search'], $_GET['page']);
- } else {
- $result = Languages::getAll($_GET['page']);
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
-
- public static function getDefinitionGroups() {
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !empty($_GET['search']) ) {
- $result = Languages::findDefinitionGroups($_GET['id'], $_GET['search']);
- } else {
- $result = Languages::getDefinitionGroups($_GET['id']);
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
-
- public static function getDefinitions() {
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !empty($_GET['search']) ) {
- $result = Languages::findDefinitions($_GET['id'], $_GET['group'], $_GET['search']);
- } else {
- $result = Languages::getDefinitions($_GET['id'], $_GET['group']);
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
- }
-?>
View
37 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC/GetAll.php
@@ -0,0 +1,37 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\Languages\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetAll {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !isset($_GET['page']) || !is_numeric($_GET['page']) ) {
+ $_GET['page'] = 1;
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = Languages::find($_GET['search'], $_GET['page']);
+ } else {
+ $result = Languages::getAll($_GET['page']);
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
33 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC/GetDefinitionGroups.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\Languages\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetDefinitionGroups {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = Languages::findDefinitionGroups($_GET['id'], $_GET['search']);
+ } else {
+ $result = Languages::getDefinitionGroups($_GET['id']);
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
33 osCommerce/OM/Core/Site/Admin/Application/Languages/RPC/GetDefinitions.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\Languages\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetDefinitions {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = Languages::findDefinitions($_GET['id'], $_GET['group'], $_GET['search']);
+ } else {
+ $result = Languages::getDefinitions($_GET['id'], $_GET['group']);
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions.php
@@ -71,7 +71,7 @@
}
var dataTableName = 'defsDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group'] . '&action=getDefinitions'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetDefinitions&id=' . $_GET['id'] . '&group=' . $_GET['group']); ?>';
var defEditLink = '<?php echo OSCOM::getLink(null, null, 'EditDefinition&id=' . $_GET['id'] . '&group=' . $_GET['group'] . '&dID=DEFINITIONID'); ?>';
var defEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
View
2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/groups.php
@@ -64,7 +64,7 @@
}
var dataTableName = 'langDefGroupDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'id=' . $_GET['id'] . '&action=getDefinitionGroups'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetDefinitionGroups&id=' . $_GET['id']); ?>';
var groupLink = '<?php echo OSCOM::getLink(null, null, 'id=' . $_GET['id'] . '&group=GROUPCODE'); ?>';
var groupLinkIcon = '<?php echo osc_icon('folder.png'); ?>';
View
2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/main.php
@@ -72,7 +72,7 @@
}
var dataTableName = 'langDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getAll'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
var languageLink = '<?php echo OSCOM::getLink(null, null, 'id=LANGUAGEID'); ?>';
var languageLinkIcon = '<?php echo osc_icon('folder.png'); ?>';
View
6 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/Action/Install/Process.php
@@ -20,12 +20,12 @@ public static function execute(ApplicationAbstract $application) {
$data = osc_sanitize_string(basename($_GET['code']));
if ( PaymentModules::install($data) ) {
- Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
+ osc_redirect_admin(OSCOM::getLink(null, null, 'Save&code=' . $_GET['code']));
} else {
Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
- }
- osc_redirect_admin(OSCOM::getLink());
+ osc_redirect_admin(OSCOM::getLink());
+ }
}
}
?>
View
33 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/RPC/GetInstalled.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\PaymentModules\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\PaymentModules\PaymentModules;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetInstalled {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = PaymentModules::findInstalled($_GET['search']);
+ } else {
+ $result = PaymentModules::getInstalled();
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
33 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/RPC/GetUninstalled.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\PaymentModules\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\PaymentModules\PaymentModules;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetUninstalled {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = PaymentModules::findUninstalled($_GET['search']);
+ } else {
+ $result = PaymentModules::getUninstalled();
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
2 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/pages/install.php
@@ -68,7 +68,7 @@
}
var dataTableName = 'paymentModulesDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getUninstalled'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetUninstalled'); ?>';
var pmInstallLink = '<?php echo OSCOM::getLink(null, null, 'Install&Process&code=PMCODE'); ?>';
var pmInstallLinkIcon = '<?php echo osc_icon('install.png'); ?>';
View
2 osCommerce/OM/Core/Site/Admin/Application/PaymentModules/pages/main.php
@@ -69,7 +69,7 @@
}
var dataTableName = 'paymentModulesDataTable';
- var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'action=getInstalled'); ?>';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetInstalled'); ?>';
var pmEditLink = '<?php echo OSCOM::getLink(null, null, 'Save&code=PMCODE'); ?>';
var pmEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
View
21 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/Action/PHPInfo.php
@@ -0,0 +1,21 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\ServerInfo\Action;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+
+ class PHPInfo {
+ public static function execute(ApplicationAbstract $application) {
+ phpinfo();
+ exit;
+ }
+ }
+?>
View
28 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/Controller.php
@@ -0,0 +1,28 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\ServerInfo;
+
+ use osCommerce\OM\Core\OSCOM;
+
+ class Controller extends \osCommerce\OM\Core\Site\Admin\ApplicationAbstract {
+ protected $_group = 'tools';
+ protected $_icon = 'serverinfo.png';
+ protected $_sort_order = 900;
+
+ protected function initialize() {
+ $this->_title = OSCOM::getDef('app_title');
+ }
+
+ protected function process() {
+ $this->_page_title = OSCOM::getDef('heading_title');
+ }
+ }
+?>
View
33 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/RPC/GetAll.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\ServerInfo\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\ServerInfo\ServerInfo;
+ use osCommerce\OM\Core\Site\RPC\Controller as RPC;
+
+ class GetAll {
+ public static function execute() {
+ if ( !isset($_GET['search']) ) {
+ $_GET['search'] = '';
+ }
+
+ if ( !empty($_GET['search']) ) {
+ $result = ServerInfo::find($_GET['search']);
+ } else {
+ $result = ServerInfo::getAll();
+ }
+
+ $result['rpcStatus'] = RPC::STATUS_SUCCESS;
+
+ echo json_encode($result);
+ }
+ }
+?>
View
91 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/ServerInfo.php
@@ -0,0 +1,91 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\ServerInfo;
+
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+ use osCommerce\OM\Core\DateTime;
+
+ class ServerInfo {
+
+/**
+ * Retrieve web server and database server information
+ *
+ * @access public
+ */
+
+ public static function getAll() {
+ $OSCOM_Database = Registry::get('Database');
+
+ $result = array();
+
+ $Qdate = $OSCOM_Database->query('select now() as datetime');
+ $Quptime = $OSCOM_Database->query('show status like "Uptime"');
+
+ @list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);
+
+ $db_uptime = intval($Quptime->valueInt('Value') / 3600) . ':' . str_pad(intval(($Quptime->valueInt('Value') / 60) % 60), 2, '0', STR_PAD_LEFT);
+
+ $data = array(array('key' => 'date',
+ 'title' => OSCOM::getDef('field_server_date'),
+ 'value' => DateTime::getShort(null, true)),
+ array('key' => 'system',
+ 'title' => OSCOM::getDef('field_server_operating_system'),
+ 'value' => $system . ' ' . $kernel),
+ array('key' => 'host',
+ 'title' => OSCOM::getDef('field_server_host'),
+ 'value' => $host . ' (' . gethostbyname($host) . ')'),
+ array('key' => 'uptime',
+ 'title' => OSCOM::getDef('field_server_up_time'),
+ 'value' => @exec('uptime')),
+ array('key' => 'http_server',
+ 'title' => OSCOM::getDef('field_http_server'),
+ 'value' => $_SERVER['SERVER_SOFTWARE']),
+ array('key' => 'php',
+ 'title' => OSCOM::getDef('field_php_version'),
+ 'value' => 'PHP v' . PHP_VERSION . ' / Zend v' . zend_version()),
+ array('key' => 'db_server',
+ 'title' => OSCOM::getDef('field_database_host'),
+ 'value' => DB_SERVER . ' (' . gethostbyname(DB_SERVER) . ')'),
+ array('key' => 'db_version',
+ 'title' => OSCOM::getDef('field_database_version'),
+ 'value' => 'MySQL v' . $OSCOM_Database->getServerVersion()),
+ array('key' => 'db_date',
+ 'title' => OSCOM::getDef('field_database_date'),
+ 'value' => DateTime::getShort($Qdate->value('datetime'), true)),
+ array('key' => 'db_uptime',
+ 'title' => OSCOM::getDef('field_database_up_time'),
+ 'value' => $db_uptime));
+
+ $result['entries'] = $data;
+
+ $result['total'] = count($data);
+
+ return $result;
+ }
+
+ public static function find($search) {
+ $modules = self::getAll();
+
+ $result = array('entries' => array());
+
+ foreach ( $modules['entries'] as $module ) {
+ if ( (stripos($module['key'], $search) !== false) || (stripos($module['title'], $search) !== false) || (stripos($module['value'], $search) !== false) ) {
+ $result['entries'][] = $module;
+ }
+ }
+
+ $result['total'] = count($result['entries']);
+
+ return $result;
+ }
+ }
+?>
View
96 osCommerce/OM/Core/Site/Admin/Application/ServerInfo/pages/main.php
@@ -0,0 +1,96 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ use osCommerce\OM\Core\OSCOM;
+?>
+
+<h1><?php echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?></h1>
+
+<?php
+ if ( $OSCOM_MessageStack->exists() ) {
+ echo $OSCOM_MessageStack->get();
+ }
+?>
+
+<form id="liveSearchForm">
+ <input type="text" id="liveSearchField" name="search" class="searchField fieldTitleAsDefault" title="Search.." /><?php echo osc_draw_button(array('type' => 'button', 'params' => 'onclick="osC_DataTable.reset();"', 'title' => 'Reset')); ?>
+
+ <span style="float: right;"><?php echo osc_draw_button(array('href' => OSCOM::getLink(null, null, 'PHPInfo'), 'icon' => 'info', 'title' => OSCOM::getDef('button_php_info'), 'newwindow' => true)); ?></span>
+</form>
+
+<div style="padding: 20px 5px 5px 5px; height: 16px;">
+ <span id="batchTotalPages"></span>
+ <span id="batchPageLinks"></span>
+</div>
+
+<form name="batch" action="#" method="post">
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable" id="serverInfoDataTable">
+ <thead>
+ <tr>
+ <th><?php echo OSCOM::getDef('table_heading_key'); ?></th>
+ <th><?php echo OSCOM::getDef('table_heading_value'); ?></th>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <th colspan="2">&nbsp;</th>
+ </tr>
+ </tfoot>
+ <tbody>
+ </tbody>
+</table>
+
+</form>
+
+<div style="padding: 2px; min-height: 16px;">
+ <span id="dataTableLegend"></span>
+ <span id="batchPullDownMenu"></span>
+</div>
+
+<script type="text/javascript">
+ var moduleParamsCookieName = 'oscom_admin_' + pageModule;
+ var dataTablePageSetName = 'page';
+
+ var moduleParams = new Object();
+ moduleParams[dataTablePageSetName] = 1;
+ moduleParams['search'] = '';
+
+ if ( $.cookie(moduleParamsCookieName) != null ) {
+ moduleParams = $.secureEvalJSON($.cookie(moduleParamsCookieName));
+ }
+
+ var dataTableName = 'serverInfoDataTable';
+ var dataTableDataURL = '<?php echo OSCOM::getRPCLink(null, null, 'GetAll'); ?>';
+
+ var osC_DataTable = new osC_DataTable();
+ osC_DataTable.load();
+
+ function feedDataTable(data) {
+ var rowCounter = 0;
+
+ for ( var r in data.entries ) {
+ var record = data.entries[r];
+
+ var newRow = $('#' + dataTableName)[0].tBodies[0].insertRow(rowCounter);
+ newRow.id = 'row' + record.key;
+
+ $('#row' + record.key).hover( function() { $(this).addClass('mouseOver'); }, function() { $(this).removeClass('mouseOver'); }).css('cursor', 'pointer');
+
+ var newCell = newRow.insertCell(0);
+ newCell.innerHTML = htmlSpecialChars(record.title);
+
+ var newCell = newRow.insertCell(1);
+ newCell.innerHTML = htmlSpecialChars(record.value);
+
+ rowCounter++;
+ }
+ }
+</script>
View
54 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/RPC.php
@@ -1,54 +0,0 @@
-<?php
-/*
- osCommerce Online Merchant $osCommerce-SIG$
- Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License v2 (1991)
- as published by the Free Software Foundation.
-*/
-
- namespace osCommerce\OM\Core\Site\Admin\Application\TaxClasses;
-
- use osCommerce\OM\Core\Site\RPC\Controller as OSCOM_Site_RPC;
-
- class RPC {
- public static function getAll() {
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !isset($_GET['page']) || !is_numeric($_GET['page']) ) {
- $_GET['page'] = 1;
- }
-
- if ( !empty($_GET['search']) ) {
- $result = TaxClasses::find($_GET['search'], $_GET['page']);
- } else {
- $result = TaxClasses::getAll($_GET['page']);
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
-
- public static function getAllEntries() {
- global $_module;
-
- if ( !isset($_GET['search']) ) {
- $_GET['search'] = '';
- }
-
- if ( !empty($_GET['search']) ) {
- $result = TaxClasses::findEntries($_GET['search'], $_GET['id']);
- } else {
- $result = TaxClasses::getAllEntries($_GET['id']);
- }
-
- $result['rpcStatus'] = OSCOM_Site_RPC::STATUS_SUCCESS;
-
- echo json_encode($result);
- }
- }
-?>
View
37 osCommerce/OM/Core/Site/Admin/Application/TaxClasses/RPC/GetAll.php
@@ -0,0 +1,37 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\TaxClasses\RPC;
+
+ use osCommerce\OM\Core\Site\Admin\Application\TaxClasses\TaxClasses;