Esempio n. 1
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Customer = Registry::get('Customer');
     global $osC_oiAddress;
     // HPDL
     $application->setPageTitle(OSCOM::getDef('shipping_method_heading'));
     $application->setPageContent('shipping.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_shipping'), OSCOM::getLink(null, null, 'Shipping', 'SSL'));
     }
     // load shipping address page if no default address exists
     if (!$OSCOM_ShoppingCart->hasShippingAddress()) {
         $application->setPageTitle(OSCOM::getDef('shipping_address_heading'));
         $application->setPageContent('shipping_address.php');
         $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_shipping_address.js'));
         $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php');
         if (!$OSCOM_Customer->isLoggedOn()) {
             $osC_oiAddress = new ObjectInfo($OSCOM_ShoppingCart->getShippingAddress());
         }
     } else {
         $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_shipping.js'));
         // load all enabled shipping modules
         Registry::set('Shipping', new ShippingClass(), true);
     }
 }
Esempio n. 2
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if ($OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         osc_redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('orders_heading'));
     $application->setPageContent('orders.php');
     $OSCOM_Language->load('order');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_my_orders'), OSCOM::getLink(null, null, 'Orders', 'SSL'));
         if (is_numeric($_GET['Orders'])) {
             $OSCOM_Breadcrumb->add(sprintf(OSCOM::getDef('breadcrumb_order_information'), $_GET['Orders']), OSCOM::getLink(null, null, 'Orders=' . $_GET['Orders'], 'SSL'));
         }
     }
     if (is_numeric($_GET['Orders'])) {
         if (Order::getCustomerID($_GET['Orders']) !== $OSCOM_Customer->getID()) {
             osc_redirect(OSCOM::getLink(null, null, null, 'SSL'));
         }
         $application->setPageTitle(sprintf(OSCOM::getDef('order_information_heading'), $_GET['Orders']));
         $application->setPageContent('orders_info.php');
     }
 }
Esempio n. 3
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Template = Registry::get('Template');
     global $osC_oiAddress;
     // HPDL
     $application->setPageTitle(OSCOM::getDef('payment_method_heading'));
     $application->setPageContent('billing.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_payment'), OSCOM::getLink(null, null, 'Billing', 'SSL'));
     }
     // load billing address page if no default address exists
     if (!$OSCOM_ShoppingCart->hasBillingAddress()) {
         $application->setPageTitle(OSCOM::getDef('payment_address_heading'));
         $application->setPageContent('billing_address.php');
         $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_payment_address.js'));
         $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php');
         if (!$OSCOM_Customer->isLoggedOn()) {
             $osC_oiAddress = new ObjectInfo($OSCOM_ShoppingCart->getBillingAddress());
         }
     } else {
         $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_payment.js'));
         // load all enabled payment modules
         $OSCOM_Payment = Registry::get('Payment');
         $OSCOM_Payment->loadAll();
         $OSCOM_Template->addJavascriptBlock($OSCOM_Payment->getJavascriptBlocks());
     }
     // HPDL
     //      if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) {
     //        $OSCOM_MessageStack->add('CheckoutBilling', $error['error'], 'error');
     //      }
 }
Esempio n. 4
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $application->setPageTitle(sprintf(OSCOM::getDef('index_heading'), STORE_NAME));
     $application->setPageContent('product_listing.php');
     if (is_numeric($_GET['Manufacturers'])) {
         Registry::set('Manufacturer', new Manufacturer($_GET['Manufacturers']));
         $OSCOM_Manufacturer = Registry::get('Manufacturer');
         $application->setPageTitle($OSCOM_Manufacturer->getTitle());
         // HPDL        $application->setPageImage('manufacturers/' . $OSCOM_Manufacturer->getImage());
         if ($OSCOM_Service->isStarted('Breadcrumb')) {
             $OSCOM_Breadcrumb->add($OSCOM_Manufacturer->getTitle(), OSCOM::getLink());
         }
         Registry::set('Products', new Products());
         $OSCOM_Products = Registry::get('Products');
         $OSCOM_Products->setManufacturer($OSCOM_Manufacturer->getID());
         if (isset($_GET['filter']) && is_numeric($_GET['filter']) && $_GET['filter'] > 0) {
             $OSCOM_Products->setCategory($_GET['filter']);
         }
         if (isset($_GET['sort']) && !empty($_GET['sort'])) {
             if (strpos($_GET['sort'], '|d') !== false) {
                 $OSCOM_Products->setSortBy(substr($_GET['sort'], 0, -2), '-');
             } else {
                 $OSCOM_Products->setSortBy($_GET['sort']);
             }
         }
     } else {
         osc_redirect(OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication()));
     }
 }
Esempio n. 5
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         osc_redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
     }
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 3) {
         $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
         if ($requested_product == 'Write') {
             unset($requested_product);
             if (count($_GET) > 4) {
                 $requested_product = basename(key(array_slice($_GET, 4, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
         }
     }
     if ($product_check === false) {
         $application->setPageContent('not_found.php');
         return false;
     }
     Registry::set('Product', new Product($requested_product));
     $OSCOM_Product = Registry::get('Product');
     if (empty($_POST['from_name'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_customers_name_empty'));
     }
     if (!osc_validate_email_address($_POST['from_email_address'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_customers_email_address'));
     }
     if (empty($_POST['to_name'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_friends_name_empty'));
     }
     if (!osc_validate_email_address($_POST['to_email_address'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_friends_email_address'));
     }
     if ($OSCOM_MessageStack->size('TellAFriend') < 1) {
         $email_subject = sprintf(OSCOM::getDef('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
         $email_body = sprintf(OSCOM::getDef('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $OSCOM_Product->getTitle(), STORE_NAME) . "\n\n";
         if (!empty($_POST['message'])) {
             $email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
         }
         $email_body .= sprintf(OSCOM::getDef('email_tell_a_friend_link'), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf(OSCOM::getDef('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
         osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
         $OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('success_tell_a_friend_email_sent'), $OSCOM_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
         osc_redirect(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
     }
     $application->setPageTitle($OSCOM_Product->getTitle());
     $application->setPageContent('tell_a_friend.php');
 }
Esempio n. 6
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     // HPDL
     $OSCOM_Template->setHasHeader(false);
     $OSCOM_Template->setHasFooter(false);
     $OSCOM_Template->setHasBoxModules(false);
     $OSCOM_Template->setHasContentModules(false);
     $OSCOM_Template->setShowDebugMessages(false);
     $OSCOM_NavigationHistory->removeCurrentPage();
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == OSCOM::getSiteApplication()) {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (!$application->siteApplicationActionExists($requested_product)) {
             if (Product::checkEntry($requested_product)) {
                 $product_check = true;
                 Registry::set('Product', new Product($requested_product));
                 $OSCOM_Product = Registry::get('Product');
                 $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getTitle());
                 $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getModel());
                 if ($OSCOM_Product->hasTags()) {
                     $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getTags());
                 }
                 $application->setPageTitle($OSCOM_Product->getTitle());
                 $application->setPageContent('images.php');
             }
         }
     }
     if ($product_check === false) {
         $application->setPageTitle(OSCOM::getDef('product_not_found_heading'));
         $application->setPageContent('not_found.php');
     }
 }
Esempio n. 7
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $application->setPageTitle(OSCOM::getDef('info_shipping_heading'));
     $application->setPageContent('shipping.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_shipping'), OSCOM::getLink(null, null, 'Shipping'));
     }
 }
Esempio n. 8
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_address_book_add_entry'), OSCOM::getLink(null, null, 'AddressBook&Create', 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('address_book_add_entry_heading'));
     $application->setPageContent('address_book_process.php');
     $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php');
     if (AddressBook::numberOfEntries() >= MAX_ADDRESS_BOOK_ENTRIES) {
         $OSCOM_MessageStack->add('AddressBook', OSCOM::getDef('error_address_book_full'));
         $application->setPageTitle(OSCOM::getDef('address_book_heading'));
         $application->setPageContent('address_book.php');
         return true;
     }
 }
Esempio n. 9
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $application->setPageTitle(OSCOM::getDef('new_products_heading'));
     $application->setPageContent('all.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_new_products'), OSCOM::getLink(null, null, 'All'));
     }
 }
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $application->setPageTitle(OSCOM::getDef('password_forgotten_heading'));
     $application->setPageContent('password_forgotten.php');
     $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_password_forgotten'), OSCOM::getLink(null, null, 'PasswordForgotten', 'SSL'));
     }
 }
Esempio n. 11
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if ($OSCOM_Service->isStarted('Reviews') === false) {
         osc_redirect(OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()));
     }
     $application->setPageTitle(OSCOM::getDef('reviews_heading'));
     $application->setPageContent('reviews.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_reviews'), OSCOM::getLink(null, null, 'Reviews'));
     }
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == OSCOM::getSiteApplication()) {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
             Registry::set('Product', new Product($requested_product));
             $OSCOM_Product = Registry::get('Product');
             $application->setPageTitle($OSCOM_Product->getTitle());
             $application->setPageContent('reviews_product.php');
             if ($OSCOM_Service->isStarted('Breadcrumb')) {
                 $OSCOM_Breadcrumb->add($OSCOM_Product->getTitle(), OSCOM::getLink(null, null, 'Reviews&' . $OSCOM_Product->getKeyword()));
             }
         }
         if ($product_check === false) {
             $application->setPageContent('not_found.php');
         }
     }
 }
Esempio n. 12
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Template = Registry::get('Template');
     if ($OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         osc_redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('address_book_heading'));
     $application->setPageContent('address_book.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_address_book'), OSCOM::getLink(null, null, 'AddressBook', 'SSL'));
     }
     if ($OSCOM_Customer->hasDefaultAddress() === false) {
         $application->setPageTitle(OSCOM::getDef('address_book_add_entry_heading'));
         $application->setPageContent('address_book_process.php');
         $OSCOM_Template->addJavascriptPhpFilename('includes/form_check.js.php');
     }
 }
Esempio n. 13
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     // HPDL
     $OSCOM_Template->setHasHeader(false);
     $OSCOM_Template->setHasFooter(false);
     $OSCOM_Template->setHasBoxModules(false);
     $OSCOM_Template->setHasContentModules(false);
     $OSCOM_Template->setShowDebugMessages(false);
     $OSCOM_NavigationHistory->removeCurrentPage();
     $application->setPageTitle(OSCOM::getDef('search_heading'));
     $application->setPageContent('help.php');
 }
Esempio n. 14
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Customer = Registry::get('Customer');
     $application->setPageTitle(OSCOM::getDef('sign_out_heading'));
     $application->setPageContent('logoff.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_sign_out'));
     }
     $OSCOM_Customer->reset();
     $OSCOM_ShoppingCart->reset();
 }
Esempio n. 15
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if ($OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         OSCOM::redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('newsletters_heading'));
     $application->setPageContent('newsletters.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_newsletters'), OSCOM::getLink(null, null, 'Newsletters', 'SSL'));
     }
 }
Esempio n. 16
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Session = Registry::get('Session');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     // redirect the customer to a friendly cookies-must-be-enabled page if cookies
     // are disabled (or the session has not started)
     if ($OSCOM_Session->hasStarted() === false) {
         osc_redirect(OSCOM::getLink(null, 'Info', 'Cookies'));
     }
     $application->setPageTitle(OSCOM::getDef('sign_in_heading'));
     $application->setPageContent('login.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_sign_in'), OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     }
 }
Esempio n. 17
0
 public static function execute(ApplicationAbstract $application)
 {
     if (!isset($_GET['v']) || !CoreUpdate::packageExists($_GET['v'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_select_version_to_view'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
     if (CoreUpdate::localPackageExists() && CoreUpdate::getPackageInfo('version_to') != $_GET['v']) {
         CoreUpdate::deletePackage();
     }
     if (!CoreUpdate::localPackageExists() && !CoreUpdate::downloadPackage($_GET['v'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_local_update_package_does_not_exist'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
     $application->setPageContent('package_contents.php');
     $application->setPageTitle(sprintf(OSCOM::getDef('action_heading_apply'), CoreUpdate::getPackageInfo('version_from'), CoreUpdate::getPackageInfo('version_to')));
 }
Esempio n. 18
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Template = Registry::get('Template');
     if (AddressBook::checkEntry($_GET['Edit']) === false) {
         $OSCOM_MessageStack->add('AddressBook', OSCOM::getDef('error_address_book_entry_non_existing'), 'error');
         osc_redirect(OSCOM::getLink(null, null, 'AddressBook', 'SSL'));
     }
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_address_book_edit_entry'), OSCOM::getLink(null, null, 'AddressBook&Edit=' . $_GET['Edit'], 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('address_book_edit_entry_heading'));
     $application->setPageContent('address_book_process.php');
     $OSCOM_Template->addJavascriptPhpFilename('includes/form_check.js.php');
 }
Esempio n. 19
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_ShoppingCart->reset(true);
     // unregister session variables used during checkout
     unset($_SESSION['comments']);
     $application->setPageTitle(OSCOM::getDef('success_heading'));
     $application->setPageContent('success.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_success'), OSCOM::getLink(null, null, 'Success', 'SSL'));
     }
     //      if ( $_GET[$this->_module] == 'update' ) {
     //        $this->_process();
     //      }
 }
Esempio n. 20
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if ($OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         OSCOM::redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('account_edit_heading'));
     $application->setPageContent('edit.php');
     $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_edit_account'), OSCOM::getLink(null, null, 'Edit', 'SSL'));
     }
 }
Esempio n. 21
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Session = Registry::get('Session');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Template = Registry::get('Template');
     // redirect the customer to a friendly cookies-must-be-enabled page if cookies
     // are disabled (or the session has not started)
     if ($OSCOM_Session->hasStarted() === false) {
         osc_redirect(OSCOM::getLink(null, 'Info', 'Cookies'));
     }
     $application->setPageTitle(OSCOM::getDef('create_account_heading'));
     $application->setPageContent('create.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_create_account'), OSCOM::getLink(null, null, 'Create', 'SSL'));
     }
     $OSCOM_Template->addJavascriptPhpFilename('includes/form_check.js.php');
 }
Esempio n. 22
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     global $osC_oiAddress;
     $application->setPageTitle(OSCOM::getDef('payment_address_heading'));
     $application->setPageContent('billing_address.php');
     $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_payment_address.js'));
     $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_payment_address'), OSCOM::getLink(null, null, 'Billing&Address', 'SSL'));
     }
     if (!$OSCOM_Customer->isLoggedOn()) {
         $osC_oiAddress = new ObjectInfo($OSCOM_ShoppingCart->getShippingAddress());
     }
 }
Esempio n. 23
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     global $osC_oiAddress;
     $application->setPageTitle(OSCOM::getDef('shipping_address_heading'));
     $application->setPageContent('shipping_address.php');
     $OSCOM_Template->addJavascriptFilename('templates/' . $OSCOM_Template->getCode() . '/javascript/checkout_shipping_address.js');
     $OSCOM_Template->addJavascriptPhpFilename('includes/form_check.js.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_shipping_address'), OSCOM::getLink(null, null, 'Shipping&Address', 'SSL'));
     }
     if (!$OSCOM_Customer->isLoggedOn()) {
         $osC_oiAddress = new ObjectInfo($OSCOM_ShoppingCart->getShippingAddress());
     }
 }
Esempio n. 24
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 3) {
         $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
         if ($requested_product == 'Write') {
             unset($requested_product);
             if (count($_GET) > 4) {
                 $requested_product = basename(key(array_slice($_GET, 4, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
         }
     }
     if ($product_check === false) {
         $application->setPageContent('not_found.php');
         return false;
     }
     if ($OSCOM_Customer->isLoggedOn() === false && SERVICE_REVIEW_ENABLE_REVIEWS == 1) {
         $OSCOM_NavigationHistory->setSnapshot();
         osc_redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
     }
     Registry::set('Product', new Product($requested_product));
     $OSCOM_Product = Registry::get('Product');
     $application->setPageTitle($OSCOM_Product->getTitle());
     $application->setPageContent('reviews_write.php');
     $OSCOM_Template->addJavascriptPhpFilename('templates/' . $OSCOM_Template->getCode() . '/javascript/products/reviews_new.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add($OSCOM_Product->getTitle(), OSCOM::getLink(null, null, 'Reviews&' . $OSCOM_Product->getKeyword()));
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_reviews_new'), OSCOM::getLink(null, null, 'Reviews&Write&' . $OSCOM_Product->getKeyword()));
     }
 }
Esempio n. 25
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $review_check = false;
     if (is_numeric($_GET['View'])) {
         if (Reviews::exists($_GET['View'])) {
             $review_check = true;
             Registry::set('Product', new Product(Reviews::getProductID($_GET['View'])));
             $OSCOM_Product = Registry::get('Product');
             $application->setPageTitle($OSCOM_Product->getTitle());
             $application->setPageContent('reviews_view.php');
             if ($OSCOM_Service->isStarted('Breadcrumb')) {
                 $OSCOM_Breadcrumb->add($OSCOM_Product->getTitle(), OSCOM::getLink(null, null, 'Reviews&View=' . $_GET['View'] . '&' . $OSCOM_Product->getKeyword()));
             }
         }
     }
     if ($review_check === false) {
         $application->setPageContent('reviews_not_found.php');
     }
 }
Esempio n. 26
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if ($_GET['Delete'] == $OSCOM_Customer->getDefaultAddressID()) {
         $OSCOM_MessageStack->add('AddressBook', OSCOM::getDef('warning_primary_address_deletion'), 'warning');
     } else {
         if (AddressBook::checkEntry($_GET['Delete']) === false) {
             $OSCOM_MessageStack->add('AddressBook', OSCOM::getDef('error_address_book_entry_non_existing'), 'error');
         }
     }
     if ($OSCOM_MessageStack->size('AddressBook') > 0) {
         OSCOM::redirect(OSCOM::getLink(null, null, 'AddressBook', 'SSL'));
     }
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_address_book_delete_entry'), OSCOM::getLink(null, null, 'AddressBook&Delete=' . $_GET['Delete'], 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('address_book_delete_entry_heading'));
     $application->setPageContent('address_book_delete.php');
 }
Esempio n. 27
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         OSCOM::redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
     }
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == OSCOM::getSiteApplication()) {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
             Registry::set('Product', new Product($requested_product));
             $OSCOM_Product = Registry::get('Product');
             $application->setPageTitle($OSCOM_Product->getTitle());
             $application->setPageContent('tell_a_friend.php');
             if ($OSCOM_Service->isStarted('Breadcrumb')) {
                 $OSCOM_Breadcrumb->add($OSCOM_Product->getTitle(), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
                 $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_tell_a_friend'), OSCOM::getLink(null, null, 'TellAFriend&' . $OSCOM_Product->getKeyword()));
             }
         }
         if ($product_check === false) {
             $application->setPageContent('not_found.php');
         }
     }
 }
Esempio n. 28
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Search = Registry::get('Search');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $application->setPageTitle(OSCOM::getDef('search_results_heading'));
     $application->setPageContent('results.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_search_results'), OSCOM::getLink(null, null, osc_get_all_get_params()));
     }
     if (isset($_GET['datefrom_days']) && is_numeric($_GET['datefrom_days']) && isset($_GET['datefrom_months']) && is_numeric($_GET['datefrom_months']) && isset($_GET['datefrom_years']) && is_numeric($_GET['datefrom_years'])) {
         if (checkdate($_GET['datefrom_months'], $_GET['datefrom_days'], $_GET['datefrom_years'])) {
             $OSCOM_Search->setDateFrom(mktime(0, 0, 0, $_GET['datefrom_months'], $_GET['datefrom_days'], $_GET['datefrom_years']));
         } else {
             $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_invalid_from_date'));
         }
     }
     if (isset($_GET['dateto_days']) && is_numeric($_GET['dateto_days']) && isset($_GET['dateto_months']) && is_numeric($_GET['dateto_months']) && isset($_GET['dateto_years']) && is_numeric($_GET['dateto_years'])) {
         if (checkdate($_GET['dateto_months'], $_GET['dateto_days'], $_GET['dateto_years'])) {
             $OSCOM_Search->setDateTo(mktime(23, 59, 59, $_GET['dateto_months'], $_GET['dateto_days'], $_GET['dateto_years']));
         } else {
             $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_invalid_to_date'));
         }
     }
     if ($OSCOM_Search->hasDateSet()) {
         if ($OSCOM_Search->getDateFrom() > $OSCOM_Search->getDateTo()) {
             $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_to_date_less_than_from_date'));
         }
     }
     if (isset($_GET['pfrom']) && !empty($_GET['pfrom'])) {
         if (settype($_GET['pfrom'], 'double')) {
             $OSCOM_Search->setPriceFrom($_GET['pfrom']);
         } else {
             $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_price_from_not_numeric'));
         }
     }
     if (isset($_GET['pto']) && !empty($_GET['pto'])) {
         if (settype($_GET['pto'], 'double')) {
             $OSCOM_Search->setPriceTo($_GET['pto']);
         } else {
             $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_price_to_not_numeric'));
         }
     }
     if ($OSCOM_Search->hasPriceSet('from') && $OSCOM_Search->hasPriceSet('to') && $OSCOM_Search->getPriceFrom() >= $OSCOM_Search->getPriceTo()) {
         $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_price_to_less_than_price_from'));
     }
     if (isset($_GET['Q']) && is_string($_GET['Q']) && !empty($_GET['Q'])) {
         $OSCOM_Search->setKeywords(urldecode($_GET['Q']));
         if ($OSCOM_Search->hasKeywords() === false) {
             $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_invalid_keywords'));
         }
     }
     if (!$OSCOM_Search->hasKeywords() && !$OSCOM_Search->hasPriceSet('from') && !$OSCOM_Search->hasPriceSet('to') && !$OSCOM_Search->hasDateSet('from') && !$OSCOM_Search->hasDateSet('to')) {
         $OSCOM_MessageStack->add('Search', OSCOM::getDef('error_search_at_least_one_input'));
     }
     if (isset($_GET['category']) && is_numeric($_GET['category']) && $_GET['category'] > 0) {
         $OSCOM_Search->setCategory($_GET['category'], isset($_GET['recursive']) && $_GET['recursive'] == '1' ? true : false);
     }
     if (isset($_GET['manufacturer']) && is_numeric($_GET['manufacturer']) && $_GET['manufacturer'] > 0) {
         $OSCOM_Search->setManufacturer($_GET['manufacturer']);
     }
     if (isset($_GET['sort']) && !empty($_GET['sort'])) {
         if (strpos($_GET['sort'], '|d') !== false) {
             $OSCOM_Search->setSortBy(substr($_GET['sort'], 0, -2), '-');
         } else {
             $OSCOM_Search->setSortBy($_GET['sort']);
         }
     }
     if ($OSCOM_MessageStack->size('Search') > 0) {
         $application->setPageContent('main.php');
     }
 }
Esempio n. 29
0
 /**
  * Sets the title of the page
  *
  * @param string $title The title of the page to set to
  * @access public
  */
 function setPageTitle($title)
 {
     $this->_application->setPageTitle($title);
 }
Esempio n. 30
0
 public static function execute(ApplicationAbstract $application)
 {
     $application->setPageTitle(OSCOM::getDef('create_account_success_heading'));
     $application->setPageContent('create_success.php');
 }